docs-v2/content/flux/v0/stdlib/internal/promql/labelreplace.md

1.9 KiB

title description menu weight
promql.labelReplace() function `promql.labelReplace()` implements functionality equivalent to [PromQL's `label_replace()` function](https://prometheus.io/docs/prometheus/latest/querying/functions/#label_replace).
flux_v0_ref
name parent identifier
promql.labelReplace internal/promql internal/promql/labelReplace
201

promql.labelReplace() implements functionality equivalent to PromQL's label_replace() function.

Important: The internal/promql package is not meant for external use.

Function type signature
(
    <-tables: stream[{A with _value: float}],
    destination: string,
    regex: string,
    replacement: string,
    source: string,
) => stream[{B with _value: float}]

{{% caption %}} For more information, see Function type signatures. {{% /caption %}}

Parameters

tables

Input data. Default is piped-forward data (<-).

source

({{< req >}}) Input label.

destination

({{< req >}}) Output label.

regex

({{< req >}}) Pattern as a regex string.

replacement

({{< req >}}) Replacement value.