Path: blob/main/docs/sources/flow/tutorials/assets/flow_configs/relabel.river
5354 views
prometheus.scrape "default" {
targets = [{"__address__" = "localhost:12345"}]
forward_to = [prometheus.relabel.filter.receiver]
}
// The prometheus.relabel component allows you to filter and mutate metrics.
// Here, we combine the metric name (from the __name__ label) with the string
// "api_server" into a new label called "service". The resulting mutated metrics
// are then forwarded to our prometheus.remote_write component.
prometheus.relabel "filter" {
rule {
source_labels = ["__name__"]
regex = "(.+)"
replacement = "api_server"
target_label = "service"
}
forward_to = [prometheus.remote_write.prom.receiver]
}
prometheus.remote_write "prom" {
endpoint {
url = "http://mimir:9009/api/v1/push"
}
}