[v10.0.x] Improve Dashboards schema docs (#68904) (#69254)

Improve Dashboards schema docs (#68904)

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
Co-authored-by: Alexandra Vargas <alexa1866@gmail.com>
Co-authored-by: Ezequiel Victorero <ezequiel.victorero@grafana.com>
(cherry picked from commit cb83861630)
This commit is contained in:
Ivan Ortega Alba
2023-05-30 14:52:24 +02:00
committed by GitHub
parent e436872496
commit 6f11409f79
5 changed files with 470 additions and 373 deletions
@@ -64,32 +64,32 @@ extraFields is reserved for any fields that are pulled from the API server metad
### Spec
| Property | Type | Required | Default | Description |
|------------------------|---------------------------------------------|----------|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `editable` | boolean | **Yes** | `true` | Whether a dashboard is editable or not. |
| `graphTooltip` | integer | **Yes** | `0` | 0 for no shared crosshair or tooltip (default).<br/>1 for shared crosshair.<br/>2 for shared crosshair AND shared tooltip.<br/>Possible values are: `0`, `1`, `2`. |
| `schemaVersion` | uint16 | **Yes** | `36` | Version of the JSON schema, incremented each time a Grafana update brings<br/>changes to said schema.<br/>TODO this is the existing schema numbering system. It will be replaced by Thema's themaVersion |
| `style` | string | **Yes** | `dark` | Theme of dashboard.<br/>Possible values are: `dark`, `light`. |
| `annotations` | [AnnotationContainer](#annotationcontainer) | No | | TODO -- should not be a public interface on its own, but required for Veneer |
| `description` | string | No | | Description of dashboard. |
| `fiscalYearStartMonth` | integer | No | `0` | The month that the fiscal year starts on. 0 = January, 11 = December<br/>Constraint: `>=0 & <12`. |
| `gnetId` | string | No | | For dashboards imported from the https://grafana.com/grafana/dashboards/ portal |
| `id` | integer | No | | Unique numeric identifier for the dashboard.<br/>TODO must isolate or remove identifiers local to a Grafana instance...? |
| `links` | [DashboardLink](#dashboardlink)[] | No | | TODO docs |
| `liveNow` | boolean | No | | When set to true, the dashboard will redraw panels at an interval matching the pixel width.<br/>This will keep data "moving left" regardless of the query refresh rate. This setting helps<br/>avoid dashboards presenting stale live data |
| `panels` | [object](#panels)[] | No | | |
| `refresh` | | No | | Refresh rate of dashboard. Represented via interval string, e.g. "5s", "1m", "1h", "1d". |
| `revision` | integer | No | | This property should only be used in dashboards defined by plugins. It is a quick check<br/>to see if the version has changed since the last time. Unclear why using the version property<br/>is insufficient. |
| `snapshot` | [Snapshot](#snapshot) | No | | TODO docs |
| `tags` | string[] | No | | Tags associated with dashboard. |
| `templating` | [object](#templating) | No | | TODO docs |
| `time` | [object](#time) | No | | Time range for dashboard, e.g. last 6 hours, last 7 days, etc |
| `timepicker` | [object](#timepicker) | No | | TODO docs<br/>TODO this appears to be spread all over in the frontend. Concepts will likely need tidying in tandem with schema changes |
| `timezone` | string | No | `browser` | Timezone of dashboard. Accepts IANA TZDB zone ID or "browser" or "utc". |
| `title` | string | No | | Title of dashboard. |
| `uid` | string | No | | Unique dashboard identifier that can be generated by anyone. string (8-40) |
| `version` | uint32 | No | | Version of the dashboard, incremented each time the dashboard is updated. |
| `weekStart` | string | No | | TODO docs |
| Property | Type | Required | Default | Description |
|------------------------|---------------------------------------------|----------|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `editable` | boolean | **Yes** | `true` | Whether a dashboard is editable or not. |
| `graphTooltip` | integer | **Yes** | `0` | 0 for no shared crosshair or tooltip (default).<br/>1 for shared crosshair.<br/>2 for shared crosshair AND shared tooltip.<br/>Possible values are: `0`, `1`, `2`. |
| `schemaVersion` | uint16 | **Yes** | `36` | Version of the JSON schema, incremented each time a Grafana update brings<br/>changes to said schema.<br/>TODO this is the existing schema numbering system. It will be replaced by Thema's themaVersion |
| `style` | string | **Yes** | `dark` | Theme of dashboard.<br/>Possible values are: `dark`, `light`. |
| `annotations` | [AnnotationContainer](#annotationcontainer) | No | | TODO -- should not be a public interface on its own, but required for Veneer |
| `description` | string | No | | Description of dashboard. |
| `fiscalYearStartMonth` | integer | No | `0` | The month that the fiscal year starts on. 0 = January, 11 = December<br/>Constraint: `>=0 & <12`. |
| `gnetId` | string | No | | ID of a dashboard imported from the https://grafana.com/grafana/dashboards/ portal |
| `id` | integer | No | | Unique numeric identifier for the dashboard.<br/>TODO must isolate or remove identifiers local to a Grafana instance...? |
| `links` | [DashboardLink](#dashboardlink)[] | No | | Links with references to other dashboards or external websites. |
| `liveNow` | boolean | No | | When set to true, the dashboard will redraw panels at an interval matching the pixel width.<br/>This will keep data "moving left" regardless of the query refresh rate. This setting helps<br/>avoid dashboards presenting stale live data |
| `panels` | [object](#panels)[] | No | | |
| `refresh` | | No | | Refresh rate of dashboard. Represented via interval string, e.g. "5s", "1m", "1h", "1d". |
| `revision` | integer | No | | This property should only be used in dashboards defined by plugins. It is a quick check<br/>to see if the version has changed since the last time. Unclear why using the version property<br/>is insufficient. |
| `snapshot` | [Snapshot](#snapshot) | No | | A dashboard snapshot shares an interactive dashboard publicly.<br/>It is a read-only version of a dashboard, and is not editable.<br/>It is possible to create a snapshot of a snapshot.<br/>Grafana strips away all sensitive information from the dashboard.<br/>Sensitive information stripped: queries (metric, template,annotation) and panel links. |
| `tags` | string[] | No | | Tags associated with dashboard. |
| `templating` | [object](#templating) | No | | Contains the list of configured template variables with their saved values along with some other metadata |
| `time` | [object](#time) | No | | Time range for dashboard.<br/>Accepted values are relative time strings like {from: 'now-6h', to: 'now'} or absolute time strings like {from: '2020-07-10T08:00:00.000Z', to: '2020-07-10T14:00:00.000Z'}. |
| `timepicker` | [object](#timepicker) | No | | Configuration of the time picker shown at the top of a dashboard. |
| `timezone` | string | No | `browser` | Timezone of dashboard. Accepted values are IANA TZDB zone ID or "browser" or "utc". |
| `title` | string | No | | Title of dashboard. |
| `uid` | string | No | | Unique dashboard identifier that can be generated by anyone. string (8-40) |
| `version` | uint32 | No | | Version of the dashboard, incremented each time the dashboard is updated. |
| `weekStart` | string | No | | Day when the week starts. Expressed by the name of the day in lowercase, e.g. "monday". |
### AnnotationContainer
@@ -106,7 +106,7 @@ FROM: AnnotationQuery in grafana-data/src/types/annotations.ts
| Property | Type | Required | Default | Description |
|--------------|-------------------------------------------------|----------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `datasource` | [object](#datasource) | **Yes** | | TODO: Should be DataSourceRef |
| `datasource` | [DataSourceRef](#datasourceref) | **Yes** | | Ref to a DataSource instance |
| `enable` | boolean | **Yes** | `true` | When enabled the annotation query is issued with every dashboard refresh |
| `iconColor` | string | **Yes** | | Color to use for the annotation event markers |
| `name` | string | **Yes** | | Name of annotation. |
@@ -134,50 +134,53 @@ these match the properties of the "grafana" datasouce that is default in most da
| `tags` | string[] | **Yes** | | Only required/valid for the grafana datasource...<br/>but code+tests is already depending on it so hard to change |
| `type` | string | **Yes** | | Only required/valid for the grafana datasource...<br/>but code+tests is already depending on it so hard to change |
### Datasource
### DataSourceRef
TODO: Should be DataSourceRef
Ref to a DataSource instance
| Property | Type | Required | Default | Description |
|----------|--------|----------|---------|-------------|
| `type` | string | No | | |
| `uid` | string | No | | |
| Property | Type | Required | Default | Description |
|----------|--------|----------|---------|------------------------------|
| `type` | string | No | | The plugin type-id |
| `uid` | string | No | | Specific datasource instance |
### DashboardLink
FROM public/app/features/dashboard/state/DashboardModels.ts - ish
TODO docs
Links with references to other dashboards or external resources
| Property | Type | Required | Default | Description |
|---------------|----------|----------|---------|----------------------------------------------------------|
| `asDropdown` | boolean | **Yes** | `false` | |
| `icon` | string | **Yes** | | |
| `includeVars` | boolean | **Yes** | `false` | |
| `keepTime` | boolean | **Yes** | `false` | |
| `tags` | string[] | **Yes** | | |
| `targetBlank` | boolean | **Yes** | `false` | |
| `title` | string | **Yes** | | |
| `tooltip` | string | **Yes** | | |
| `type` | string | **Yes** | | TODO docs<br/>Possible values are: `link`, `dashboards`. |
| `url` | string | **Yes** | | |
| Property | Type | Required | Default | Description |
|---------------|----------|----------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `asDropdown` | boolean | **Yes** | `false` | If true, all dashboards links will be displayed in a dropdown. If false, all dashboards links will be displayed side by side. Only valid if the type is dashboards |
| `icon` | string | **Yes** | | Icon name to be displayed with the link |
| `includeVars` | boolean | **Yes** | `false` | If true, includes current template variables values in the link as query params |
| `keepTime` | boolean | **Yes** | `false` | If true, includes current time range in the link as query params |
| `tags` | string[] | **Yes** | | List of tags to limit the linked dashboards. If empty, all dashboards will be displayed. Only valid if the type is dashboards |
| `targetBlank` | boolean | **Yes** | `false` | If true, the link will be opened in a new tab |
| `title` | string | **Yes** | | Title to display with the link |
| `tooltip` | string | **Yes** | | Tooltip to display when the user hovers their mouse over it |
| `type` | string | **Yes** | | Dashboard Link type. Accepted values are dashboards (to refer to another dashboard) and link (to refer to an external resource)<br/>Possible values are: `link`, `dashboards`. |
| `url` | string | **Yes** | | Link URL. Only required/valid if the type is link |
### Snapshot
TODO docs
A dashboard snapshot shares an interactive dashboard publicly.
It is a read-only version of a dashboard, and is not editable.
It is possible to create a snapshot of a snapshot.
Grafana strips away all sensitive information from the dashboard.
Sensitive information stripped: queries (metric, template,annotation) and panel links.
| Property | Type | Required | Default | Description |
|---------------|---------|----------|---------|-------------|
| `created` | string | **Yes** | | TODO docs |
| `expires` | string | **Yes** | | TODO docs |
| `externalUrl` | string | **Yes** | | TODO docs |
| `external` | boolean | **Yes** | | TODO docs |
| `id` | uint32 | **Yes** | | TODO docs |
| `key` | string | **Yes** | | TODO docs |
| `name` | string | **Yes** | | TODO docs |
| `orgId` | uint32 | **Yes** | | TODO docs |
| `updated` | string | **Yes** | | TODO docs |
| `userId` | uint32 | **Yes** | | TODO docs |
| `url` | string | No | | TODO docs |
| Property | Type | Required | Default | Description |
|---------------|---------|----------|---------|--------------------------------------------------------------------------------|
| `created` | string | **Yes** | | Time when the snapshot was created |
| `expires` | string | **Yes** | | Time when the snapshot expires, default is never to expire |
| `externalUrl` | string | **Yes** | | external url, if snapshot was shared in external grafana instance |
| `external` | boolean | **Yes** | | Is the snapshot saved in an external grafana instance |
| `id` | uint32 | **Yes** | | Unique identifier of the snapshot |
| `key` | string | **Yes** | | Optional, defined the unique key of the snapshot, required if external is true |
| `name` | string | **Yes** | | Optional, name of the snapshot |
| `orgId` | uint32 | **Yes** | | org id of the snapshot |
| `updated` | string | **Yes** | | last time when the snapshot was updated |
| `userId` | uint32 | **Yes** | | user id of the snapshot creator |
| `url` | string | No | | url of the snapshot, if snapshot was shared internally |
### Panels
@@ -215,7 +218,7 @@ TODO docs
| Property | Type | Required | Default | Description |
|---------------------|---------------------------------------|----------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `color` | [FieldColor](#fieldcolor) | No | | TODO docs |
| `custom` | [object](#custom) | No | | custom is specified by the PanelFieldConfig field<br/>in panel plugin schemas. |
| `custom` | [object](#custom) | No | | custom is specified by the FieldConfig field<br/>in panel plugin schemas. |
| `decimals` | number | No | | Significant digits (for display) |
| `description` | string | No | | Human readable field metadata |
| `displayNameFromDS` | string | No | | This can be used by data sources that return and explicit naming structure for values and labels<br/>When this property is configured, this value is used rather than the default naming strategy. |
@@ -243,25 +246,26 @@ TODO docs
### ThresholdsConfig
| Property | Type | Required | Default | Description |
|----------|---------------------------|----------|---------|------------------------------------------------------------|
| `mode` | string | **Yes** | | Possible values are: `absolute`, `percentage`. |
| `steps` | [Threshold](#threshold)[] | **Yes** | | Must be sorted by 'value', first value is always -Infinity |
| Property | Type | Required | Default | Description |
|----------|---------------------------|----------|---------|------------------------------------------------------------------------------------------------------------------------------------------------|
| `mode` | string | **Yes** | | Thresholds can either be absolute (specific number) or percentage (relative to min or max).<br/>Possible values are: `absolute`, `percentage`. |
| `steps` | [Threshold](#threshold)[] | **Yes** | | Must be sorted by 'value', first value is always -Infinity |
### Threshold
TODO docs
User-defined value for a metric that triggers visual changes in a panel when this value is met or exceeded
They are used to conditionally style and color visualizations based on query results , and can be applied to most visualizations.
| Property | Type | Required | Default | Description |
|----------|---------|----------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| `color` | string | **Yes** | | TODO docs |
| `index` | integer | No | | Threshold index, an old property that is not needed an should only appear in older dashboards |
| `state` | string | No | | TODO docs<br/>TODO are the values here enumerable into a disjunction?<br/>Some seem to be listed in typescript comment |
| `value` | number | No | | TODO docs<br/>FIXME the corresponding typescript field is required/non-optional, but nulls currently appear here when serializing -Infinity to JSON |
| Property | Type | Required | Default | Description |
|----------|---------|----------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `color` | string | **Yes** | | Color represents the color of the visual change that will occur in the dashboard when the threshold value is met or exceeded. |
| `index` | integer | No | | Threshold index, an old property that is not needed an should only appear in older dashboards |
| `state` | string | No | | TODO docs<br/>TODO are the values here enumerable into a disjunction?<br/>Some seem to be listed in typescript comment |
| `value` | number | No | | Value represents a specified metric for the threshold, which triggers a visual change in the dashboard when this value is met or exceeded.<br/>FIXME the corresponding typescript field is required/non-optional, but nulls currently appear here when serializing -Infinity to JSON |
### ValueMapping
TODO docs
Allow to transform the visual representation of specific data values in a visualization, irrespective of their original units
| Property | Type | Required | Default | Description |
|----------|-------------------------------------------------------------------------------------------------------------------------------|----------|---------|-------------|
@@ -269,7 +273,7 @@ TODO docs
### RangeMap
TODO docs
Maps numeric ranges to a color or different display text
| Property | Type | Required | Default | Description |
|-----------|--------------------|----------|---------|-------------|
@@ -281,12 +285,12 @@ TODO docs
| Property | Type | Required | Default | Description |
|----------|-------------------------------------------|----------|---------|--------------------------------------------------------------------------------|
| `from` | number | **Yes** | | to and from are `number &#124; null` in current ts, really not sure what to do |
| `result` | [ValueMappingResult](#valuemappingresult) | **Yes** | | TODO docs |
| `result` | [ValueMappingResult](#valuemappingresult) | **Yes** | | Result used as replacement text and color for RegexMap and SpecialValueMap |
| `to` | number | **Yes** | | |
### ValueMappingResult
TODO docs
Result used as replacement text and color for RegexMap and SpecialValueMap
| Property | Type | Required | Default | Description |
|----------|---------|----------|---------|-------------|
@@ -297,7 +301,7 @@ TODO docs
### RegexMap
TODO docs
Maps regular expressions to replacement text and a color
| Property | Type | Required | Default | Description |
|-----------|--------------------|----------|---------|-------------|
@@ -306,14 +310,15 @@ TODO docs
### Options
| Property | Type | Required | Default | Description |
|-----------|-------------------------------------------|----------|---------|-------------|
| `pattern` | string | **Yes** | | |
| `result` | [ValueMappingResult](#valuemappingresult) | **Yes** | | TODO docs |
| Property | Type | Required | Default | Description |
|-----------|-------------------------------------------|----------|---------|----------------------------------------------------------------------------|
| `pattern` | string | **Yes** | | |
| `result` | [ValueMappingResult](#valuemappingresult) | **Yes** | | Result used as replacement text and color for RegexMap and SpecialValueMap |
### SpecialValueMap
TODO docs
Maps special values like Null, NaN (not a number), and boolean values like true and false to a display text
and color
| Property | Type | Required | Default | Description |
|-----------|--------------------|----------|---------|-------------|
@@ -322,15 +327,15 @@ TODO docs
### Options
| Property | Type | Required | Default | Description |
|-----------|-------------------------------------------|----------|---------|---------------------------------------|
| `match` | string | **Yes** | | Possible values are: `true`, `false`. |
| `pattern` | string | **Yes** | | |
| `result` | [ValueMappingResult](#valuemappingresult) | **Yes** | | TODO docs |
| Property | Type | Required | Default | Description |
|-----------|-------------------------------------------|----------|---------|----------------------------------------------------------------------------|
| `match` | string | **Yes** | | Possible values are: `true`, `false`. |
| `pattern` | string | **Yes** | | |
| `result` | [ValueMappingResult](#valuemappingresult) | **Yes** | | Result used as replacement text and color for RegexMap and SpecialValueMap |
### ValueMap
TODO docs
Maps text values to a color or different display text
| Property | Type | Required | Default | Description |
|-----------|------------------------------------------------------|----------|---------|-------------|
@@ -339,7 +344,7 @@ TODO docs
### Custom
custom is specified by the PanelFieldConfig field
custom is specified by the FieldConfig field
in panel plugin schemas.
| Property | Type | Required | Default | Description |
@@ -380,13 +385,13 @@ Support for legacy graph and heatmap panels.
### GridPos
| Property | Type | Required | Default | Description |
|----------|---------|----------|---------|--------------------------------------|
| `h` | uint32 | **Yes** | `9` | Panel |
| `w` | integer | **Yes** | `12` | Panel<br/>Constraint: `>0 & <=24`. |
| `x` | integer | **Yes** | `0` | Panel x<br/>Constraint: `>=0 & <24`. |
| `y` | uint32 | **Yes** | `0` | Panel y |
| `static` | boolean | No | | true if fixed |
| Property | Type | Required | Default | Description |
|----------|---------|----------|---------|--------------------------------------------|
| `h` | uint32 | **Yes** | `9` | Panel |
| `w` | integer | **Yes** | `12` | Panel<br/>Constraint: `>0 & <=24`. |
| `x` | integer | **Yes** | `0` | Panel x<br/>Constraint: `>=0 & <24`. |
| `y` | uint32 | **Yes** | `0` | Panel y |
| `static` | boolean | No | | Whether the panel is fixed within the grid |
### HeatmapPanel
@@ -407,32 +412,32 @@ Dashboard panels. Panels are canonically defined inline
because they share a version timeline with the dashboard
schema; they do not evolve independently.
| Property | Type | Required | Default | Description |
|-------------------|---------------------------------------------------|----------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `fieldConfig` | [FieldConfigSource](#fieldconfigsource) | **Yes** | | |
| `options` | [object](#options) | **Yes** | | options is specified by the PanelOptions field in panel<br/>plugin schemas. |
| `repeatDirection` | string | **Yes** | `h` | Direction to repeat in if 'repeat' is set.<br/>"h" for horizontal, "v" for vertical.<br/>TODO this is probably optional<br/>Possible values are: `h`, `v`. |
| `transformations` | [DataTransformerConfig](#datatransformerconfig)[] | **Yes** | | |
| `transparent` | boolean | **Yes** | `false` | Whether to display the panel without a background. |
| `type` | string | **Yes** | | The panel plugin type id. May not be empty.<br/>Constraint: `length >=1`. |
| `datasource` | [object](#datasource) | No | | The datasource used in all targets. |
| `description` | string | No | | Description. |
| `gridPos` | [GridPos](#gridpos) | No | | |
| `id` | uint32 | No | | TODO docs |
| `interval` | string | No | | TODO docs<br/>TODO tighter constraint |
| `libraryPanel` | [LibraryPanelRef](#librarypanelref) | No | | |
| `links` | [DashboardLink](#dashboardlink)[] | No | | Panel links.<br/>TODO fill this out - seems there are a couple variants? |
| `maxDataPoints` | number | No | | TODO docs |
| `pluginVersion` | string | No | | FIXME this almost certainly has to be changed in favor of scuemata versions |
| `repeatPanelId` | integer | No | | Id of the repeating panel. |
| `repeat` | string | No | | Name of template variable to repeat for. |
| `tags` | string[] | No | | TODO docs |
| `targets` | [Target](#target)[] | No | | TODO docs |
| `thresholds` | | No | | TODO docs - seems to be an old field from old dashboard alerts? |
| `timeFrom` | string | No | | TODO docs<br/>TODO tighter constraint |
| `timeRegions` | | No | | TODO docs |
| `timeShift` | string | No | | TODO docs<br/>TODO tighter constraint |
| `title` | string | No | | Panel title. |
| Property | Type | Required | Default | Description |
|-------------------|---------------------------------------------------|----------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `fieldConfig` | [FieldConfigSource](#fieldconfigsource) | **Yes** | | |
| `options` | [object](#options) | **Yes** | | options is specified by the Options field in panel<br/>plugin schemas. |
| `repeatDirection` | string | **Yes** | `h` | Direction to repeat in if 'repeat' is set.<br/>"h" for horizontal, "v" for vertical.<br/>TODO this is probably optional<br/>Possible values are: `h`, `v`. |
| `transformations` | [DataTransformerConfig](#datatransformerconfig)[] | **Yes** | | |
| `transparent` | boolean | **Yes** | `false` | Whether to display the panel without a background. |
| `type` | string | **Yes** | | The panel plugin type id. May not be empty.<br/>Constraint: `length >=1`. |
| `datasource` | [object](#datasource) | No | | The datasource used in all targets. |
| `description` | string | No | | Description. |
| `gridPos` | [GridPos](#gridpos) | No | | |
| `id` | uint32 | No | | TODO docs |
| `interval` | string | No | | The min time interval setting defines a lower limit for the $__interval and $__interval_ms variables.<br/>This value must be formatted as a number followed by a valid time<br/>identifier like: "40s", "3d", etc.<br/>See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options |
| `libraryPanel` | [LibraryPanelRef](#librarypanelref) | No | | |
| `links` | [DashboardLink](#dashboardlink)[] | No | | Panel links.<br/>TODO fill this out - seems there are a couple variants? |
| `maxDataPoints` | number | No | | The maximum number of data points that the panel queries are retrieving. |
| `pluginVersion` | string | No | | FIXME this almost certainly has to be changed in favor of scuemata versions |
| `repeatPanelId` | integer | No | | Id of the repeating panel. |
| `repeat` | string | No | | Name of template variable to repeat for. |
| `tags` | string[] | No | | TODO docs |
| `targets` | [Target](#target)[] | No | | TODO docs |
| `thresholds` | | No | | TODO docs - seems to be an old field from old dashboard alerts? |
| `timeFrom` | string | No | | Overrides the relative time range for individual panels,<br/>which causes them to be different than what is selected in<br/>the dashboard time picker in the top-right corner of the dashboard. You can use this to show metrics from different<br/>time periods or days on the same dashboard.<br/>The value is formatted as time operation like: `now-5m` (Last 5 minutes), `now/d` (the day so far),<br/>`now-5d/d`(Last 5 days), `now/w` (This week so far), `now-2y/y` (Last 2 years).<br/>Note: Panel time overrides have no effect when the dashboard’s time range is absolute.<br/>See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options |
| `timeRegions` | | No | | TODO docs |
| `timeShift` | string | No | | Overrides the time range for individual panels by shifting its start and end relative to the time picker.<br/>For example, you can shift the time range for the panel to be two hours earlier than the dashboard time picker setting `2h`.<br/>Note: Panel time overrides have no effect when the dashboard’s time range is absolute.<br/>See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options |
| `title` | string | No | | Panel title. |
### FieldConfigSource
@@ -446,7 +451,7 @@ schema; they do not evolve independently.
| Property | Type | Required | Default | Description |
|---------------------|---------------------------------------|----------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `color` | [FieldColor](#fieldcolor) | No | | TODO docs |
| `custom` | [custom](#custom) | No | | custom is specified by the PanelFieldConfig field<br/>in panel plugin schemas. |
| `custom` | [custom](#custom) | No | | custom is specified by the FieldConfig field<br/>in panel plugin schemas. |
| `decimals` | number | No | | Significant digits (for display) |
| `description` | string | No | | Human readable field metadata |
| `displayNameFromDS` | string | No | | This can be used by data sources that return and explicit naming structure for values and labels<br/>When this property is configured, this value is used rather than the default naming strategy. |
@@ -464,7 +469,7 @@ schema; they do not evolve independently.
### RangeMap
TODO docs
Maps numeric ranges to a color or different display text
| Property | Type | Required | Default | Description |
|-----------|---------------------|----------|---------|-------------|
@@ -473,7 +478,7 @@ TODO docs
### RegexMap
TODO docs
Maps regular expressions to replacement text and a color
| Property | Type | Required | Default | Description |
|-----------|---------------------|----------|---------|-------------|
@@ -482,7 +487,8 @@ TODO docs
### SpecialValueMap
TODO docs
Maps special values like Null, NaN (not a number), and boolean values like true and false to a display text
and color
| Property | Type | Required | Default | Description |
|-----------|---------------------|----------|---------|-------------|
@@ -513,7 +519,7 @@ The datasource used in all targets.
### Options
options is specified by the PanelOptions field in panel
options is specified by the Options field in panel
plugin schemas.
| Property | Type | Required | Default | Description |
@@ -564,36 +570,36 @@ Dashboard panels. Panels are canonically defined inline
because they share a version timeline with the dashboard
schema; they do not evolve independently.
| Property | Type | Required | Default | Description |
|-------------------|---------------------------------------------------|----------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `fieldConfig` | [FieldConfigSource](#fieldconfigsource) | **Yes** | | |
| `options` | [options](#options) | **Yes** | | options is specified by the PanelOptions field in panel<br/>plugin schemas. |
| `repeatDirection` | string | **Yes** | `h` | Direction to repeat in if 'repeat' is set.<br/>"h" for horizontal, "v" for vertical.<br/>TODO this is probably optional<br/>Possible values are: `h`, `v`. |
| `transformations` | [DataTransformerConfig](#datatransformerconfig)[] | **Yes** | | |
| `transparent` | boolean | **Yes** | `false` | Whether to display the panel without a background. |
| `type` | string | **Yes** | | The panel plugin type id. May not be empty.<br/>Constraint: `length >=1`. |
| `datasource` | [datasource](#datasource) | No | | The datasource used in all targets. |
| `description` | string | No | | Description. |
| `gridPos` | [GridPos](#gridpos) | No | | |
| `id` | uint32 | No | | TODO docs |
| `interval` | string | No | | TODO docs<br/>TODO tighter constraint |
| `libraryPanel` | [LibraryPanelRef](#librarypanelref) | No | | |
| `links` | [DashboardLink](#dashboardlink)[] | No | | Panel links.<br/>TODO fill this out - seems there are a couple variants? |
| `maxDataPoints` | number | No | | TODO docs |
| `pluginVersion` | string | No | | FIXME this almost certainly has to be changed in favor of scuemata versions |
| `repeatPanelId` | integer | No | | Id of the repeating panel. |
| `repeat` | string | No | | Name of template variable to repeat for. |
| `tags` | string[] | No | | TODO docs |
| `targets` | [Target](#target)[] | No | | TODO docs |
| `thresholds` | | No | | TODO docs - seems to be an old field from old dashboard alerts? |
| `timeFrom` | string | No | | TODO docs<br/>TODO tighter constraint |
| `timeRegions` | | No | | TODO docs |
| `timeShift` | string | No | | TODO docs<br/>TODO tighter constraint |
| `title` | string | No | | Panel title. |
| Property | Type | Required | Default | Description |
|-------------------|---------------------------------------------------|----------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `fieldConfig` | [FieldConfigSource](#fieldconfigsource) | **Yes** | | |
| `options` | [options](#options) | **Yes** | | options is specified by the Options field in panel<br/>plugin schemas. |
| `repeatDirection` | string | **Yes** | `h` | Direction to repeat in if 'repeat' is set.<br/>"h" for horizontal, "v" for vertical.<br/>TODO this is probably optional<br/>Possible values are: `h`, `v`. |
| `transformations` | [DataTransformerConfig](#datatransformerconfig)[] | **Yes** | | |
| `transparent` | boolean | **Yes** | `false` | Whether to display the panel without a background. |
| `type` | string | **Yes** | | The panel plugin type id. May not be empty.<br/>Constraint: `length >=1`. |
| `datasource` | [datasource](#datasource) | No | | The datasource used in all targets. |
| `description` | string | No | | Description. |
| `gridPos` | [GridPos](#gridpos) | No | | |
| `id` | uint32 | No | | TODO docs |
| `interval` | string | No | | The min time interval setting defines a lower limit for the $__interval and $__interval_ms variables.<br/>This value must be formatted as a number followed by a valid time<br/>identifier like: "40s", "3d", etc.<br/>See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options |
| `libraryPanel` | [LibraryPanelRef](#librarypanelref) | No | | |
| `links` | [DashboardLink](#dashboardlink)[] | No | | Panel links.<br/>TODO fill this out - seems there are a couple variants? |
| `maxDataPoints` | number | No | | The maximum number of data points that the panel queries are retrieving. |
| `pluginVersion` | string | No | | FIXME this almost certainly has to be changed in favor of scuemata versions |
| `repeatPanelId` | integer | No | | Id of the repeating panel. |
| `repeat` | string | No | | Name of template variable to repeat for. |
| `tags` | string[] | No | | TODO docs |
| `targets` | [Target](#target)[] | No | | TODO docs |
| `thresholds` | | No | | TODO docs - seems to be an old field from old dashboard alerts? |
| `timeFrom` | string | No | | Overrides the relative time range for individual panels,<br/>which causes them to be different than what is selected in<br/>the dashboard time picker in the top-right corner of the dashboard. You can use this to show metrics from different<br/>time periods or days on the same dashboard.<br/>The value is formatted as time operation like: `now-5m` (Last 5 minutes), `now/d` (the day so far),<br/>`now-5d/d`(Last 5 days), `now/w` (This week so far), `now-2y/y` (Last 2 years).<br/>Note: Panel time overrides have no effect when the dashboard’s time range is absolute.<br/>See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options |
| `timeRegions` | | No | | TODO docs |
| `timeShift` | string | No | | Overrides the time range for individual panels by shifting its start and end relative to the time picker.<br/>For example, you can shift the time range for the panel to be two hours earlier than the dashboard time picker setting `2h`.<br/>Note: Panel time overrides have no effect when the dashboard’s time range is absolute.<br/>See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options |
| `title` | string | No | | Panel title. |
### Templating
TODO docs
Contains the list of configured template variables with their saved values along with some other metadata
| Property | Type | Required | Default | Description |
|----------|-----------------------------------|----------|---------|-------------|
@@ -623,15 +629,6 @@ TODO there appear to be a lot of different kinds of [template] vars here? if so
| `query` | | No | | TODO: Move this into a separated QueryVariableModel type |
| `rootStateKey` | string | No | | |
### DataSourceRef
Ref to a DataSource instance
| Property | Type | Required | Default | Description |
|----------|--------|----------|---------|------------------------------|
| `type` | string | No | | The plugin type-id |
| `uid` | string | No | | Specific datasource instance |
### Error
| Property | Type | Required | Default | Description |
@@ -639,7 +636,8 @@ Ref to a DataSource instance
### Time
Time range for dashboard, e.g. last 6 hours, last 7 days, etc
Time range for dashboard.
Accepted values are relative time strings like {from: 'now-6h', to: 'now'} or absolute time strings like {from: '2020-07-10T08:00:00.000Z', to: '2020-07-10T14:00:00.000Z'}.
| Property | Type | Required | Default | Description |
|----------|--------|----------|----------|-------------|
@@ -648,16 +646,15 @@ Time range for dashboard, e.g. last 6 hours, last 7 days, etc
### Timepicker
TODO docs
TODO this appears to be spread all over in the frontend. Concepts will likely need tidying in tandem with schema changes
Configuration of the time picker shown at the top of a dashboard.
| Property | Type | Required | Default | Description |
|---------------------|----------|----------|---------------------------------------|-----------------------------------------|
| `collapse` | boolean | **Yes** | `false` | Whether timepicker is collapsed or not. |
| `enable` | boolean | **Yes** | `true` | Whether timepicker is enabled or not. |
| `hidden` | boolean | **Yes** | `false` | Whether timepicker is visible or not. |
| `refresh_intervals` | string[] | **Yes** | `[5s 10s 30s 1m 5m 15m 30m 1h 2h 1d]` | Selectable intervals for auto-refresh. |
| `time_options` | string[] | **Yes** | `[5m 15m 1h 6h 12h 24h 2d 7d 30d]` | TODO docs |
| Property | Type | Required | Default | Description |
|---------------------|----------|----------|---------------------------------------|---------------------------------------------------------------------------------------------------|
| `collapse` | boolean | **Yes** | `false` | Whether timepicker is collapsed or not. Has no effect on provisioned dashboard. |
| `enable` | boolean | **Yes** | `true` | Whether timepicker is enabled or not. Has no effect on provisioned dashboard. |
| `hidden` | boolean | **Yes** | `false` | Whether timepicker is visible or not. |
| `refresh_intervals` | string[] | **Yes** | `[5s 10s 30s 1m 5m 15m 30m 1h 2h 1d]` | Interval options available in the refresh picker dropdown. |
| `time_options` | string[] | **Yes** | `[5m 15m 1h 6h 12h 24h 2d 7d 30d]` | Selectable options available in the time picker dropdown. Has no effect on provisioned dashboard. |
### Status