Relabeling: Rules and Actions
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 theactionfield can take arereplace,keep,drop,labelmap,labeldrop,labelkeep, andhashmod. 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 theseparatorvalue (e.g.,source_labels: ['label1', 'label2']).separator: Defines the string used to join multiplesource_labels. The default separator is;.
Observability with Prometheus and Grafana
A Complete Hands-On Guide to Operational Clarity in Cloud-Native SystemsEnroll now to unlock all content and receive all future updates for free.
