| 
									
										
										
										
											2020-05-07 23:45:50 +08:00
										 |  |  | +++ | 
					
						
							| 
									
										
										
										
											2020-12-01 20:52:32 +08:00
										 |  |  | title = "Build a plugin" | 
					
						
							| 
									
										
										
										
											2021-04-16 05:08:58 +08:00
										 |  |  | aliases = ["/docs/grafana/latest/plugins/developing/"] | 
					
						
							| 
									
										
										
										
											2020-05-07 23:45:50 +08:00
										 |  |  | +++ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Build a plugin
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-08 00:45:52 +08:00
										 |  |  | For more information on the types of plugins you can build, refer to the [Plugin Overview]({{< relref "../../plugins/_index.md" >}}). | 
					
						
							| 
									
										
										
										
											2020-05-07 23:45:50 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | ## Get started
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The easiest way to start developing Grafana plugins is to use the [Grafana Toolkit](https://www.npmjs.com/package/@grafana/toolkit). | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-24 00:56:44 +08:00
										 |  |  | Open the terminal, and run the following command in your [plugin directory]({{< relref "../../administration/configuration.md#plugins" >}}): | 
					
						
							| 
									
										
										
										
											2020-05-07 23:45:50 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | ```bash | 
					
						
							|  |  |  | npx @grafana/toolkit plugin:create my-grafana-plugin | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | If you want a more guided introduction to plugin development, check out our tutorials: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-10 21:38:45 +08:00
										 |  |  | - [Build a panel plugin]({{< relref "/tutorials/build-a-panel-plugin.md" >}}) | 
					
						
							|  |  |  | - [Build a data source plugin]({{< relref "/tutorials/build-a-data-source-plugin.md" >}}) | 
					
						
							| 
									
										
										
										
											2020-05-07 23:45:50 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | ## Go further
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Learn more about specific areas of plugin development. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ### Tutorials
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | If you're looking to build your first plugin, check out these introductory tutorials: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-10 21:38:45 +08:00
										 |  |  | - [Build a panel plugin]({{< relref "/tutorials/build-a-panel-plugin.md" >}}) | 
					
						
							|  |  |  | - [Build a data source plugin]({{< relref "/tutorials/build-a-data-source-plugin.md" >}}) | 
					
						
							|  |  |  | - [Build a data source backend plugin]({{< relref "/tutorials/build-a-data-source-backend-plugin.md" >}}) | 
					
						
							| 
									
										
										
										
											2020-05-07 23:45:50 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | Ready to learn more? Check out our other tutorials: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-10 21:38:45 +08:00
										 |  |  | - [Build a panel plugin with D3.js]({{< relref "/tutorials/build-a-panel-plugin-with-d3.md" >}}) | 
					
						
							| 
									
										
										
										
											2020-05-07 23:45:50 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-13 05:31:36 +08:00
										 |  |  | ### Guides
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Improve an existing plugin with one of our guides: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-11 18:12:27 +08:00
										 |  |  | - [Add authentication for data source plugins]({{< relref "add-authentication-for-data-source-plugins" >}}) | 
					
						
							| 
									
										
										
										
											2020-05-13 05:31:36 +08:00
										 |  |  | - [Add support for annotations]({{< relref "add-support-for-annotations.md" >}}) | 
					
						
							| 
									
										
										
										
											2020-05-19 15:05:48 +08:00
										 |  |  | - [Add support for Explore queries]({{< relref "add-support-for-explore-queries.md" >}}) | 
					
						
							| 
									
										
										
										
											2020-05-13 05:31:36 +08:00
										 |  |  | - [Add support for variables]({{< relref "add-support-for-variables.md" >}}) | 
					
						
							| 
									
										
										
										
											2021-01-20 06:52:09 +08:00
										 |  |  | - [Add a query editor help component]({{< relref "add-query-editor-help.md" >}}) | 
					
						
							| 
									
										
										
										
											2020-05-19 15:05:48 +08:00
										 |  |  | - [Build a logs data source plugin]({{< relref "build-a-logs-data-source-plugin.md" >}}) | 
					
						
							|  |  |  | - [Build a streaming data source plugin]({{< relref "build-a-streaming-data-source-plugin.md" >}}) | 
					
						
							| 
									
										
										
										
											2020-07-31 22:07:03 +08:00
										 |  |  | - [Error handling]({{< relref "error-handling.md" >}}) | 
					
						
							| 
									
										
										
										
											2020-09-16 20:39:46 +08:00
										 |  |  | - [Working with data frames]({{< relref "working-with-data-frames.md" >}}) | 
					
						
							| 
									
										
										
										
											2020-05-13 05:31:36 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | ### Concepts
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Deepen your knowledge through a series of high-level overviews of plugin concepts: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | - [Data frames]({{< relref "data-frames.md" >}}) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ### UI library
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Explore the many UI components in our [Grafana UI library](https://developers.grafana.com/ui). | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-09-25 22:47:52 +08:00
										 |  |  | ### Examples
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | For inspiration, check out our [plugin examples](https://github.com/grafana/grafana-plugin-examples). | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-07 23:45:50 +08:00
										 |  |  | ### API reference
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Learn more about Grafana options and packages. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #### Metadata
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-08 00:45:52 +08:00
										 |  |  | - [Plugin metadata]({{< relref "metadata.md" >}}) | 
					
						
							| 
									
										
										
										
											2020-05-07 23:45:50 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | #### Typescript
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-08 00:45:52 +08:00
										 |  |  | - [Grafana Data]({{< relref "../../packages_api/data/_index.md" >}}) | 
					
						
							|  |  |  | - [Grafana Runtime]({{< relref "../../packages_api/runtime/_index.md" >}}) | 
					
						
							|  |  |  | - [Grafana UI]({{< relref "../../packages_api/ui/_index.md" >}}) | 
					
						
							| 
									
										
										
										
											2020-05-07 23:45:50 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | #### Go
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-14 19:21:26 +08:00
										 |  |  | - [Grafana Plugin SDK for Go]({{< relref "backend/grafana-plugin-sdk-for-go" >}}) | 
					
						
							| 
									
										
										
										
											2020-10-23 04:22:34 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-09 23:55:50 +08:00
										 |  |  | 
 |