Documentation ¶
Index ¶
- func DeleteMetricsForPod(pod *corev1.Pod)
- func EnableMetrics(address string)
- func GetPodQueue() workqueue.DelayingInterface
- func GetRegistry() *prometheus.Registry
- func ListMetricsWithPod() []*prometheus.MetricVec
- func NewCounterVecWithPod(opts prometheus.CounterOpts, labels []string) *prometheus.CounterVec
- func NewGaugeVecWithPod(opts prometheus.GaugeOpts, labels []string) *prometheus.GaugeVec
- func NewHistogramVecWithPod(opts prometheus.HistogramOpts, labels []string) *prometheus.HistogramVec
- func RegisterPodDeleteHandler()
- func StartPodDeleteHandler()
- type BPFMetric
- type GranularCounter
- type GranularGauge
- type GranularHistogram
- type LabelFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteMetricsForPod ¶ added in v0.11.0
func EnableMetrics ¶
func EnableMetrics(address string)
func GetPodQueue ¶ added in v0.11.0
func GetPodQueue() workqueue.DelayingInterface
func GetRegistry ¶ added in v0.11.0
func GetRegistry() *prometheus.Registry
func ListMetricsWithPod ¶ added in v0.11.0
func ListMetricsWithPod() []*prometheus.MetricVec
func NewCounterVecWithPod ¶ added in v0.11.0
func NewCounterVecWithPod(opts prometheus.CounterOpts, labels []string) *prometheus.CounterVec
NewCounterVecWithPod is a wrapper around prometheus.NewCounterVec that also registers the metric to be cleaned up when a pod is deleted. It should be used only to register metrics that have "pod" and "namespace" labels.
func NewGaugeVecWithPod ¶ added in v0.11.0
func NewGaugeVecWithPod(opts prometheus.GaugeOpts, labels []string) *prometheus.GaugeVec
NewGaugeVecWithPod is a wrapper around prometheus.NewGaugeVec that also registers the metric to be cleaned up when a pod is deleted. It should be used only to register metrics that have "pod" and "namespace" labels.
func NewHistogramVecWithPod ¶ added in v0.11.0
func NewHistogramVecWithPod(opts prometheus.HistogramOpts, labels []string) *prometheus.HistogramVec
NewHistogramVecWithPod is a wrapper around prometheus.NewHistogramVec that also registers the metric to be cleaned up when a pod is deleted. It should be used only to register metrics that have "pod" and "namespace" labels.
func RegisterPodDeleteHandler ¶ added in v0.11.0
func RegisterPodDeleteHandler()
RegisterPodDeleteHandler registers handler for deleting metrics associated with deleted pods. Without it, Tetragon kept exposing stale metrics for deleted pods. This was causing continuous increase in memory usage in Tetragon agent as well as in the metrics scraper.
func StartPodDeleteHandler ¶ added in v0.11.0
func StartPodDeleteHandler()
Types ¶
type BPFMetric ¶ added in v1.0.0
type BPFMetric interface { Desc() *prometheus.Desc MustMetric(value float64, labelValues ...string) prometheus.Metric }
BPFMetric represents a metric read directly from a BPF map. It's intended to be used in custom collectors. The interface doesn't provide any validation, so it's up to the collector implementer to guarantee the metrics consistency.
func NewBPFCounter ¶ added in v1.0.0
func NewBPFCounter(desc *prometheus.Desc) BPFMetric
func NewBPFGauge ¶ added in v1.0.0
func NewBPFGauge(desc *prometheus.Desc) BPFMetric
type GranularCounter ¶ added in v1.0.0
type GranularCounter interface { ToProm() *prometheus.CounterVec WithLabelValues(lvs ...string) prometheus.Counter // contains filtered or unexported methods }
func MustNewGranularCounter ¶ added in v1.0.0
func MustNewGranularCounter(opts prometheus.CounterOpts, labels []string) GranularCounter
func NewGranularCounter ¶ added in v1.0.0
func NewGranularCounter(f *LabelFilter, opts prometheus.CounterOpts, labels []string) (GranularCounter, error)
type GranularGauge ¶ added in v1.0.0
type GranularGauge interface { ToProm() *prometheus.GaugeVec WithLabelValues(lvs ...string) prometheus.Gauge // contains filtered or unexported methods }
func MustNewGranularGauge ¶ added in v1.0.0
func MustNewGranularGauge(opts prometheus.GaugeOpts, labels []string) GranularGauge
func NewGranularGauge ¶ added in v1.0.0
func NewGranularGauge(f *LabelFilter, opts prometheus.GaugeOpts, labels []string) (GranularGauge, error)
type GranularHistogram ¶ added in v1.0.0
type GranularHistogram interface { ToProm() *prometheus.HistogramVec WithLabelValues(lvs ...string) prometheus.Observer // contains filtered or unexported methods }
func MustNewGranularHistogram ¶ added in v1.0.0
func MustNewGranularHistogram(opts prometheus.HistogramOpts, labels []string) GranularHistogram
func NewGranularHistogram ¶ added in v1.0.0
func NewGranularHistogram(f *LabelFilter, opts prometheus.HistogramOpts, labels []string) (GranularHistogram, error)
type LabelFilter ¶ added in v1.0.0
type LabelFilter struct {
// contains filtered or unexported fields
}
func NewLabelFilter ¶ added in v1.0.0
func NewLabelFilter(known []string, enabled map[string]interface{}) *LabelFilter