Repository navigation
Conversation
caohy1988
approved these changes
Nov 23, 2026
caohy1988
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for working through the #592 follow-ups. The gallery export still matches the trial dashboard, datasource references only go through the input, and the drift tests pass and do catch the obvious bad exports. Approving.
There are a few things I'd still like tightened in a follow-up. The most important is first-load behavior after a fresh gallery import: the Session variable starts empty and its option query allows "", so a table with any empty session ID can open filtered down to just those events. The rest are mostly gaps in the drift tests (duplicate entries, nested panels, booleans vs numbers) and the README regeneration steps. I'll put them in a separate issue.
The Recent sessions link passed timezone=${__timezone}, which Grafana's
default URL formatting leaves unencoded. With the dashboard on a fixed-offset
zone such as Etc/GMT+5, the link carried timezone=Etc/GMT+5, and the new tab
read the "+" as a space ("Etc/GMT 5") and showed Trace detail in another zone.
${__timezone:percentencode} sends timezone=Etc%2FGMT%2B5.
The link tests check that utc, Etc/GMT+5, Etc/GMT-14 and a three-part zone
round-trip. The gallery copy is regenerated with Grafana 12.3.4 in the same
commit; only the link's timezone token differs (SHA-256 7b91b27f3e6308fd19e70aa6daff847664ea45aa6e182688a2c2c2105ccd1122).
Checked on a clean Grafana 12.3.4 with plugin 3.3.1: with the dashboard on
Etc/GMT+5, the link carries timezone=Etc%2FGMT%2B5 and the new tab shows Trace
detail five hours behind UTC, while the same link with the raw "+" does not.
Part of GoogleCloudPlatform#596.
tests/test_grafana_gallery_export.py compared queries, data sources and a chosen set of fields, so a changed reducer field, a relabelled series, a downgraded or missing __requires version, or a value saved in a variable's state still passed. It now diffs every panel, variable and dashboard setting and fails on any difference the export does not explain. The allowed rewrites are listed in the file: - defaults Grafana 12.3 fills in, each with its exact value (FILLED_DEFAULTS), plus pluginVersion and 0..1 bounds on a percentunit field; - schema-migration changes: the base threshold step written as 0 or dropped, a hidden table footer moved into field defaults, and hideFrom.tooltip set on series already hidden from the viz; - the export's own changes: constants and the data source become __inputs references, query variables lose their selection, and keys that only restate a default (hide 0, skipUrlSync false, sort 0, liveNow false) are dropped. Sanitization is checked on its own: query variables keep no current value or options; constants keep only their VAR_* reference in query, current and options; the data source input is exactly DS_BIGQUERY, labelled "BigQuery"; __requires lists only Grafana 12.3.4 or later and the plugin version run_local.py pins; and the file has no URLs, credentials or hosts. Each regression listed in GoogleCloudPlatform#596 now fails the test, as do a few more: the reducer field, a series label, __requires versions, a missing plugin version, a constant's current value, a saved session, a datasource input named after an instance, a URL, a threshold, allowCustomValue and a changed default. Part of GoogleCloudPlatform#596.
The regeneration steps had jq read exported.json from the repository root, which .gitignore does not cover, so git add -A could stage a raw export with real project and dataset names. The steps now save the download as dashboards/grafana/gallery/exported.json and delete it afterwards. The ignore rule matched only direct children of gallery/, although the README said every other JSON file there is ignored. It now uses gallery/**/*.json with the matching *.gallery.json exception, and the README's note on keys says what it covers. Part of GoogleCloudPlatform#596.
caohy1988
force-pushed
the
grafana-gallery-followups
branch
from
November 23, 2026 23:47
042fcd3 to
4f371f1
Compare
This was referenced Nov 25, 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 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 #596. Follow-up to #592, in three commits. Please keep them separate when merging (Rebase and merge).
1. fix(dashboards): percent-encode the timezone in the trace link
The link now uses
timezone=${__timezone:percentencode}instead oftimezone=${__timezone}, so fixed-offset zones keep their+. Before,Etc/GMT+5reached the new tab asEtc/GMT 5. The link test now round-tripsutc,Etc/GMT+5,Etc/GMT-14andAmerica/Argentina/Buenos_Aires. The gallery copy is regenerated with Grafana 12.3.4 in the same commit, and only the timezone token differs. SHA-2567b91b27f3e6308fd19e70aa6daff847664ea45aa6e182688a2c2c2105ccd1122.2. test(dashboards): diff the whole gallery export against the trial
tests/test_grafana_gallery_export.pynow diffs every panel, variable and dashboard setting, and fails on any difference the export doesn't explain. The allowed rewrites are listed in the file:FILLED_DEFAULTS).hideFrom.tooltipset on series that are already hidden from the viz.__inputsreferences, cleared query-variable state, and dropped keys that only restated a default.Sanitization is checked separately:
currentoroptions.VAR_*reference.DS_BIGQUERY, labelled "BigQuery".__requireslists only Grafana ≥ 12.3.4 and the plugin versionrun_local.pypins.Each of these mutations of the gallery file now fails the test, and the unmodified file passes:
/^llm_calls$/__requiresversion downgradedcurrentcurrent, and in itsoptionsallowCustomValueflipped3. docs(dashboards): keep the raw Grafana export inside gallery/
The regeneration steps now save the download as
dashboards/grafana/gallery/exported.json, which is ignored, and delete it after thejqstep. The ignore rule is nowgallery/**/*.jsonwith the matching*.gallery.jsonexception, and the README says what it covers.Checks
tests/test_grafana_efficiency_trial.py,tests/test_grafana_gallery_export.py,tests/test_check_grafana_queries_sync.pyandtests/test_grafana_local_runner.pygive 202 passed.scripts/check_grafana_queries_sync.pypasses, andautoformat.shmakes no changes.Etc/GMT+5, the new tab shows Trace detail five hours behind UTC. The old link, with a raw+, showed UTC times.Not changed here: the pre-existing
___ALL___sentinel that #596 notes, where a session whose id is literally___ALL___matches every session.