docs: refactors field value overrides topics (#53849)

* refactors field value overrides topics

* Update docs/sources/panels/configure-overrides/index.md

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>

* Update docs/sources/panels/configure-overrides/index.md

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>

* Update docs/sources/panels/configure-overrides/index.md

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>

* Update docs/sources/panels/configure-overrides/index.md

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>

* Update docs/sources/panels/configure-overrides/index.md

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>

* Update docs/sources/panels/configure-overrides/index.md

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>

* Update docs/sources/panels/configure-overrides/index.md

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>

* makes prettier

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
This commit is contained in:
Christopher Moyer 2022-08-22 15:37:29 -05:00 committed by GitHub
parent dcdf232882
commit 657e1683d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 125 additions and 167 deletions

View File

@ -104,7 +104,7 @@ Dashboards and panels allow you to show your data in visual form. Each panel nee
- [Format data using value mapping]({{< relref "../../panels/format-data/about-value-mapping/" >}})
- [Visualization-specific options]({{< relref "../../visualizations/" >}})
- [Override field values]({{< relref "../../panels/override-field-values/about-field-overrides/" >}})
- [Override field values]({{< relref "../../panels/configure-overrides/" >}})
- [Configure thresholds]({{< relref "../../panels/configure-thresholds/" >}})
- [Configure standard options]({{< relref "../../panels/configure-standard-options/" >}})

View File

@ -0,0 +1,118 @@
---
aliases:
- /docs/grafana/latest/panels/field-overrides/
- /docs/grafana/latest/panels/override-field-values/
- /docs/grafana/latest/panels/override-field-values/about-field-overrides/
- /docs/grafana/latest/panels/override-field-values/add-a-field-override/
- /docs/grafana/latest/panels/override-field-values/delete-a-field-override/
- /docs/grafana/latest/panels/override-field-values/edit-field-override/
- /docs/grafana/latest/panels/override-field-values/view-field-override/
title: Configure field overrides
menuTitle: Configure field overrides
weight: 400
---
# Configure field overrides
Overrides allow you to customize visualization settings for specific fields or series. This is accomplished by adding an override rule that targets a particular set of fields and that can each define multiple options.
For example, you set the unit for all fields that include the text 'bytes' by adding an override using the `Fields with name matching regex` matcher and then add the Unit option to the override rule.
## Example 1: Format temperature
Lets assume that our result set is a data frame that consists of two fields: time and temperature.
| time | temperature |
| :-----------------: | :---------: |
| 2020-01-02 03:04:00 | 45.0 |
| 2020-01-02 03:05:00 | 47.0 |
| 2020-01-02 03:06:00 | 48.0 |
Each field (column) of this structure can have field options applied that alter the way its values are displayed. This means that you can, for example, set the Unit to Temperature > Celsius, resulting in the following table:
| time | temperature |
| :-----------------: | :---------: |
| 2020-01-02 03:04:00 | 45.0 °C |
| 2020-01-02 03:05:00 | 47.0 °C |
| 2020-01-02 03:06:00 | 48.0 °C |
In addition, the decimal place is not required, so we can remove it. You can change the Decimals from `auto` to zero (`0`), resulting in the following table:
| time | temperature |
| :-----------------: | :---------: |
| 2020-01-02 03:04:00 | 45 °C |
| 2020-01-02 03:05:00 | 47 °C |
| 2020-01-02 03:06:00 | 48 °C |
## Example 2: Format temperature and humidity
Lets assume that our result set is a data frame that consists of four fields: time, high temp, low temp, and humidity.
| time | high temp | low temp | humidity |
| ------------------- | --------- | -------- | -------- |
| 2020-01-02 03:04:00 | 45.0 | 30.0 | 67 |
| 2020-01-02 03:05:00 | 47.0 | 34.0 | 68 |
| 2020-01-02 03:06:00 | 48.0 | 31.0 | 68 |
Let's add the Celsius unit and get rid of the decimal place. This results in the following table:
| time | high temp | low temp | humidity |
| ------------------- | --------- | -------- | -------- |
| 2020-01-02 03:04:00 | 45 °C | 30 °C | 67 °C |
| 2020-01-02 03:05:00 | 47 °C | 34 °C | 68 °C |
| 2020-01-02 03:06:00 | 48 °C | 31 °C | 68 °C |
The temperature fields look good, but the humidity must now be changed. We can fix this by applying a field option override to the humidity field and change the unit to Misc > percent (0-100).
| time | high temp | low temp | humidity |
| ------------------- | --------- | -------- | -------- |
| 2020-01-02 03:04:00 | 45 °C | 30 °C | 67% |
| 2020-01-02 03:05:00 | 47 °C | 34 °C | 68% |
| 2020-01-02 03:06:00 | 48 °C | 31 °C | 68% |
## Add a field override
A field override rule can customize the visualization settings for a specific field or series.
1. Edit the panel to which you want to add an override.
1. In the panel options side pane, click **Add field override** at the bottom of the pane.
1. Select which fields an override rule will be applied to:
- **Fields with name:** Select a field from the list of all available fields. Properties you add to a rule with this selector are only applied to this single field.
- **Fields with name matching regex:** Specify fields to override with a regular expression. Properties you add to a rule with this selector are applied to all fields where the field name match the regex.
- **Fields with type:** Select fields by type, such as string, numeric, and so on. Properties you add to a rule with this selector are applied to all fields that match the selected type.
- **Fields returned by query:** Select all fields returned by a specific query, such as A, B, or C. Properties you add to a rule with this selector are applied to all fields returned by the selected query.
1. Click **Add override property**.
1. Select the field option that you want to apply.
1. Enter options by adding values in the fields. To return options to default values, delete the white text in the fields.
1. Continue to add overrides to this field by clicking **Add override property**, or you can click **Add override** and select a different field to add overrides to.
1. When finished, click **Save** to save all panel edits to the dashboard.
## Delete a field override
Delete a field override when you no longer need it. When you delete an override, the appearance of value defaults to its original format. This change impacts dashboards and dashboard users that rely on an affected panel.
1. Edit the panel that contains the override you want to delete.
1. In panel options side pane, scroll down until you see the overrides.
1. Click the override you want to delete and then click the associated trash icon.
## View field overrides
You can view field overrides in the panel display options.
1. Edit the panel that contains the overrides you want to view.
1. In panel options side pane, scroll down until you see the overrides.
> The override settings that appear on the **All** tab are the same as the settings that appear on the **Overrides** tab.
## Edit a field override
Edit a field override when you want to make changes to an override setting. The change you make takes effect immediately.
1. Edit the panel that contains the overrides you want to edit.
1. In panel options side pane, scroll down until you see the overrides.
1. Locate the override that you want to change.
1. Perform any of the following:
- Edit settings on existing overrides or field selection parameters.
- Delete existing override properties by clicking the **X** next to the property.
- Add an override properties by clicking **Add override property**.

View File

@ -1,14 +0,0 @@
---
aliases:
- /docs/grafana/latest/panels/field-overrides/
- /docs/grafana/latest/panels/override-field-values/
- /docs/sources/panels/override-field-values/
title: Override field values
weight: 400
---
# Override field values
Apply field overrides when you want to format field values that appear in a visualization.
{{< section >}}

View File

@ -1,65 +0,0 @@
---
aliases:
- /docs/grafana/latest/panels/override-field-values/about-field-overrides/
- /docs/sources/panels/override-field-values/about-field-overrides/
title: About field overrides
weight: 10
---
# About field overrides
Overrides allow you to change the settings for one or more fields. Field options for overrides are the same as the field options available in a particular visualization. The only difference is that you choose which fields to apply them to.
For example, you could change the number of decimal places shown in all numeric fields or columns by changing the **Decimals** option for **Fields with type** that matches **Numeric**.
## Example 1: Format temperature
Lets assume that our result set is a data frame that consists of two fields: time and temperature.
| time | temperature |
| :-----------------: | :---------: |
| 2020-01-02 03:04:00 | 45.0 |
| 2020-01-02 03:05:00 | 47.0 |
| 2020-01-02 03:06:00 | 48.0 |
Each field (column) of this structure can have field options applied that alter the way its values are displayed. This means that you can, for example, set the Unit to Temperature > Celsius, resulting in the following table:
| time | temperature |
| :-----------------: | :---------: |
| 2020-01-02 03:04:00 | 45.0 °C |
| 2020-01-02 03:05:00 | 47.0 °C |
| 2020-01-02 03:06:00 | 48.0 °C |
In addition, the decimal place is not required, so we can remove it. You can change the Decimals from `auto` to zero (`0`), resulting in the following table:
| time | temperature |
| :-----------------: | :---------: |
| 2020-01-02 03:04:00 | 45 °C |
| 2020-01-02 03:05:00 | 47 °C |
| 2020-01-02 03:06:00 | 48 °C |
## Example 2: Format temperature and humidity
Lets assume that our result set is a data frame that consists of four fields: time, high temp, low temp, and humidity.
| time | high temp | low temp | humidity |
| ------------------- | --------- | -------- | -------- |
| 2020-01-02 03:04:00 | 45.0 | 30.0 | 67 |
| 2020-01-02 03:05:00 | 47.0 | 34.0 | 68 |
| 2020-01-02 03:06:00 | 48.0 | 31.0 | 68 |
Let's add the Celsius unit and get rid of the decimal place. This results in the following table:
| time | high temp | low temp | humidity |
| ------------------- | --------- | -------- | -------- |
| 2020-01-02 03:04:00 | 45 °C | 30 °C | 67 °C |
| 2020-01-02 03:05:00 | 47 °C | 34 °C | 68 °C |
| 2020-01-02 03:06:00 | 48 °C | 31 °C | 68 °C |
The temperature fields look good, but the humidity must now be changed. We can fix this by applying a field option override to the humidity field and change the unit to Misc > percent (0-100).
| time | high temp | low temp | humidity |
| ------------------- | --------- | -------- | -------- |
| 2020-01-02 03:04:00 | 45 °C | 30 °C | 67% |
| 2020-01-02 03:05:00 | 47 °C | 34 °C | 68% |
| 2020-01-02 03:06:00 | 48 °C | 31 °C | 68% |

View File

@ -1,25 +0,0 @@
---
aliases:
- /docs/grafana/latest/panels/override-field-values/add-a-field-override/
- /docs/sources/panels/override-field-values/add-a-field-override/
title: Add a field override
weight: 30
---
# Add a field override
You can override a field when you want to change the display of the value in the visualization.
1. Edit the panel to which you want to add an override.
1. In the panel display options, in the **Overrides** section, click **Add field override**.
1. Select which fields an override rule will be applied to:
- **Fields with name -** Select a field from the list of all available fields. Properties you add to a rule with this selector are only applied to this single field.
- **Fields with name matching regex -** Specify fields to override with a regular expression. Properties you add to a rule with this selector are applied to all fields where the field name match the regex.
- **Fields with type -** Select fields by type, such as string, numeric, and so on. Properties you add to a rule with this selector are applied to all fields that match the selected type.
- **Fields returned by query -** Select all fields returned by a specific query, such as A, B, or C. Properties you add to a rule with this selector are applied to all fields returned by the selected query.
1. Click **Add override property**.
1. Select the field option that you want to apply.
1. Enter options by adding values in the fields. To return options to default values, delete the white text in the fields.
1. Continue to add overrides to this field by clicking **Add override property**, or you can click **Add override** and select a different field to add overrides to.
1. When finished, click **Save** to save all panel edits to the dashboard.

View File

@ -1,17 +0,0 @@
---
aliases:
- /docs/grafana/latest/panels/override-field-values/delete-a-field-override/
- /docs/sources/panels/override-field-values/delete-a-field-override/
title: Delete a field override
weight: 50
---
# Delete a field override
Delete a field override when you no longer need it.
When you delete an override, the appearance of value defaults to its original format. This change impacts dashboards and dashboard users that rely on an affected panel.
1. Edit the panel that contains the override you want to delete.
1. In panel display options, click the **Overrides** tab.
1. Click the override you want to delete and then click the associated trash icon.

View File

@ -1,21 +0,0 @@
---
aliases:
- /docs/grafana/latest/panels/override-field-values/edit-field-override/
- /docs/sources/panels/override-field-values/edit-field-override/
title: Edit a field overrides
weight: 40
---
# Edit a field override
Edit a field override when you want to make changes to an override setting.
**To edit a field override**:
1. Edit the panel that contains the overrides you want to edit.
1. In the panel display options, click the **Overrides** tab.
1. Locate the override that you want to change.
1. Perform any of the following:
- Edit settings on existing overrides or field selection parameters.
- Delete existing override properties by clicking the **X** next to the property.
- Add an override properties by clicking **Add override property**.

View File

@ -1,18 +0,0 @@
---
aliases:
- /docs/grafana/latest/panels/override-field-values/view-field-override/
- /docs/sources/panels/override-field-values/view-field-override/
title: View field overrides
weight: 20
---
# View field overrides
You can view field overrides in the panel display options.
**To view field overrides**:
1. Open for edit the panel that contains the overrides you want to view.
1. In the panel display options, click the **Overrides** tab.
> The override settings that appear on the **All** tab are the same as the settings that appear on the **Overrides** tab.

View File

@ -139,7 +139,7 @@ Display all Y-axes on the right side.
Hide all axes.
To selectively hide axes, [add an override]({{< relref "../panels/override-field-values/add-a-field-override/" >}}) targeting specific fields.
To selectively hide axes, [Add a field override]({{< relref "../panels/configure-overrides#add-a-field-override" >}}) that targets specific fields.
### Label

View File

@ -25,8 +25,8 @@ The graph panel can render metrics as a line, a path of dots, or a series of bar
Graph visualizations allow you to apply:
- [Alerts]({{< relref "../alerting/" >}}) - This is the only type of visualization that allows you to set alerts.
- [Transform data]({{< relref "../panels/transform-data/#add-a-transformation-function-to-data" >}})
- [Add a field override]({{< relref "../panels/override-field-values/add-a-field-override/" >}})
- [Transform data]({{< relref "../panels/transform-data/add-transformation-to-data/" >}})
- [Add a field override]({{< relref "../panels/configure-overrides#add-a-field-override" >}})
- [Configure thresholds]({{< relref "../panels/configure-thresholds/" >}})
## Display options

View File

@ -151,7 +151,7 @@ _Stacking_ allows Grafana to display series on top of each other. Be cautious wh
#### Stack series in groups
The stacking group option is only available as an override. For more information about creating an override, refer to [About field overrides]({{< relref "../../panels/override-field-values/about-field-overrides/" >}}).
The stacking group option is only available as an override. For more information about creating an override, refer to [Configure field overrides]({{< relref "../../panels/configure-overrides" >}}).
1. Edit the panel and click **Overrides**.
1. Create a field override for the **Stack series** option.
@ -186,7 +186,7 @@ Select the placement of the Y-axis.
- **Right:** Display all Y-axes on the right side.
- **Hidden:** Hide all axes.
To selectively hide axes, [add an override]({{< relref "../../panels/override-field-values/add-a-field-override/" >}}) that targets specific fields.
To selectively hide axes, [Add a field override]({{< relref "../../panels/configure-overrides#add-a-field-override" >}}) that targets specific fields.
### Label

View File

@ -95,7 +95,7 @@ Up until now the overrides were available only for Graph and Table panel(via Col
This feature enables even more powerful visualizations and fine grained control over how the data is displayed.
Learn more about this feature in [Field overrides]({{< relref "../panels/override-field-values/about-field-overrides/" >}}).
Learn more about this feature in [Field overrides]({{< relref "../panels/configure-overrides/" >}}).
## Inspect panels and export data to CSV