Skip to content

Conversation

@thampiotr
Copy link
Contributor

@thampiotr thampiotr commented Dec 16, 2025

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:
image

After:
image

PR Checklist

  • Documentation added
  • Tests updated
  • Config converters updated

@thampiotr thampiotr requested a review from Copilot December 16, 2025 16:16
Copy link
Contributor

Copilot AI left a 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';

@thampiotr thampiotr force-pushed the thampiotr/alloy-logs-dashboard-fixes branch from c384492 to 85f79e3 Compare January 8, 2026 17:23
@thampiotr thampiotr changed the title fix(mixin): correct invalid queries in alloy logs dashboard fix(mixin): Correct invalid queries in alloy logs dashboard Jan 8, 2026
@thampiotr thampiotr marked this pull request as ready for review January 9, 2026 11:22
@thampiotr thampiotr requested a review from a team as a code owner January 9, 2026 11:22
@thampiotr thampiotr requested a review from Copilot January 9, 2026 11:23
Copy link
Contributor

Copilot AI left a 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.

@thampiotr thampiotr force-pushed the thampiotr/alloy-logs-dashboard-fixes branch from ac206d3 to 5ca1180 Compare January 9, 2026 14:29
Copy link
Contributor

@dehaansa dehaansa left a 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.

@thampiotr thampiotr enabled auto-merge (squash) January 9, 2026 14:36
@thampiotr thampiotr merged commit ad8efd3 into main Jan 9, 2026
48 checks passed
@thampiotr thampiotr deleted the thampiotr/alloy-logs-dashboard-fixes branch January 9, 2026 14:54
@grafana-alloybot grafana-alloybot bot mentioned this pull request Jan 9, 2026
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