What a plugin is made of
Every plugin includes a frontend component with code that runs in the browser. For a panel plugin, that’s all you need: it draws data that Grafana has already fetched.
Some plugins also need a backend component
A backend component is the part of a plugin that runs on the Grafana server instead of in the browser. Data source and app plugins can have one, and the create-plugin tool asks whether to add it. Panel plugins can’t.
You need a backend component when the browser is the wrong place to do the work:
- The system you’re querying isn’t reachable from a browser, or it uses a protocol other than HTTP, for example a SQL database server.
- You need to keep credentials such as API keys out of browser code.
- You want a data source to work with Grafana alerting.
- You want to keep state between users, for example to cache query results.