Chore: Updated plugin schema docs ref PR@38463 (#38501)

* updated plugin schema docs ref PR@38463

* Documentation updates as per review
This commit is contained in:
Stephanie Closson
2021-08-24 11:45:41 -03:00
committed by GitHub
parent d1ed0cb275
commit 8bb9600cc6
2 changed files with 52 additions and 38 deletions

View File

@ -14,31 +14,32 @@ The plugin.json file is required for all plugins. When Grafana starts, it scans
## Properties ## Properties
| Property | Type | Required | Description | | Property | Type | Required | Description |
| --------------- | ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | -------------------- | ----------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `dependencies` | [object](#dependencies) | **Yes** | Dependencies needed by the plugin. | | `dependencies` | [object](#dependencies) | **Yes** | Dependencies needed by the plugin. |
| `id` | string | **Yes** | Unique name of the plugin. If the plugin is published on grafana.com, then the plugin id has to follow the naming conventions. | | `id` | string | **Yes** | Unique name of the plugin. If the plugin is published on grafana.com, then the plugin id has to follow the naming conventions. |
| `info` | [object](#info) | **Yes** | Metadata for the plugin. Some fields are used on the plugins page in Grafana and others on grafana.com if the plugin is published. | | `info` | [object](#info) | **Yes** | Metadata for the plugin. Some fields are used on the plugins page in Grafana and others on grafana.com if the plugin is published. |
| `name` | string | **Yes** | Human-readable name of the plugin that is shown to the user in the UI. | | `name` | string | **Yes** | Human-readable name of the plugin that is shown to the user in the UI. |
| `type` | string | **Yes** | Plugin type. Possible values are: `app`, `datasource`, `panel`. | | `type` | string | **Yes** | Plugin type. Possible values are: `app`, `datasource`, `panel`. |
| `$schema` | string | No | Schema definition for the plugin.json file | | `$schema` | string | No | Schema definition for the plugin.json file. |
| `alerting` | boolean | No | For data source plugins. If the plugin supports alerting. | | `alerting` | boolean | No | For data source plugins, if the plugin supports alerting. |
| `annotations` | boolean | No | For data source plugins. If the plugin supports annotation queries. | | `annotations` | boolean | No | For data source plugins, if the plugin supports annotation queries. |
| `autoEnabled` | boolean | No | Set to true for app plugins that should be enabled by default in all orgs | | `autoEnabled` | boolean | No | Set to true for app plugins that should be enabled by default in all orgs |
| `backend` | boolean | No | If the plugin has a backend component. | | `backend` | boolean | No | If the plugin has a backend component. |
| `category` | string | No | Plugin category used on the Add data source page. Possible values are: `tsdb`, `logging`, `cloud`, `tracing`, `sql`, `enterprise`, `other`. | | `category` | string | No | Plugin category used on the Add data source page. Possible values are: `tsdb`, `logging`, `cloud`, `tracing`, `sql`, `enterprise`, `other`. |
| `enterpriseFeatures` | [object](#enterprisefeatures) | No | Grafana Enerprise specific features. |
| `executable` | string | No | The first part of the file name of the backend component executable. There can be multiple executables built for different operating system and architecture. Grafana will check for executables named `<executable>_<$GOOS>_<lower case $GOARCH><.exe for Windows>`, e.g. `plugin_linux_amd64`. Combination of $GOOS and $GOARCH can be found here: https://golang.org/doc/install/source#environment. | | `executable` | string | No | The first part of the file name of the backend component executable. There can be multiple executables built for different operating system and architecture. Grafana will check for executables named `<executable>_<$GOOS>_<lower case $GOARCH><.exe for Windows>`, e.g. `plugin_linux_amd64`. Combination of $GOOS and $GOARCH can be found here: https://golang.org/doc/install/source#environment. |
| `hiddenQueries` | boolean | No | | | `hiddenQueries` | boolean | No | For data source plugins, include hidden queries in the data request. |
| `includes` | [object](#includes)[] | No | Resources to include in plugin. | | `includes` | [object](#includes)[] | No | Resources to include in plugin. |
| `logs` | boolean | No | For data source plugins. If the plugin supports logs. | | `logs` | boolean | No | For data source plugins, if the plugin supports logs. |
| `metrics` | boolean | No | For data source plugins. If the plugin supports metric queries. Used in the Explore feature. | | `metrics` | boolean | No | For data source plugins, if the plugin supports metric queries. Used in Explore. |
| `preload` | boolean | No | Initialize plugin on startup. By default, the plugin initializes on first use. | | `preload` | boolean | No | Initialize plugin on startup. By default, the plugin initializes on first use. |
| `queryOptions` | [object](#queryoptions) | No | For data source plugins. There is a query options section in the plugin's query editor and these options can be turned on if needed. | | `queryOptions` | [object](#queryoptions) | No | For data source plugins. There is a query options section in the plugin's query editor and these options can be turned on if needed. |
| `routes` | [object](#routes)[] | No | For data source plugins. Proxy routes used for plugin authentication and adding headers to HTTP requests made by the plugin. For more information, refer to [Add authentication for data source plugins]({{< relref "add-authentication-for-data-source-plugins.md">}}). | | `routes` | [object](#routes)[] | No | For data source plugins. Proxy routes used for plugin authentication and adding headers to HTTP requests made by the plugin. For more information, refer to [Authentication for data source plugins](https://grafana.com/docs/grafana/latest/developers/plugins/authentication/). |
| `skipDataQuery` | boolean | No | For panel plugins. Hides the query editor. | | `skipDataQuery` | boolean | No | For panel plugins. Hides the query editor. |
| `state` | string | No | Marks a plugin as a pre-release. Possible values are: `alpha`, `beta`. | | `state` | string | No | Marks a plugin as a pre-release. Possible values are: `alpha`, `beta`. |
| `streaming` | boolean | No | For data source plugins. If the plugin supports streaming. | | `streaming` | boolean | No | For data source plugins, if the plugin supports streaming. |
| `tables` | boolean | No | | | `tables` | boolean | No | This is an undocumented feature. |
| `tracing` | boolean | No | For data source plugins. If the plugin supports tracing. | | `tracing` | boolean | No | For data source plugins, if the plugin supports tracing. |
## dependencies ## dependencies
@ -65,6 +66,16 @@ Plugin dependency. Used to display information about plugin dependencies in the
| `type` | string | **Yes** | Possible values are: `app`, `datasource`, `panel`. | | `type` | string | **Yes** | Possible values are: `app`, `datasource`, `panel`. |
| `version` | string | **Yes** | | | `version` | string | **Yes** | |
## enterpriseFeatures
Grafana Enerprise specific features.
### Properties
| Property | Type | Required | Description |
| ------------------------- | ------- | -------- | ------------------------------------------------------------------- |
| `healthDiagnosticsErrors` | boolean | No | Enable/Disable health diagnostics errors. Requires Grafana >=7.5.5. |
## includes ## includes
### Properties ### Properties
@ -79,6 +90,7 @@ Plugin dependency. Used to display information about plugin dependencies in the
| `path` | string | No | Used for app plugins. | | `path` | string | No | Used for app plugins. |
| `role` | string | No | Possible values are: `Admin`, `Editor`, `Viewer`. | | `role` | string | No | Possible values are: `Admin`, `Editor`, `Viewer`. |
| `type` | string | No | Possible values are: `dashboard`, `page`, `panel`, `datasource`. | | `type` | string | No | Possible values are: `dashboard`, `page`, `panel`, `datasource`. |
| `uid` | string | No | Unique identifier of the included resource |
## info ## info
@ -168,7 +180,7 @@ For data source plugins. There is a query options section in the plugin's query
## routes ## routes
For data source plugins. Proxy routes used for plugin authentication and adding headers to HTTP requests made by the plugin. For more information, refer to [Add authentication for data source plugins]({{< relref "add-authentication-for-data-source-plugins.md">}}). For data source plugins. Proxy routes used for plugin authentication and adding headers to HTTP requests made by the plugin. For more information, refer to [Authentication for data source plugins](https://grafana.com/docs/grafana/latest/developers/plugins/authentication/).
### Properties ### Properties

View File

@ -9,7 +9,7 @@
"properties": { "properties": {
"$schema": { "$schema": {
"type": "string", "type": "string",
"description": "Schema definition for the plugin.json file" "description": "Schema definition for the plugin.json file."
}, },
"id": { "id": {
"type": "string", "type": "string",
@ -32,11 +32,11 @@
}, },
"annotations": { "annotations": {
"type": "boolean", "type": "boolean",
"description": "For data source plugins. If the plugin supports annotation queries." "description": "For data source plugins, if the plugin supports annotation queries."
}, },
"alerting": { "alerting": {
"type": "boolean", "type": "boolean",
"description": "For data source plugins. If the plugin supports alerting." "description": "For data source plugins, if the plugin supports alerting."
}, },
"backend": { "backend": {
"type": "boolean", "type": "boolean",
@ -102,7 +102,7 @@
}, },
"logs": { "logs": {
"type": "boolean", "type": "boolean",
"description": "For data source plugins. If the plugin supports logs." "description": "For data source plugins, if the plugin supports logs."
}, },
"skipDataQuery": { "skipDataQuery": {
"type": "boolean", "type": "boolean",
@ -110,21 +110,23 @@
}, },
"metrics": { "metrics": {
"type": "boolean", "type": "boolean",
"description": "For data source plugins. If the plugin supports metric queries. Used in the Explore feature." "description": "For data source plugins, if the plugin supports metric queries. Used in Explore."
}, },
"streaming": { "streaming": {
"type": "boolean", "type": "boolean",
"description": "For data source plugins. If the plugin supports streaming." "description": "For data source plugins, if the plugin supports streaming."
}, },
"tables": { "tables": {
"type": "boolean" "type": "boolean",
"description": "This is an undocumented feature."
}, },
"tracing": { "tracing": {
"type": "boolean", "type": "boolean",
"description": "For data source plugins. If the plugin supports tracing." "description": "For data source plugins, if the plugin supports tracing."
}, },
"hiddenQueries": { "hiddenQueries": {
"type": "boolean" "type": "boolean",
"description": "For data source plugins, include hidden queries in the data request."
}, },
"autoEnabled": { "autoEnabled": {
"type": "boolean", "type": "boolean",
@ -443,12 +445,12 @@
}, },
"enterpriseFeatures": { "enterpriseFeatures": {
"type": "object", "type": "object",
"description": "Grafana Enerprise specific features", "description": "Grafana Enerprise specific features.",
"additionalProperties": true, "additionalProperties": true,
"properties": { "properties": {
"healthDiagnosticsErrors": { "healthDiagnosticsErrors": {
"type": "boolean", "type": "boolean",
"description": "Enable/Disable health diagnostics errors. Requires Grafana >=7.5.5", "description": "Enable/Disable health diagnostics errors. Requires Grafana >=7.5.5.",
"default": false "default": false
} }
} }