Hi Sunil, On 4/3/20 6:00 PM, Sagar wrote: > For more information , there are more global labels (such as > environment, cluster , etc) apart from replica . > > Do I need to remove other global variables and maintain only one label > as replica . You need to drop those labels which are used to distinguish different Prometheus instances which scrape the same targets.
Some example: If you've got two Prometheus servers scraping all your database servers and are adding external labels such as cluster=database and replica=A for the one and replica=B for the other and if you've got another pair of Prometheus servers for your web servers with external labels cluster=web and replica=A and replica=B again, then you would only drop the replica label, not the cluster label. > I also tried with options given below ( from the link > : https://github.com/prometheus/prometheus/issues/3239 ) > > |alerting: alert_relabel_configs:- action: drop source_labels: > [replica] regex: '1'| > > Please advise , thanks I don't think you should have regex: 1 here? Just drop the regex line so that it will default to '(.*)' which matches all values. If this doesn't help, can you share your actual config + the behaviour you are seeing? > Is it possible to query alertmanager alerts like metrics in prometheus ? > Like http:/server:9093/mertrics or something else . Alertmanager does have metrics, but it does not export alerts there. However, there is an API for reading them programatically. https://petstore.swagger.io/?url=https://raw.githubusercontent.com/prometheus/alertmanager/master/api/v2/openapi.yaml#/alert Kind regards, Christian -- 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/72ba1626-f957-28ff-35db-9b89e72b75a1%40hoffmann-christian.info.

