Schema: Improve Dashboard kind docs and remove deprecated props (#69652)

Backport: Schema: Improve Dashboard kind docs and remove deprecated props (#69359)

Removes unused properties:
  * `FieldColorModeId.PaletteSaturated`: It doesn't exist and it is not a valid palette.
  * `VariableModel.rootStateKey`: It is not persisted in the DB, so it shouldn't be in the schema. It is a property only used in the frontend to store the Redux store key.
  * `VariableModel.error`: It is not persisted in the DB, so it shouldn't be in the schema. It is a property only used in the frontend to store fetching errors.
  * `Panel.thresholds`: old property only existing in previous versions of the dashboard schema.
  * `Panel.timeRegions`: old property only existing in previous versions of the dashboard schema.

(cherry picked from commit 819041c732)
This commit is contained in:
Ivan Ortega Alba
2023-06-06 20:22:46 +03:00
committed by GitHub
parent 71eda16c12
commit 781a531137
8 changed files with 1425 additions and 811 deletions
@@ -64,40 +64,43 @@ 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 | | 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". |
| 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. |
| `style` | string | **Yes** | `dark` | Theme of dashboard.<br/>Default value: dark.<br/>Possible values are: `dark`, `light`. |
| `annotations` | [AnnotationContainer](#annotationcontainer) | No | | Contains the list of annotations that are associated with the dashboard.<br/>Annotations are used to overlay event markers and overlay event tags on graphs.<br/>Grafana comes with a native annotation store and the ability to add annotation events directly from the graph panel or via the HTTP API.<br/>See https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/annotate-visualizations/ |
| `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 | | `id` is internal to a specific Grafana instance. `uid` should be used to identify a dashboard across Grafana instances. |
| `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 | | List of dashboard panels |
| `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. |
| `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 | | Configured template variables |
| `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
TODO -- should not be a public interface on its own, but required for Veneer
Contains the list of annotations that are associated with the dashboard.
Annotations are used to overlay event markers and overlay event tags on graphs.
Grafana comes with a native annotation store and the ability to add annotation events directly from the graph panel or via the HTTP API.
See https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/annotate-visualizations/
| Property | Type | Required | Default | Description |
|----------|---------------------------------------|----------|---------|-------------|
| `list` | [AnnotationQuery](#annotationquery)[] | No | | |
| Property | Type | Required | Default | Description |
|----------|---------------------------------------|----------|---------|---------------------|
| `list` | [AnnotationQuery](#annotationquery)[] | No | | List of annotations |
### AnnotationQuery
@@ -190,78 +193,91 @@ Sensitive information stripped: queries (metric, template,annotation) and panel
### DataTransformerConfig
TODO docs
Transformations allow to manipulate data returned by a query before the system applies a visualization.
Using transformations you can: rename fields, join time series data, perform mathematical operations across queries,
use the output of one transformation as the input to another transformation, etc.
| Property | Type | Required | Default | Description |
|------------|---------------------------------|----------|---------|----------------------------------------------------------------------------------------|
| `id` | string | **Yes** | | Unique identifier of transformer |
| `options` | | **Yes** | | Options to be passed to the transformer<br/>Valid options depend on the transformer id |
| `disabled` | boolean | No | | Disabled transformations are skipped |
| `filter` | [MatcherConfig](#matcherconfig) | No | | |
| Property | Type | Required | Default | Description |
|------------|---------------------------------|----------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `id` | string | **Yes** | | Unique identifier of transformer |
| `options` | | **Yes** | | Options to be passed to the transformer<br/>Valid options depend on the transformer id |
| `disabled` | boolean | No | | Disabled transformations are skipped |
| `filter` | [MatcherConfig](#matcherconfig) | No | | Matcher is a predicate configuration. Based on the config a set of field(s) or values is filtered in order to apply override / transformation.<br/>It comes with in id ( to resolve implementation from registry) and a configuration that’s specific to a particular matcher type. |
### MatcherConfig
| Property | Type | Required | Default | Description |
|-----------|--------|----------|---------|-------------|
| `id` | string | **Yes** | `` | |
| `options` | | No | | |
Matcher is a predicate configuration. Based on the config a set of field(s) or values is filtered in order to apply override / transformation.
It comes with in id ( to resolve implementation from registry) and a configuration that’s specific to a particular matcher type.
| Property | Type | Required | Default | Description |
|-----------|--------|----------|---------|--------------------------------------------------------------------------------|
| `id` | string | **Yes** | `` | The matcher id. This is used to find the matcher implementation from registry. |
| `options` | | No | | The matcher options. This is specific to the matcher implementation. |
### FieldConfigSource
| Property | Type | Required | Default | Description |
|-------------|-----------------------------|----------|---------|-------------|
| `defaults` | [FieldConfig](#fieldconfig) | **Yes** | | |
| `overrides` | [object](#overrides)[] | **Yes** | | |
The data model used in Grafana, namely the data frame, is a columnar-oriented table structure that unifies both time series and table query results.
Each column within this structure is called a field. A field can represent a single time series or table column.
Field options allow you to change how the data is displayed in your visualizations.
| Property | Type | Required | Default | Description |
|-------------|-----------------------------|----------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `defaults` | [FieldConfig](#fieldconfig) | **Yes** | | The data model used in Grafana, namely the data frame, is a columnar-oriented table structure that unifies both time series and table query results.<br/>Each column within this structure is called a field. A field can represent a single time series or table column.<br/>Field options allow you to change how the data is displayed in your visualizations. |
| `overrides` | [object](#overrides)[] | **Yes** | | Overrides are the options applied to specific fields overriding the defaults. |
### FieldConfig
| Property | Type | Required | Default | Description |
|---------------------|---------------------------------------|----------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `color` | [FieldColor](#fieldcolor) | No | | TODO docs |
| `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. |
| `displayName` | string | No | | The display value for this field. This supports template variables blank is auto |
| `filterable` | boolean | No | | True if data source field supports ad-hoc filters |
| `links` | | No | | The behavior when clicking on a result |
| `mappings` | [ValueMapping](#valuemapping)[] | No | | Convert input values into a display string |
| `max` | number | No | | |
| `min` | number | No | | |
| `noValue` | string | No | | Alternative to empty string |
| `path` | string | No | | An explicit path to the field in the datasource. When the frame meta includes a path,<br/>This will default to `${frame.meta.path}/${field.name}<br/><br/>When defined, this value can be used as an identifier within the datasource scope, and<br/>may be used to update the results |
| `thresholds` | [ThresholdsConfig](#thresholdsconfig) | No | | |
| `unit` | string | No | | Numeric Options |
| `writeable` | boolean | No | | True if data source can write a value to the path. Auth/authz are supported separately |
The data model used in Grafana, namely the data frame, is a columnar-oriented table structure that unifies both time series and table query results.
Each column within this structure is called a field. A field can represent a single time series or table column.
Field options allow you to change how the data is displayed in your visualizations.
| Property | Type | Required | Default | Description |
|---------------------|---------------------------------------|----------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `color` | [FieldColor](#fieldcolor) | No | | Map a field to a color. |
| `custom` | [object](#custom) | No | | custom is specified by the FieldConfig field<br/>in panel plugin schemas. |
| `decimals` | number | No | | Specify the number of decimals Grafana includes in the rendered value.<br/>If you leave this field blank, Grafana automatically truncates the number of decimals based on the value.<br/>For example 1.1234 will display as 1.12 and 100.456 will display as 100.<br/>To display all decimals, set the unit to `String`. |
| `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. |
| `displayName` | string | No | | The display value for this field. This supports template variables blank is auto |
| `filterable` | boolean | No | | True if data source field supports ad-hoc filters |
| `links` | | No | | The behavior when clicking on a result |
| `mappings` | [ValueMapping](#valuemapping)[] | No | | Convert input values into a display string |
| `max` | number | No | | The maximum value used in percentage threshold calculations. Leave blank for auto calculation based on all series and fields. |
| `min` | number | No | | The minimum value used in percentage threshold calculations. Leave blank for auto calculation based on all series and fields. |
| `noValue` | string | No | | Alternative to empty string |
| `path` | string | No | | An explicit path to the field in the datasource. When the frame meta includes a path,<br/>This will default to `${frame.meta.path}/${field.name}<br/><br/>When defined, this value can be used as an identifier within the datasource scope, and<br/>may be used to update the results |
| `thresholds` | [ThresholdsConfig](#thresholdsconfig) | No | | Thresholds configuration for the panel |
| `unit` | string | No | | Unit a field should use. The unit you select is applied to all fields except time.<br/>You can use the units ID availables in Grafana or a custom unit.<br/>Available units in Grafana: https://github.com/grafana/grafana/blob/main/packages/grafana-data/src/valueFormats/categories.ts<br/>As custom unit, you can use the following formats:<br/>`suffix:<suffix>` for custom unit that should go after value.<br/>`prefix:<prefix>` for custom unit that should go before value.<br/>`time:<format>` For custom date time formats type for example `time:YYYY-MM-DD`.<br/>`si:<base scale><unit characters>` for custom SI units. For example: `si: mF`. This one is a bit more advanced as you can specify both a unit and the source data scale. So if your source data is represented as milli (thousands of) something prefix the unit with that SI scale character.<br/>`count:<unit>` for a custom count unit.<br/>`currency:<unit>` for custom a currency unit. |
| `writeable` | boolean | No | | True if data source can write a value to the path. Auth/authz are supported separately |
### FieldColor
TODO docs
Map a field to a color.
| Property | Type | Required | Default | Description |
|--------------|--------|----------|---------|----------------------------------------------------------|
| `mode` | string | **Yes** | | The main color scheme mode |
| `fixedColor` | string | No | | Stores the fixed color value if mode is fixed |
| `seriesBy` | string | No | | TODO docs<br/>Possible values are: `min`, `max`, `last`. |
| Property | Type | Required | Default | Description |
|--------------|--------|----------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `mode` | string | **Yes** | | Color mode for a field. You can specify a single color, or select a continuous (gradient) color schemes, based on a value.<br/>Continuous color interpolates a color using the percentage of a value relative to min and max.<br/>Accepted values are:<br/>`thresholds`: From thresholds. Informs Grafana to take the color from the matching threshold<br/>`palette-classic`: Classic palette. Grafana will assign color by looking up a color in a palette by series index. Useful for Graphs and pie charts and other categorical data visualizations<br/>`palette-classic-by-name`: Classic palette (by name). Grafana will assign color by looking up a color in a palette by series name. Useful for Graphs and pie charts and other categorical data visualizations<br/>`continuous-GrYlRd`: ontinuous Green-Yellow-Red palette mode<br/>`continuous-RdYlGr`: Continuous Red-Yellow-Green palette mode<br/>`continuous-BlYlRd`: Continuous Blue-Yellow-Red palette mode<br/>`continuous-YlRd`: Continuous Yellow-Red palette mode<br/>`continuous-BlPu`: Continuous Blue-Purple palette mode<br/>`continuous-YlBl`: Continuous Yellow-Blue palette mode<br/>`continuous-blues`: Continuous Blue palette mode<br/>`continuous-reds`: Continuous Red palette mode<br/>`continuous-greens`: Continuous Green palette mode<br/>`continuous-purples`: Continuous Purple palette mode<br/>`shades`: Shades of a single color. Specify a single color, useful in an override rule.<br/>`fixed`: Fixed color mode. Specify a single color, useful in an override rule.<br/>Possible values are: `thresholds`, `palette-classic`, `palette-classic-by-name`, `continuous-GrYlRd`, `continuous-RdYlGr`, `continuous-BlYlRd`, `continuous-YlRd`, `continuous-BlPu`, `continuous-YlBl`, `continuous-blues`, `continuous-reds`, `continuous-greens`, `continuous-purples`, `fixed`, `shades`. |
| `fixedColor` | string | No | | The fixed color value for fixed or shades color modes. |
| `seriesBy` | string | No | | Defines how to assign a series color from "by value" color schemes. For example for an aggregated data points like a timeseries, the color can be assigned by the min, max or last value.<br/>Possible values are: `min`, `max`, `last`. |
### ThresholdsConfig
| 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 |
Thresholds configuration for the panel
| Property | Type | Required | Default | Description |
|----------|---------------------------|----------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `mode` | string | **Yes** | | Thresholds can either be `absolute` (specific number) or `percentage` (relative to min or max, it will be values between 0 and 1).<br/>Possible values are: `absolute`, `percentage`. |
| `steps` | [Threshold](#threshold)[] | **Yes** | | Must be sorted by 'value', first value is always -Infinity |
### Threshold
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** | | 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 |
| 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. |
| `value` | number | **Yes** | | Value represents a specified metric for the threshold, which triggers a visual change in the dashboard when this value is met or exceeded.<br/>Nulls currently appear here when serializing -Infinity to JSON. |
### ValueMapping
@@ -273,52 +289,59 @@ Allow to transform the visual representation of specific data values in a visual
### RangeMap
Maps numeric ranges to a color or different display text
Maps numerical ranges to a display text and color.
For example, if a value is within a certain range, you can configure a range value mapping to display Low or High rather than the number.
| Property | Type | Required | Default | Description |
|-----------|--------------------|----------|---------|-------------|
| `options` | [object](#options) | **Yes** | | |
| `type` | string | **Yes** | | |
| Property | Type | Required | Default | Description |
|-----------|--------------------|----------|---------|-----------------------------------------------------------------------------------|
| `options` | [object](#options) | **Yes** | | Range to match against and the result to apply when the value is within the range |
| `type` | string | **Yes** | | |
### Options
| 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** | | Result used as replacement text and color for RegexMap and SpecialValueMap |
| `to` | number | **Yes** | | |
Range to match against and the result to apply when the value is within the range
| Property | Type | Required | Default | Description |
|----------|-------------------------------------------|----------|---------|-----------------------------------------------------------------------|
| `from` | number | **Yes** | | Min value of the range. It can be null which means -Infinity |
| `result` | [ValueMappingResult](#valuemappingresult) | **Yes** | | Result used as replacement with text and color when the value matches |
| `to` | number | **Yes** | | Max value of the range. It can be null which means +Infinity |
### ValueMappingResult
Result used as replacement text and color for RegexMap and SpecialValueMap
Result used as replacement with text and color when the value matches
| Property | Type | Required | Default | Description |
|----------|---------|----------|---------|-------------|
| `color` | string | No | | |
| `icon` | string | No | | |
| `index` | integer | No | | |
| `text` | string | No | | |
| Property | Type | Required | Default | Description |
|----------|---------|----------|---------|-----------------------------------------------------------------------|
| `color` | string | No | | Text to use when the value matches |
| `icon` | string | No | | Icon to display when the value matches. Only specific visualizations. |
| `index` | integer | No | | Position in the mapping array. Only used internally. |
| `text` | string | No | | Text to display when the value matches |
### RegexMap
Maps regular expressions to replacement text and a color
Maps regular expressions to replacement text and a color.
For example, if a value is www.example.com, you can configure a regex value mapping so that Grafana displays www and truncates the domain.
| Property | Type | Required | Default | Description |
|-----------|--------------------|----------|---------|-------------|
| `options` | [object](#options) | **Yes** | | |
| `type` | string | **Yes** | | |
| Property | Type | Required | Default | Description |
|-----------|--------------------|----------|---------|----------------------------------------------------------------------------------------------|
| `options` | [object](#options) | **Yes** | | Regular expression to match against and the result to apply when the value matches the regex |
| `type` | string | **Yes** | | |
### Options
| Property | Type | Required | Default | Description |
|-----------|-------------------------------------------|----------|---------|----------------------------------------------------------------------------|
| `pattern` | string | **Yes** | | |
| `result` | [ValueMappingResult](#valuemappingresult) | **Yes** | | Result used as replacement text and color for RegexMap and SpecialValueMap |
Regular expression to match against and the result to apply when the value matches the regex
| Property | Type | Required | Default | Description |
|-----------|-------------------------------------------|----------|---------|-----------------------------------------------------------------------|
| `pattern` | string | **Yes** | | Regular expression to match against |
| `result` | [ValueMappingResult](#valuemappingresult) | **Yes** | | Result used as replacement with text and color when the value matches |
### SpecialValueMap
Maps special values like Null, NaN (not a number), and boolean values like true and false to a display text
and color
Maps special values like Null, NaN (not a number), and boolean values like true and false to a display text and color.
See SpecialValueMatch to see the list of special values.
For example, you can configure a special value mapping so that null values appear as N/A.
| Property | Type | Required | Default | Description |
|-----------|--------------------|----------|---------|-------------|
@@ -327,20 +350,20 @@ and color
### Options
| 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 |
| Property | Type | Required | Default | Description |
|----------|-------------------------------------------|----------|---------|--------------------------------------------------------------------------------------------------------------------------------------|
| `match` | string | **Yes** | | Special value types supported by the `SpecialValueMap`<br/>Possible values are: `true`, `false`, `null`, `nan`, `null+nan`, `empty`. |
| `result` | [ValueMappingResult](#valuemappingresult) | **Yes** | | Result used as replacement with text and color when the value matches |
### ValueMap
Maps text values to a color or different display text
Maps text values to a color or different display text and color.
For example, you can configure a value mapping so that all instances of the value 10 appear as Perfection! rather than the number.
| Property | Type | Required | Default | Description |
|-----------|------------------------------------------------------|----------|---------|-------------|
| `options` | map[string][ValueMappingResult](#valuemappingresult) | **Yes** | | |
| `type` | string | **Yes** | | |
| Property | Type | Required | Default | Description |
|-----------|------------------------------------------------------|----------|---------|---------------------------------------------------------------------------------------------------------------|
| `options` | map[string][ValueMappingResult](#valuemappingresult) | **Yes** | | Map with <value_to_match>: ValueMappingResult. For example: { "10": { text: "Perfection!", color: "green" } } |
| `type` | string | **Yes** | | |
### Custom
@@ -352,10 +375,10 @@ in panel plugin schemas.
### Overrides
| Property | Type | Required | Default | Description |
|--------------|---------------------------------------------|----------|---------|-------------|
| `matcher` | [MatcherConfig](#matcherconfig) | **Yes** | | |
| `properties` | [DynamicConfigValue](#dynamicconfigvalue)[] | **Yes** | | |
| Property | Type | Required | Default | Description |
|--------------|---------------------------------------------|----------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `matcher` | [MatcherConfig](#matcherconfig) | **Yes** | | Matcher is a predicate configuration. Based on the config a set of field(s) or values is filtered in order to apply override / transformation.<br/>It comes with in id ( to resolve implementation from registry) and a configuration that’s specific to a particular matcher type. |
| `properties` | [DynamicConfigValue](#dynamicconfigvalue)[] | **Yes** | | |
### DynamicConfigValue
@@ -366,7 +389,8 @@ in panel plugin schemas.
### GraphPanel
Support for legacy graph and heatmap panels.
Support for legacy graph panel.
@deprecated this a deprecated panel type
| Property | Type | Required | Default | Description |
|----------|-------------------|----------|---------|----------------------------------------------------|
@@ -385,110 +409,126 @@ 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 | | Whether the panel is fixed within the grid |
Position and dimensions of a panel in the grid
| Property | Type | Required | Default | Description |
|----------|---------|----------|---------|-------------------------------------------------------------------------------------------------------------------|
| `h` | uint32 | **Yes** | `9` | Panel height. The height is the number of rows from the top edge of the panel. |
| `w` | integer | **Yes** | `12` | Panel width. The width is the number of columns from the left edge of the panel.<br/>Constraint: `>0 & <=24`. |
| `x` | integer | **Yes** | `0` | Panel x. The x coordinate is the number of columns from the left edge of the grid<br/>Constraint: `>=0 & <24`. |
| `y` | uint32 | **Yes** | `0` | Panel y. The y coordinate is the number of rows from the top edge of the grid |
| `static` | boolean | No | | Whether the panel is fixed within the grid. If true, the panel will not be affected by other panels' interactions |
### HeatmapPanel
Support for legacy heatmap panel.
@deprecated this a deprecated panel type
| Property | Type | Required | Default | Description |
|----------|--------|----------|---------|---------------------------------|
| `type` | string | **Yes** | | Possible values are: `heatmap`. |
### LibraryPanelRef
| Property | Type | Required | Default | Description |
|----------|--------|----------|---------|-------------|
| `name` | string | **Yes** | | |
| `uid` | string | **Yes** | | |
A library panel is a reusable panel that you can use in any dashboard.
When you make a change to a library panel, that change propagates to all instances of where the panel is used.
Library panels streamline reuse of panels across multiple dashboards.
| Property | Type | Required | Default | Description |
|----------|--------|----------|---------|--------------------|
| `name` | string | **Yes** | | Library panel name |
| `uid` | string | **Yes** | | Library panel uid |
### Panel
Dashboard panels. Panels are canonically defined inline
because they share a version timeline with the dashboard
schema; they do not evolve independently.
Dashboard panels are the basic visualization building blocks.
| 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** | | |
| `fieldConfig` | [FieldConfigSource](#fieldconfigsource) | **Yes** | | The data model used in Grafana, namely the data frame, is a columnar-oriented table structure that unifies both time series and table query results.<br/>Each column within this structure is called a field. A field can represent a single time series or table column.<br/>Field options allow you to change how the data is displayed in your visualizations. |
| `options` | [object](#options) | **Yes** | | It depends on the panel plugin. They are specified by the Options field in panel plugin schemas. |
| `transformations` | [DataTransformerConfig](#datatransformerconfig)[] | **Yes** | | List of transformations that are applied to the panel data before rendering.<br/>When there are multiple transformations, Grafana applies them in the order they are listed.<br/>Each transformation creates a result set that then passes on to the next transformation in the processing pipeline. |
| `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 |
| `type` | string | **Yes** | | The panel plugin type id. This is used to find the plugin to display the panel.<br/>Constraint: `length >=1`. |
| `datasource` | [DataSourceRef](#datasourceref) | No | | Ref to a DataSource instance |
| `description` | string | No | | Panel description. |
| `gridPos` | [GridPos](#gridpos) | No | | Position and dimensions of a panel in the grid |
| `id` | uint32 | No | | Unique identifier of the panel. Generated by Grafana when creating a new panel. It must be unique within a dashboard, but not globally. |
| `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? |
| `libraryPanel` | [LibraryPanelRef](#librarypanelref) | No | | A library panel is a reusable panel that you can use in any dashboard.<br/>When you make a change to a library panel, that change propagates to all instances of where the panel is used.<br/>Library panels streamline reuse of panels across multiple dashboards. |
| `links` | [DashboardLink](#dashboardlink)[] | No | | Panel links. |
| `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 |
| `pluginVersion` | string | No | | The version of the plugin that is used for this panel. This is used to find the plugin to display the panel and to migrate old panel configs. |
| `repeatDirection` | string | No | `h` | Direction to repeat in if 'repeat' is set.<br/>`h` for horizontal, `v` for vertical.<br/>Possible values are: `h`, `v`. |
| `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? |
| `tags` | string[] | No | | Tags for the panel. |
| `targets` | [Target](#target)[] | No | | Depends on the panel plugin. See the plugin documentation for details. |
| `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
| Property | Type | Required | Default | Description |
|-------------|-----------------------------|----------|---------|-------------|
| `defaults` | [FieldConfig](#fieldconfig) | **Yes** | | |
| `overrides` | [overrides](#overrides)[] | **Yes** | | |
The data model used in Grafana, namely the data frame, is a columnar-oriented table structure that unifies both time series and table query results.
Each column within this structure is called a field. A field can represent a single time series or table column.
Field options allow you to change how the data is displayed in your visualizations.
| Property | Type | Required | Default | Description |
|-------------|-----------------------------|----------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `defaults` | [FieldConfig](#fieldconfig) | **Yes** | | The data model used in Grafana, namely the data frame, is a columnar-oriented table structure that unifies both time series and table query results.<br/>Each column within this structure is called a field. A field can represent a single time series or table column.<br/>Field options allow you to change how the data is displayed in your visualizations. |
| `overrides` | [overrides](#overrides)[] | **Yes** | | Overrides are the options applied to specific fields overriding the defaults. |
### FieldConfig
| Property | Type | Required | Default | Description |
|---------------------|---------------------------------------|----------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `color` | [FieldColor](#fieldcolor) | No | | TODO docs |
| `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. |
| `displayName` | string | No | | The display value for this field. This supports template variables blank is auto |
| `filterable` | boolean | No | | True if data source field supports ad-hoc filters |
| `links` | | No | | The behavior when clicking on a result |
| `mappings` | [ValueMapping](#valuemapping)[] | No | | Convert input values into a display string |
| `max` | number | No | | |
| `min` | number | No | | |
| `noValue` | string | No | | Alternative to empty string |
| `path` | string | No | | An explicit path to the field in the datasource. When the frame meta includes a path,<br/>This will default to `${frame.meta.path}/${field.name}<br/><br/>When defined, this value can be used as an identifier within the datasource scope, and<br/>may be used to update the results |
| `thresholds` | [ThresholdsConfig](#thresholdsconfig) | No | | |
| `unit` | string | No | | Numeric Options |
| `writeable` | boolean | No | | True if data source can write a value to the path. Auth/authz are supported separately |
The data model used in Grafana, namely the data frame, is a columnar-oriented table structure that unifies both time series and table query results.
Each column within this structure is called a field. A field can represent a single time series or table column.
Field options allow you to change how the data is displayed in your visualizations.
| Property | Type | Required | Default | Description |
|---------------------|---------------------------------------|----------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `color` | [FieldColor](#fieldcolor) | No | | Map a field to a color. |
| `custom` | [custom](#custom) | No | | custom is specified by the FieldConfig field<br/>in panel plugin schemas. |
| `decimals` | number | No | | Specify the number of decimals Grafana includes in the rendered value.<br/>If you leave this field blank, Grafana automatically truncates the number of decimals based on the value.<br/>For example 1.1234 will display as 1.12 and 100.456 will display as 100.<br/>To display all decimals, set the unit to `String`. |
| `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. |
| `displayName` | string | No | | The display value for this field. This supports template variables blank is auto |
| `filterable` | boolean | No | | True if data source field supports ad-hoc filters |
| `links` | | No | | The behavior when clicking on a result |
| `mappings` | [ValueMapping](#valuemapping)[] | No | | Convert input values into a display string |
| `max` | number | No | | The maximum value used in percentage threshold calculations. Leave blank for auto calculation based on all series and fields. |
| `min` | number | No | | The minimum value used in percentage threshold calculations. Leave blank for auto calculation based on all series and fields. |
| `noValue` | string | No | | Alternative to empty string |
| `path` | string | No | | An explicit path to the field in the datasource. When the frame meta includes a path,<br/>This will default to `${frame.meta.path}/${field.name}<br/><br/>When defined, this value can be used as an identifier within the datasource scope, and<br/>may be used to update the results |
| `thresholds` | [ThresholdsConfig](#thresholdsconfig) | No | | Thresholds configuration for the panel |
| `unit` | string | No | | Unit a field should use. The unit you select is applied to all fields except time.<br/>You can use the units ID availables in Grafana or a custom unit.<br/>Available units in Grafana: https://github.com/grafana/grafana/blob/main/packages/grafana-data/src/valueFormats/categories.ts<br/>As custom unit, you can use the following formats:<br/>`suffix:<suffix>` for custom unit that should go after value.<br/>`prefix:<prefix>` for custom unit that should go before value.<br/>`time:<format>` For custom date time formats type for example `time:YYYY-MM-DD`.<br/>`si:<base scale><unit characters>` for custom SI units. For example: `si: mF`. This one is a bit more advanced as you can specify both a unit and the source data scale. So if your source data is represented as milli (thousands of) something prefix the unit with that SI scale character.<br/>`count:<unit>` for a custom count unit.<br/>`currency:<unit>` for custom a currency unit. |
| `writeable` | boolean | No | | True if data source can write a value to the path. Auth/authz are supported separately |
### RangeMap
Maps numeric ranges to a color or different display text
Maps numerical ranges to a display text and color.
For example, if a value is within a certain range, you can configure a range value mapping to display Low or High rather than the number.
| Property | Type | Required | Default | Description |
|-----------|---------------------|----------|---------|-------------|
| `options` | [options](#options) | **Yes** | | |
| `type` | string | **Yes** | | |
| Property | Type | Required | Default | Description |
|-----------|---------------------|----------|---------|-----------------------------------------------------------------------------------|
| `options` | [options](#options) | **Yes** | | Range to match against and the result to apply when the value is within the range |
| `type` | string | **Yes** | | |
### RegexMap
Maps regular expressions to replacement text and a color
Maps regular expressions to replacement text and a color.
For example, if a value is www.example.com, you can configure a regex value mapping so that Grafana displays www and truncates the domain.
| Property | Type | Required | Default | Description |
|-----------|---------------------|----------|---------|-------------|
| `options` | [options](#options) | **Yes** | | |
| `type` | string | **Yes** | | |
| Property | Type | Required | Default | Description |
|-----------|---------------------|----------|---------|----------------------------------------------------------------------------------------------|
| `options` | [options](#options) | **Yes** | | Regular expression to match against and the result to apply when the value matches the regex |
| `type` | string | **Yes** | | |
### SpecialValueMap
Maps special values like Null, NaN (not a number), and boolean values like true and false to a display text
and color
Maps special values like Null, NaN (not a number), and boolean values like true and false to a display text and color.
See SpecialValueMatch to see the list of special values.
For example, you can configure a special value mapping so that null values appear as N/A.
| Property | Type | Required | Default | Description |
|-----------|---------------------|----------|---------|-------------|
@@ -508,19 +548,9 @@ type directly to achieve the same effect.
| Property | Type | Required | Default | Description |
|----------|------|----------|---------|-------------|
### Datasource
The datasource used in all targets.
| Property | Type | Required | Default | Description |
|----------|--------|----------|---------|-------------|
| `type` | string | No | | |
| `uid` | string | No | | |
### Options
options is specified by the Options field in panel
plugin schemas.
It depends on the panel plugin. They are specified by the Options field in panel plugin schemas.
| Property | Type | Required | Default | Description |
|----------|------|----------|---------|-------------|
@@ -529,25 +559,16 @@ plugin schemas.
Row panel
| Property | Type | Required | Default | Description |
|--------------|-----------------------|----------|---------|------------------------------------------|
| `collapsed` | boolean | **Yes** | `false` | |
| `id` | uint32 | **Yes** | | |
| `panels` | [panels](#panels)[] | **Yes** | | |
| `type` | string | **Yes** | | Possible values are: `row`. |
| `datasource` | [object](#datasource) | No | | Name of default datasource. |
| `gridPos` | [GridPos](#gridpos) | No | | |
| `repeat` | string | No | | Name of template variable to repeat for. |
| `title` | string | No | | |
### Datasource
Name of default datasource.
| Property | Type | Required | Default | Description |
|----------|--------|----------|---------|-------------|
| `type` | string | No | | |
| `uid` | string | No | | |
| Property | Type | Required | Default | Description |
|--------------|---------------------------------|----------|---------|-----------------------------------------------------------------------------------------------------------------------------------------|
| `collapsed` | boolean | **Yes** | `false` | Whether this row should be collapsed or not. |
| `id` | uint32 | **Yes** | | Unique identifier of the panel. Generated by Grafana when creating a new panel. It must be unique within a dashboard, but not globally. |
| `panels` | [panels](#panels)[] | **Yes** | | List of panels in the row |
| `type` | string | **Yes** | | The panel type<br/>Possible values are: `row`. |
| `datasource` | [DataSourceRef](#datasourceref) | No | | Ref to a DataSource instance |
| `gridPos` | [GridPos](#gridpos) | No | | Position and dimensions of a panel in the grid |
| `repeat` | string | No | | Name of template variable to repeat for. |
| `title` | string | No | | Row title |
### Panels
@@ -557,7 +578,8 @@ Name of default datasource.
### GraphPanel
Support for legacy graph and heatmap panels.
Support for legacy graph panel.
@deprecated this a deprecated panel type
| Property | Type | Required | Default | Description |
|----------|-------------------|----------|---------|----------------------------------------------------|
@@ -566,73 +588,71 @@ Support for legacy graph and heatmap panels.
### Panel
Dashboard panels. Panels are canonically defined inline
because they share a version timeline with the dashboard
schema; they do not evolve independently.
Dashboard panels are the basic visualization building blocks.
| 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** | | |
| `fieldConfig` | [FieldConfigSource](#fieldconfigsource) | **Yes** | | The data model used in Grafana, namely the data frame, is a columnar-oriented table structure that unifies both time series and table query results.<br/>Each column within this structure is called a field. A field can represent a single time series or table column.<br/>Field options allow you to change how the data is displayed in your visualizations. |
| `options` | [options](#options) | **Yes** | | It depends on the panel plugin. They are specified by the Options field in panel plugin schemas. |
| `transformations` | [DataTransformerConfig](#datatransformerconfig)[] | **Yes** | | List of transformations that are applied to the panel data before rendering.<br/>When there are multiple transformations, Grafana applies them in the order they are listed.<br/>Each transformation creates a result set that then passes on to the next transformation in the processing pipeline. |
| `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 |
| `type` | string | **Yes** | | The panel plugin type id. This is used to find the plugin to display the panel.<br/>Constraint: `length >=1`. |
| `datasource` | [DataSourceRef](#datasourceref) | No | | Ref to a DataSource instance |
| `description` | string | No | | Panel description. |
| `gridPos` | [GridPos](#gridpos) | No | | Position and dimensions of a panel in the grid |
| `id` | uint32 | No | | Unique identifier of the panel. Generated by Grafana when creating a new panel. It must be unique within a dashboard, but not globally. |
| `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? |
| `libraryPanel` | [LibraryPanelRef](#librarypanelref) | No | | A library panel is a reusable panel that you can use in any dashboard.<br/>When you make a change to a library panel, that change propagates to all instances of where the panel is used.<br/>Library panels streamline reuse of panels across multiple dashboards. |
| `links` | [DashboardLink](#dashboardlink)[] | No | | Panel links. |
| `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 |
| `pluginVersion` | string | No | | The version of the plugin that is used for this panel. This is used to find the plugin to display the panel and to migrate old panel configs. |
| `repeatDirection` | string | No | `h` | Direction to repeat in if 'repeat' is set.<br/>`h` for horizontal, `v` for vertical.<br/>Possible values are: `h`, `v`. |
| `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? |
| `tags` | string[] | No | | Tags for the panel. |
| `targets` | [Target](#target)[] | No | | Depends on the panel plugin. See the plugin documentation for details. |
| `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
Contains the list of configured template variables with their saved values along with some other metadata
Configured template variables
| Property | Type | Required | Default | Description |
|----------|-----------------------------------|----------|---------|-------------|
| `list` | [VariableModel](#variablemodel)[] | No | | |
| Property | Type | Required | Default | Description |
|----------|-----------------------------------|----------|---------|----------------------------------------------------------------------------------------------|
| `list` | [VariableModel](#variablemodel)[] | No | | List of configured template variables with their saved values along with some other metadata |
### VariableModel
FROM: packages/grafana-data/src/types/templateVars.ts
TODO docs
TODO what about what's in public/app/features/types.ts?
TODO there appear to be a lot of different kinds of [template] vars here? if so need a disjunction
A variable is a placeholder for a value. You can use variables in metric queries and in panel titles.
| Property | Type | Required | Default | Description |
|----------------|---------------------------------|----------|----------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `global` | boolean | **Yes** | `false` | |
| `hide` | integer | **Yes** | | Possible values are: `0`, `1`, `2`. |
| `id` | string | **Yes** | `00000000-0000-0000-0000-000000000000` | |
| `index` | int32 | **Yes** | `-1` | |
| `name` | string | **Yes** | | |
| `skipUrlSync` | boolean | **Yes** | `false` | |
| `state` | string | **Yes** | | Possible values are: `NotStarted`, `Loading`, `Streaming`, `Done`, `Error`. |
| `type` | string | **Yes** | | FROM: packages/grafana-data/src/types/templateVars.ts<br/>TODO docs<br/>TODO this implies some wider pattern/discriminated union, probably?<br/>Possible values are: `query`, `adhoc`, `constant`, `datasource`, `interval`, `textbox`, `custom`, `system`. |
| `datasource` | [DataSourceRef](#datasourceref) | No | | Ref to a DataSource instance |
| `description` | string | No | | |
| `error` | [object](#error) | No | | |
| `label` | string | No | | |
| `query` | | No | | TODO: Move this into a separated QueryVariableModel type |
| `rootStateKey` | string | No | | |
| Property | Type | Required | Default | Description |
|---------------|-------------------------------------|----------|----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `hide` | integer | **Yes** | | Determine if the variable shows on dashboard<br/>Accepted values are 0 (show label and value), 1 (show value only), 2 (show nothing).<br/>Possible values are: `0`, `1`, `2`. |
| `id` | string | **Yes** | `00000000-0000-0000-0000-000000000000` | Unique numeric identifier for the variable. |
| `name` | string | **Yes** | | Name of variable |
| `skipUrlSync` | boolean | **Yes** | `false` | Whether the variable value should be managed by URL query params or not |
| `type` | string | **Yes** | | Dashboard variable type<br/>`query`: Query-generated list of values such as metric names, server names, sensor IDs, data centers, and so on.<br/>`adhoc`: Key/value filters that are automatically added to all metric queries for a data source (Prometheus, Loki, InfluxDB, and Elasticsearch only).<br/>`constant`: Define a hidden constant.<br/>`datasource`: Quickly change the data source for an entire dashboard.<br/>`interval`: Interval variables represent time spans.<br/>`textbox`: Display a free text input field with an optional default value.<br/>`custom`: Define the variable options manually using a comma-separated list.<br/>`system`: Variables defined by Grafana. See: https://grafana.com/docs/grafana/latest/dashboards/variables/add-template-variables/#global-variables<br/>Possible values are: `query`, `adhoc`, `constant`, `datasource`, `interval`, `textbox`, `custom`, `system`. |
| `allFormat` | string | No | | Format to use while fetching all values from data source, eg: wildcard, glob, regex, pipe, etc. |
| `current` | [VariableOption](#variableoption) | No | | Option to be selected in a variable. |
| `datasource` | [DataSourceRef](#datasourceref) | No | | Ref to a DataSource instance |
| `description` | string | No | | Description of variable. It can be defined but `null`. |
| `label` | string | No | | Optional display name |
| `multi` | boolean | No | `false` | Whether multiple values can be selected or not from variable value list |
| `options` | [VariableOption](#variableoption)[] | No | | Options that can be selected for a variable. |
| `query` | | No | | Query used to fetch values for a variable |
| `refresh` | integer | No | | Options to config when to refresh a variable<br/>`0`: Never refresh the variable<br/>`1`: Queries the data source every time the dashboard loads.<br/>`2`: Queries the data source when the dashboard time range changes.<br/>Possible values are: `0`, `1`, `2`. |
### Error
### VariableOption
| Property | Type | Required | Default | Description |
|----------|------|----------|---------|-------------|
Option to be selected in a variable.
| Property | Type | Required | Default | Description |
|------------|---------|----------|---------|---------------------------------------|
| `text` | | **Yes** | | Text to be displayed for the option |
| `value` | | **Yes** | | Value of the option |
| `selected` | boolean | No | | Whether the option is selected or not |
### Time