keycloak/keycloak-operator

Operator creates `ServiceMonitor` even when metrics are not present

Closed this issue · 1 comments

Describe the bug

When the operator detects that ServiceMonitor object type (part of Prometheus operator) is present in the cluster, it creates a ServiceMonitor pointing to /auth/realms/master/metrics endpoint which comes from community Keycloak Metrics SPI.

When the extension is not explicitly installed, Prometheus complains about invalid targets.

Creation of ServiceMonitor can't be disabled.

Version

17.0.1

Expected behavior

We should introduce an optional switch to disable creation of ServiceMonitor.

Actual behavior

No response

How to Reproduce?

No response

Anything else?

No response

Perhaps not disable ServiceMonitor, but leave out the non-working Endpoint from the ServiceMonitor object.

There are two endpoints defined in the ServiceMonitor object, one is working correctly, the other is not.