Skip to content

Draft: Observability dashboard render

Tim Zallmann requested to merge tz-observability-dashboard-render into master

What does this MR do and why?

POC for using Dashboarding for Rendering Observability Data. gitlab-org/opstrace/opstrace#2123 (closed)

  • Creates a new data source for connecting to promotheus data
  • Test dashboard + test visualization for a PromQL Query
  • First attempt for a PromQL Editor

Possible PromQL extension for autocompletion

Screenshots or screen recordings

Walkthrough - https://www.youtube.com/watch?v=STtFWAFHR-s

Bildschirm_foto_2023-03-15_um_16.08.22

Bildschirm_foto_2023-03-15_um_16.08.34

Bildschirm_foto_2023-03-15_um_16.40.14

How to set up and validate locally

Just for the demo and should/can be replaced with the Rails Proxy

  1. CORS Proxy to add proxy headers of Grafana as it doesn't support CORS so I can call it directly from the FE
  2. I used https://github.com/Rob--W/cors-anywhere to run on http://localhost:3005/ (but you can also use NGINX or anything else right now)
  3. Which gave me then the capability to call this funky URL http://localhost:3005/http://localhost:3001/api/datasources/proxy/1/api/v1/query_range directly which is simply the Grafana API endpoint
  4. Added a Grafana API token which i then sent in !114751 (diffs)
  5. Add the token from Grafana to !114751 (diffs)

Actual setup steps for this MR

  1. Have GOUI running on http://localhost:3001/ and connect to Promotheus (I used https://prometheus.demo.do.prometheus.io/) as datasoruce 1 (this is basically hardcoded)
  2. Enable the feature flag by running the following command in your GitLab directory which should enable analytics :
  • echo "Feature.enable(:combined_analytics_dashboards)" | rails c
  1. Navigate to the Dashboard page for a project for example http://localhost:3000/Commit451/lab-coat/-/analytics/dashboards which then should show you a Test Rendering Observability Data dashboard

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Tim Zallmann

Merge request reports