backstage / community-plugins

Community plugins for Backstage
Apache License 2.0
139 stars 139 forks source link

[Plugin] Grafana Graphs #233

Closed stichiboi closed 1 week ago

stichiboi commented 1 year ago

Summary

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

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

Project website (if applicable)

I know a plugin for Grafana already exists: but this plugin just shows lists of dashboards. I would like to see the real graphs. Existing Grafana plugin

I tried opening an issue on that repo 1 month ago, but the original author isn't responding to the existing PRs or the issues 😢

Wouldn't it be better to have the plugin on the main Backstage repo, where all the other plugins are?

Context

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...

falkenbt commented 1 year ago

Regarding the iframe option: You can hide the controls/navigation by appending &kiosk=1 to the Grafana URL.

MarcBruins commented 1 year ago

With the input of @falkenbt option 1 seems a lot easier to do and less performance impact. And regarding the inactive existing plugin, this could be a separate plugin as NewRelic has the same:

What also could help to implement it to have a look at the OkayHQ plugin which also has an iframe implementation https://github.com/OkayHQ/backstage-plugin

github-actions[bot] commented 2 weeks ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.