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
* Add buildModeInfo to plugin description
* Use a panel setting to determine childCount or not
* Revert supportsChildCount from pluginJson
* Try and restore e2e behaviour
* Correct defaults
* Correct env behaviour
Copy file name to clipboardExpand all lines: CHANGELOG.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,18 @@
1
1
# Changelog
2
2
3
+
## [0.2.0] - 2025-11-04
4
+
5
+
### Changed
6
+
7
+
- Converted `SUPPORTS_CHILD_COUNT` from build-time environment variable to runtime panel option. The plugin now uses a panel setting "Enable G-Research Tempo API support" that can be configured per panel when editing a dashboard. This allows a single build to work with both standard Grafana Tempo API and G-Research custom Tempo API.
8
+
- Removed `build:with-child-count` script. Use `bun run build` for all builds.
9
+
- Updated release workflow to use standard build process.
10
+
11
+
### Added
12
+
13
+
- Panel option "Enable G-Research Tempo API support" for runtime configuration of child count support.
14
+
- Support for setting default panel option value via `SUPPORTS_CHILD_COUNT` environment variable for local development (e.g., `SUPPORTS_CHILD_COUNT=1 bun run dev`).
Copy file name to clipboardExpand all lines: README.md
+32-21Lines changed: 32 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,18 +19,34 @@ For detailed usage instructions and troubleshooting, see [HELP.md](HELP.md).
19
19
20
20
App plugins can let you create a custom out-of-the-box monitoring experience by custom pages, nested data sources and panel plugins.
21
21
22
-
## Build-time Configuration
22
+
## Panel Configuration
23
23
24
-
The plugin supports build-time configuration through environment variables. Create a `.env` file in the root directory and set the following variables:
24
+
The plugin supports runtime configuration through panel options. To configure the setting:
25
25
26
-
-`SUPPORTS_CHILD_COUNT`: Set to `'1'` to enable child count support, `'0'` to disable it. This affects whether the plugin will use `childCount` attributes from the backend. Default is `'false'`.
26
+
1. Create or edit a panel using this plugin on a dashboard
27
+
2. In the panel edit mode, look for the "Enable G-Research Tempo API support" option in the panel options panel (right sidebar)
28
+
3. Toggle the setting as needed
27
29
28
-
Example `.env` file:
30
+
**Setting**: Enable G-Research Tempo API support
31
+
32
+
- A boolean setting that controls whether the plugin uses child count support for G-Research custom Tempo API. When enabled, the plugin will use `childCount` attributes from the backend. When disabled, it works with the standard Grafana Tempo API.
33
+
34
+
### Development Default
35
+
36
+
By default, child count support is **enabled** (for G-Research custom Tempo API). For local development with standard Grafana Tempo API, you can disable it:
29
37
30
38
```bash
31
-
SUPPORTS_CHILD_COUNT=0
39
+
# Default: child count enabled (for G-Research custom Tempo API)
40
+
bun run dev
41
+
42
+
# Disable for standard Grafana Tempo API
43
+
SUPPORTS_CHILD_COUNT=0 bun run dev
44
+
# Or use the convenience script:
45
+
bun run dev:without-child-count
32
46
```
33
47
48
+
This sets the default value for new panels, but you can still override it per panel in the UI.
49
+
34
50
## Get started
35
51
36
52
### Frontend
@@ -53,12 +69,6 @@ SUPPORTS_CHILD_COUNT=0
53
69
bun run build
54
70
```
55
71
56
-
To build with child count support enabled:
57
-
58
-
```bash
59
-
bun run build:with-child-count
60
-
```
61
-
62
72
4. Run the tests (using Jest)
63
73
64
74
```bash
@@ -256,13 +266,12 @@ Minor differences:
256
266
257
267
## API discrepancies
258
268
259
-
To differentiate between the Grafana Tempo API and the G-Research–flavoured Tempo API, the plugin checks the `SUPPORTS_CHILD_COUNT` environment variable.
260
-
Building with `SUPPORTS_CHILD_COUNT=1` results in the runtime behavior described above.
269
+
To differentiate between the Grafana Tempo API and the G-Research–flavoured Tempo API, the plugin uses a panel setting called "Enable G-Research Tempo API support". When enabled, the plugin will use the G-Research custom API features like child count support. When disabled, it works with the standard Grafana Tempo API.
261
270
262
271
## Testing
263
272
264
273
We run end-to-end using Playwright and `@grafana/plugin-e2e`.
265
-
There are two ways to run the tests, there is setup for when `SUPPORTS_CHILD_COUNT=0`or `SUPPORTS_CHILD_COUNT=1`.
274
+
There are two ways to run the tests, depending on which API you want to test against (standard Grafana Tempo API or G-Research custom API).
266
275
In both cases, we rely on a provisioned Docker compose setup.
267
276
268
277
**Playwright requires Chromium as a dependency**
@@ -275,18 +284,18 @@ _Why is this not part of our package.json?_
275
284
276
285
Chromium cannot be installed in our production environment, so we do not include it as a required dependency in package.json.
277
286
278
-
### SUPPORTS_CHILD_COUNT = 0
287
+
### Standard Grafana Tempo API
279
288
280
289
Run `bun run server` to start the regular developer setup.
281
290
Here we shall target the Grafana Tempo API as mentioned in [./docker-compose.yaml].
282
291
283
292
Run
284
293
285
294
```shell
286
-
bun run build
295
+
bun run build:without-child-count
287
296
```
288
297
289
-
to build a bundle without `SUPPORTS_CHILD_COUNT`.
298
+
to build the plugin without child count support (for standard Grafana Tempo API). When creating or editing a panel on a dashboard, make sure "Enable G-Research Tempo API support" is disabled in the panel options.
290
299
291
300
Next, we need to provision sample data to our Tempo store.
292
301
Run
@@ -303,7 +312,7 @@ Afterwards all pieces are in place to run the e2e tests:
303
312
bun run e2e
304
313
```
305
314
306
-
### SUPPORTS_CHILD_COUNT = 1
315
+
### G-Research Custom Tempo API
307
316
308
317
To simulate the production API, we have constructed a different Docker setup in [local-tempo-docker-compose.yml](./local-tempo-docker-compose.yml).
309
318
There we also have a `Tempo` service, so from Grafana's point of view nothing will have changed.
@@ -323,12 +332,14 @@ In production, this would be the .NET side of things, for our local setup, we ca
323
332
bun run tests/test-api.ts
324
333
```
325
334
326
-
Next, build our plugin using `SUPPORTS_CHILD_COUNT=1` via
335
+
Next, build our plugin (default has child count enabled):
327
336
328
337
```shell
329
-
bun run build:with-child-count
338
+
bun run build
330
339
```
331
340
341
+
The default panel option will have "Enable G-Research Tempo API support" enabled, which is correct for this setup.
342
+
332
343
Afterwards, you should be able to run the tests using:
333
344
334
345
```shell
@@ -338,7 +349,7 @@ bun run e2e
338
349
### Updating the test Trace
339
350
340
351
In `scripts/e2e-tempo-trace.js`, we have a test scenario.
341
-
To ensure we use the same data during `SUPPORTS_CHILD_COUNT=1`.
352
+
To ensure we use the same data when testing with G-Research custom Tempo API.
342
353
You can extract the last trace to [tests/test-trace.json](./tests/test-trace.json) via
0 commit comments