Setting bearer token in rewrites

99 views
Skip to first unread message

Brian Candler

unread,
Jul 5, 2021, 10:05:29 AM7/5/21
to Prometheus Users
Suppose I have a bunch of hosts I want to poll, but with different bearer tokens.

Is there a rewrite variable I can use for this, similar to __scheme__, __address__ and __metrics_path__?

Julien Pivotto

unread,
Jul 5, 2021, 10:30:26 AM7/5/21
to Brian Candler, Prometheus Users
Hello,


There is none, since labels are not considered secrets.



>
> --
> 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/998c372b-f736-4754-9c5e-2b2284ae1cdfn%40googlegroups.com.


--
Julien Pivotto
@roidelapluie

Brian Candler

unread,
Jul 5, 2021, 10:31:46 AM7/5/21
to Prometheus Users
Thank you.  So this requires a separate scrape job per target?  Or an external proxy to add the bearer token via a table lookup?

Julien Pivotto

unread,
Jul 5, 2021, 10:37:33 AM7/5/21
to Brian Candler, Prometheus Users
On 05 Jul 07:31, Brian Candler wrote:
> Thank you. So this requires a separate scrape job per target? Or an
> external proxy to add the bearer token via a table lookup?

Yes. I do not know your requirements, but we also provide auth2 and tls
client certificates.

>
> On Monday, 5 July 2021 at 15:30:26 UTC+1 Julien Pivotto wrote:
>
> > On 05 Jul 07:05, Brian Candler wrote:
> > > Suppose I have a bunch of hosts I want to poll, but with different
> > bearer
> > > tokens.
> > >
> > > Is there a rewrite variable I can use for this, similar to __scheme__,
> > > __address__ and __metrics_path__?
> >
> > Hello,
> >
> >
> > There is none, since labels are not considered secrets.
> >
> >
> >
> > >
> > > --
> > > 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/998c372b-f736-4754-9c5e-2b2284ae1cdfn%40googlegroups.com
> > .
> >
> >
> > --
> > Julien Pivotto
> > @roidelapluie
> >
>
> --
> 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/a1e4fc61-ace8-4d3f-96c7-609073245cc3n%40googlegroups.com.


--
Julien Pivotto
@roidelapluie

Brian Candler

unread,
Jul 5, 2021, 10:46:12 AM7/5/21
to Prometheus Users
It's for scraping minio, which generates a JWT that you have to stick in the bearer token.  That's the only auth method it supports (other than public = no auth).
Reply all
Reply to author
Forward
0 new messages