Add custom metrics form to dashboard
We need to build a GUI based chart editor, which would achieve a few goals:
- Provide a way to easily define new charts, from within the dashboard.
We can add a 'new metric' button into the metrics dashboard filter bar. Clicking the button would prompt a modal containing all the information that is currently in settings > integrations > prometheus > new metric:
Later we could provide a much more functional version:
- REPL based query creation and input
- Visual builder for components like
Rate: 5 minutes: metric_name, as well as functions like joins.
- Typeahead hints/completion
- Metric name highlighting
- Label matching validation (can be a source of frustrating errors)
- Inline validation of query
Security / Permissions
Note, we should retain the current security model of restriction the ability to add/edit metrics to Maintainers and above.
Once we go to a source backed dashboard we can expand this, as the changes would go through review before being merged.
The goal would be to not require users to have specific knowledge of PromQL, so it is more user friendly. Internally in our own usage, we have had quite a few questions on building more advanced queries and it would be nice to not force people to attempt to build these on their own with raw PromQL, and inevitably struggle.