Prometheus Monitoring Configuration

Prometheus Monitoring Configuration Properties describes properties for configuring Prometheus.

Table 1. Prometheus Monitoring Configuration Properties
Property Description
monitoring.enabled When set to true, it is assumed that:
  • A Prometheus operator has been installed in the Kubernetes cluster, including the ServiceMonitor CRD.
  • The snmp-exporter.enabled engine monitoring property is also set to false.
The enabled sub-charts include any relevant ServiceMonitor objects. The default value is false.
monitoring.labels A dictionary of extra labels added to the ServiceMonitor objects to ensure that they are correctly identified by Prometheus.
Note: Create any new labels that your environment requires, but do not change any of the default MATRIXX labels.
global.monitoring.relabelings An array of relabelings, in addition to the default node_ip and node_name labellings, that are applied to metrics as they are processed for all ServiceMonitors.

The labelling parameters include:

  • targetLabel — The label named as the reported metric to receive the new value in replace actions. Regex capture groups are available. This parameter is required for replace actions.
  • sourceLabels — A list of the candidate labels to change. Their content is concatenated using the specified separator and matched with the regex expression for replacement. This parameter is required for replace actions.
  • action — (Optional) The action to perform based on regex matching. Default is replace.
  • modulus — (Optional) The modulus to take of the hash of the source label values.
  • regex — (Optional) The extracted value is matched with this regular expression. The default value is (.*).
  • replacement — (Optional). A replacement value for the extracted value. Regex capture groups are available. The default value is $1.
  • separator — (Optional). A character to separate concatenated source label values. The default value is a semi-colon (;).

Monitoring Label Replacement

This Helm values file excerpt shows replacement of the __meta_kubernetes_pod_node_name label with my_node_ip, and __meta_kubernetes_pod_node_name with my_node_name:
global:
 # Configuration relating to Prometheus Monitoring
  monitoring:
    # True if Prometheus monitoring should be enabled. Requires the ServiceMonitor (monitoring.coreos.com/v1) to be installed
    enabled: true
    # relabelings additional relabelings to add to service monitor
    # default relabelings already include: node_ip, node_name
    relabelings:
      - action: replace
        regex: ^(.*)$
        replacement: $1
        separator: ;
        sourceLabels: [__meta_kubernetes_pod_host_ip]
        targetLabel: my_node_ip
      - targetLabel: my_node_name
        sourceLabels: [__meta_kubernetes_pod_node_name]