Monitoring labels aren't applied to rook-ceph-exporter
Is this a bug report or feature request?
- Bug Report
Deviation from expected behavior:
The monitoring labels aren't applied to the rook-ceph-exporter service monitor.
Expected behavior:
The rook-ceph-exporter would have the same labels applied as the rook-ceph-mgr service monitor.
How to reproduce it (minimal and precise):
Add this to the cluster spec:
labels:
monitoring:
prometheus: abc
and notice the label only being applied to two of the three service monitors.
Poking at the code today to see if I could fix this, looks like it's already possible.
spec:
...
labels:
exporter:
prometheus: perl
These labels are applied to both the rook-ceph-exporter Deployments and the ServiceMonitor. https://github.com/rook/rook/blob/6ce7b1f7d1204d345f9035cbde2f87e1cb01b851/pkg/operator/ceph/cluster/nodedaemon/exporter.go#L264-L265
We could also apply the monitoring labels, but not sure it's worth it.
@abh @rspier is there something else we can do here? as @rspier commented labels can already be specified in the spec file.
At a minimum, maybe an exporter: example could be added to the docs? (I can send a PR if you agree.)
https://rook.io/docs/rook/latest-release/Storage-Configuration/Monitoring/ceph-monitoring/?h=monitoring#using-custom-label-selectors-in-prometheus
I think our expectation was that the monitoring: stanza would also apply to the exporter.
(If there's ever an non-backwards compatible change to the CephCluster object, it might be interesting to move the monitoring labels into the spec.monitoring stanza or even embed a ServiceMonitorSpec there for override purposes. But the existing system works.)
nice, thanks @rkachach & @travisn!
+1!