There is one rewrite mechanism that allows you to override the labels an metric
ids on input measurements. The stanza is
label_set stanza allows you override a value for one of the labels. This
is the syntax of the label_set stanza:
label_set <label_name> <label_value> [default]
default modifier means that the label should only be set if it is not
already set. So for example, this would set the
hostname label to
for all measurements that do not alrady have a hostname label:
label_set hostname "localhost" default
While this line would override the hostname label for all measurements, even if they already have a hostname label.
label_set hostname "localhost"
label_set stanza is valid in the global context (where it applies to all metrics),
within a metric block (where it applies only to the single metric) and in every
listen_ blocks (where it applies to measurements received through the
respective transport).The order in which non-default overrides are applied is
metric, transport, global. The order in which default overrides are applied is
the reverse of the previous list.