Plugin Development Overview
Grafana’s plugin system allows you to extend its functionality by creating custom data sources, visualizations, and applications. This guide provides an overview of the plugin architecture and development workflow.Plugin Types
Grafana supports four types of plugins:- Data Source Plugins: Connect to external data sources and query data
- Panel Plugins: Create custom visualizations for displaying data
- App Plugins: Build complete applications within Grafana with custom pages and workflows
- Renderer Plugins: Generate images or PDFs of dashboards (advanced use case)
Plugin Architecture
Frontend Architecture
Frontend plugins are built using TypeScript and React. All plugins extend the baseGrafanaPlugin class from @grafana/data:
Core Packages
@grafana/data: Data structures, types, and base plugin classes@grafana/ui: Reusable UI components following Grafana’s design system@grafana/runtime: Runtime services (data fetching, location, config)@grafana/schema: CUE-generated TypeScript types for dashboards and panels
Backend Architecture
Backend plugins are written in Go and communicate with Grafana using the Grafana Plugin SDK for Go. The backend plugin system is located inpkg/plugins/.
Plugin Discovery and Loading
The plugin loader (pkg/plugins/manager/loader/) follows a pipeline architecture:
- Discovery: Finds plugin bundles from various sources
- Bootstrap: Reads
plugin.jsonand creates plugin objects - Validation: Verifies plugin signatures and dependencies
- Initialization: Starts backend processes and registers handlers
- Termination: Gracefully shuts down plugins
Plugin Lifecycle
Backend plugins implement thebackendplugin.Plugin interface (pkg/plugins/backendplugin/ifaces.go):
Plugin Metadata
Every plugin requires aplugin.json file that defines its metadata and capabilities:
Key Metadata Fields
type: Plugin type (datasource,panel,app,renderer)id: Unique identifier (convention:orgname-pluginname-type)name: Display name shown in Grafana UIbackend: Whether the plugin has a backend componentexecutable: Name of the backend binary (for backend plugins)dependencies: Required Grafana version and plugin dependenciesroutes: HTTP routes for proxying requests to external APIsincludes: Dashboards, pages, or other resources bundled with the plugin
Plugin Classes
Plugins are classified into two classes:- Core Plugins (
ClassCore): Built-in plugins shipped with Grafana (e.g., Prometheus, Loki, Time Series panel) - External Plugins (
ClassExternal): Third-party or custom plugins installed separately
- Frontend:
public/app/plugins/ - Backend: Various locations depending on the plugin
Plugin Signatures
Grafana enforces plugin signatures to ensure security and integrity. Signature statuses:internal: Core plugin, no signature requiredvalid: Properly signed with valid signatureinvalid: Signature verification failedmodified: Valid signature but content has been modifiedunsigned: No signature file present
grafana: Official Grafana Labs pluginscommercial: Commercial pluginscommunity: Community pluginsprivate: Private plugins for internal use
Development Workflow
Prerequisites
- Node.js 24.x (see
.nvmrcfor exact version) - Go 1.25.7 (for backend plugins)
- Yarn 4.11.0 (via corepack)
- Grafana development environment
Project Structure
Typical plugin structure:Building Plugins
For frontend plugins:Testing
Run the plugin in a local Grafana instance:Plugin Extensions
Grafana supports plugin extensions that allow plugins to extend functionality of other plugins:- Extension Points: Places where plugins can be extended
- Added Links: Links added to other plugins’ UIs
- Added Components: React components added to other plugins
- Exposed Components: Components that other plugins can use
plugin.json:
Plugin Communication
Frontend to Backend
Frontend plugins communicate with their backend via:- Query Handlers: For data queries (
QueryDataHandler) - Resource Handlers: For custom HTTP endpoints (
CallResourceHandler) - Health Checks: For verifying connectivity (
CheckHealthHandler)
Backend to External Services
Backend plugins can:- Make HTTP requests to external APIs
- Use plugin routes for authentication and proxying
- Store credentials securely in encrypted form
Next Steps
- Data Source Plugin Development
- Panel Plugin Development
- App Plugin Development
- Publishing Your Plugin