[DOC] Update Tempo and Pyroscope data source doc (#91704)
Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>
This commit is contained in:
co-authored by
Isabel Matwawana
parent
d779dfb0a2
commit
b03a709500
@@ -15,31 +15,34 @@ weight: 600
|
||||
|
||||
# Provision Grafana
|
||||
|
||||
In previous versions of Grafana, you could only use the API for provisioning data sources and dashboards. But that required the service to be running before you started creating dashboards and you also needed to set up credentials for the HTTP API. In v5.0 we decided to improve this experience by adding a new active provisioning system that uses config files. This will make GitOps more natural as data sources and dashboards can be defined via files that can be version controlled. We hope to extend this system to later add support for users and orgs as well.
|
||||
Grafana has an active provisioning system that uses configuration files.
|
||||
This makes GitOps more natural since data sources and dashboards can be defined using files that can be version controlled.
|
||||
|
||||
## Config File
|
||||
## Configuration file
|
||||
|
||||
See [Configuration]({{< relref "../../setup-grafana/configure-grafana/" >}}) for more information on what you can configure in `grafana.ini`.
|
||||
Refer to [Configuration]({{< relref "../../setup-grafana/configure-grafana/" >}}) for more information on what you can configure in `grafana.ini`.
|
||||
|
||||
### Config File Locations
|
||||
### Configuration file locations
|
||||
|
||||
- Default configuration from `$WORKING_DIR/conf/defaults.ini`
|
||||
- Custom configuration from `$WORKING_DIR/conf/custom.ini`
|
||||
- The custom configuration file path can be overridden using the `--config` parameter
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
{{< admonition type="note" >}}
|
||||
If you have installed Grafana using the `deb` or `rpm`
|
||||
packages, then your configuration file is located at
|
||||
`/etc/grafana/grafana.ini`. This path is specified in the Grafana
|
||||
init.d script using `--config` file parameter.
|
||||
{{% /admonition %}}
|
||||
`init.d` script using the `--config` file parameter.
|
||||
{{< /admonition >}}
|
||||
|
||||
### Using Environment Variables
|
||||
### Environment variables
|
||||
|
||||
It is possible to use environment variable interpolation in all 3 provisioning configuration types. Allowed syntax
|
||||
is either `$ENV_VAR_NAME` or `${ENV_VAR_NAME}` and can be used only for values not for keys or bigger parts
|
||||
of the configurations. It is not available in the dashboard's definition files just the dashboard provisioning
|
||||
You can use environment variable interpolation in all three provisioning configuration types.
|
||||
The allowed syntax is either `$ENV_VAR_NAME` or `${ENV_VAR_NAME}`, and it can be used only for values, not for keys or larger parts
|
||||
of the configurations.
|
||||
It's not available in the dashboard's definition files, just the dashboard provisioning
|
||||
configuration.
|
||||
|
||||
Example:
|
||||
|
||||
```yaml
|
||||
@@ -51,13 +54,13 @@ datasources:
|
||||
password: $PASSWORD
|
||||
```
|
||||
|
||||
If you have a literal `$` in your value and want to avoid interpolation, `$$` can be used.
|
||||
You can use `$$` if you have a literal `$` in your value and want to avoid interpolation.
|
||||
|
||||
<hr />
|
||||
## Configuration management tools
|
||||
|
||||
## Configuration Management Tools
|
||||
|
||||
Currently we do not provide any scripts/manifests for configuring Grafana. Rather than spending time learning and creating scripts/manifests for each tool, we think our time is better spent making Grafana easier to provision. Therefore, we heavily rely on the expertise of the community.
|
||||
Currently, we don't provide any scripts or manifests for configuring Grafana.
|
||||
Rather than spending time learning and creating scripts or manifests for each tool, we think our time is better spent making Grafana easier to provision.
|
||||
Therefore, we heavily rely on the expertise of the community.
|
||||
|
||||
| Tool | Project |
|
||||
| --------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
||||
@@ -70,12 +73,8 @@ Currently we do not provide any scripts/manifests for configuring Grafana. Rathe
|
||||
|
||||
## Data sources
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Available in Grafana v5.0 and higher.
|
||||
{{% /admonition %}}
|
||||
|
||||
You can manage data sources in Grafana by adding YAML configuration files in the [`provisioning/datasources`]({{< relref "../../setup-grafana/configure-grafana#provisioning" >}}) directory.
|
||||
Each config file can contain a list of `datasources` to add or update during startup.
|
||||
You can manage data sources in Grafana by adding YAML configuration files in the [`provisioning/data sources`]({{< relref "../../setup-grafana/configure-grafana#provisioning" >}}) directory.
|
||||
Each configuration file can contain a list of `datasources` to add or update during startup.
|
||||
If the data source already exists, Grafana reconfigures it to match the provisioned configuration file.
|
||||
|
||||
The configuration file can also list data sources to automatically delete, called `deleteDatasources`.
|
||||
@@ -85,17 +84,17 @@ You can configure Grafana to automatically delete provisioned data sources when
|
||||
To do so, add `prune: true` to the root of your provisioning file.
|
||||
With this configuration, Grafana also removes the provisioned data sources if you remove the provisioning file entirely.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
{{< admonition type="note" >}}
|
||||
The `prune` parameter is available in Grafana v11.1 and higher.
|
||||
{{% /admonition %}}
|
||||
{{< /admonition >}}
|
||||
|
||||
### Running multiple Grafana instances
|
||||
|
||||
If you run multiple instances of Grafana, add a version number to each data source in the configuration and increase it when you update the configuration.
|
||||
Grafana updates only data sources with the same or lower version number than specified in the config.
|
||||
Grafana updates only data sources with the same or lower version number than specified in the configuration.
|
||||
This prevents old configurations from overwriting newer ones if you have different versions of the `datasource.yaml` file that don't define version numbers, and then restart instances at the same time.
|
||||
|
||||
### Example data source config file
|
||||
### Example data source configuration file
|
||||
|
||||
This example provisions a [Graphite data source]({{< relref "../../datasources/graphite" >}}):
|
||||
|
||||
@@ -179,16 +178,16 @@ datasources:
|
||||
|
||||
For provisioning examples of specific data sources, refer to that [data source's documentation]({{< relref "../../datasources" >}}).
|
||||
|
||||
#### JSON Data
|
||||
#### JSON data
|
||||
|
||||
Since not all data sources have the same configuration settings, we include only the most common ones as fields.
|
||||
Not all data sources have the same configuration settings. Only the most common fields are included in examples.
|
||||
To provision the rest of a data source's settings, include them as a JSON blob in the `jsonData` field.
|
||||
|
||||
Common settings in the [built-in core data sources]({{< relref "../../datasources#built-in-core-data-sources" >}}) include:
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
{{< admonition type="note" >}}
|
||||
Data sources tagged with _HTTP\*_ communicate using the HTTP protocol, which includes all core data source plugins except MySQL, PostgreSQL, and MSSQL.
|
||||
{{% /admonition %}}
|
||||
{{< /admonition >}}
|
||||
|
||||
| Name | Type | Data source | Description |
|
||||
| ----------------------------- | ------- | ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
@@ -249,11 +248,14 @@ For examples of specific data sources' JSON data, refer to that [data source's d
|
||||
|
||||
#### Secure JSON Data
|
||||
|
||||
Secure JSON data is a map of settings that will be encrypted with [secret key]({{< relref "../../setup-grafana/configure-grafana#secret_key" >}}) from the Grafana config. The purpose of this is only to hide content from the users of the application. This should be used for storing TLS Cert and password that Grafana will append to the request on the server side. All of these settings are optional.
|
||||
Secure JSON data is a map of settings that are encrypted with a [secret key]({{< relref "../../setup-grafana/configure-grafana#secret_key" >}}) from the Grafana configuration.
|
||||
The encryption hides content from the users of the application.
|
||||
This should be used for storing the TLS Cert and password that Grafana appends to the request on the server side.
|
||||
All of these settings are optional.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
The _HTTP\*_ tag denotes data sources that communicate using the HTTP protocol, including all core data source plugins except MySQL, PostgreSQL, and MSSQL.
|
||||
{{% /admonition %}}
|
||||
{{< admonition type="note" >}}
|
||||
The _HTTP\*_ tag denotes data sources that communicate using the HTTP protocol, including all core data source plugins except MySQL, PostgreSQL, and MS SQL.
|
||||
{{< /admonition >}}
|
||||
|
||||
| Name | Type | Data source | Description |
|
||||
| ----------------- | ------ | ---------------------------------- | -------------------------------------------------------- |
|
||||
@@ -270,7 +272,7 @@ The _HTTP\*_ tag denotes data sources that communicate using the HTTP protocol,
|
||||
#### Custom HTTP headers for data sources
|
||||
|
||||
Data sources managed with provisioning can be configured to add HTTP headers to all requests.
|
||||
The header name is configured in the `jsonData` field and the header value is configured in `secureJsonData`.
|
||||
Configure the header name in the `jsonData` field and the header value in `secureJsonData`.
|
||||
|
||||
```yaml
|
||||
apiVersion: 1
|
||||
@@ -287,16 +289,14 @@ datasources:
|
||||
|
||||
## Plugins
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Available in Grafana v7.1 and higher.
|
||||
{{% /admonition %}}
|
||||
You can manage plugin applications in Grafana by adding one or more YAML configuration files in the [`provisioning/plugins`]({{< relref "../../setup-grafana/configure-grafana#provisioning" >}}) directory.
|
||||
Each configuration file can contain a list of `apps` that update during start up.
|
||||
Grafana updates each app to match the configuration file.
|
||||
|
||||
You can manage plugin applications in Grafana by adding one or more YAML config files in the [`provisioning/plugins`]({{< relref "../../setup-grafana/configure-grafana#provisioning" >}}) directory. Each config file can contain a list of `apps` that will be updated during start up. Grafana updates each app to match the configuration file.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
{{< admonition type="note" >}}
|
||||
This feature enables you to provision plugin configurations, not the plugins themselves.
|
||||
The plugins must already be installed on the Grafana instance.
|
||||
{{% /admonition %}}
|
||||
{{< /admonition >}}
|
||||
|
||||
### Example plugin configuration file
|
||||
|
||||
@@ -324,9 +324,10 @@ apps:
|
||||
|
||||
## Dashboards
|
||||
|
||||
You can manage dashboards in Grafana by adding one or more YAML config files in the [`provisioning/dashboards`]({{< relref "../../setup-grafana/configure-grafana#dashboards" >}}) directory. Each config file can contain a list of `dashboards providers` that load dashboards into Grafana from the local filesystem.
|
||||
You can manage dashboards in Grafana by adding one or more YAML configuration files in the [`provisioning/dashboards`]({{< relref "../../setup-grafana/configure-grafana#dashboards" >}}) directory.
|
||||
Each configuration file can contain a list of `dashboards providers` that load dashboards into Grafana from the local filesystem.
|
||||
|
||||
The dashboard provider config file looks somewhat like this:
|
||||
The dashboard provider configuration file looks somewhat like this:
|
||||
|
||||
```yaml
|
||||
apiVersion: 1
|
||||
@@ -355,40 +356,47 @@ providers:
|
||||
foldersFromFilesStructure: true
|
||||
```
|
||||
|
||||
When Grafana starts, it will update/insert all dashboards available in the configured path. Then later on poll that path every **updateIntervalSeconds** and look for updated json files and update/insert those into the database.
|
||||
When Grafana starts, it updates and inserts all dashboards available in the configured path.
|
||||
Then later on, Grafana polls that path every **updateIntervalSeconds**, looks for updated JSON files, and updates and inserts those into the database.
|
||||
|
||||
> **Note:** Dashboards are provisioned to the root level if the `folder` option is missing or empty.
|
||||
|
||||
#### Making changes to a provisioned dashboard
|
||||
|
||||
It's possible to make changes to a provisioned dashboard in the Grafana UI. However, it is not possible to automatically save the changes back to the provisioning source.
|
||||
If `allowUiUpdates` is set to `true` and you make changes to a provisioned dashboard, you can `Save` the dashboard then changes will be persisted to the Grafana database.
|
||||
While you can change a provisioned dashboard in the Grafana UI, those changes can't be saved back to the provisioning source.
|
||||
If `allowUiUpdates` is set to `true` and you make changes to a provisioned dashboard, you can `Save` the dashboard, then changes persist to the Grafana database.
|
||||
|
||||
> **Note:**
|
||||
> If a provisioned dashboard is saved from the UI and then later updated from the source, the dashboard stored in the database will always be overwritten. The `version` property in the JSON file will not affect this, even if it is lower than the existing dashboard.
|
||||
>
|
||||
> If a provisioned dashboard is saved from the UI and the source is removed, the dashboard stored in the database will be deleted unless the configuration option `disableDeletion` is set to true.
|
||||
{{< admonition type="note" >}}
|
||||
If a provisioned dashboard is saved from the UI and then later updated from the source, the dashboard stored in the database will always be overwritten. The `version` property in the JSON file won't affect this, even if it's lower than the version of the existing dashboard.
|
||||
|
||||
If a provisioned dashboard is saved from the UI and the source is removed, the dashboard stored in the database is deleted unless the configuration option `disableDeletion` is set to `true`.
|
||||
{{< /admonition >}}
|
||||
|
||||
If `allowUiUpdates` is configured to `false`, you are not able to make changes to a provisioned dashboard. When you click `Save`, Grafana brings up a _Cannot save provisioned dashboard_ dialog. The screenshot below illustrates this behavior.
|
||||
|
||||
Grafana offers options to export the JSON definition of a dashboard. Either `Copy JSON to Clipboard` or `Save JSON to file` can help you synchronize your dashboard changes back to the provisioning source.
|
||||
|
||||
Note: The JSON definition in the input field when using `Copy JSON to Clipboard` or `Save JSON to file` will have the `id` field automatically removed to aid the provisioning workflow.
|
||||
{{< admonition type="note" >}}
|
||||
The JSON definition in the input field when using `Copy JSON to Clipboard` or `Save JSON to file` has the `id` field automatically removed to aid the provisioning workflow.
|
||||
{{< /admonition >}}
|
||||
|
||||
{{< figure src="/static/img/docs/v51/provisioning_cannot_save_dashboard.png" max-width="500px" class="docs-image--no-shadow" >}}
|
||||
|
||||
### Reusable Dashboard URLs
|
||||
### Reusable dashboard URLs
|
||||
|
||||
If the dashboard in the JSON file contains an [UID]({{< relref "../../dashboards/build-dashboards/view-dashboard-json-model" >}}), Grafana forces insert/update on that UID. This allows you to migrate dashboards between Grafana instances and provisioning Grafana from configuration without breaking the URLs given because the new dashboard URL uses the UID as identifier.
|
||||
When Grafana starts, it updates/inserts all dashboards available in the configured folders. If you modify the file, then the dashboard is also updated.
|
||||
By default, Grafana deletes dashboards in the database if the file is removed. You can disable this behavior using the `disableDeletion` setting.
|
||||
If the dashboard in the JSON file contains an [UID]({{< relref "../../dashboards/build-dashboards/view-dashboard-json-model" >}}), Grafana forces insert/update on that UID.
|
||||
This allows you to migrate dashboards between Grafana instances and provisioning Grafana from configuration without breaking the URLs given because the new dashboard URL uses the UID as identifier.
|
||||
When Grafana starts, it updates and inserts all dashboards available in the configured folders.
|
||||
If you modify the file, then the dashboard is also updated.
|
||||
By default, Grafana deletes dashboards in the database if the file is removed.
|
||||
You can disable this behavior using the `disableDeletion` setting.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
{{< admonition type="note" >}}
|
||||
Provisioning allows you to overwrite existing dashboards
|
||||
which leads to problems if you reuse settings that are supposed to be unique.
|
||||
Be careful not to reuse the same `title` multiple times within a folder
|
||||
or `uid` within the same installation as this will cause weird behaviors.
|
||||
{{% /admonition %}}
|
||||
or `uid` within the same installation as this causes weird behaviors.
|
||||
{{< /admonition >}}
|
||||
|
||||
### Provision folders structure from filesystem to Grafana
|
||||
|
||||
@@ -406,7 +414,7 @@ For example, to replicate these dashboards structure from the filesystem to Graf
|
||||
└── /resources_dashboard.json
|
||||
```
|
||||
|
||||
you need to specify just this short provision configuration file.
|
||||
You need to specify just this short provision configuration file.
|
||||
|
||||
```yaml
|
||||
apiVersion: 1
|
||||
@@ -420,32 +428,24 @@ providers:
|
||||
foldersFromFilesStructure: true
|
||||
```
|
||||
|
||||
`server` and `application` will become new folders in Grafana menu.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
`folder` and `folderUid` options should be empty or missing to make `foldersFromFilesStructure` work.
|
||||
{{% /admonition %}}
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
To provision dashboards to the root level, store them in the root of your `path`.
|
||||
{{% /admonition %}}
|
||||
In this example, `server` and `application` become new folders in the Grafana menu.
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
This feature doesn't currently allow you to create nested folder structures, that is, where you have folders within folders.
|
||||
The `folder` and `folderUid` options should be empty or missing to make `foldersFromFilesStructure` work.
|
||||
|
||||
To provision dashboards to the root level, store them in the root of your `path`.
|
||||
|
||||
You can't create nested folders structures, where you have folders within folders.
|
||||
{{< /admonition >}}
|
||||
|
||||
## Alerting
|
||||
|
||||
For information on provisioning Grafana Alerting, refer to [Provision Grafana Alerting resources]({{< relref "../../alerting/set-up/provision-alerting-resources/" >}}).
|
||||
|
||||
### Supported Settings
|
||||
### Supported settings
|
||||
|
||||
The following sections detail the supported settings and secure settings for each alert notification type. Secure settings are stored encrypted in the database and you add them to `secure_settings` in the YAML file instead of `settings`.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Secure settings is supported since Grafana v7.2.
|
||||
{{% /admonition %}}
|
||||
|
||||
#### Alert notification `pushover`
|
||||
|
||||
| Name | Secure setting |
|
||||
|
||||
Reference in New Issue
Block a user