kyverno: [Bug] cannot disable a metric with metricsExposure setting
Kyverno Version
1.11.0
Description
I configured metricsExposure setting to disable several metrics.
According to the logs of kyverno-admission-controller pod, the corresponding config map was properly read by the pod:
I1207 15:55:06.147173 1 metricsconfig.go:203] config "msg"="metricsExposure configured" "metricsExposure"="{\"kyverno_admission_review_duration_seconds_bucket\":{\"enabled\":false},\"kyverno_policy_execution_duration_seconds_bucket\":{\"enabled\":false},\"kyverno_policy_execution_duration_seconds_count\":{\"enabled\":false},\"kyverno_policy_execution_duration_seconds_sum\":{\"enabled\":false},\"kyverno_policy_results_total\":{\"disabledLabelDimensions\":[\"resource_namespace\"]}}" "name"="kyverno-metrics" "namespace"="kyverno"
However, Kyverno continues to export all these metrics and they end up in TSDB of Prometheus.
Slack discussion
No response
Troubleshooting
- I have read and followed the documentation AND the troubleshooting guide.
- I have searched other issues in this repository and mine is not recorded.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 15 (1 by maintainers)
@RSE132
I’ve bumped into the same problem and here’s what I’ve managed to learn:
_bucketand_totalare omitted. E.g.: https://github.com/kyverno/kyverno/blob/7bf4033c6e5a1dc06eb56f64b1d142b8c26921ec/pkg/webhooks/handlers/metrics.go#L25disabledLabelDimensions) is only supported for histograms as the last sentence of this section states: https://kyverno.io/docs/monitoring/#configuring-the-metricsThis config applied on the admission controller
yielded a histogram instead of a count
I was using chart version
3.1.4, Kyverno:v1.11.4