Hi Brian,

My existing prometheus config scrape for all the namespaces doesn't have
any namespace restriction at this moment which means its not working.


I am need to scrape all the metrics for *test and dev* namespaces only rest
namespaces can be ignored.

I am wondering how do i change the *prometheus.yaml* / *prometheus.env.yaml
*i have installed prometheus using coreOS prometheus-operator, where id did
not specify any config file either *prometheus.yaml* / *prometheus.env.yaml
*while deploying the prometheus.

Any idea on how can i make changes so that my prometheus can scrape only
test and dev namespaces only.

Thanks in advance.

Regards,
Ravi


On Thu, Apr 30, 2020 at 10:28 PM Brian Candler <[email protected]> wrote:

> It looks like you're already limiting to specific namespaces?  Is that not
> working?
>
> # Optional namespace discovery. If omitted, all namespaces are used.
> namespaces:
>   names:
>     [ - <string> 
> <https://prometheus.io/docs/prometheus/latest/configuration/configuration/#string>
>  ]
>
>
>
> Otherwise: you're already filtering your prometheus service discovery
> results: e.g.
>
>   - action: keep
>
>     source_labels:
>
>     - __meta_kubernetes_service_label_alertmanager
>
>     regex: main
>
>   - action: keep
>
>     source_labels:
>
>     - __meta_kubernetes_endpoint_port_name
>
>     regex: web
>
> You can addd an additional relabeling keep rule to match on
> __meta_kubernetes_namespace with a regex that matches the values of
> interest.  See:
>
>
> https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config
>
> --
> 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/59b38efc-806e-4f1a-a558-c3442bd12b79%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/59b38efc-806e-4f1a-a558-c3442bd12b79%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAPvvAzhcyJvxu4LmM49c2UNBUcqF6jhaYSpUp8R%2B0Dapt%2BPFzQ%40mail.gmail.com.

Reply via email to