K-Phoen / backstage-plugin-grafana

Grafana plugin for Backstage
Apache License 2.0
57 stars 33 forks source link

Embed Graphs in Backstage #39

Closed stichiboi closed 1 year ago

stichiboi commented 2 years ago

I want to see a dashboard's graphs directly in Backstage

Ideally there is a component DashboardGraphs which takes in a single prop dashboardId

I see 2 options to implement this:

  1. An iframe with the link directly to the dashboard page (https://mygrafana.xom/d/dashboardId). But this will also show the navigation, the edit controls etc...
  2. The component makes a request to the Grafana API -> From here I can find all the panels and their IDs -> I generate a separate iframe for each panel, using the d-solo options (https://mygrafana.xom/d-solo/dashboardId/dashboardSlug?panelId=1 (I can get dashboardSlug from the same API request)

Option 2 seems better for me. It's more compact and there is no risk of navigating / editing. I'm just not sure if all the different iframes will have an impact on the perfomance...

I'm available to work on this. I would just like some input to make this better for everyone else!