can we give dns names in targets list inside prometheus.yml configuration file

1,952 views
Skip to first unread message

dibya ranjan mishra

unread,
Sep 6, 2018, 9:19:42 AM9/6/18
to Prometheus Users
Hi, 
I am running prometheus through docker. I want to know is it possible to give dns names instead of ip address in targets list inside prometheus.yml configuration file?


Because I am getting some error saying that target is down.

vi...@tlmt.ch

unread,
Sep 6, 2018, 9:27:00 AM9/6/18
to Prometheus Users
Yes you can use dns names, which is how I'm using prometheus as well. This has to be a different error.

Can you ping or curl the questioned target from inside the prometheus container? Use `docker exec --it <container-id> /bin/sh` to start a shell inside your container.

dibya ranjan mishra

unread,
Sep 6, 2018, 10:01:28 AM9/6/18
to Prometheus Users
When I give the targets as "<somename>:9100" in the targets list and then when I go to the prometheus server page and go to targets menu, it tells the following:

Endpoint                                          State                            Last Scrape                       Error
http://<soomename>:9100/metrics DOWN9.627s ago                     Get http://<somename>:9100/metrics: dial tcp: lookup <somename> on 127.0.0.11:53: no such host

But I am able to go to the url manually 

Thanks,

Matt Palmer

unread,
Sep 6, 2018, 9:03:44 PM9/6/18
to Prometheus Users
On Thu, Sep 06, 2018 at 07:01:28AM -0700, dibya ranjan mishra wrote:
> ago Get http://<somename>:9100/metrics: dial tcp:
> lookup <somename> on 127.0.0.11:53: no such host
>
> But I am able to go to the url manually

That just means DNS resolution is broken in whatever context Prometheus is
running.

- Matt

dibya ranjan mishra

unread,
Sep 7, 2018, 12:05:15 AM9/7/18
to Prometheus Users
Hi Matt,
Any suggestion for getting rid of this issue?

Thanks,

Matthias Rampke

unread,
Sep 7, 2018, 3:57:47 AM9/7/18
to dibya ranjan mishra, Prometheus Users
Can you curl the URL from the environment that Prometheus is running in? If it is running in a container, exec into that container and try from there. That it works on your workstation does not mean it's working in your production environment. I'm afraid there is very little we can do to debug the latter from here :)

/MR

--
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 post to this group, send email to promethe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/921cec04-717a-4310-bd5c-03b74da18a4b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages