On Monday, 4 September 2023 at 10:15:06 UTC+1 sneha wrote: i tried adding multiple db instance in .my.cnf file with mysql exporter version 0.15.0 but it only scrape DB instance only. is there any sample to use mutliple DB instance for single exporter
Yes, there is an example Prometheus config at https://github.com/prometheus/mysqld_exporter/#multi-target-support (see under "On the prometheus side ... ") It sets the `target` parameter for each scrape to the DB of interest, whilst setting __address__ to point to the exporter itself. Before doing this, make sure you're able to scrape the exporter directly using curl, i.e. curl 'http://localhost:9104/probe?target=server1:3306' curl 'http://localhost:9104/probe?target=server2:3306' should give you metrics for the two servers. and how to distinguish scrape data is of which instance. In a label. The example config that I linked above copies "__param_target" to "instance", so the "instance" label tells you which DB target was being scraped. -- 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/20b820fe-0e01-4908-8ec6-1629bfe430b2n%40googlegroups.com.

