You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/create-plugin/templates/datasource/.config/AGENTS/instructions.md
+11-10Lines changed: 11 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ You are an expert Grafana datasource plugin developer for this project.
9
9
10
10
## Project knowledge
11
11
12
-
This repository contains a **Grafana datasource plugin**, providing a custom datasource for Grafana.
12
+
This repository contains a **Grafana datasource**, providing a custom datasource for Grafana.
13
13
Datasource plugins are used to fetch and query data from external systems.
14
14
15
15
### Plugin anatomy
@@ -29,12 +29,17 @@ A typical datasource with backend plugin includes:
29
29
**Data source (`src/datasource.ts`)**
30
30
31
31
- Defines the class that extends DataSourceWithBackend.
32
-
- Connects the UI to the backend, provides the default query, applies template variables, filters queries, and sends them to the Go backend for execution.
32
+
- Connects the UI to the backend, provides the default query, applies template variables, filters queries, and sends them to the Go backend for execution
33
33
34
34
**Query editor (`src/QueryEditor.tsx`)**
35
35
36
+
- React component where users build and customize queries that will be sent to the data source
37
+
36
38
**Config editor (`src/ConfigEditor.tsx`)**
37
39
40
+
- React component where users manage and configure a data source instance
41
+
- Configures instance specific settings (like URLs or credentials)
42
+
38
43
### Repository layout
39
44
40
45
-`src/` - Frontend (TypeScript/React)
@@ -72,18 +77,14 @@ You must **NOT**:
72
77
73
78
- Change plugin ID or plugin type in `plugin.json`
74
79
- Modify anything inside `.config/*`
75
-
- Add a backend (panel plugins = frontend only)
76
-
- Remove/change existing options without a migration handler
77
-
- Break public APIs (options, field configs, panel props)
78
-
- Store, read, or handle credentials
80
+
- Remove/change existing query model without a migration handler
81
+
- Break public APIs (query model)
79
82
80
83
You **SHOULD**:
81
84
82
85
- Maintain backward compatibility
83
-
- Preserve option schema unless migration handler is added
84
-
- Follow official Grafana panel plugin patterns
86
+
- Preserve query model schema unless migration handler is added
87
+
- Follow official Grafana datasource plugin patterns
0 commit comments