Prometheus Adapter Custom Metrics for Libvirt in a K8S Cluster Prometheus Adapter Custom Metrics for Libvirt in a K8S Cluster kubernetes kubernetes

Prometheus Adapter Custom Metrics for Libvirt in a K8S Cluster


It actually depends on how you install the Prometheus Adapter. If you install via helm and use the YAML as configuration to the rules. You need to follow this README https://github.com/helm/charts/blob/master/stable/prometheus-adapter/README.md and and declare the rules like

rules:  custom:  - seriesQuery: '{__name__=~"^some_metric_count$"}'    resources:      template: <<.Resource>>    name:      matches: ""      as: "my_custom_metric"    metricsQuery: sum(<<.Series>>{<<.LabelMatchers>>}) by (<<.GroupBy>>)

Pay attention to the custom keyword. If you miss it, the number won't be available via custom metrics.