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 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