Final __address__ value

39 views
Skip to first unread message

Victor Ivanov

unread,
Nov 8, 2020, 4:33:30 PM11/8/20
to Prometheus Users

Hello!

Is there a way to see th final adderss value that prometheus will use to talk to the instance?

I tried using DigitalOcean SD with additional relabelling

```
  relabel_configs:
    - source_labels: [__meta_digitalocean_private_ipv4]
      regex: '(10\.133\.\d+\.\d+)'
      target_label: __address__
      replacement: '{$1}:9100'
    - source_labels: [__meta_digitalocean_droplet_name]
      target_label: instance
      regex: '(.+)'
      replacement: '${1}:9100'
```

and no matter what I try I see 0 when I ask for up{job="node"} metric

I also have the same server added via file_sd and they are available.
Also, these two sets of servers should not intersect because for file_sd droplets instance is their private ip4 address, and for DigitalOcean_SD droplets instance should be droplet name (something like nginx-1.example.com)

My current best guess is that I've messed up with relabeling and prmetheus tries to talk to the wrong IP address or wrong port, but I can't understand what is exactly wrong

Julien Pivotto

unread,
Nov 8, 2020, 4:36:42 PM11/8/20
to Victor Ivanov, Prometheus Users
On 08 Nov 13:33, Victor Ivanov wrote:
>
> Hello!
>
> Is there a way to see th final adderss value that prometheus will use to
> talk to the instance?
>
> I tried using DigitalOcean SD with additional relabelling
>
> ```
> relabel_configs:
> - source_labels: [__meta_digitalocean_private_ipv4]
> regex: '(10\.133\.\d+\.\d+)'
> target_label: __address__
> replacement: '{$1}:9100'
> - source_labels: [__meta_digitalocean_droplet_name]
> target_label: instance
> regex: '(.+)'
> replacement: '${1}:9100'
> ```
>
> and no matter what I try I see 0 when I ask for up{job="node"} metric
>
> I also have the same server added via file_sd and they are available.
> Also, these two sets of servers should not intersect because for file_sd
> droplets instance is their private ip4 address, and for DigitalOcean_SD
> droplets instance should be droplet name (something like
> nginx-1.example.com)

You can look in the targets page which URL prometheus is scraping and
what is the error message

>
> My current best guess is that I've messed up with relabeling and prmetheus
> tries to talk to the wrong IP address or wrong port, but I can't understand
> what is exactly wrong
>
> --
> You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/195eb849-42ce-46ff-ad46-6ea5d19e96fen%40googlegroups.com.


--
Julien Pivotto
@roidelapluie

Victor Ivanov

unread,
Nov 8, 2020, 4:42:23 PM11/8/20
to Prometheus Users
Thanks a ton, Julien!


I replaced [] with [] when in fact I should have changed [$1] to ${1}

Thanks for the targets page hint anyway, I dunno how I've missed it :)

Cheers!
Reply all
Reply to author
Forward
0 new messages