Documentation
¶
Overview ¶
Package metrics defines the Prometheus collectors shared across kyverno-runtime's collector, attribution, monitor, and reporter packages, plus a small HTTP server helper to expose them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Metrics ¶
type Metrics struct {
// EventsIngested counts runtime events ingested by the collector,
// labeled by source and kind.
EventsIngested *prometheus.CounterVec
// EventsDropped counts events dropped by the collector, labeled by
// source and reason.
EventsDropped *prometheus.CounterVec
// AttributionMisses counts events that could not be attributed to a
// pod (see pkg/attribution.Index.Annotate).
AttributionMisses prometheus.Counter
// MonitorFilterEvalErrors counts monitorFilter expressions that failed to
// evaluate, labeled by policy and expression name. A failure reports the
// finding anyway, so this counts filters that are not narrowing.
MonitorFilterEvalErrors *prometheus.CounterVec
// FindingsEmitted counts findings emitted to the reporter, labeled by
// policy and behavior.
FindingsEmitted *prometheus.CounterVec
// ReportWrites counts OpenReports write attempts, labeled by result
// (ok|error|skipped).
ReportWrites *prometheus.CounterVec
}
Metrics holds every Prometheus collector registered by kyverno-runtime.
func New ¶
func New(reg prometheus.Registerer) *Metrics
New creates and registers all collectors against reg. Passing a fresh *prometheus.Registry (rather than the global DefaultRegisterer) keeps tests and repeated daemon.go wiring free of "duplicate metrics collector registration" panics.
Click to show internal directories.
Click to hide internal directories.