[prometheus-users] Re: Scrape only a particular namespace and ignore all other namespaces

2023-03-26 Thread Himanshu Gude
yes, I m new to prometheus env. could you pls give an example for each case, which will help me to figure out what changes to be made in the configurations. Your first case is what I am looking for. Thanks in advance! On Sunday, March 26, 2023 at 9:20:38 PM UTC+5:30 Brian Candler wrote: > Tha

Re: [prometheus-users] Scrape only a particular namespace and ignore all other namespaces

2023-03-26 Thread Julien Pivotto
You can update the prometheus config: scrape_configs: - job_name: 'kubernetes-pods' kubernetes_sd_configs: - role: pod namespaces: names: - devsecops On 25 Mar 23:00, Himanshu Gude wrote: > Hello guys, > > There is a requirement in my project which stat

[prometheus-users] Re: Scrape only a particular namespace and ignore all other namespaces

2023-03-26 Thread Brian Candler
That's two different things you're asking. * alerting only from "devsecops" namespace: ensure every metric has a label with the namespace, and configure alerting rules to match only where namespace=devsecops * scraping only from one namespace: if you can't configure the scrape URL to fetch onl

[prometheus-users] Re: Consultation around a generic metric for Kubernetes operators

2023-03-26 Thread Brian Candler
> There is a disagreement about this, since there are no examples that I could find that has a third optional value. The closest example I can think of is Nagios plugins (0=ok, 1=warning, 2=critical, 3=unknown). See nrpe_exporter: https://github.com/canonical/nrpe_exporter https://www.robustperc