3scale-ops / prometheus-exporter-operator

Operator to centralize the setup of 3rd party prometheus exporters on Kubernetes/OpenShift, with a collection of grafana dashboards
Apache License 2.0
42 stars 15 forks source link

Feat/Add support to blackbox-exporter to prometheus-exporter-operator #13

Closed slopezz closed 3 years ago

slopezz commented 3 years ago

Closes https://github.com/3scale/platform/issues/456

This PR adds support for blackbox exporter to prometheus-exporter-operator.

Taking into account that prometheus-operator had called Probe to the new custom resource that uses blackbox_exporter, it has been decided to use the same naming convention PrometheusExporter type probe (details on https://github.com/prometheus-operator/prometheus-operator/pull/2832).

slopezz commented 3 years ago

@slopezz wouldn't it be possible to add a field in the Probe spec to list the endpoints you want checked and have that automatically create the required ServiceMonitors? Seems a bit weird to me having to manually manage those.

@roivaz The purpose of the operator is deploying easily different prometheus exporters using simple PrometheusExporter resource (so you don't need to know that behind the scenes, there is a service, deployment with specific images, args, commands, secret/configmap mounts... and then a ServiceMonitor and its GrafanaDashboard).

For this specfic case of blackbox, apart from deploying the exporter, in order to be able to use it because by its own does nothing, you need to create extra resources for every endpoint to monitor:

It would be nice to integrate an array of target/module into the blackbox PromerheusExporter resources (so you forget to create individual Probes/ServiceMonitors, but would be difficult to manage):

So to summarize, I think by the moment, I would go with the standard prometheus probes monitoring, where you deploy an independent blackbox-exporter (with a PromenetheusExporter resource) and then create N resources for every target (Probes or ServiceMonitors) pointing to that deployed exporter, and then, the relabelling of the target label is intended for the dashboard only.