Feedback

Chat Icon

Observability with Prometheus and Grafana

A Complete Hands-On Guide to Operational Clarity in Cloud-Native Systems

Relabeling: Rules and Actions
38%

Relabeling Rules

A relabeling rule consists of a set of configurations that define how labels are modified or filtered, as we have seen in the previous examples. The following fields are commonly used in relabeling rules:

  • action: Specifies the operation to be performed on the labels. Some values that the action field can take are replace, keep, drop, labelmap, labeldrop, labelkeep, and hashmod. We will see more examples of these actions in the next section.

  • source_labels: Specifies the labels that will be used as input. This can be a single label or a list. When it's a list, the labels are concatenated using the separator value (e.g., source_labels: ['label1', 'label2']).

  • separator: Defines the string used to join multiple source_labels. The default separator is ;.

Observability with Prometheus and Grafana

A Complete Hands-On Guide to Operational Clarity in Cloud-Native Systems

Enroll now to unlock all content and receive all future updates for free.