Reloading DNS IPs in prometheus

53 views
Skip to first unread message

eswar yaga

unread,
Jan 15, 2021, 8:33:34 AM1/15/21
to Prometheus Users

Hi,

My configuration uses a DNS like this

 - job_name: 'app-dev'
metrics_path: '/federate'
params:
'match[]':
- "{__name__ =~ '^.+'}"
static_configs:

But When the DNS points to a new IP of APP server, DNS looks sticky and still scraping from old IP 

Is there any way to refresh IPs with out restarting server

Thanks
Eswar

Matthias Rampke

unread,
Jan 17, 2021, 5:09:52 PM1/17/21
to eswar yaga, Prometheus Users
What is the TTL on these records?

Also consider using DNS SD, it gives you slightly more control over the refresh cycle.

/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 view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/3dc8c408-6684-4c53-af51-ea27fe8a24cen%40googlegroups.com.

Julien Pivotto

unread,
Jan 18, 2021, 4:26:18 AM1/18/21
to Matthias Rampke, eswar yaga, Prometheus Users
Prometheus uses keep alive, so we never refresh DNS until the instance
is really down.

For that use case you should use DNS-SD.

On 17 Jan 23:09, Matthias Rampke wrote:
> What is the TTL on these records?
>
> Also consider using DNS SD, it gives you slightly more control over the
> refresh cycle.
>
> /MR
>
> On Fri, Jan 15, 2021, 14:33 eswar yaga <eswar...@gmail.com> wrote:
>
> >
> > Hi,
> >
> > My configuration uses a DNS like this
> >
> > *- job_name: 'app-dev'*
> > *metrics_path: '/federate'*
> > *params:*
> > *'match[]':*
> > * - "{__name__ =~ '^.+'}"*
> > *static_configs:*
> > * - targets: ['app-dev-prom.localdns.myaddress.com
> > <http://app-dev-prom.localdns.myaddress.com>']*
> >
> > But When the DNS points to a new IP of APP server, DNS looks sticky and
> > still scraping from old IP
> >
> > Is there any way to refresh IPs with out restarting server
> >
> > Thanks
> > Eswar
> >
> > --
> > 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/3dc8c408-6684-4c53-af51-ea27fe8a24cen%40googlegroups.com
> > <https://groups.google.com/d/msgid/prometheus-users/3dc8c408-6684-4c53-af51-ea27fe8a24cen%40googlegroups.com?utm_medium=email&utm_source=footer>
> > .
> >
>
> --
> 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/CAMV%3D_gb8SX-jZbCbQhrhMHEErfHu_Y90hZ7SVu1cYV_9o12fng%40mail.gmail.com.

--
Julien Pivotto
@roidelapluie

eswar yaga

unread,
Jan 27, 2021, 8:38:59 AM1/27/21
to Prometheus Users
But DNS-SD serves different purpose right. Can I use DNS-SD for normal prometheus app end points like (abc.app.com/metrics)

But  I need this for  federate.. 

OR Is there any way I can refresh DNS cache on prometheus server apart from DNS-SD

Thanks
Reply all
Reply to author
Forward
0 new messages