-
Notifications
You must be signed in to change notification settings - Fork 46
Description
Feature request
As an administrator, I want to enable link sharing without configuring a backing store.
eg, Grafana's Explore page encodes relevant state like:
Benefit
Users could simply copy/paste the URL from the browser, without using the special share link UI.
It would also make Promlens operationally simpler, without requiring additional external resources.
Background
Currently, Promlens requires a storage provider (eg postgres or sqlite) to enable the share link functionality.
Looking at https://github.com/prometheus/promlens/blob/0e62d284ab9b15ef9ba380adb795bda5d8922621/pkg/sharer/sharer.go , this happens by approximately like:
- user clicks "share link" button in client UI
- client sends JSON of page state to server
- server takes JSON string and generates a hash to use as the key and stores the JSON string at key
- server returns key to client
- client shows link in UI e.g.
https://promlens-instance/?l=<key>
If the state were serialized in the link itself, the flow would be simplied:
- user clicks "share link" button in client UI
- client serializes page state (eg, base64 encoded json) and appends to URL as query fragment, eg
https://promlens-instance/#<state> - client shows UI
or further:
- as page state changes, client serializes page state into location hash with History.replaceState
- at any point, user can copy the URL from the browser address bar
The above examples are a sketch, I'm flexible to other implementation approaches.
Is this in line with the direction for this project? I'm happy to help implement and test or discuss further.