Skip to content

fix: grafana link and uid drift in dashboards - #224

Merged
HardMax71 merged 4 commits into
mainfrom
fix/grafana-link
Feb 23, 2026
Merged

fix: grafana link and uid drift in dashboards#224
HardMax71 merged 4 commits into
mainfrom
fix/grafana-link

Conversation

@HardMax71

@HardMax71 HardMax71 commented Feb 23, 2026

Copy link
Copy Markdown
Owner

Summary by cubic

Fixes Grafana routing and stabilizes dashboard links/UID to prevent drift. Corrects queue wait-time metrics and updates dashboards to the renamed metrics so panels render correctly.

  • Bug Fixes

    • Frontend /grafana proxy now reads GRAFANA_URL; docker-compose sets a default (http://grafana:3000).
    • Dashboard UID set to integr8scode and internal links fixed to /d/integr8scode.
    • Updated coordinator-execution queries to use queue_wait_time_seconds_bucket, queue_schedule_total, and queue_enqueue_total.
    • Scheduler now computes wait time from enqueue timestamp, records per-priority wait time, adds a release metric, and logs wait_seconds.
    • Adjusted unit test to match the new queue script return shape and wait-time calculation.
  • Migration

    • Set GRAFANA_URL for the frontend if not using the default.

Written for commit ab79431. Summary will update on new commits.

Summary by CodeRabbit

  • Chores
    • Updated Grafana configuration and dashboard settings for production deployment
    • Made system URLs configurable via environment variables for flexible deployments
    • Updated monitoring dashboard metrics for improved observability

Copilot AI review requested due to automatic review settings February 23, 2026 13:33
@coderabbitai

coderabbitai Bot commented Feb 23, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Grafana configuration is updated with a production root URL, dashboard metrics are renamed for metric consistency, a dashboard identifier is changed, and the Grafana URL is externalized as an environment variable across Docker Compose and nginx configuration for dynamic deployment setup.

Changes

Cohort / File(s) Summary
Grafana Backend Configuration
backend/grafana/grafana.ini
Added [server] section with root_url set to https://grafana.integr8scode.cc/.
Dashboard Updates
backend/grafana/provisioning/dashboards/coordinator-execution.json, backend/grafana/provisioning/dashboards/integr8scode.json
Updated Prometheus/VM metric expressions in coordinator-execution.json (execution_queue_wait_time_seconds_bucket → queue_wait_time_seconds_bucket, executions_assigned_total → queue_schedule_total, executions_queued_total → queue_enqueue_total). Changed integr8scode.json dashboard uid from "integr8scode-main" to "integr8scode".
Environment & Proxy Configuration
docker-compose.yaml, frontend/nginx.conf.template
Added GRAFANA_URL environment variable to frontend service and made Grafana root URL configurable via GF_SERVER_ROOT_URL. Updated nginx proxy upstream to use GRAFANA_URL environment variable instead of hardcoded http://grafana:3000.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

  • fix: deploy configs updated #205: Both PRs modify Grafana configuration and Docker Compose environment variables for the Grafana service.
  • Feat/auto deploy #182: Directly related changes to Grafana config, frontend nginx proxy configuration, and environment variable integration across docker-compose and nginx.

Poem

🐰 The URLs now dance with grace,
From config vars, they find their place,
Through Docker's paths and nginx gates,
Grafana flourishes—production awaits! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: fixing Grafana links (environment variable configuration across multiple files) and UID drift (dashboard uid updated from 'integr8scode-main' to 'integr8scode').
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/grafana-link

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes Grafana integration issues by addressing configuration drift and correcting metric names in dashboards. The changes make Grafana URLs configurable via environment variables and align dashboard queries with the actual OpenTelemetry instrumentation.

Changes:

  • Added configurable GRAFANA_URL environment variable for nginx proxy configuration
  • Changed dashboard UID from "integr8scode-main" to "integr8scode" to fix drift
  • Corrected metric names in coordinator-execution dashboard to match actual instrumentation (queue_schedule_total, queue_enqueue_total, queue_wait_time_seconds_bucket)

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
frontend/nginx.conf.template Updated Grafana proxy to use configurable GRAFANA_URL environment variable instead of hardcoded URL
docker-compose.yaml Added GRAFANA_URL env var for frontend; changed GRAFANA_ROOT_URL default to empty string
backend/grafana/provisioning/dashboards/integr8scode.json Changed dashboard UID from "integr8scode-main" to "integr8scode"
backend/grafana/provisioning/dashboards/coordinator-execution.json Fixed metric names to match actual OpenTelemetry instrumentation
backend/grafana/grafana.ini Added hardcoded production root_url configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docker-compose.yaml Outdated
environment:
- GF_LOG_LEVEL=warn
- GF_SERVER_ROOT_URL=${GRAFANA_ROOT_URL:-http://localhost:3000/}
- GF_SERVER_ROOT_URL=${GRAFANA_ROOT_URL:-}

Copilot AI Feb 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value for GRAFANA_ROOT_URL is now empty (:-) instead of the previous default "http://localhost:3000/". An empty root_url may cause Grafana to malfunction or generate incorrect URLs in local development environments. Consider providing a sensible default like "http://localhost:3000/" or "http://localhost:5001/grafana/" for local development, or documenting that this variable must be set explicitly.

Suggested change
- GF_SERVER_ROOT_URL=${GRAFANA_ROOT_URL:-}
- GF_SERVER_ROOT_URL=${GRAFANA_ROOT_URL:-http://localhost:3000/}

Copilot uses AI. Check for mistakes.
"timezone": "",
"title": "System Overview",
"uid": "integr8scode-main",
"uid": "integr8scode",

Copilot AI Feb 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dashboard UID has been changed from "integr8scode-main" to "integr8scode", but other dashboards still reference the old UID in their navigation links. The following files need to be updated to use "/d/integr8scode" instead of "/d/integr8scode-main":

  • dlq-monitoring.json (line 31)
  • event-stream-monitoring.json (line 33)
  • kafka-events-monitoring.json (line 33)
  • rate-limiting-dashboard.json (line 30)

Without these updates, navigation links from these dashboards to the System Overview will be broken.

Copilot uses AI. Check for mistakes.
Comment thread backend/grafana/grafana.ini Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
backend/grafana/provisioning/dashboards/coordinator-execution.json (1)

149-188: ⚠️ Potential issue | 🟠 Major

Panel wait-time queries will fail silently; queue.wait_time metric is defined but never recorded.

Two of the three renamed metrics are properly implemented:

  • queue_enqueue_total is recorded via QueueMetrics.record_enqueue()
  • queue_schedule_total is recorded via QueueMetrics.record_schedule()

However, queue_wait_time_seconds_bucket is defined as a histogram instrument in QueueMetrics._create_instruments() but the record_wait_time() method is never called anywhere in the backend. Panels 1 and 5 (both referencing queue_wait_time_seconds_bucket) will display no data.

Either implement the call to QueueMetrics.record_wait_time() where execution wait times are measured, or remove the metric references from the dashboard.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@backend/grafana/provisioning/dashboards/coordinator-execution.json` around
lines 149 - 188, The dashboard panels reference the histogram metric
queue_wait_time_seconds_bucket which is created in
QueueMetrics._create_instruments() but never recorded; add calls to
QueueMetrics.record_wait_time(duration_seconds) at the point where job/execution
wait time is measured (e.g., before execution starts or when dequeuing/assigning
work) so the histogram buckets are populated, or alternatively remove the panels
referencing queue_wait_time_seconds_bucket/queue wait-time from the Grafana
JSON; ensure you use the QueueMetrics.record_wait_time() method and the same
duration units expected by the histogram to match the existing
queue_enqueue_total and queue_schedule_total usage.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@backend/grafana/grafana.ini`:
- Around line 1-2: The grafana.ini currently hardcodes root_url which conflicts
with the docker-compose environment variable GF_SERVER_ROOT_URL
(GRAFANA_ROOT_URL) and can be overridden to an empty string; remove the root_url
line from grafana.ini (the [server] section entry named root_url) so the
container env var GF_SERVER_ROOT_URL/GRAFANA_ROOT_URL is the single source of
truth (or alternatively, if you prefer INI as source, remove GF_SERVER_ROOT_URL
from docker-compose and set the value in grafana.ini) — pick one source and
delete the other to avoid empty-string overrides.

In `@backend/grafana/provisioning/dashboards/integr8scode.json`:
- Line 911: Update any hardcoded Grafana dashboard links that point to the old
UID to match the new UID value "integr8scode": search for occurrences of the URL
string "/d/integr8scode-main" (e.g., in event-stream-monitoring.json and
kafka-events-monitoring.json) and replace them with "/d/integr8scode" so
cross-dashboard navigation references the new "uid": "integr8scode".

In `@docker-compose.yaml`:
- Line 193: GF_SERVER_ROOT_URL in docker-compose.yaml currently defaults to an
empty string via the GRAFANA_ROOT_URL fallback, which can silently override the
root_url in grafana.ini; update the environment entry for GF_SERVER_ROOT_URL so
it uses a non-empty default (the production root URL used in grafana.ini) when
GRAFANA_ROOT_URL is unset, ensure the value matches the grafana.ini root_url to
avoid dual-source ambiguity, and test by bringing the compose stack up without
GRAFANA_ROOT_URL to confirm alert links are correct.

---

Outside diff comments:
In `@backend/grafana/provisioning/dashboards/coordinator-execution.json`:
- Around line 149-188: The dashboard panels reference the histogram metric
queue_wait_time_seconds_bucket which is created in
QueueMetrics._create_instruments() but never recorded; add calls to
QueueMetrics.record_wait_time(duration_seconds) at the point where job/execution
wait time is measured (e.g., before execution starts or when dequeuing/assigning
work) so the histogram buckets are populated, or alternatively remove the panels
referencing queue_wait_time_seconds_bucket/queue wait-time from the Grafana
JSON; ensure you use the QueueMetrics.record_wait_time() method and the same
duration units expected by the histogram to match the existing
queue_enqueue_total and queue_schedule_total usage.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b7dcb88 and 1515552.

📒 Files selected for processing (5)
  • backend/grafana/grafana.ini
  • backend/grafana/provisioning/dashboards/coordinator-execution.json
  • backend/grafana/provisioning/dashboards/integr8scode.json
  • docker-compose.yaml
  • frontend/nginx.conf.template

Comment thread backend/grafana/grafana.ini Outdated
Comment thread backend/grafana/provisioning/dashboards/integr8scode.json
Comment thread docker-compose.yaml Outdated
@sonarqubecloud

Copy link
Copy Markdown

@HardMax71
HardMax71 merged commit 811f74a into main Feb 23, 2026
16 checks passed
@HardMax71
HardMax71 deleted the fix/grafana-link branch February 23, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants