feat: add Grafana dashboard, ServiceMonitor, and monitoring compose overlay#22
Open
bornakapusta wants to merge 3 commits intomainfrom
Open
feat: add Grafana dashboard, ServiceMonitor, and monitoring compose overlay#22bornakapusta wants to merge 3 commits intomainfrom
bornakapusta wants to merge 3 commits intomainfrom
Conversation
- Grafana dashboard JSON covering all 14 gatekeeperd Prometheus metrics - Helm ConfigMap template for Grafana sidecar auto-provisioning - Helm ServiceMonitor template for Prometheus Operator - Root-level dashboards/grafana-gatekeeperd.json for non-K8s users - Monitoring documentation (docs/MONITORING.md) - README monitoring section
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Docker Images BuiltImages are available for testing: # gatekeeperd
docker pull ghcr.io/tight-line/gatekeeperd:pr-22-9e6b39f
# gatekeeper-relay
docker pull ghcr.io/tight-line/gatekeeper-relay:pr-22-9e6b39fdocker-compose.ymlGATEKEEPERD_IMAGE=ghcr.io/tight-line/gatekeeperd:pr-22-9e6b39f \
RELAY_IMAGE=ghcr.io/tight-line/gatekeeper-relay:pr-22-9e6b39f \
docker-compose --profile relay upHelm (values override)image:
repository: ghcr.io/tight-line/gatekeeperd # or gatekeeper-relay
tag: "pr-22-9e6b39f"Images expire ~15 days after PR closes. |
Move monitoring services to a separate docker-compose.monitoring.yml overlay file instead of using profiles in the main compose file. This keeps the base compose focused on the app and makes monitoring opt-in via the -f flag.
|
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 #15
Summary
docker-compose.monitoring.ymloverlay for local Prometheus + Grafana stack (replaces profile-based approach)monitoring/directory with Prometheus scrape config and Grafana provisioningLocal monitoring
Dashboard screenshot
Changes
Dashboard (
dashboards/grafana-gatekeeperd.json,charts/gatekeeperd/dashboards/gatekeeperd.json)Docker Compose monitoring overlay
docker-compose.monitoring.yml— Prometheus + Grafana services, opt-in via-fflagmonitoring/prometheus.yml— scrape config targetinggatekeeperd:9090monitoring/grafana/provisioning/— auto-provisions Prometheus datasource and dashboardHelm templates
grafana-dashboard-configmap.yaml— ConfigMap withgrafana_dashboardsidecar label, gated bygrafana.dashboard.enabledservicemonitor.yaml— Prometheus Operator ServiceMonitor, gated byserviceMonitor.enabledvalues.yaml— Newgrafana.dashboard.*andserviceMonitor.*value blocksDocumentation
docs/MONITORING.md— Manual Grafana import, Helm sidecar provisioning, ServiceMonitor setup, template variables, full metrics reference tableREADME.md— Added Monitoring section linking to docs and dashboard fileCHANGELOG.md— Unreleased entries for all additionsMetrics coverage
All 14 metrics from
internal/metrics/metrics.goare covered:gatekeeper_requests_totalgatekeeper_request_duration_secondsgatekeeper_verification_failures_totalgatekeeper_validation_failures_totalgatekeeper_ip_filter_denied_totalgatekeeper_ip_ranges_loadedgatekeeper_ip_range_fetch_errors_totalgatekeeper_forward_errors_totalgatekeeper_relay_webhooks_queued_totalgatekeeper_relay_webhooks_delivered_totalgatekeeper_relay_delivery_errors_totalgatekeeper_relay_webhooks_pendinggatekeeper_relay_clients_connectedgatekeeper_relay_delivery_duration_secondsTest plan
docker-compose -f docker-compose.yml -f docker-compose.monitoring.yml up -dstarts all 4 containersdashboards/grafana-gatekeeperd.jsoninto Grafana manually — verify all panels render without errorshelm templatewithgrafana.dashboard.enabled=true— verify ConfigMap rendershelm templatewithserviceMonitor.enabled=true— verify ServiceMonitor rendersdashboards/grafana-gatekeeperd.jsonmatchescharts/gatekeeperd/dashboards/gatekeeperd.json