@grafana/create-plugin 7.13.0 → 7.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/codemods/additions/additions.js +12 -0
- package/dist/codemods/additions/prompts/docs-content.md +131 -0
- package/dist/codemods/additions/scripts/docs-content.js +30 -0
- package/dist/codemods/additions/scripts/docs.js +468 -0
- package/dist/codemods/additions/scripts/experimental-app-sdk.js +15 -14
- package/dist/codemods/utils.agents.js +64 -0
- package/dist/codemods/utils.js +40 -7
- package/dist/codemods/utils.workflows.js +94 -0
- package/dist/utils/utils.cli.js +3 -2
- package/dist/utils/utils.handlebars.js +9 -2
- package/package.json +1 -1
- package/src/codemods/additions/additions.ts +12 -0
- package/src/codemods/additions/prompts/docs-content.md +131 -0
- package/src/codemods/additions/scripts/docs-content.test.ts +103 -0
- package/src/codemods/additions/scripts/docs-content.ts +32 -0
- package/src/codemods/additions/scripts/docs.test.ts +1766 -0
- package/src/codemods/additions/scripts/docs.ts +697 -0
- package/src/codemods/additions/scripts/experimental-app-sdk.test.ts +4 -3
- package/src/codemods/additions/scripts/experimental-app-sdk.ts +15 -15
- package/src/codemods/migrations/scripts/004-eslint9-flat-config.ts +1 -3
- package/src/codemods/utils.agents.test.ts +140 -0
- package/src/codemods/utils.agents.ts +81 -0
- package/src/codemods/utils.test.ts +23 -0
- package/src/codemods/utils.ts +29 -7
- package/src/codemods/utils.workflows.test.ts +153 -0
- package/src/codemods/utils.workflows.ts +140 -0
- package/src/utils/utils.cli.ts +2 -1
- package/src/utils/utils.handlebars.ts +9 -0
- package/templates/app-sdk/.config/app-sdk/generate-kinds.mjs +1 -1
- package/templates/docs/app/docs/AGENTS.md +127 -0
- package/templates/docs/app/docs/CLAUDE.md +1 -0
- package/templates/docs/app/docs/README.md +20 -0
- package/templates/docs/app/docs/configure.md +65 -0
- package/templates/docs/app/docs/dashboards.md +29 -0
- package/templates/docs/app/docs/index.md +70 -0
- package/templates/docs/app/docs/permissions.md +45 -0
- package/templates/docs/app/docs/troubleshooting.md +65 -0
- package/templates/docs/app/feature-page.md +26 -0
- package/templates/docs/app/features-index.md +12 -0
- package/templates/docs/common/workflows/validate-docs.yml +52 -0
- package/templates/docs/datasource/docs/AGENTS.md +123 -0
- package/templates/docs/datasource/docs/CLAUDE.md +1 -0
- package/templates/docs/datasource/docs/README.md +20 -0
- package/templates/docs/datasource/docs/alerting.md +56 -0
- package/templates/docs/datasource/docs/annotations.md +68 -0
- package/templates/docs/datasource/docs/configure.md +114 -0
- package/templates/docs/datasource/docs/dashboards.md +28 -0
- package/templates/docs/datasource/docs/index.md +40 -0
- package/templates/docs/datasource/docs/query-editor.md +72 -0
- package/templates/docs/datasource/docs/template-variables.md +69 -0
- package/templates/docs/datasource/docs/troubleshooting.md +73 -0
- package/templates/docs/panel/docs/AGENTS.md +113 -0
- package/templates/docs/panel/docs/CLAUDE.md +1 -0
- package/templates/docs/panel/docs/README.md +20 -0
- package/templates/docs/panel/docs/data-formats.md +27 -0
- package/templates/docs/panel/docs/examples.md +35 -0
- package/templates/docs/panel/docs/index.md +26 -0
- package/templates/docs/panel/docs/options.md +53 -0
- package/templates/docs/panel/docs/troubleshooting.md +35 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Troubleshooting
|
|
3
|
+
description: "Troubleshoot common {{{yamlEscape pluginName}}} connection, authentication and query errors."
|
|
4
|
+
keywords:
|
|
5
|
+
- "{{{yamlEscape pluginName}}}"
|
|
6
|
+
- data source
|
|
7
|
+
- troubleshooting
|
|
8
|
+
sidebar_position: 8
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
This page explains how to fix common issues when you configure or use the {{{pluginName}}} data source. For setup instructions, refer to [Configure the {{{pluginName}}} data source](./configure.md).
|
|
12
|
+
|
|
13
|
+
<!-- section-brief
|
|
14
|
+
Fill this in: Never guess failures. Each symptom must come from an error message in source, a known issue in the README or other docs or a reported issue.
|
|
15
|
+
|
|
16
|
+
Replace this brief with one H2 per category that has real failures, in this order:
|
|
17
|
+
|
|
18
|
+
- `## Connection errors`: Grafana can't reach the service, such as timeouts or TLS errors.
|
|
19
|
+
- `## Authentication errors`: wrong credentials, expired tokens or missing permissions.
|
|
20
|
+
- `## Query errors`: queries that fail or return no data.
|
|
21
|
+
- `## Template variable errors`: variables that return no or wrong values, or load slowly.
|
|
22
|
+
{{#if hasAnnotations}}
|
|
23
|
+
- `## Annotation errors`: annotations that don't appear, linking to [annotations](./annotations.md).
|
|
24
|
+
{{/if}}
|
|
25
|
+
{{#if hasAlerting}}
|
|
26
|
+
- `## Alerting errors`: alert rules that fail or don't fire, such as a query that works on a dashboard but not in an alert rule, which skips the frontend data source class. Link to [alerting](./alerting.md).
|
|
27
|
+
{{/if}}
|
|
28
|
+
{{#if hasBackend}}
|
|
29
|
+
- `## Private data source connect errors`: connections through PDC that fail, if the backend supports the secure SOCKS proxy.
|
|
30
|
+
{{/if}}
|
|
31
|
+
- `## Performance issues`: slow dashboards, timeouts or rate limits, and the settings that help.
|
|
32
|
+
|
|
33
|
+
Add an H2 if the backend classifies its errors, or for another feature with real failures, such as ad hoc filters.
|
|
34
|
+
|
|
35
|
+
Open each H2 with one sentence on when its errors occur. Add an H3 per symptom, named after the error message in quotes, such as `### "Password authentication failed"`, then **Symptoms:** and a **Possible causes and solutions:** table, or a numbered **Solutions:** list for a single cause.
|
|
36
|
+
-->
|
|
37
|
+
|
|
38
|
+
## Get more detail about an error
|
|
39
|
+
|
|
40
|
+
To see the raw request and response for a panel, open the panel editor and click **Query inspector**.
|
|
41
|
+
{{#if hasBackend}}
|
|
42
|
+
|
|
43
|
+
In self-managed Grafana, you can also find more detail in the Grafana server logs:
|
|
44
|
+
|
|
45
|
+
1. Set the log level to `debug` in the Grafana configuration file:
|
|
46
|
+
|
|
47
|
+
```ini
|
|
48
|
+
[log]
|
|
49
|
+
level = debug
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
1. Restart Grafana and reproduce the error.
|
|
53
|
+
1. Look for log lines with `logger=plugin.{{{pluginId}}}`.
|
|
54
|
+
1. Set the log level back to `info` when you're done, to keep the logs small.
|
|
55
|
+
{{/if}}
|
|
56
|
+
|
|
57
|
+
## Get additional help
|
|
58
|
+
|
|
59
|
+
If this page doesn't solve your problem:
|
|
60
|
+
|
|
61
|
+
- Search the [Grafana community forums](https://community.grafana.com/).
|
|
62
|
+
- If your Grafana Cloud or Grafana Enterprise plan includes support, contact Grafana Support.
|
|
63
|
+
|
|
64
|
+
<!-- section-brief
|
|
65
|
+
Fill this in: Add links to the plugin's issue tracker and the service's docs to the list above.
|
|
66
|
+
-->
|
|
67
|
+
|
|
68
|
+
When you report an issue, include:
|
|
69
|
+
|
|
70
|
+
- The Grafana and plugin versions.
|
|
71
|
+
- The error message, with sensitive information removed.
|
|
72
|
+
- The steps to reproduce the issue.
|
|
73
|
+
- The relevant data source settings, with credentials removed.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Plugin docs
|
|
2
|
+
|
|
3
|
+
This folder is the documentation for **{{{pluginName}}}**, published at
|
|
4
|
+
`grafana.com/grafana/plugins/{{pluginId}}/docs/`.
|
|
5
|
+
|
|
6
|
+
## Guides
|
|
7
|
+
|
|
8
|
+
Read these before you write or change any page. This docs format is new and your training
|
|
9
|
+
data does not cover it, so do not rely on what you know about other docs tools.
|
|
10
|
+
|
|
11
|
+
Run `{{packageManagerName}} run docs:validate` and open the guide on its last line, `Docs guides:`. It's
|
|
12
|
+
the guides' `index.md`, which says which guide to read for what, and the other guides sit next to it.
|
|
13
|
+
The guides match the version of the validator this plugin uses. The line is a local path, usually
|
|
14
|
+
`node_modules/@grafana/plugin-docs-cli/docs/index.md`, or a URL when the package isn't on disk, such as
|
|
15
|
+
with Yarn Plug'n'Play.
|
|
16
|
+
|
|
17
|
+
The guides name scripts such as `docs:validate`. This plugin uses **{{packageManagerName}}**, so run them
|
|
18
|
+
with `{{packageManagerName}} run`, as in the commands below.
|
|
19
|
+
|
|
20
|
+
## Pages and their source
|
|
21
|
+
|
|
22
|
+
When you change code, update the page that documents it:
|
|
23
|
+
|
|
24
|
+
| Page | Source of truth |
|
|
25
|
+
| -------------------- | -------------------------------------------------------------------------------------- |
|
|
26
|
+
| `index.md` | Nothing - it is a curated router. Update it when pages are added or removed. |
|
|
27
|
+
| `options.md` | `setPanelOptions` and `useFieldConfig` in `src/module.ts` |
|
|
28
|
+
| `data-formats.md` | The panel component's data handling, plus any field pickers in `src/module.ts` |
|
|
29
|
+
| `examples.md` | `provisioning/dashboards/*.json` if present, otherwise the panel's own option defaults |
|
|
30
|
+
| `troubleshooting.md` | Error and empty-state messages in source, known and reported issues. Never guess. |
|
|
31
|
+
|
|
32
|
+
Never guess failures in `troubleshooting.md`. Each symptom must come from an error, warning or empty-state
|
|
33
|
+
message in source, a known issue in the README or other docs or a reported issue.
|
|
34
|
+
|
|
35
|
+
## Optional pages
|
|
36
|
+
|
|
37
|
+
Add one of these pages when the plugin has the matching feature. Use the filename given here, give the page
|
|
38
|
+
a `sidebar_position` that puts it where it belongs and link it from `index.md`.
|
|
39
|
+
|
|
40
|
+
| Trigger | Page | Scope |
|
|
41
|
+
| ---------------------------------------------------------------------------------- | ------------------ | ------------------------------------------------------------ |
|
|
42
|
+
| `setPresetsSupplier(...)` in source | `presets.md` | The presets the panel ships, when each applies, screenshots. |
|
|
43
|
+
| RBAC role declarations in `src/plugin.json` | `permissions.md` | What each role grants, default assignments. |
|
|
44
|
+
| Substantial accessibility considerations (keyboard shortcuts, screen reader notes) | `accessibility.md` | Keyboard interaction, ARIA, contrast, motion preferences. |
|
|
45
|
+
|
|
46
|
+
## What not to write
|
|
47
|
+
|
|
48
|
+
Never write installation instructions, such as installing the plugin with `grafana-cli`, from a zip file or
|
|
49
|
+
in Docker. The Installation tab on the plugin page covers them, and these docs start from a plugin that is
|
|
50
|
+
already installed. When the README has an installation section, leave it out of the pages.
|
|
51
|
+
|
|
52
|
+
## Section briefs
|
|
53
|
+
|
|
54
|
+
Each section of a scaffolded page has a brief telling you what belongs there. A brief is an HTML comment
|
|
55
|
+
that starts with `section-brief`. Search the docs folder for `section-brief` to find what is left to write:
|
|
56
|
+
|
|
57
|
+
```markdown
|
|
58
|
+
## Options
|
|
59
|
+
|
|
60
|
+
<!-- section-brief
|
|
61
|
+
Fill this in: Describe every option the plugin registers, one row per option.
|
|
62
|
+
|
|
63
|
+
If the plugin has no options, remove this section entirely.
|
|
64
|
+
-->
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Some sections also have fixed text, with a brief that builds on it:
|
|
68
|
+
|
|
69
|
+
```markdown
|
|
70
|
+
## Basic example
|
|
71
|
+
|
|
72
|
+
A panel excerpt in dashboard JSON has this shape:
|
|
73
|
+
|
|
74
|
+
<!-- section-brief
|
|
75
|
+
Fill this in: Complete the excerpt above with the options the example needs.
|
|
76
|
+
-->
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Text outside a brief is written for every panel and is part of the scaffold. Keep it, and change it
|
|
80
|
+
only where it's wrong for this plugin, such as a menu path or a step that differs.
|
|
81
|
+
|
|
82
|
+
Everything inside a brief is the instruction. A brief covers the section it sits under, unless it says
|
|
83
|
+
otherwise: it may tell you to extend the fixed text above it, to replace it with several sections or to
|
|
84
|
+
remove the page. When a brief says to remove a section, remove its heading and fixed text too.
|
|
85
|
+
|
|
86
|
+
To fill a section:
|
|
87
|
+
|
|
88
|
+
1. Read the brief.
|
|
89
|
+
2. Read the source the page documents, from the table above, then write the section.
|
|
90
|
+
3. Delete the whole comment, from `<!-- section-brief` to `-->`.
|
|
91
|
+
|
|
92
|
+
Briefs are not shown in the preview or the catalog, so a section you haven't written looks like a bare
|
|
93
|
+
heading. `docs:validate` lists every section that still has only its brief.
|
|
94
|
+
|
|
95
|
+
## Validate
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
{{packageManagerName}} run docs:validate
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Run `docs:validate` after every page you write or change and fix what it reports. A docs task is done when
|
|
102
|
+
it reports no warnings and no suggestions about section briefs. In particular, an `empty-section` or
|
|
103
|
+
`unfilled-section-brief` suggestion means a section is still unwritten or a brief is still in place. Neither
|
|
104
|
+
fails validation, so a passing exit code alone does not mean the docs are done.
|
|
105
|
+
|
|
106
|
+
## Preview
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
{{packageManagerName}} run docs:serve # local preview at http://localhost:3001, reloads on save
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
`docs:serve` keeps running until you stop it. Start it in the background if you need to look at the
|
|
113
|
+
rendered pages, and stop it when you are done.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@AGENTS.md
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# {{{pluginName}}} documentation
|
|
2
|
+
|
|
3
|
+
This folder is the documentation for **{{{pluginName}}}**. It's published on the Documentation tab of
|
|
4
|
+
`grafana.com/grafana/plugins/{{pluginId}}/` with each plugin release. This README isn't published.
|
|
5
|
+
|
|
6
|
+
To learn how plugin docs work and how to write them, read the
|
|
7
|
+
[Add documentation to your plugin](https://grafana.com/developers/plugin-tools/how-to-guides/plugin-docs) guide.
|
|
8
|
+
|
|
9
|
+
## Next steps
|
|
10
|
+
|
|
11
|
+
1. Write the pages. Each section has a note that says what belongs there. **Or** let an AI agent draft them from your source code and README: commit your changes, then run `{{createPluginCmd}} add docs-content`. Review its work either way.
|
|
12
|
+
2. Add screenshots, videos and figures where they help readers. Save them inside this folder, for example in `img/`, and link to them with a relative path. `docs:validate` checks their formats and sizes.
|
|
13
|
+
3. Run `{{packageManagerName}} run docs:serve` to preview the docs. It also lists every section left to fill.
|
|
14
|
+
|
|
15
|
+
## Commands
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
{{packageManagerName}} run docs:serve # local preview at http://localhost:3001
|
|
19
|
+
{{packageManagerName}} run docs:validate # check your docs, including sections left to fill
|
|
20
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Data formats
|
|
3
|
+
description: "Learn what data formats the {{{yamlEscape pluginName}}} panel accepts."
|
|
4
|
+
sidebar_position: 2
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
This document explains the data the {{{pluginName}}} panel needs from a query, so you can build a matching query or check your test data.
|
|
8
|
+
|
|
9
|
+
## Supported data shape
|
|
10
|
+
|
|
11
|
+
<!-- section-brief
|
|
12
|
+
Fill this in: Describe the data frame shape {{{pluginName}}} expects: time series with N numeric fields, table with specific columns, single numeric value, geographic coordinates, log lines, etc. Be specific about field types and structure, because this is the contract dashboard authors rely on when building queries for the panel. Name the required field types (time, number, string, boolean) and any minimum/maximum field counts. After each shape, add a `#### Example` table whose headers are the field names the panel reads, with 3-5 rows of realistic values, so a reader can build a matching query or test data.
|
|
13
|
+
-->
|
|
14
|
+
|
|
15
|
+
## Field mapping
|
|
16
|
+
|
|
17
|
+
<!-- section-brief
|
|
18
|
+
Fill this in: Explain which incoming field plays which role in the visualization - for example "the first time-typed field is the x-axis, all numeric fields become series". If {{{pluginName}}} lets users explicitly pick field roles in the editor, document those controls here. Remove the section if mapping is fully automatic and not user-configurable.
|
|
19
|
+
-->
|
|
20
|
+
|
|
21
|
+
## Check what your query returns
|
|
22
|
+
|
|
23
|
+
To see the data the panel receives, open the panel editor, click **Query inspector** and select the **Data** tab. You can also turn on **Table view** at the top of the panel editor to see the data as a table.
|
|
24
|
+
|
|
25
|
+
## Reshape data that doesn't match
|
|
26
|
+
|
|
27
|
+
If a query returns data in a different shape, you can reshape it without changing the query. Select the **Transform data** tab in the panel editor and add a transformation. For more information, refer to [Transform data](https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/transform-data/).
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Examples
|
|
3
|
+
description: "Worked examples of the {{{yamlEscape pluginName}}} panel."
|
|
4
|
+
sidebar_position: 4
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
To use an example, open your dashboard and go to **Dashboard settings** > **JSON Model**. Paste the excerpt into the `panels` array and click **Save changes**.
|
|
8
|
+
|
|
9
|
+
<!-- section-brief
|
|
10
|
+
Fill this in: Show concrete examples of {{{pluginName}}} configured for real use cases. When the repo has panels of this plugin's type in `provisioning/dashboards/*.json`, take the examples from those before inventing any. Express each example as a `dashboard.json` panel excerpt: `type` and `options`, plus `fieldConfig` and `targets` when the example depends on them. Leave out `id`, `gridPos`, `pluginVersion`, datasource UIDs and timestamps - they are specific to one dashboard and hide the settings that matter. Pair each example with a screenshot of the rendered visualization.
|
|
11
|
+
|
|
12
|
+
If the repo ships a complete dashboard, for example under `provisioning/dashboards/`, link to it for readers who want the full JSON. Use the file's `https://` URL in your repository - relative links can't point outside the docs folder.
|
|
13
|
+
-->
|
|
14
|
+
|
|
15
|
+
## Basic example
|
|
16
|
+
|
|
17
|
+
A panel excerpt in dashboard JSON has this shape:
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"type": "{{pluginId}}",
|
|
22
|
+
"options": {},
|
|
23
|
+
"targets": []
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
<!-- section-brief
|
|
28
|
+
Fill this in: Complete the excerpt above as the minimum viable {{{pluginName}}} configuration: the smallest `panels[]` entry that produces a meaningful visualization. Include only the settings it needs, plus a sample query in `targets` if the panel reads data. If the panel doesn't read data, remove `targets` from the excerpt. Pair with a screenshot of the result.
|
|
29
|
+
-->
|
|
30
|
+
|
|
31
|
+
## Common variations
|
|
32
|
+
|
|
33
|
+
<!-- section-brief
|
|
34
|
+
Fill this in: Show 1-3 alternate configurations that cover the most common ways dashboard authors use {{{pluginName}}} - different data shapes, option combinations, or display modes. Each variation is an excerpt showing only the settings that differ from the basic example, plus a screenshot. Explain in one line what each variation demonstrates.
|
|
35
|
+
-->
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Introduction
|
|
3
|
+
description: "Where to start and what to read next in the {{{yamlEscape pluginName}}} docs."
|
|
4
|
+
sidebar_position: 1
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<!-- section-brief
|
|
8
|
+
Fill this in: Write a short orientation for someone who already has {{{pluginName}}} installed and landed here from the Documentation tab. One or two sentences on what this section covers and how it's organized. Do not restate what the plugin does, its feature list, or its requirements - that's the README's job on the Overview tab, and this reader has already seen it there. Do not list every page in this folder either - the sidebar already does that; use prose to say what to read first and why.
|
|
9
|
+
-->
|
|
10
|
+
|
|
11
|
+
## Recommended path
|
|
12
|
+
|
|
13
|
+
<!-- section-brief
|
|
14
|
+
Fill this in: Give a short, ordered reading path for someone new to {{{pluginName}}} - two or three sentences, not a repeat of the sidebar. Point out the one or two pages most people need first and why, e.g. "Start with **Data formats** to shape your query results, then **Options** to configure the panel."
|
|
15
|
+
-->
|
|
16
|
+
|
|
17
|
+
## Common tasks
|
|
18
|
+
|
|
19
|
+
- [Shape your query results for {{{pluginName}}}](./data-formats.md)
|
|
20
|
+
- [Configure panel and field options](./options.md)
|
|
21
|
+
- [See worked dashboard.json examples](./examples.md)
|
|
22
|
+
- [Fix a panel that isn't rendering correctly](./troubleshooting.md)
|
|
23
|
+
|
|
24
|
+
<!-- section-brief
|
|
25
|
+
Fill this in: Keep the list above and adapt it to {{{pluginName}}}'s actual entry points - add, remove or reword tasks so each one matches a real job a user comes here to do. If you remove a page, remove its task too. This is a curated set of jobs, not a mechanical list of every file in this folder.
|
|
26
|
+
-->
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Options
|
|
3
|
+
description: "Reference for {{{yamlEscape pluginName}}} panel options."
|
|
4
|
+
sidebar_position: 3
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
To change these options, edit the panel and use the options pane.
|
|
8
|
+
|
|
9
|
+
<!-- section-brief
|
|
10
|
+
Fill this in: Reference the options {{{pluginName}}} exposes in the panel editor. Cover both the custom options the panel adds (via `setPanelOptions` in source) and the standard field options it enables (via `useFieldConfig`). Skip the sections below that don't apply to this panel - if there's no Standard field options block, no Tooltip and legend section etc., remove those headings entirely rather than leaving an empty brief.
|
|
11
|
+
|
|
12
|
+
Do not redocument the framework-level standard options themselves (Min, Max, Unit, etc.) - Grafana's own docs cover those. The Standard field options section lists which ones are enabled, nothing more.
|
|
13
|
+
-->
|
|
14
|
+
|
|
15
|
+
## Panel options
|
|
16
|
+
|
|
17
|
+
<!-- section-brief
|
|
18
|
+
Fill this in: Emit a markdown table with these columns - one row per option registered through `setPanelOptions` in `src/module.ts`. Match the Grafana built-in panel docs style: https://grafana.com/docs/grafana/latest/visualizations/panels-visualizations/visualizations/logs/#logs-options
|
|
19
|
+
|
|
20
|
+
| Option | Type | Default | Description |
|
|
21
|
+
| ------ | ---- | ------- | ----------- |
|
|
22
|
+
|
|
23
|
+
- _Option_: the `name` value from the `setPanelOptions` `.add*({...})` call, verbatim.
|
|
24
|
+
- _Type_: a short label for the editor the option uses, derived from the builder method (`addBooleanSwitch` → Toggle, `addSelect` → Select, `addNumberInput` → Number, `addFieldNamePicker` → Field picker). For a custom editor, name what it is, such as Color picker, rather than writing Custom.
|
|
25
|
+
- _Default_: the value a reader sees in the panel editor, rendered as inline code. Resolve enum members, constants and translation calls to that value - `ClockMode.time` becomes `Time`. Keep the source expression only when it can't be resolved. When there is no default but the code falls back to a value while the option is unset, give that fallback value. Leave the cell empty only when there is neither.
|
|
26
|
+
- _Description_: the `description` value, verbatim. If the verbatim text causes a `docs:validate` warning, reword it as little as possible and keep its meaning. When source has none, write one short sentence describing what the option does, based on how the panel code uses it. Don't guess beyond what the code shows.
|
|
27
|
+
|
|
28
|
+
If the panel does not call `setPanelOptions`, remove this section entirely.
|
|
29
|
+
-->
|
|
30
|
+
|
|
31
|
+
## Standard field options
|
|
32
|
+
|
|
33
|
+
For what each standard option does, refer to [Configure standard options](https://grafana.com/docs/grafana/latest/panels-visualizations/configure-standard-options/).
|
|
34
|
+
|
|
35
|
+
<!-- section-brief
|
|
36
|
+
Fill this in: A bulleted list of the standard field options this panel enables - the entries from `useFieldConfig({ standardOptions: [...] })` in `src/module.ts`. If the panel calls `useFieldConfig()` or `useFieldConfig({})` without a `standardOptions` key, document this as "all standard options are enabled" and list the standard set.
|
|
37
|
+
|
|
38
|
+
If the panel does not call `useFieldConfig` at all, remove this section entirely, including the link above.
|
|
39
|
+
-->
|
|
40
|
+
|
|
41
|
+
## Custom field options
|
|
42
|
+
|
|
43
|
+
<!-- section-brief
|
|
44
|
+
Fill this in: A table with the same shape as Panel options (Option / Type / Default / Description) but for the per-field overrides registered via `useFieldConfig({ useCustomConfig: builder => ... })`. These appear under the Overrides picker in the panel editor.
|
|
45
|
+
|
|
46
|
+
If the panel does not register custom field options, remove this section entirely.
|
|
47
|
+
-->
|
|
48
|
+
|
|
49
|
+
## Tooltip and legend options
|
|
50
|
+
|
|
51
|
+
<!-- section-brief
|
|
52
|
+
Fill this in: Describe the tooltip and legend options {{{pluginName}}} exposes: hover behavior, the fields the tooltip shows and its formatting, and legend placement, values and calculations. Most of these already appear in the Panel options table above when they're registered via `setPanelOptions` with `category: ['Tooltip']` or `category: ['Legend']`, so use this section only for narrative context that doesn't fit in a table row. Remove this section if there is nothing extra to say beyond the table.
|
|
53
|
+
-->
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Troubleshooting
|
|
3
|
+
description: "Troubleshoot the {{{yamlEscape pluginName}}} panel."
|
|
4
|
+
sidebar_position: 5
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
This page explains how to fix common issues when you use the {{{pluginName}}} panel. For the data the panel expects, refer to [Data formats](./data-formats.md).
|
|
8
|
+
|
|
9
|
+
<!-- section-brief
|
|
10
|
+
Fill this in: Replace this brief with one H2 per real failure mode, such as "Panel shows no data", "Wrong field selected" or "Rendering errors". Open each H2 with the symptom users see, then give the most likely cause and the steps to resolve it. Remove this brief and add nothing if there are no real failures to report.
|
|
11
|
+
-->
|
|
12
|
+
|
|
13
|
+
## Get more detail about an error
|
|
14
|
+
|
|
15
|
+
To see the data the panel receives, open the panel editor, click **Query inspector** and select the **Data** tab.
|
|
16
|
+
|
|
17
|
+
For errors in the panel itself, open the developer tools in your browser and check the console.
|
|
18
|
+
|
|
19
|
+
## Get additional help
|
|
20
|
+
|
|
21
|
+
If this page doesn't solve your problem:
|
|
22
|
+
|
|
23
|
+
- Search the [Grafana community forums](https://community.grafana.com/).
|
|
24
|
+
- If your Grafana Cloud or Grafana Enterprise plan includes support, contact Grafana Support.
|
|
25
|
+
|
|
26
|
+
<!-- section-brief
|
|
27
|
+
Fill this in: Add links to the plugin's issue tracker to the list above.
|
|
28
|
+
-->
|
|
29
|
+
|
|
30
|
+
When you report an issue, include:
|
|
31
|
+
|
|
32
|
+
- The Grafana and plugin versions.
|
|
33
|
+
- The error message, with sensitive information removed.
|
|
34
|
+
- The steps to reproduce the issue.
|
|
35
|
+
- The panel options and a sample of the data it shows, with sensitive information removed.
|