Skip to content

Replace hardcoded Prometheus datasource UID with template variable - #651

Closed
cbartz with Copilot wants to merge 2 commits into
feat/add-prometheus-based-dashboardfrom
copilot/sub-pr-645
Closed

cbartz with Copilot wants to merge 2 commits into
feat/add-prometheus-based-dashboardfrom
copilot/sub-pr-645

Conversation

Copilot AI commented Nov 11, 2025 •

Copy link
Copy Markdown
Contributor

Applicable spec: N/A

Overview

Replaces hardcoded Prometheus datasource UID in metrics_prometheus.json with a template variable to enable dashboard portability across Grafana instances.

Rationale

The dashboard contained 32 hardcoded references to PE6731821AF182E02, preventing reuse in different Grafana environments. Template variable approach matches existing pattern in metrics.json.

Juju Events Changes

None

Module Changes

None

Library Changes

None

Checklist

  • The charm style guide was applied.
  • The contributing guide was applied.
  • The [changes are compliant with ISD054 - Managing Charm Complexity
  • The documentation for charmhub is updated.
  • The PR is tagged with appropriate label (urgent, trivial, complex).
  • The changelog is updated with changes that affects the users of the charm.
  • The application version number is updated in github-runner-manager/pyproject.toml.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: cbartz <4182921+cbartz@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on Prometheus-based Grafana dashboard Replace hardcoded Prometheus datasource UID with template variable Nov 11, 2025
Copilot AI requested a review from cbartz November 11, 2025 14:10
Comment on lines +1514 to +1536
{
"current": {
"selected": true,
"text": [
"All"
],
"value": [
"$__all"
]
},
"hide": 0,
"includeAll": true,
"label": "Prometheus datasource",
"multi": true,
"name": "prometheusds",
"options": [],
"query": "prometheus",
"queryValue": "",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"type": "datasource"
},

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot please remove this template, the prometheus datasource has been defined by the pr

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can remove the template variable, but what should the datasource UID references be changed to instead of ${prometheusds}? Should they be:

  • null (to use default datasource)
  • "$__all"
  • A specific UID that the PR provides
  • Something else?

The original feedback requested replacing the hardcoded PE6731821AF182E02 with a template variable, so I want to make sure I use the correct approach.

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