Skip to content

Metrics configuration

All components of the KX Insights Platform charts are able to generate metrics, these metrics may be consumed by a Prometheus installation.

Within the KX Insights Platform a side car is used to gather metrics, and a ServiceMonitor CRD is used to update Prometheus to scrape the metrics from a known endpoint.

Default metrics can be configured from the global level.

global:
  metrics:
    enabled: true
    useAnnotations: false
    serviceMonitor:
      enabled: true
      interval: 30s
      path: "/metrics"
      additionalLabels:
        release: kx-prom

enabled

Variable Type Example Default
enabled bool true false

Enables metrics across all sub charts. Will initiate the generation of configuration files and additional containers within your deployment.

useAnnotations

variable type example default
useAnnotations bool true false

Where Metrics has been enabled, and ServiceMonitor disabled, annotations may be applied to all Pods deployed within KX Insights. This will allow Metrics scraping without the use of a ServiceMonitor resource.

Note

Deployment will fail if both serviceMonitor.enabled and useAnnotations has been set to true.

serviceMonitor

Variable Type Example Default
serviceMonitor object {} {}

ServiceMonitor is a Prometheus CRD, it is used to update the Prometheus scrape targets. Several fields can be configured at a global level within the ServiceMonitor.

serviceMonitor.enabled

Variable Type Example Default
enabled bool true false

Enabling the ServiceMonitor will create a template for the ServiceMonitor with each of the sub chart deployments. By default it will detail a target port based on your local chart configuration.

Note

Enabling the ServiceMonitor without the existence of a Prometheus install will cause your deployment to fail. Prometheus must be pre-installed to create the required CRD.

serviceMonitor.interval

Variable Type Example Default
interval string 10s 30s

This field defines the frequency at which the Prometheus Operator will attempt to scrape metrics from your REST endpoint. Multiple interval types are supported beyond the seconds (s) example. Full details here of the available patterns under duration.

serviceMonitor.path

Variable Type Example Default
path string "/metrics" "/metrics"

This defines the target endpoint for the Prometheus Operator.

serviceMonitor.additionalLabels

Variable Type Example Default
additionalLabels object { release: kx-prom } { }

additionalLabels allows labels to added to the ServiceMonitor. These labels are used to link the ServiceMonitor with the pre-installed Prometheus Operator. The object expects key value pairs.

Where global and local entries exist within the additionalLabels object, they are merged before being applied to the ServiceMonitor.