canonical / cos-configuration-k8s-operator

https://charmhub.io/cos-configuration-k8s
Apache License 2.0
4 stars 7 forks source link

Add support for custom Prometheus scrape jobs #86

Open przemeklal opened 8 months ago

przemeklal commented 8 months ago

Enhancement Proposal

It would be great if a user could manually add any scrape_jobs configuration to COS Prometheus using cos-configuration charm.

Historically, we relied on this config option https://charmhub.io/prometheus/configure#scrape-jobs in the LMA Prometheus charm to achieve that.

Use cases:

sed-i commented 8 months ago

Thanks for the proposal @przemeklal. Is this specifically to be able to see scrape targets up/down for the multi-target use case? (instead of the blackbox exporter itself)

przemeklal commented 8 months ago

It's kind of both actually, we have the multi-target use case because on many clouds we rely on blackbox-exporter meshes deployed using dedicated subordinate machine charms. But any "advanced" use case where one needs to scrape multiple targets, do a lot of relabeling, etc. and do other things that https://github.com/canonical/prometheus-scrape-target-k8s-operator doesn't support.

It also feels a bit awkward that I must define custom alerting rules and dashboards for these "external" exporters here in the cos-config charm but I don't have any way to configure how I want to scrape them in the same charm.

dstathis commented 4 months ago

I think we should do this. It would unify the "external targets" story and be much less cumbersome than using prometheus-scape-target.