-
Notifications
You must be signed in to change notification settings - Fork 499
fix(mixin): Correct invalid queries in alloy logs dashboard #5123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes invalid queries in the Alloy logs dashboard by replacing the grafonnet-based implementation with a custom dashboard definition. The main issue being addressed is that cluster and namespace template variables were previously querying Loki (using empty label selectors like {}) instead of Prometheus metrics, which caused invalid queries.
Key changes:
- Rewrites the logs dashboard using custom dashboard utilities instead of the logs-lib library
- Fixes template variable queries to use Prometheus datasource for cluster/namespace variables
- Adds comprehensive test suite to validate dashboard configurations and feature flags
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| operations/alloy-mixin/dashboards/alloy-logs.libsonnet | Complete rewrite replacing grafonnet logs-lib with custom implementation; fixes datasource queries for template variables |
| operations/alloy-mixin/rendered/dashboards/alloy-logs.json | Regenerated dashboard JSON reflecting the corrected queries and new structure |
| operations/alloy-mixin/test/config_test.jsonnet | New test file validating feature flags, template variables, and filter selector functionality |
| Makefile | Adds test-mixin target and Grizzly validation to ensure dashboard validity |
Comments suppressed due to low confidence (1)
operations/alloy-mixin/test/config_test.jsonnet:1
- The 'includeAll' value for the job variable is inconsistent between K8s and non-K8s configurations. In the K8s configuration (line 51), job has 'includeAll: true', but in the non-K8s configuration (line 107), it has 'includeAll: false'. This inconsistency could cause unexpected behavior when switching between cluster modes. Consider aligning these values to match the intended behavior.
local mixin = import '../mixin.libsonnet';
c384492 to
85f79e3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
ac206d3 to
5ca1180
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having some mixin tests is awesome! Code looks good, have not deployed the updated logs dashboard but it looks good in review.
PR Description
The logs overview dashboard was not even properly working, had query errors when used with k8s. This adds a simple replacement dashboard of the imported one and fixes the issues with queries.
We are also adding some tests to validate the correctness of dashbaords that we produce.
Notes to the Reviewer
Before:

After:

PR Checklist