fix(mixin): Correct invalid queries in alloy logs dashboard #5123
Merged
fix(mixin): Correct invalid queries in alloy logs dashboard #5123
Conversation
Contributor
There was a problem hiding this comment.
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
dehaansa
reviewed
Jan 8, 2026
ac206d3 to
5ca1180
Compare
dehaansa
approved these changes
Jan 9, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
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