On Friday, 20 March 2020 08:42:20 UTC, Eswar Rao Bevara wrote:
>
> I have scraping metrics for some of my spring boot applications and there 
> are around 30 applications that I am scrapping metrics from. is there a way 
> to use file_sd to reduce the redundancy of the code just like the way it 
> worked for blackbox exporter.
>
>
Without specific information all I can say is "yes, you can do all sorts of 
things".

You might not even need relabelling, if it's just a question of connecting 
to multiple exporters on different ports on the same host:

- targets:
    - foo.example.com:9100
    - foo.example.com:9123
    - foo.example.com:9876

However it would be "normal practice" to have a different scrape job for 
each type of exporter you are talking to.  Remember that multiple scrape 
jobs can re-use the same file_sd files.

I believe it should also be possible to set __metrics_path__ differently 
for different targets 
<https://stackoverflow.com/questions/44927130/different-scrape-url-for-every-target>,
 
although I've never had to do this, e.g.

- labels:
    __metrics_path__: /something
  targets:
    - foo.example.com:9100

- labels:
    __metrics_path__: /otherthing
  targets:
    - foo.example.com:8080
    - foo.example.com:9999

HTH, Brian.

-- 
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/4bc0921e-57c5-4ef3-b48e-54a9a74ca6cf%40googlegroups.com.

Reply via email to