Kavita Jain
Kavita Jain

Reputation: 90

How to get metrics starting with particular words in Prometheus and what to update in prometheus.yml file

I want to fliter out metrics starting with particular word in prometheus and it should display all the occurrence

Upvotes: 1

Views: 4819

Answers (1)

Use the following query:

{__name__=~"STRING.+"}

If you want to search using the REST API execute:

curl --globoff --request GET "http://PROMETHEUS-SERVER/api/v1/query?query={__name__=~'prom.%2B'}"

Upvotes: 1

Related Questions