1. How do you need to provide the API token - as a HTTP header (if so 
what)? As a URL query parameter? Something else?

2. What do you mean by "set up dynamic targets"?  What service discovery 
mechanism are you using?

static_configs and file_sd_configs are the same, when it comes to setting 
labels and targets.

3. What relabelling configs do you have?   That "__storage_apitoken" label 
must be rewritten to have some effect.  Otherwise, labels which begin with 
double underscore are thrown away 
<https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config>
.

4. Aside: you shouldn't set "job" as a target label.  This is added 
automatically by the scrape job itself.

On Monday, 11 April 2022 at 21:34:00 UTC+1 [email protected] wrote:

> I am trying to set up dynamic targets for our storage environment.  I am 
> able to access it using the static_configs but it requires an API token.
>
> This is what I have currently configured but had to revert back to 
> static_configs.  It wouldn't read the API token at all.
>
> [
>   {
>     "targets": [ "1.2.3.4", "2.3.45" ],
>     "labels": {
>       "env": "prod",
>       "__storage_apitoken": "something-something-something-something",
>       "job": "storage_exporter"
>     }
>   }
> ]
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/3d672625-c6be-40d5-b7e3-722bcd973dc5n%40googlegroups.com.

Reply via email to