Repository navigation
feat: add OTel metrics with Prometheus exporter and ServiceMonitor auto-creation - #165
Merged
Merged
Conversation
miyunari
force-pushed
the
feat/operator-metrics
branch
2 times, most recently
from
July 26, 2026 15:45
1248aa0 to
fdfb411
Compare
miyunari
force-pushed
the
feat/operator-metrics
branch
from
July 30, 2026 20:19
f69d6c0 to
f97ae5d
Compare
miyunari
enabled auto-merge (squash)
July 30, 2026 20:19
…to-creation Expose operator-level metrics using the OpenTelemetry SDK with a Prometheus exporter registered on controller-runtime's metrics registry. This adds webhook mutation and controller reconcile counters and duration histograms to the existing /metrics endpoint. Add --enable-service-monitor flag (ENABLE_SERVICE_MONITOR env var) that automatically creates a Prometheus ServiceMonitor CR at startup for OpenShift environments where scraping is the default discovery method. The operator checks for the monitoring.coreos.com/v1 API at startup and gracefully skips creation if the CRD is not installed. Signed-off-by: Nina Bongartz <pninak@web.de>
The service-monitor component adds --enable-service-monitor and POD_NAMESPACE to the deployment. Including it in the production overlay by default caused the operator startup to be slower on clusters without the prometheus-operator CRD, leading to webhook timeout failures in E2E tests on Kind clusters. Move the component to opt-in: users who need automatic ServiceMonitor creation can add the component to their overlay. Signed-off-by: Nina Bongartz <pninak@web.de>
miyunari
force-pushed
the
feat/operator-metrics
branch
from
July 30, 2026 20:39
f97ae5d to
765a7d1
Compare
SequeI
approved these changes
Jul 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/metricsendpoint--enable-service-monitorflag (ENABLE_SERVICE_MONITORenv var) to automatically create a PrometheusServiceMonitorCR at startup for OpenShift environmentsmonitoring.coreos.com/v1API is not available on the clusterconfig/components/service-monitor/) with RBAC and deployment patches for easy opt-inNew metrics
webhook.mutations_totalnamespace,resultwebhook.mutation.duration_secondsnamespace,resultreconcile.count_totalcontroller,resultreconcile.duration_secondscontroller,result