Alloy prometheus.remote_write - How to set external_labels

Hi all,

I try to use alloy to send metrics to prometheus. That works.

But I want to set also labels like in the prometheus.job’s.

This is my config:

prometheus.remote_write “to_prometheus” {
endpoint {
url = “http://xxx.xxx.xxx.xxx:9090/api/v1/write” // Prometheus Remote Write API
}
external_labels = {
“instance” = [“address”],
“ciname” = constants.hostname,
“app” = “job”,
“job” = constants.hostname,
}
}

I want to have the content of

_address_ in the label instance

label job in label app

At the moment, only ciname and job are set (see last line),

I also tried it withe relabel, but this had no impact…

Thanks fo any hints.

Regards

Jürgen

Pretty sure external labels need to be static. Try setting the dynamic labels from prometheus.scrape or with prometheus.relable component.

I’ve this in my relabel:

And this is what I get:

No 1 is from a prometrheus-scrape-job.

And No 2 is from Alloy push …

And try have it like No 1.

But I found no way to get it … :frowning: