Closed OchiengEd closed 3 years ago
should this be added to the helm chart or created by the operator when it starts?
It should not matter where it is added. It however makes sense to create the ServiceMonitor
after the metrics service.
An example would appear as shown below.
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: cert-utils-service-monitor
labels:
role: metrics-sink
spec:
selector:
matchLabels:
name: cert-utils-operator
endpoints:
- port: http-metrics
This should have been done in helm with a default of not installing it to follow other community standards that have already been set on this. The code is making an assumption that you are using Prometheus in your k8s cluster, if you are not, the code fails and is unusable. If you are going to do this in code even though this is largely done in the helm chart with a flag, it should at minimum be configurable.
I agree. @trevorbox would you be able to fix this?
Given the operator already exposes a metrics endpoint through a service, I recommend creating a
ServiceMonitor
to sink the metrics to Prometheus.This will eliminate the need for manual intervention to accomplish this task.