# grafana/grafana-plugin-examples architecture

> Architecture diagram of the GitHub repository grafana/grafana-plugin-examples, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/grafana/grafana-plugin-examples
- Repository: https://github.com/grafana/grafana-plugin-examples

## Overview

This repository is a catalog of Grafana plugin examples, not a shared runtime library. The principal workflow is for a plugin developer to choose an example matching a plugin type and use it as a starting point. The README documents app, panel, and data source examples, including backend variants and the panel’s time-range behavior. Source excerpts were not provided, so the graph reflects documented capabilities and tree-supported paths; it does not infer internal calls between example modules.

Main entry points: [`examples/app-with-backend`](https://github.com/grafana/grafana-plugin-examples/tree/main/examples/app-with-backend) (App with backend), [`examples/panel-basic`](https://github.com/grafana/grafana-plugin-examples/tree/main/examples/panel-basic) (Basic panel), [`examples/datasource-with-backend`](https://github.com/grafana/grafana-plugin-examples/tree/main/examples/datasource-with-backend) (Data source with backend), [`examples/app-basic`](https://github.com/grafana/grafana-plugin-examples/tree/main/examples/app-basic) (Basic app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_apps["App plugins"]
  node_app_basic["Basic app"]
  node_app_backend["App with backend"]
end

subgraph group_panels["Panel plugins"]
  node_panel_basic["Basic panel"]
end

subgraph group_datasources["Data source plugins"]
  node_datasource_basic["Basic data source"]
  node_datasource_backend["Data source with backend"]
end

subgraph group_backends["Backend components"]
  node_app_backend_impl["App backend<br/>[app.go]"]
  node_datasource_backend_impl["Data source backend<br/>[datasource.go]"]
end

node_developer(("Plugin developer"))
node_grafana["Grafana time range"]

node_developer -->|"chooses example"| node_app_basic
node_developer -->|"chooses example"| node_app_backend
node_developer -->|"chooses example"| node_panel_basic
node_developer -->|"chooses example"| node_datasource_basic
node_developer -->|"chooses example"| node_datasource_backend
node_app_backend -->|"includes backend"| node_app_backend_impl
node_datasource_backend -->|"includes backend"| node_datasource_backend_impl
node_panel_basic -->|"reads and updates range"| node_grafana

click node_app_basic "https://github.com/grafana/grafana-plugin-examples/tree/main/examples/app-basic"
click node_app_backend "https://github.com/grafana/grafana-plugin-examples/tree/main/examples/app-with-backend"
click node_panel_basic "https://github.com/grafana/grafana-plugin-examples/tree/main/examples/panel-basic"
click node_datasource_basic "https://github.com/grafana/grafana-plugin-examples/tree/main/examples/datasource-basic"
click node_datasource_backend "https://github.com/grafana/grafana-plugin-examples/tree/main/examples/datasource-with-backend"
click node_app_backend_impl "https://github.com/grafana/grafana-plugin-examples/blob/main/examples/app-with-backend/pkg/plugin/app.go"
click node_datasource_backend_impl "https://github.com/grafana/grafana-plugin-examples/blob/main/examples/datasource-with-backend/pkg/plugin/datasource.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app_basic,node_app_backend toneBlue
class node_panel_basic toneAmber
class node_datasource_basic,node_datasource_backend toneMint
class node_app_backend_impl,node_datasource_backend_impl toneRose
class node_developer,node_grafana toneIndigo
```

## Components

### App plugins

- [Basic app](https://github.com/grafana/grafana-plugin-examples/tree/main/examples/app-basic): `examples/app-basic`
- [App with backend](https://github.com/grafana/grafana-plugin-examples/tree/main/examples/app-with-backend): `examples/app-with-backend`

### Panel plugins

- [Basic panel](https://github.com/grafana/grafana-plugin-examples/tree/main/examples/panel-basic): `examples/panel-basic`

### Data source plugins

- [Basic data source](https://github.com/grafana/grafana-plugin-examples/tree/main/examples/datasource-basic): `examples/datasource-basic`
- [Data source with backend](https://github.com/grafana/grafana-plugin-examples/tree/main/examples/datasource-with-backend): `examples/datasource-with-backend`

### Backend components

- [App backend](https://github.com/grafana/grafana-plugin-examples/blob/main/examples/app-with-backend/pkg/plugin/app.go): `examples/app-with-backend/pkg/plugin/app.go`
- [Data source backend](https://github.com/grafana/grafana-plugin-examples/blob/main/examples/datasource-with-backend/pkg/plugin/datasource.go): `examples/datasource-with-backend/pkg/plugin/datasource.go`

### Other components

- **Plugin developer**
- **Grafana time range**

## Connections

- Plugin developer → Basic app: chooses example (evidence: `README.md`)
- Plugin developer → App with backend: chooses example (evidence: `README.md`)
- Plugin developer → Basic panel: chooses example (evidence: `README.md`)
- Plugin developer → Basic data source: chooses example (evidence: `README.md`)
- Plugin developer → Data source with backend: chooses example (evidence: `README.md`)
- App with backend → App backend: includes backend (evidence: `README.md`)
- Data source with backend → Data source backend: includes backend (evidence: `README.md`)
- Basic panel → Grafana time range: reads and updates range (evidence: `README.md`)
