Thanks Brian... In the same relabel config can we do for both metrics and target?
On Tuesday, June 16, 2020 at 4:34:01 PM UTC+5:30, Brian Candler wrote: > > My mistake, it's __metrics_path__ not __metric_path__. > > it's just another internal label like __address__, so you set it in > relabelling: > > https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config > > You'd use it if the URL path you want to scrape varies per target, rather > than using the same path (e.g. "/metrics") for every target. > > Therefore, if you want to scrape http://10.2.3.17:8080/10.2.0.85 (where > the target is 10.2.0.85) I think it would be something like this: > > - job_name: 'apigeenode' > static_configs: > - targets: > - 10.2.0.85 <http://10.2.3.17:8080/10.2.0.85> > - 10.2.0.86 <http://10.2.3.17:8080/10.2.0.86> > - ... > > relabel_configs: > - source_labels: [__address__] > target_label: instance > - source_labels: [__address__] > target_label: __metrics_path__ > - target_label: __address__ > replacement: 10.2.3.17:8080 > > -- 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/d1269f1d-bc9d-4259-be31-d304de19f17fo%40googlegroups.com.

