Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Dashboard Builders #10

Merged
merged 1 commit into from
Apr 26, 2024
Merged

Feature: Dashboard Builders #10

merged 1 commit into from
Apr 26, 2024

Conversation

amotl
Copy link
Contributor

@amotl amotl commented Apr 24, 2024

About

The idea of this patch is to make it possible to support dashboard-as-code workflows, by using dashboard builders, in this case, grafana-dashboard or grafanalib, for having a start.

Usage

On the import action, it is not much different than before. Now, beyond accepting dashboards in JSON format, the program will also accept arbitrary file paths. When applicable, they will be treated as executable programs, expected to generate valid native Grafana JSON on STDOUT.

Synopsis

Prepare.

wget https://github.com/grafana-toolbox/grafana-snippets/raw/main/dashboard/gd-prometheus.py
export GRAFANA_URL=http://admin:admin@localhost:3000

Import a dashboard emitted by a dashboard builder, overwriting it when a dashboard with the same name already exists in the same folder.

grafana-import import --overwrite -i gd-prometheus.py

Trivia

This is a stacked PR, based on GH-9. It can be reviewed independently, but please do not merge prematurely.

References

@amotl amotl changed the base branch from main to noconfig April 24, 2024 22:31
Base automatically changed from noconfig to main April 24, 2024 22:43
@amotl amotl requested a review from peekjef72 April 24, 2024 22:48
@amotl amotl marked this pull request as ready for review April 24, 2024 22:48
@amotl amotl changed the title Feature: Dashboard Builders, supporting dashboard-as-code workflows Feature: Dashboard Builders Apr 25, 2024
Copy link
Collaborator

@peekjef72 peekjef72 left a comment

Choose a reason for hiding this comment

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

great again.

@amotl amotl merged commit 281e1b5 into main Apr 26, 2024
2 checks passed
@amotl amotl deleted the builder branch April 26, 2024 20:49
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