rook icon indicating copy to clipboard operation
rook copied to clipboard

Monitoring labels aren't applied to rook-ceph-exporter

Open abh opened this issue 2 years ago • 1 comments

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.

abh avatar Feb 15 '24 05:02 abh

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.

rspier avatar Feb 17 '24 22:02 rspier

@abh @rspier is there something else we can do here? as @rspier commented labels can already be specified in the spec file.

rkachach avatar Feb 28 '24 15:02 rkachach

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.)

rspier avatar Mar 02 '24 06:03 rspier

nice, thanks @rkachach & @travisn!

abh avatar Mar 14 '24 01:03 abh

+1!

rspier avatar Mar 23 '24 17:03 rspier