-
Notifications
You must be signed in to change notification settings - Fork 8
Interactive Editing #36
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
Open
tombrk
wants to merge
17
commits into
main
Choose a base branch
from
grafana-edit
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
Adds initial and highly experimental support for converting pops to mixins for somewhat easy integration into current pipelines. Usage: $ pop mix ./path/to/pop [-o yaml|json] [-s alerts|rules|grafana]
When invoked with `-s rules|alerts` we now include the `groups:` prefix so that the output can directly be piped into Prometheus rule files
To overwrite changed dashboards safely these need to be in their separate files. pop edit now enforces that with information-rich error messages.
Makes `pop edit` create the (currently one and only) dashboard on some Grafana instance (using a temp uid) and subscribes for change events. Once exited (SIGINT), all temporary dashboards are cleaned up
Adds pkg/coord for coordinating graceful shutdown of components (including cleanup) on actions like CTRL-C (SIGINT)
adds a http based interface to the edit package, so that a browser UI can perform those actions
initially bootstraps a react based UI that lists the dashboards in the Polly package and displays a respective Edit link (which actually works) for each.
adds actually usable support for prometheus rules
Quick note that i am actively working on a fix for this in grafana/grafana#38727 which will unblock a pile of things, this included. Right now it's looking rosy that i deal with a bunch of the fugly awkwardness around using scuemata from CUE, in fact |
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.
Rather large PR implementing a (very basic) interactive editing flow.
Usage:
Then visit http://localhost:3001 and edit the one dashboard. Changes made in Grafana will be reflected on disk.
Packages
grafana.Watcher
type for subscribing to change eventscontext.Context
.edit.Editor
,edit.Grafana
: Go structs performing editing sessions (e.g. subscribing to events, plumbing, etc)edit.Server
: gRPC-web server to exposeedit.Editor
capabilities to the frontendedit.Check()
: enforces dashboards are in their separate files, so that they can safely be replacedInternals
Grafana pushes notifications over a special WebSocket API using centrifuge, when dashboards are saved.
edit.Grafana
uses agrafana.Watcher
to be notified by that, queries the current dashboard model using the deprecated (but only) API client and saves it to disk.edit.Server
andedit.DashboardService
implement a gRPC (and gRPC-web) server for interacting with this exactedit.Grafana
, allowing easy control of the edit session.Both the frontend and the backend use strongly typed gRPC messages, which fits nicely with the overall schema awareness of Polly