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
{{ message }}
This repository was archived by the owner on Aug 4, 2025. It is now read-only.
This plugin provides a datasource to connect a REST API to [nodegraph](https://grafana.com/docs/grafana/latest/visualizations/node-graph/) panel of Grafana.
5
+
This plugin provides a data source to connect a REST API to [nodegraph](https://grafana.com/docs/grafana/latest/visualizations/node-graph/) panel of Grafana.
6
6
7
7

8
8
9
-
## What is Grafana Data Source Plugin?
10
-
11
-
Grafana supports a wide range of data sources, including Prometheus, MySQL, and even Datadog. There’s a good chance you can already visualize metrics from the systems you have set up. In some cases, though, you already have an in-house metrics solution that you’d like to add to your Grafana dashboards. Grafana Data Source Plugins enables integrating such solutions with Grafana.
12
-
13
9
## Getting started
14
10
15
11
1. Use Grafana 7.4 or higher
16
12
17
-
- Download and place the datasouce in grafana/plugins directory.
13
+
- Download and place the data source in `grafana/plugins` directory.
18
14
19
-
This plugin is not signed yet, Grafana will not allow loading it by default. you should enable it by adding:
15
+
This plugin is not signed yet; Grafana will not allow loading it by default. You have to enable it by adding:
20
16
21
17
for example, if you are using Grafana with containers, add:
2. You can now add the the data source. Just enter the url of your API app and push "Save & Test". You will get an error in case of connection failure.
23
+
2. You can now add the data source. Just enter the URL of your API app and push "Save & Test." You will get an error in case of connection failure.
28
24
29
-
> Note: The browser should have access to the application not the grafana server.
25
+
> Note: The browser should have access to the application, not the Grafana server.
30
26
31
27

32
28
33
-
3. In grafana dashboard, pick the Nodegraph panel and have the graph visualization.
29
+
3. In the Grafana dashboard, pick the Nodegraph panel and visualize the graph.
34
30
35
31
## API Configuration
36
32
37
-
You REST API application should return data in the following format:
33
+
The REST API application should return data in the following format:
38
34
39
-
> Note: You API application should handle CORS policy. Otherwise you will face CORS-Policy error in Grafana.
35
+
> Note: Your API application should handle CORS policy. Otherwise, you will face a CORS-Policy error in Grafana.
40
36
41
37
### Fetch Graph Fields
42
38
43
39
This route returns the nodes and edges fields defined in the [parameter tables](https://grafana.com/docs/grafana/latest/visualizations/node-graph/#data-api).
44
-
This would help the plugin to create desired parameters for the graph.
45
-
For nodes, `id` and for edges, `id`, `source` and `target` fields are required and the other fields are optional.
40
+
It would help the plugin to create desired parameters for the graph.
41
+
For nodes, `id` and for edges, `id`, `source`, and `target` fields are required. Other fields are optional.
46
42
47
43
endpoint: `/api/graph/fields`
48
44
@@ -110,7 +106,7 @@ content format example:
110
106
111
107
### Fetch Graph Data
112
108
113
-
This route returns the graph data which is intended to visualize.
109
+
This route returns the graph data, which is intended to visualize.
114
110
115
111
endpoint: `/api/graph/data`
116
112
@@ -151,12 +147,12 @@ Data Format example:
151
147
}
152
148
```
153
149
154
-
For more detail of the variables please visit [here](https://grafana.com/docs/grafana/latest/visualizations/node-graph/#data-api).
150
+
For more detail of the variables, please visit [here](https://grafana.com/docs/grafana/latest/visualizations/node-graph/#data-api).
155
151
156
152
### Health
157
153
158
-
This route is for testing the health of the API which is used by the *Save & Test* action while adding the plugin.[(Part 2 of the Getting Started Section)](#getting-started).
159
-
Currently, it only needs to return `200` status code in case of a success connection.
154
+
This route is for testing the health of the API, which is used by the *Save & Test* action while adding the plugin.[(Part 2 of the Getting Started Section)](#getting-started).
155
+
Currently, it only needs to return the `200` status code in case of a successful connection.
160
156
161
157
endpoint: `/api/health`
162
158
@@ -166,7 +162,7 @@ success status code: `200`
166
162
167
163
## API Example
168
164
169
-
In `example` folder you can find a simple API application in Python Flask.
165
+
In the `example` folder, you can find a simple API application in Python Flask.
170
166
171
167
### Requirements:
172
168
@@ -180,6 +176,12 @@ python run.py
180
176
```
181
177
The application will be started on `http://localhost:5000`
182
178
179
+
## Query Configuration
180
+
You can pass a query string to apply for the data endpoint of the graph via *Query String*. Like any other query, you can utilize variables too:
181
+
182
+

183
+
With variable `$service` defined as `processors`, above query will produce this endpoint:
184
+
`/api/graph/data?query=text1&service=processors`
183
185
## Compiling the data source by yourself
184
186
185
187
1. Install dependencies
@@ -215,7 +217,7 @@ The application will be started on `http://localhost:5000`
215
217
216
218
## Contributing
217
219
218
-
Thank you for considering contributing! If you find an issue, or have a better way to do something, feel free to open an issue, or a PR.
220
+
Thank you for considering contributing! If you find an issue or have a better way to do something, feel free to open an issue or a PR.
0 commit comments