Add control-plane operator metrics and fix dashboard scraping - #63
Merged
Conversation
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.
Closes #56
Add control-plane operator metrics, fix metrics scraping, and revamp the operator dashboard
Summary
Introduces custom control-plane metrics for the Redkey operator, fixes a ServiceMonitor misconfiguration that left the operator dashboard empty, and reorganizes the operator Grafana dashboard for clarity.
New metrics
Five custom metrics are registered on the controller-runtime Prometheus registry (served on the existing operator
/metricsendpoint) and instrumented at their reconcile call sites:redkey_reconcile_stage_errors_totalstageredkey_config_creations_totalreasoninitialvsgeneration_change)redkey_cleanup_deleted_configs_totalredkey_robin_deployment_changes_totalactioncreate/patchoperationsredkey_time_to_ready_secondsAll labels use bounded enums to keep cardinality predictable (no per-cluster/name labels).
Scraping fix
The operator ServiceMonitor scraped the metrics endpoint with
scheme/port: https, but the operator serves plain HTTP on:8080(--metrics-bind-address=:8080, service port namedhttp). Prometheus therefore generated no target, so every panel showed "No data". Switched the ServiceMonitor toport/scheme: httpto match, and updated the stale comment referencing the 8443/HTTPS endpoint.Dashboard changes
gridPoscoordinates normalized to prevent section bleed-through (panels from one section rendering under another).Supersededphase).Docs
Updated
docs/observability.mdwith the new metrics, example queries, and the revised dashboard layout.Testing
go build ./...,go vet ./..., andgo test ./internal/controller/...pass.up, and the new series (e.g.redkey_config_creations_total,redkey_phase) are ingested by Prometheus and rendered in Grafana.