You can add whatever query params you like in the scrape job, e.g. you
could add ?from=foo or ?from=bar as part of the URL being scraped.
- job_name: blah
metrics_path: /metrics
params:
from: [ foo ]
...
However, I wonder how you intend to use this information. The data which
is scraped *should* be independent of who is scraping it, and it should be
possible to do additional scrapes without affecting the data (e.g. hitting
the exporter with "curl" to test it shouldn't alter the data for anyone
else).
Therefore, I wonder if there's a better way to achieve what you're trying
to achieve. For example, if you are keeping a counter of "how many widgets
processed in the last minute", and resetting it to zero on each scrape,
then you should not be doing this; you should be keeping a counter which
just keeps incrementing. It's up to the consumer of the data to look at
data and work out the number of widgets processed per minute, or per hour
or whatever. Having the data in this format is much more useful anyway.
If you can describe what it is you're doing, and why it matters where the
scrape is coming from, we may be able to give some alternative suggestions.
On Tuesday, 15 February 2022 at 07:15:11 UTC Stuart Clark wrote:
> On 15/02/2022 04:32, [email protected] wrote:
> >
> > If you have multiple Prometheus servers using an identical target
> > list, is there a way on the target server to tell which Prometheus
> > server is scraping at the time the scrap occurs.
> >
> > For example, Prom_server_a and Prom_server_b scrape
> > target_server_123. On target_server_123 is there something on this
> > server that says Prom_server_a is scraping right now. Prom_server_b is
> > scraping right now?
> >
> The source IP address in any logs?
>
> --
> Stuart Clark
>
>
--
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/89e37051-b5f9-4311-85c4-806721f7a921n%40googlegroups.com.