Skip to content

[Bug]: Serve: URL variables are not set. Hyperlinks and refresh broken #223

@RoryCrispin

Description

@RoryCrispin

grafanactl Version

v0.1.8

Which command group is affected?

resources (get/list/push/pull/delete/edit/serve/validate)

Command Executed

grafanactl serve

Command Output

-

What happened?

when using grafanactl serve,

What did you expect to happen?

Because Grafanactl serve embeds the grafana page within a wrapper iframe, several features of Grafana are broken which makes editing dashboards as code a painful experience;

Impacted Use Cases

Dashboard editing with template variables

  • While editing a dashboard, I set one or more template variables.
  • After changing the dashboard definition, the page reloads.
  • All template variables are reset on reload.
  • As a result, I must manually re-enter the variables each time.

Cross-linking dashboards (e.g. via table hyperlinks)

  • When testing links between dashboards, the generated URLs point to
    localhost:8080/d/<uid>/?some_vars=true
  • These URLs are not routed correctly by grafanactl, so the links cannot be tested in practice.
Image

Workaround;

There is a partial workaround:
If I navigate directly to the iframed dashboard page, URL state (including variables) is preserved across reloads.
However, in this mode the dashboard UID is not used in the URL slug; instead, the filename is used.
As a consequence, dashboard hyperlinks still do not resolve correctly.

Expected / Reference Behavior

This workflow could be significantly improved.

When developing against the Scenes app with auto-reload, full hot-reloading is supported without iframing the Grafana page.
In that setup, JavaScript is injected directly, preserving URL state and navigation behavior correctly.
A similar approach here would avoid variable resets and allow dashboard cross-links to work as expected during development.

How can we reproduce this?

How often does this happen?

Every time

Environment Details

MacOs Tahoe Grafana 12.3.0

Troubleshooting Steps Taken

  • I ran the command with -v, -vv, or -vvv flag for verbose output
  • I checked my configuration with grafanactl config view
  • I verified I'm using the correct context with config current-context
  • I verified my authentication token/credentials are valid
  • I checked the documentation for this command

Anything else we should know?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions