A template for building Grafana frontend plugins (panel and app plugins) in a monorepo structure. It provides a fully ejected build system with complete control over configuration, ideal for teams building multiple related visualization plugins or plugins with shared code.
Scope: this monorepo targets panel and app plugins only. It intentionally does not include Go backend plugin tooling.
- Monorepo Architecture - Multiple plugins and shared packages in one repository
- Full Build Control - Ejected webpack and build configurations, no hidden abstractions
- Modern Toolchain - Turborepo, pnpm workspaces, SWC, TypeScript, Biome.js (imported plugins keep their own ESLint + Prettier)
- Panel Example - Ready-to-copy
PanelPlugintemplate (app plugins are supported too) - Type Safety - Strict TypeScript with composite builds and project references
- Fast Development - Docker Compose setup with hot reload
- Testing Ready - Jest configured for all packages
- Production Ready - Optimized builds with caching via Turborepo
-
Clone this repository:
git clone <your-repo-url> cd dataViz
-
Install dependencies:
cd plugins pnpm install -
Start the development environment:
# In one terminal: build the plugins once (shared across Grafana instances) pnpm run plugin # In another terminal: start a Grafana instance attached to that build pnpm run server
pnpm run serverstarts Grafana on port3001by default. To use a different port/version, setGRAFANA_PORT/GRAFANA_VERSION— e.g.GRAFANA_VERSION=13.1.0 GRAFANA_PORT=3002 pnpm run server. Because the plugin build is shared, you can run multiplepnpm run serverinstances on different ports/versions at once. -
Access Grafana at http://localhost:3001
- A demo dashboard (Workspace Panel Demo) renders the panel with TestData
- The panel plugin is also available in any dashboard's panel picker as Workspace Panel
Default host ports for every Docker stack in the repo. Commands run from the directory in the Run from column. Ports marked with a variable can be overridden (e.g. GRAFANA_PORT=3005 pnpm run server).
| Package | Stack | Run from | Service | Host port | Override |
|---|---|---|---|---|---|
| monorepo | plugin build/watch | plugins/ — pnpm run plugin |
live reload | 35729 |
— |
| monorepo | Grafana (all plugins) | plugins/ — pnpm run server |
Grafana | 3001 |
GRAFANA_PORT |
grafana-clock-panel |
standalone | package — pnpm run server |
Grafana | 3000 |
— |
grafana-echarts |
standalone | package — pnpm run server |
Grafana | 3020 |
GRAFANA_PORT |
grafana-echarts |
relations build | package — pnpm run server:relations |
Grafana | 4001 |
GRAFANA_PORT |
grafana-echarts |
relations build, nightly | package — pnpm run server:e2e:nightly |
Grafana | 4002 |
GRAFANA_PORT |
grafana-echarts |
LGTM | package — pnpm run server:lgtm |
Grafana | 3010 |
GRAFANA_PORT |
| Loki | 3100 |
LOKI_PORT |
|||
| Tempo HTTP | 3200 |
TEMPO_PORT |
|||
| Tempo OTLP gRPC / HTTP | 4317 / 4318 |
TEMPO_OTLP_GRPC_PORT / TEMPO_OTLP_HTTP_PORT |
|||
| Prometheus | 9090 |
PROMETHEUS_PORT |
|||
| Alloy | 12345 |
ALLOY_PORT |
- Node.js 24 (see
plugins/.nvmrc) - pnpm 10 or later
- Docker (for the local development environment)
dataViz/ # git root
├── .github/ # CI: workflows, actions, scripts, local tests
└── plugins/ # pnpm workspace root (run commands from here)
├── .shared/ # Shared build configurations
│ ├── tsconfig.base.json # Base TypeScript config
│ ├── tsconfig.json # Shared packages config
│ └── webpack-shared.mjs # Shared webpack config
├── packages/
│ ├── @shared/ # Shared libraries
│ │ └── core/ # Core utilities package
│ └── @plugins/ # Grafana plugins
│ ├── grafana-workspace-panel/ # Example panel plugin (template)
│ ├── grafana-clock-panel/ # Clock panel, imported with its own toolchain
│ └── grafana-echarts/ # ECharts app plugin; also publishes grafana-relations-panel
├── provisioning/ # Grafana provisioning
├── docker-compose.yaml # Plugin build/watch stack
├── docker-compose.grafana.yaml # Grafana instance stack
├── package.json # Root workspace
├── pnpm-workspace.yaml # pnpm workspace config
├── turbo.json # Turborepo orchestration
└── biome.json # Linting/formatting config
Copy one of the example plugins (the panel template is the usual starting point for a visualization):
cd plugins
cp -r packages/@plugins/grafana-workspace-panel packages/@plugins/your-new-pluginThen update:
package.json- thenamefieldsrc/plugin.json-id,name, and other metadatawebpack.config.mjs- thePLUGIN_IDand theuniqueNameargumenttsconfig.json- thepathsalias- root
tsconfig.json- add a project reference jest.config.js- copy from the template; add amoduleNameMapperentry if it imports a workspace package- Docker files - add a
distvolume / mount and allow the id as unsigned if you want it loaded by the Docker Grafana stack
CI picks the new package up automatically; no workflow needs editing. Add a plugin-ci.json only when the
defaults don't fit, e.g. the package publishes more than one plugin, or its e2e Grafana isn't on port 3000.
e2e runs only for packages with both an e2e script and a playwright.config.ts. See DEVELOPING.md.
Create shared code that multiple plugins can use:
mkdir -p packages/@shared/your-package-nameAdd a package.json and tsconfig.json, then import it in your plugins:
import { something } from '@shared/your-package-name';See plugins/README.md for the full workflow, including the two-stack Docker model and all available commands. Common commands:
cd plugins
pnpm build # Production build of all packages
pnpm dev # Watch mode
pnpm test # Run tests
pnpm type-check # TypeScript checking
pnpm lint # Lint
pnpm format:fix # Fix formatting
pnpm check # format + test:ci + lint + type-check- pnpm - Fast, disk-efficient package manager with workspace support
- Turborepo - High-performance build system with intelligent caching
- Webpack 5 - Module bundler configured for Grafana plugins
- TypeScript - Strict mode with composite builds
- React 18 - UI framework (provided by Grafana)
- SWC - Fast TypeScript/JSX compiler
- Biome.js - Fast linting and formatting for packages on this repo's toolchain.
grafana-clock-panelandgrafana-echartswere imported with their own ESLint + Prettier setup and still use it - Jest - Unit testing (via
@swc/jest) - Docker Compose - Local development environment
- @grafana/data - Data manipulation utilities and plugin base classes
- @grafana/runtime - Runtime services
- @grafana/ui - UI components
This template uses an "ejected" approach that differs from the standard @grafana/create-plugin:
- Full control over webpack, TypeScript, and build configurations
- Monorepo support with shared packages
- Custom build pipeline optimized for your needs
- Modern tooling (Turborepo, SWC, Biome.js)
- Ability to build multiple plugins that share code
- More manual configuration required
- No automatic updates from @grafana/create-plugin
- Need to maintain build configuration yourself
No workflow names a plugin. Each one asks .github/actions/discover-plugins which packages exist and what they publish, so a new package gets CI without workflow changes.
On a pull request:
ci.yml- format, lint, type-check and unit tests for every package, then a build of each plugin the packages publish, checking that the right plugin ended up indist/plugin-ci.yml- for the packages the PR touches:- a Grafana API compatibility check (levitate). It is non-blocking: a possible incompatibility shows as a warning and a PR comment.
- Playwright e2e against every Grafana version the plugin supports
plugin-bundle-stats.yml- a bundle-size comparison againstmain, as a PR comment per plugin
A change outside the plugin packages (the lockfile, plugins/.shared/) runs everything for every package, and a change to one of these workflows re-runs that workflow for every package. Per-package settings live in an optional plugin-ci.json. To test CI changes locally before pushing, run node --test --test-concurrency=1 '.github/tests/*.test.ts' from the repo root. Both are described in DEVELOPING.md.
Apache License 2.0, see LICENSE. The imported plugins keep their own licenses: grafana-clock-panel is MIT and grafana-echarts is Apache-2.0, each in its package LICENSE.
For Grafana plugin development: