[release-12.3.0] Restructure As code and developer resources (#113969)
Co-authored-by: Roberto Jiménez Sánchez <roberto.jimenez@grafana.com> Co-authored-by: Anna Urbiztondo <anna.urbiztondo@grafana.com>
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
---
|
||||
description: Learn about how to provision resources using Git Sync and local file provisioning administration.
|
||||
keywords:
|
||||
- observability
|
||||
- configuration
|
||||
- as code
|
||||
- git integration
|
||||
- git sync
|
||||
- github
|
||||
labels:
|
||||
products:
|
||||
- enterprise
|
||||
- oss
|
||||
title: Provision resources and sync dashboards
|
||||
menuTitle: Provision resources
|
||||
weight: 300
|
||||
canonical: https://grafana.com/docs/grafana/latest/as-code/observability-as-code/provision-resources/
|
||||
aliases:
|
||||
- ../../observability-as-code/provision-resources/ # /docs/grafana/next/observability-as-code/provision-resources/
|
||||
---
|
||||
|
||||
# Provision resources and sync dashboards
|
||||
|
||||
{{< admonition type="caution" >}}
|
||||
|
||||
Git Sync is available in [private preview](https://grafana.com/docs/release-life-cycle/) for Grafana Cloud. Support and documentation is available but might be limited to enablement, configuration, and some troubleshooting. No SLAs are provided. You can sign up to the private preview using the [Git Sync early access form](https://forms.gle/WKkR3EVMcbqsNnkD9).
|
||||
|
||||
Git Sync and local file provisioning are [experimental features](https://grafana.com/docs/release-life-cycle/) introduced in Grafana v12 for open source and Enterprise editions. Engineering and on-call support is not available. Documentation is either limited or not provided outside of code comments. No SLA is provided.
|
||||
|
||||
{{< /admonition >}}
|
||||
|
||||
Provisioning allows you to configure how to store your dashboard JSON and other files in GitHub repositories using either Git Sync or a local path.
|
||||
|
||||
Of the two options, **Git Sync** is the favorited method for provisioning your dashboards. You can synchronize any new dashboards and changes to existing dashboards from the UI to your configured GitHub repository. If you push a change in the repository, those changes are mirrored in your Grafana instance. Refer to [Git Sync workflow](#git-sync-workflow) for more information.
|
||||
|
||||
Alternatively, **local file provisioning** allows you to include in your Grafana instance resources (such as folders and dashboard JSON files) that are stored in a local file system. Refer to [Local file workflow](#local-file-workflow) for more information.
|
||||
|
||||
## Provisioned folders and connections
|
||||
|
||||
The dashboards saved in your GitHub repository or local folder appear in Grafana in the 'provisioned' folder. The dashboards and folders saved to the local path are referred to as 'provisioned' resources and are labeled as such in the Grafana UI. You can update any provisioned dashboard that is either stored within a GitHub repository (Git Sync workflow) or in a local file (local file workflow).
|
||||
|
||||
You can set a single folder, or multiple folders to a different repository, with up to 10 connections. Alternatively, your entire Grafana instance can be the provisioned folder.
|
||||
|
||||
## Git Sync workflow
|
||||
|
||||
In the Git Sync workflow:
|
||||
|
||||
- When you provision resources with Git Sync you can modify them from within the Grafana UI or within the GitHub repository. Changes made in either the repository or the Grafana UI are bidirectional.
|
||||
- Any changes made in the provisioned files stored in the GitHub repository are reflected in the Grafana database. By default, Grafana polls GitHub every 60 seconds. The Grafana UI reads from the database and updates the UI to reflect these changes.
|
||||
|
||||
For example, if you update a dashboard within the Grafana UI and click **Save** to preserve the changes, you'll be notified that the dashboard is provisioned in a GitHub repository. Next you'll be prompted to choose how to preserve the changes: either directly to a branch, or pushed to a new branch using a pull request in GitHub.
|
||||
|
||||
For more information, see [Introduction to Git Sync](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/observability-as-code/provision-resources/intro-git-sync) and [Set up Git Sync](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/observability-as-code/provision-resources/git-sync-setup).
|
||||
|
||||
## Local file workflow
|
||||
|
||||
In the local file workflow:
|
||||
|
||||
- All provisioned resources are changed in the local files.
|
||||
- Any changes made in the provisioned files are reflected in the Grafana database. The Grafana UI reads the database and updates the UI to reflect these changes.
|
||||
- You can't use the Grafana UI to edit or delete provisioned resources.
|
||||
|
||||
Learn more in [Set up file provisioning](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/observability-as-code/provision-resources/file-path-setup/).
|
||||
|
||||
## Explore provisioning
|
||||
|
||||
{{< section withDescriptions="true" depth="5" >}}
|
||||
@@ -0,0 +1,170 @@
|
||||
---
|
||||
description: Instructions for setting up file provisioning with a local path.
|
||||
keywords:
|
||||
- as code
|
||||
- as-code
|
||||
- file provisioning
|
||||
- local path
|
||||
labels:
|
||||
products:
|
||||
- enterprise
|
||||
- oss
|
||||
title: Set up file provisioning
|
||||
weight: 200
|
||||
canonical: https://grafana.com/docs/grafana/latest/as-code/observability-as-code/provision-resources/file-path-setup/
|
||||
aliases:
|
||||
- ../../../observability-as-code/provision-resources/file-path-setup/ # /docs/grafana/next/observability-as-code/provision-resources/file-path-setup/
|
||||
---
|
||||
|
||||
# Set up file provisioning
|
||||
|
||||
{{< admonition type="caution" >}}
|
||||
|
||||
Local file provisioning is an [experimental feature](https://grafana.com/docs/release-life-cycle/) introduced in Grafana v12 for open source and Enterprise editions, but it's **not available in Grafana Cloud**. Engineering and on-call support is not available. Documentation is either limited or not provided outside of code comments. No SLA is provided.
|
||||
|
||||
{{< /admonition >}}
|
||||
|
||||
Use local file provisioning to include in your Grafana instance resources (such as folders and dashboard JSON files) that are stored in a local file system.
|
||||
|
||||
This page explains how to set up local file provisioning.
|
||||
|
||||
The local path mount is referred to as a repository.
|
||||
|
||||
Using the local path lets you also use it with a tool like `fuse`, allowing you to mount S3 buckets as local paths. You can also use tools like `restic` to automatically back up your dashboards to your preferred backup storage solution.
|
||||
|
||||
To set up file sync with local with local files, you need to:
|
||||
|
||||
1. Enable feature toggles and paths in Grafana configuration file (first time set up).
|
||||
1. Set the local path.
|
||||
1. Choose what content to sync with Grafana.
|
||||
|
||||
## New file provisioning capabilities
|
||||
|
||||
Local file provisioning using **Administration** > **Provisioning** will eventually replace the traditional methods Grafana has used for referencing local file systems for dashboard files.
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
For production systems, use the `folderFromFilesStructure` capability instead of **Administration** > **Provisioning** to include dashboards from a local file system in your Grafana instance. Refer to [Provision Grafana](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/administration/provisioning/#provision-folders-structure-from-filesystem-to-grafana) for more information.
|
||||
{{< /admonition >}}
|
||||
|
||||
### Limitations
|
||||
|
||||
- A provisioned dashboard can't be deleted from within Grafana UI. The dashboard has to be deleted at the local file system and those changes synced to Grafana.
|
||||
- Changes from the local file system are one way: you can't save changes from the Grafana UI to GitHub.
|
||||
|
||||
## Before you begin
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
Enable the `provisioning` and `kubernetesDashboards` feature toggles in Grafana to use this feature.
|
||||
{{< /admonition >}}
|
||||
|
||||
To set up file provisioning, you need:
|
||||
|
||||
- Administration rights in your Grafana organization.
|
||||
- A local directory where your dashboards will be stored.
|
||||
- If you want to use a GitHub repository, refer to [Set up Git Sync](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/observability-as-code/provision-resources/file-path-setup/).
|
||||
- To update the `permitted_provisioning_paths` section of `custom.ini`.
|
||||
- To enable the required feature toggles in your Grafana instance.
|
||||
|
||||
## Enable required feature toggles and configure permitted paths
|
||||
|
||||
To activate local file provisioning in Grafana, you need to enable the `provisioning` and `kubernetesDashboards` feature toggles.
|
||||
For additional information about feature toggles, refer to [Configure feature toggles](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/setup-grafana/configure-grafana/feature-toggles).
|
||||
|
||||
The local setting must be a relative path and its relative path must be configured in the `permitted_provisioned_paths` configuration option.
|
||||
The configuration option is relative to your working directory, i.e. where you are running Grafana from; this is usually `/usr/share/grafana` or similar.
|
||||
|
||||
Local file paths can point to any directory that is permitted by the configuration.
|
||||
The default paths is `devenv/dev-dashboards` and `conf/provisioning` in your `grafana` installation directory.
|
||||
|
||||
The path must behave as a standard file directory on the system of choice.
|
||||
Any subdirectories are automatically included.
|
||||
|
||||
The values that you enter for the `permitted_provisioning_paths` become the base paths for those entered when you enter a local path in the **Connect to local storage** wizard.
|
||||
|
||||
1. Open your Grafana configuration file, either `grafana.ini` or `custom.ini`. For file location based on operating system, refer to [Configuration file location](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/setup-grafana/configure-grafana/feature-toggles/#experimental-feature-toggles).
|
||||
1. Locate or add a `[feature_toggles]` section. Add these values:
|
||||
|
||||
```ini
|
||||
[feature_toggles]
|
||||
provisioning = true
|
||||
kubernetesDashboards = true ; use k8s from browser
|
||||
```
|
||||
|
||||
1. Locate or add a `[paths]` section. To add more than one location, use the pipe character (`|`) to separate the paths. The list should not include empty paths or trailing pipes. Add these values:
|
||||
|
||||
```ini
|
||||
[paths]
|
||||
; This is devenv/dev-dashboards and conf/provisioning by default.
|
||||
permitted_provisioning_paths = grafana/ | /etc/grafana/provisioning/
|
||||
```
|
||||
|
||||
1. Save the changes to the file and start Grafana.
|
||||
|
||||
## Set up file-based provisioning
|
||||
|
||||
To use file-based provisioning, you need the file path to the `grafana` folder where your dashboards are stored in the repository.
|
||||
|
||||
To start setting up file-based provisioning:
|
||||
|
||||
1. Log in to your Grafana server with an account that has the Grafana Admin flag set.
|
||||
1. Select **Administration** in the left-side menu and then **Provisioning**.
|
||||
1. Select [Configure file provisioning](#set-up-file-based-provisioning).
|
||||
|
||||
### Connect to local storage
|
||||
|
||||
The local path can point to any directory that is permitted by the configuration.
|
||||
Refer to [Enabled required feature toggles and paths](#enable-required-feature-toggles-and-configure-permitted-paths) for information.
|
||||
|
||||
The starting path is always your working `grafana` directory.
|
||||
The prefix that must be entered is determined by the locations configured in `permitted_provisioning_paths`.
|
||||
The default paths are `devenv/dev-dashboards` and `conf/provisioning` in your `grafana` installation directory.
|
||||
The value you enter in the Grafana UI must _begin_ with any of the configured values. For example, `conf/provisioning/test` is valid, but `conf/test` is not.
|
||||
|
||||
1. Enter the **Local path**, for example `grafana/`. This must begin with any of the configured `permitted_provisioned_paths`.
|
||||
1. Select **Choose what to synchronize**.
|
||||
|
||||
The set up process verifies the path and provides an error message if a problem occurs.
|
||||
|
||||
### Choose what to synchronize
|
||||
|
||||
#### Synchronization limitations
|
||||
|
||||
Full instance sync is not available in Grafana Cloud.
|
||||
|
||||
In Grafana OSS/Enterprise:
|
||||
|
||||
- If you try to perform a full instance sync with resources that contain alerts or panels, the connection will be blocked.
|
||||
- You won't be able to create new alerts or library panels after setup is completed.
|
||||
- If you opted for full instance sync and want to use alerts and library panels, you'll have to delete the provisioned repository and connect again with folder sync.
|
||||
|
||||
#### Set up synchronization
|
||||
|
||||
Choose to either sync your entire organization resources with external storage, or to sync certain resources to a new Grafana folder (with up to 10 connections).
|
||||
|
||||
- Choose **Sync all resources with external storage** if you want to sync and manage your entire Grafana instance through external storage. With this option, all of your dashboards are synced to that one repository. You can only have one provisioned connection with this selection, and you won't have the option of setting up additional repositories to connect to.
|
||||
|
||||
- Choose **Sync external storage to new Grafana folder** to sync external resources into a new folder without affecting the rest of your instance. You can repeat this process for up to 10 connections.
|
||||
|
||||
Next, enter a **Display name** for the repository connection. Resources stored in this connection appear under the chosen display name in the Grafana UI.
|
||||
|
||||
Click **Synchronize** to continue.
|
||||
|
||||
### Synchronize with external storage
|
||||
|
||||
After this one time step, all future updates are automatically saved to the local file path and provisioned back to the instance.
|
||||
|
||||
During the initial synchronization, your dashboards will be temporarily unavailable. No data or configurations will be lost.
|
||||
How long the process takes depends upon the number of resources involved.
|
||||
|
||||
Select **Begin synchronization** to start the process.
|
||||
|
||||
### Choose additional settings
|
||||
|
||||
If you wish, you can make any files synchronized as as **Read only** so no changes can be made to the resources through Grafana.
|
||||
Any resources made outside of Grafana and saved to the local repository will be reflected in Grafana.
|
||||
|
||||
Select **Finish**.
|
||||
|
||||
## Verify your dashboards in Grafana
|
||||
|
||||
To verify that your dashboards are available at the location that you specified, click **Dashboards**. The name of the dashboard is listed in the **Name** column.
|
||||
@@ -0,0 +1,227 @@
|
||||
---
|
||||
description: Instructions for setting up Git Sync, so you can provision GitHub repositories for use with Grafana.
|
||||
keywords:
|
||||
- set up
|
||||
- git integration
|
||||
- git sync
|
||||
- github
|
||||
labels:
|
||||
products:
|
||||
- enterprise
|
||||
- oss
|
||||
title: Set up Git Sync
|
||||
weight: 100
|
||||
canonical: https://grafana.com/docs/grafana/latest/as-code/observability-as-code/provision-resources/git-sync-setup/
|
||||
aliases:
|
||||
- ../../../observability-as-code/provision-resources/git-sync-setup/ # /docs/grafana/next/observability-as-code/provision-resources/git-sync-setup/
|
||||
---
|
||||
|
||||
# Set up Git Sync
|
||||
|
||||
{{< admonition type="caution" >}}
|
||||
|
||||
Git Sync is available in [private preview](https://grafana.com/docs/release-life-cycle/) for Grafana Cloud, and is an [experimental feature](https://grafana.com/docs/release-life-cycle/) in Grafana v12 for open source and Enterprise editions.
|
||||
|
||||
Support and documentation is available but might be limited to enablement, configuration, and some troubleshooting. No SLAs are provided.
|
||||
|
||||
You can sign up to the private preview using the [Git Sync early access form](https://forms.gle/WKkR3EVMcbqsNnkD9).
|
||||
|
||||
{{< /admonition >}}
|
||||
|
||||
Git Sync lets you manage Grafana dashboards as code by storing dashboard JSON files and folders in a remote GitHub repository.
|
||||
|
||||
To set up Git Sync and synchronize with a GitHub repository follow these steps:
|
||||
|
||||
1. [Enable feature toggles in Grafana](#enable-required-feature-toggles) (first time set up).
|
||||
1. [Create a GitHub access token](#create-a-github-access-token).
|
||||
1. [Configure a connection to your GitHub repository](#set-up-the-connection-to-github).
|
||||
1. [Choose what content to sync with Grafana](#choose-what-to-synchronize).
|
||||
|
||||
Optionally, you can [extend Git Sync](#configure-webhooks-and-image-rendering) by enabling pull request notifications and image previews of dashboard changes.
|
||||
|
||||
| Capability | Benefit | Requires |
|
||||
| ----------------------------------------------------- | ------------------------------------------------------------------------------- | -------------------------------------- |
|
||||
| Adds a table summarizing changes to your pull request | Provides a convenient way to save changes back to GitHub. | Webhooks configured |
|
||||
| Add a dashboard preview image to a PR | View a snapshot of dashboard changes to a pull request without opening Grafana. | Image renderer and webhooks configured |
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
|
||||
Alternatively, you can configure a local file system instead of using GitHub. Refer to [Set up file provisioning](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/observability-as-code/provision-resources/file-path-setup/) for more information.
|
||||
|
||||
{{< /admonition >}}
|
||||
|
||||
## Performance impacts of enabling Git Sync
|
||||
|
||||
Git Sync is an experimental feature and is under continuous development. Reporting any issues you encounter can help us improve Git Sync.
|
||||
|
||||
When Git Sync is enabled, the database load might increase, especially for instances with a lot of folders and nested folders. Evaluate the performance impact, if any, in a non-production environment.
|
||||
|
||||
## Before you begin
|
||||
|
||||
{{< admonition type="caution" >}}
|
||||
|
||||
Refer to [Known limitations](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/observability-as-code/provision-resources/intro-git-sync#known-limitations/) before using Git Sync.
|
||||
|
||||
{{< /admonition >}}
|
||||
|
||||
### Requirements
|
||||
|
||||
To set up Git Sync, you need:
|
||||
|
||||
- Administration rights in your Grafana organization.
|
||||
- Enable the required feature toggles in your Grafana instance. Refer to [Enable required feature toggles](#enable-required-feature-toggles) for instructions.
|
||||
- A GitHub repository to store your dashboards in.
|
||||
- If you want to use a local file path, refer to [the local file path guide](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/observability-as-code/provision-resources/file-path-setup/).
|
||||
- A GitHub access token. The Grafana UI will prompt you during setup.
|
||||
- Optional: A public Grafana instance.
|
||||
- Optional: The [Image Renderer service](https://github.com/grafana/grafana-image-renderer) to save image previews with your PRs.
|
||||
|
||||
## Enable required feature toggles
|
||||
|
||||
To activate Git Sync in Grafana, you need to enable the `provisioning` and `kubernetesDashboards` feature toggles.
|
||||
For additional information about feature toggles, refer to [Configure feature toggles](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/setup-grafana/configure-grafana/feature-toggles).
|
||||
|
||||
To enable the required feature toggles, add them to your Grafana configuration file:
|
||||
|
||||
1. Open your Grafana configuration file, either `grafana.ini` or `custom.ini`. For file location based on operating system, refer to [Configuration file location](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/setup-grafana/configure-grafana/feature-toggles/#experimental-feature-toggles).
|
||||
1. Locate or add a `[feature_toggles]` section. Add these values:
|
||||
|
||||
```ini
|
||||
[feature_toggles]
|
||||
provisioning = true
|
||||
kubernetesDashboards = true ; use k8s from browser
|
||||
```
|
||||
|
||||
1. Save the changes to the file and restart Grafana.
|
||||
|
||||
## Create a GitHub access token
|
||||
|
||||
Whenever you connect to a GitHub repository, you need to create a GitHub access token with specific repository permissions.
|
||||
This token needs to be added to your Git Sync configuration to enable read and write permissions between Grafana and GitHub repository.
|
||||
|
||||
1. Create a new token using [Create new fine-grained personal access token](https://github.com/settings/personal-access-tokens/new). Refer to [Managing your personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) for instructions.
|
||||
1. Under **Permissions**, expand **Repository permissions**.
|
||||
1. Set these permissions for Git Sync:
|
||||
- **Contents**: Read and write permission
|
||||
- **Metadata**: Read-only permission
|
||||
- **Pull requests**: Read and write permission
|
||||
- **Webhooks**: Read and write permission
|
||||
|
||||
1. Select any additional options and then press **Generate token**.
|
||||
1. Verify the options and select **Generate token**.
|
||||
1. Copy the access token. Leave the browser window available with the token until you've completed configuration.
|
||||
|
||||
GitHub Apps are not currently supported.
|
||||
|
||||
## Set up the connection to GitHub
|
||||
|
||||
Use **Provisioning** to guide you through setting up Git Sync to use a GitHub repository.
|
||||
|
||||
1. Log in to your Grafana server with an account that has the Grafana Admin flag set.
|
||||
1. Select **Administration** in the left-side menu and then **Provisioning**.
|
||||
1. Select **Configure Git Sync**.
|
||||
|
||||
### Connect to external storage
|
||||
|
||||
To connect your GitHub repository, follow these steps:
|
||||
|
||||
1. Paste your GitHub personal access token into **Enter your access token**. Refer to [Create a GitHub access token](#create-a-github-access-token) for instructions.
|
||||
1. Paste the **Repository URL** for your GitHub repository into the text box.
|
||||
1. Enter a branch to use. The default value is `main`.
|
||||
1. Add a **Path** to a subdirectory where your dashboards are stored. The default value is `grafana/`. If your dashboards are stored in the root of your repository, then remove the directory name.
|
||||
1. Select **Choose what to synchronize** to have the connection to your repository verified and continue setup.
|
||||
|
||||
### Choose what to synchronize
|
||||
|
||||
In this step you can decide which elements to synchronize. Keep in mind the available options depend on the status of your Grafana instance.
|
||||
|
||||
- If the instance contains resources in an incompatible data format, you'll have to migrate all the data using instance sync. Folder sync won't be supported.
|
||||
- If there is already another connection using folder sync, instance sync won't be offered.
|
||||
|
||||
#### Synchronization limitations
|
||||
|
||||
Git Sync only supports dashboards and folders. Alerts, panels, and other resources are not supported yet.
|
||||
|
||||
{{< admonition type="caution" >}}
|
||||
|
||||
Refer to [Known limitations](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/observability-as-code/provision-resources/intro-git-sync#known-limitations/) before using Git Sync. Refer to [Supported resources](/docs/grafana/<GRAFANA_VERSION>/observability-as-code/provision-resources/intro-git-sync#supported-resources) for details about which resources you can sync.
|
||||
|
||||
{{< /admonition >}}
|
||||
|
||||
Full instance sync is not available in Grafana Cloud.
|
||||
|
||||
In Grafana OSS/Enterprise:
|
||||
|
||||
- If you try to perform a full instance sync with resources that contain alerts or panels, Git Sync will block the connection.
|
||||
- You won't be able to create new alerts or library panels after the setup is completed.
|
||||
- If you opted for full instance sync and want to use alerts and library panels, you'll have to delete the synced repository and connect again with folder sync.
|
||||
|
||||
#### Set up synchronization
|
||||
|
||||
To set up synchronization, choose to either sync your entire organization resources with external storage, or to sync certain resources to a new Grafana folder (with up to 10 connections).
|
||||
|
||||
- Choose **Sync all resources with external storage** if you want to sync and manage your entire Grafana instance through external storage. With this option, all of your dashboards are synced to that one repository. You can only have one provisioned connection with this selection, and you won't have the option of setting up additional repositories to connect to.
|
||||
- Choose **Sync external storage to new Grafana folder** to sync external resources into a new folder without affecting the rest of your instance. You can repeat this process for up to 10 connections.
|
||||
|
||||
Next, enter a **Display name** for the repository connection. Resources stored in this connection appear under the chosen display name in the Grafana UI. Click **Synchronize** to continue.
|
||||
|
||||
### Choose additional settings
|
||||
|
||||
Finally, you can set up how often your configured storage is polled for updates.
|
||||
|
||||
1. For **Update instance interval (seconds)**, enter how often you want the instance to pull updates from GitHub. The default value is 60 seconds.
|
||||
1. Optional: Select **Read only** to ensure resources can't be modified in Grafana.
|
||||
1. Optional: If you have the Grafana Image Renderer plugin configured, you can **Enable dashboards previews in pull requests**. If image rendering is not available, then you can't select this option. For more information, refer to the [Image Renderer service](https://github.com/grafana/grafana-image-renderer).
|
||||
1. Select **Finish** to proceed.
|
||||
|
||||
## Verify your dashboards in Grafana
|
||||
|
||||
To verify that your dashboards are available at the location that you specified, click **Dashboards**. The name of the dashboard is listed in the **Name** column.
|
||||
|
||||
Now that your dashboards have been synced from a repository, you can customize the name, change the branch, and create a pull request (PR) for it. Refer to [Manage provisioned repositories with Git Sync](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/observability-as-code/provision-resources/use-git-sync/) for more information.
|
||||
|
||||
## Configure webhooks and image rendering
|
||||
|
||||
You can extend Git Sync by getting instant updates and pull requests using webhooks and add dashboard previews in pull requests.
|
||||
|
||||
### Set up webhooks for realtime notification and pull request integration
|
||||
|
||||
When connecting to a GitHub repository, Git Sync uses webhooks to enable real-time updates from GitHub public repositories or enable pull request integrations. Without webhooks, the polling interval is set in the final configuration screen, and the default is 60 seconds. If you use local storage, then Git Sync only provides periodic pulling.
|
||||
|
||||
You can set up webhooks with whichever service or tooling you prefer. You can use Cloudflare Tunnels with a Cloudflare-managed domain, port-forwarding and DNS options, or a tool such as `ngrok`.
|
||||
|
||||
To set up webhooks you need to expose your Grafana instance to the public Internet. You can do this via port forwarding and DNS, a tool such as `ngrok`, or any other method you prefer. The permissions set in your GitHub access token provide the authorization for this communication.
|
||||
|
||||
After you have the public URL, you can add it to your Grafana configuration file:
|
||||
|
||||
```yaml
|
||||
[server]
|
||||
root_url = https://PUBLIC_DOMAIN.HERE
|
||||
```
|
||||
|
||||
To check the configured webhooks, go to **Administration** > **Provisioning** and click the **View** link for your GitHub repository.
|
||||
|
||||
#### Expose necessary paths only
|
||||
|
||||
If your security setup does not permit publicly exposing the Grafana instance, you can either choose to `allowlist` the GitHub IP addresses, or expose only the necessary paths.
|
||||
|
||||
The necessary paths required to be exposed are, in RegExp:
|
||||
|
||||
- `/apis/provisioning\.grafana\.app/v0(alpha1)?/namespaces/[^/]+/repositories/[^/]+/(webhook|render/.*)$`
|
||||
<!-- TODO: Path for the blob storage for image rendering? @ryantxu would know this best. -->
|
||||
|
||||
### Set up image rendering for dashboard previews
|
||||
|
||||
Set up image rendering to add visual previews of dashboard updates directly in pull requests. Image rendering also requires webhooks.
|
||||
|
||||
To enable this capability, install the Grafana Image Renderer in your Grafana instance. For more information and installation instructions, refer to the [Image Renderer service](https://github.com/grafana/grafana-image-renderer).
|
||||
|
||||
## Modify configurations after set up is complete
|
||||
|
||||
To update your repository configuration after you've completed set up:
|
||||
|
||||
1. Log in to your Grafana server with an account that has the Grafana Admin flag set.
|
||||
1. Select **Administration** in the left-side menu and then **Provisioning**.
|
||||
1. Select **Settings** for the repository you wish to modify.
|
||||
1. Use the **Configure repository** screen to update any of the settings.
|
||||
1. Select **Save** to preserve the updates.
|
||||
@@ -0,0 +1,167 @@
|
||||
---
|
||||
description: Learn about Git Sync, the Grafana feature for storing and managing dashboards within GitHub repositories.
|
||||
keywords:
|
||||
- dashboards
|
||||
- git integration
|
||||
- git sync
|
||||
- github
|
||||
labels:
|
||||
products:
|
||||
- enterprise
|
||||
- oss
|
||||
- cloud
|
||||
refs:
|
||||
roles-and-permissions:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/administration/roles-and-permissions/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/account-management/authentication-and-permissions/cloud-roles/
|
||||
title: Git Sync
|
||||
weight: 100
|
||||
canonical: https://grafana.com/docs/grafana/latest/as-code/observability-as-code/provision-resources/intro-git-sync/
|
||||
aliases:
|
||||
- ../../../observability-as-code/provision-resources/intro-git-sync/ # /docs/grafana/next/observability-as-code/provision-resources/intro-git-sync/
|
||||
---
|
||||
|
||||
# Introduction to Git Sync
|
||||
|
||||
{{< admonition type="caution" >}}
|
||||
|
||||
Git Sync is available in [private preview](https://grafana.com/docs/release-life-cycle/) for Grafana Cloud, and is an [experimental feature](https://grafana.com/docs/release-life-cycle/) in Grafana v12 for open source and Enterprise editions.
|
||||
|
||||
Support and documentation is available but might be limited to enablement, configuration, and some troubleshooting. No SLAs are provided.
|
||||
|
||||
You can sign up to the private preview using the [Git Sync early access form](https://forms.gle/WKkR3EVMcbqsNnkD9).
|
||||
|
||||
{{< /admonition >}}
|
||||
|
||||
Git Sync in Grafana lets you manage your dashboards as code as JSON files stored in GitHub. You and your team can version control, collaborate, and automate deployments efficiently.
|
||||
|
||||
Using Git Sync, you can:
|
||||
|
||||
- Manage dashboard configuration outside of Grafana instances using Git
|
||||
- Introduce a review process for creating and modifying dashboards
|
||||
- Replicate dashboards across multiple instances
|
||||
|
||||
## How it works
|
||||
|
||||
{{< admonition type="caution" >}}
|
||||
|
||||
Git Sync only works with specific folders for the moment. Full-instance sync is not currently supported.
|
||||
|
||||
{{< /admonition >}}
|
||||
|
||||
Git Sync is bidirectional and works both with changes done directly in GitHub as well as in the Grafana UI.
|
||||
|
||||
### Provisioning folder
|
||||
|
||||
Git Sync creates a folder for all the synchronized resources to live under. You can continue to have unprovisioned resources outside that folder.
|
||||
|
||||
### Make changes in Grafana
|
||||
|
||||
Whenever you modify a dashboard directly from the UI, Grafana can commit changes to Git upon saving. You can configure settings to either enforce PR approvals before merging in your repository, or allow direct commits.
|
||||
|
||||
Grafana periodically polls GitHub at a regular internal to synchronize any changes. The default polling interval is 60 seconds, and you can change this setting in the Grafana UI.
|
||||
|
||||
- If you enable the [webhooks feature](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/observability-as-code/provision-resources/git-sync-setup/#configure-webhooks-and-image-rendering), repository notifications appear almost immediately.
|
||||
- Without webhooks, Grafana polls for changes at the specified interval.
|
||||
|
||||
### Make changes in your GitHub repositories
|
||||
|
||||
With Git Sync, you can make changes to the files in the provisioned folder in GitHub and see them in Grafana. Automated workflows ensure those changes are automatically represented in the Grafana database by updating Git. The Grafana UI reads the database and updates the UI to reflect these changes.
|
||||
|
||||
## Known limitations
|
||||
|
||||
{{< admonition type="caution" >}}
|
||||
|
||||
Refer to [Requirements](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/observability-as-code/provision-resources/git-sync-setup#requirements/) to learn what you need to use Git Sync.
|
||||
|
||||
{{< /admonition >}}
|
||||
|
||||
**Git Sync is under development and the following limitations apply.**
|
||||
|
||||
**Synced resources**
|
||||
|
||||
- You can only sync dashboards and folders. Refer to [Supported resources](#supported-resources) for more information.
|
||||
- If you're using Git Sync in Grafana OSS and Grafana Enterprise, some resources might be in an incompatible data format and won't be synced.
|
||||
- Full-instance sync is not available in Grafana Cloud and has limitations in Grafana OSS and Grafana Enterprise. Refer to [Choose what to synchronize](../git-sync-setup/#choose-what-to-synchronize) for more details.
|
||||
- When migrating to full instance sync, during the synchronization process your resources will be temporarily unavailable. No one will be able to create, edit, or delete resources during this process.
|
||||
- If you want to manage existing resources with Git Sync, you need to save them as JSON files and commit them to the synced repository. Open a PR to import, copy, move, or save a dashboard.
|
||||
- Restoring resources from the UI is currently not possible. As an alternative, you can restore dashboards directly in your GitHub repository by raising a PR, and they will be updated in Grafana.
|
||||
|
||||
**Authentication**
|
||||
|
||||
- You can only authenticate in GitHub using your Personal Access Token token.
|
||||
|
||||
**Permission management**
|
||||
|
||||
- You cannot modify the permissions of a provisioned folder after you've synced it.
|
||||
- Default permissions are: Admin = Admin, Editor = Editor, and Viewer = Viewer. Refer to [Roles and permissions](ref:roles-and-permissions) for more information.
|
||||
|
||||
**Compatibility**
|
||||
|
||||
- Support for native Git, Git app, and other providers, such as GitLab or Bitbucket, is on the roadmap.
|
||||
|
||||
## Supported resources
|
||||
|
||||
Git Sync only supports dashboards and folders. Alerts, panels, and other resources are not supported yet.
|
||||
|
||||
If you're using Git Sync in Grafana OSS or Grafana Enterprise, some supported resources might be in an incompatible data format. If this happens, syncing will be blocked. Compatibility issues will be fixed with an upcoming migration tool.
|
||||
|
||||
### Resource states
|
||||
|
||||
A resource can be:
|
||||
|
||||
| Is the resource? | **Compatible** | **Incompatible** |
|
||||
| ---------------- | -------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
|
||||
| **Supported** | The resource can be managed with Git Sync. | The resource is supported but has compatibility issues. It **cannot** be managed with Git Sync. |
|
||||
| **Unsupported** | The resource is **not** supported and **cannot** be managed with Git Sync. | Not applicable. |
|
||||
|
||||
### Git Sync instance states
|
||||
|
||||
An instance can be in one of the following Git Sync states:
|
||||
|
||||
- **Unprovisioned**: None of the instance's resources are being managed by Git Sync.
|
||||
- **Partially provisioned**: Some of the resources are controlled by Git Sync.
|
||||
- **Fully provisioned**: All supported resource types are managed by Git Sync. Note that unsupported resources are not managed.
|
||||
|
||||
## Common use cases
|
||||
|
||||
You can use Git Sync in the following scenarios.
|
||||
|
||||
### Version control and auditing
|
||||
|
||||
Organizations can maintain a structured, version-controlled history of Grafana dashboards. The version control lets you revert to previous versions when necessary, compare modifications across commits, and ensure transparency in dashboard management.
|
||||
|
||||
Additionally, having a detailed history of changes enhances compliance efforts, as teams can generate audit logs that document who made changes, when they were made, and why.
|
||||
|
||||
### Automated deployment and CI/CD integration
|
||||
|
||||
Teams can streamline their workflow by integrating dashboard updates into their CI/CD pipelines. By pushing changes to GitHub, automated processes can trigger validation checks, test dashboard configurations, and deploy updates programmatically using the `grafanactl` CLI and Foundation SDK.
|
||||
|
||||
This reduces the risk of human errors, ensures consistency across environments, and enables a faster, more reliable release cycle for dashboards used in production monitoring and analytics.
|
||||
|
||||
### Collaborative dashboard development
|
||||
|
||||
With Git Sync, multiple users can work on dashboards simultaneously without overwriting each other’s modifications.
|
||||
By leveraging pull requests and branch-based workflows, teams can submit changes for review before merging them into the main branch. This process not only improves quality control but also ensures that dashboards adhere to best practices and organizational standards.
|
||||
|
||||
Additionally, GitHub’s built-in discussion and review tools facilitate effective collaboration, making it easier to address feedback before changes go live.
|
||||
|
||||
### Multi-environment synchronization
|
||||
|
||||
Enterprises managing multiple Grafana instances, such as development, staging, and production environments, can seamlessly sync dashboards across these instances. This ensures consistency in visualization and monitoring configurations, reducing discrepancies that might arise from manually managing dashboards in different environments.
|
||||
|
||||
By using Git Sync, teams can automate deployments across environments, eliminating repetitive setup tasks and maintaining a standardized monitoring infrastructure across the organization.
|
||||
|
||||
### Disaster recovery and backup
|
||||
|
||||
By continuously syncing dashboards to GitHub, organizations can create an always-updated backup, ensuring dashboards are never lost due to accidental deletion or system failures.
|
||||
|
||||
If an issue arises, such as a corrupted dashboard, unintended modification, or a system crash, teams can quickly restore the latest functional version from the Git repository. This not only minimizes downtime but also adds a layer of resilience to Grafana monitoring setups, ensuring critical dashboards remain available when needed.
|
||||
|
||||
## Provision dashboards as code
|
||||
|
||||
Because dashboards are defined in JSON files, you can enable as-code workflows where the JSON file is an output from Go, TypeScript, or another coding language in the format of a dashboard schema.
|
||||
|
||||
To learn more about creating dashboards in a coding language to provision them for Git Sync, refer to the [Foundation SDK](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/observability-as-code/foundation-sdk) documentation.
|
||||
+138
@@ -0,0 +1,138 @@
|
||||
---
|
||||
description: Update, save, and modify provisioned resources in Grafana using Git Sync.
|
||||
keywords:
|
||||
- dashboards
|
||||
- provisioned files
|
||||
- git sync
|
||||
- github
|
||||
labels:
|
||||
products:
|
||||
- enterprise
|
||||
- oss
|
||||
title: Work with provisioned dashboards
|
||||
weight: 300
|
||||
canonical: https://grafana.com/docs/grafana/latest/as-code/observability-as-code/provision-resources/provisioned-dashboards/
|
||||
aliases:
|
||||
- ../../../observability-as-code/provision-resources/provisioned-dashboards/ # /docs/grafana/next/observability-as-code/provision-resources/provisioned-dashboards/
|
||||
---
|
||||
|
||||
# Work with provisioned dashboards
|
||||
|
||||
{{< admonition type="caution" >}}
|
||||
|
||||
Git Sync is available in [private preview](https://grafana.com/docs/release-life-cycle/) for Grafana Cloud. Support and documentation is available but might be limited to enablement, configuration, and some troubleshooting. No SLAs are provided. You can sign up to the private preview using the [Git Sync early access form](https://forms.gle/WKkR3EVMcbqsNnkD9).
|
||||
|
||||
Git Sync and local file provisioning are [experimental features](https://grafana.com/docs/release-life-cycle/) introduced in Grafana v12 for open source and Enterprise editions. Engineering and on-call support is not available. Documentation is either limited or not provided outside of code comments. No SLA is provided.
|
||||
|
||||
{{< /admonition >}}
|
||||
|
||||
Using Provisioning, you can choose to store your dashboard JSON files in either GitHub repositories using Git Sync or a local file path.
|
||||
|
||||
For more information, refer to the [Dashboards](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/dashboards/) documentation.
|
||||
|
||||
## Provisioning methods
|
||||
|
||||
Dashboards and folders synchronized using Git Sync or a local file path are referred to as "provisioned" resources.
|
||||
|
||||
### Git Sync provisioning
|
||||
|
||||
Of the two experimental options, **Git Sync** is the recommended method for provisioning your dashboards.
|
||||
You can synchronize any new dashboards and changes to existing dashboards to your configured GitHub repository.
|
||||
If you push a change in the repository, those changes are mirrored in your Grafana instance.
|
||||
|
||||
For more information on configuring Git Sync, refer to [Introduction to Git Sync](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/observability-as-code/provision-resources/intro-git-sync/).
|
||||
|
||||
### Local path provisioning
|
||||
|
||||
Local path provisioning makes files from a specified path available within Grafana, and any changes made in the configured local path are updated in Grafana. Note that these provisioned resources can only be modified in the local files and not within Grafana.
|
||||
|
||||
Refer to [Set up file provisioning](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/observability-as-code/provision-resources/file-path-setup) to learn more about the version of local file provisioning in Grafana 12.
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
The experimental local path provisioning using **Administration** > **Provisioning** will replace the file provisioning methods Grafana uses for referencing local file.
|
||||
|
||||
For production systems, use the established methods for provisioning file systems in Grafana.
|
||||
Refer to [Provision Grafana](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/administration/provisioning/#provision-folders-structure-from-filesystem-to-grafana) for more information.
|
||||
{{< /admonition >}}
|
||||
|
||||
## Manage dashboards provisioned with Git Sync
|
||||
|
||||
Using Git Sync, you can manage your dashboards in the UI and synchronize them with a GitHub repository.
|
||||
|
||||
Git Sync changes the behavior in Grafana for dashboards that are saved in Git Sync:
|
||||
|
||||
- Dashboards saved in your repository or local folder configured with Git Sync appear in a provisioned folder in Grafana.
|
||||
- Any dashboard folders saved with Git Sync have a **Provisioned** label in the UI.
|
||||
- Any changes to a provisioned resources have to be saved to the repository by opening a pull request or committing directly to the `main` branch.
|
||||
|
||||
You can set a single folder, or multiple folders to a different repository, with up to 10 connections.
|
||||
|
||||
### Git workflow with dashboards
|
||||
|
||||
By default, Git version control uses a branch-based workflow for changes. This means that you can:
|
||||
|
||||
- Commit changes to an existing branch (such as `main`) or save them to a new branch in your GitHub repository.
|
||||
- Use pull requests to review changes to dashboards.
|
||||
- Preview the changes before merging.
|
||||
|
||||
To learn more about Git, refer to [Getting Started - About Version Control](https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control) of the [Pro Git book](https://git-scm.com/book/en/v2) in the official Git documentation.
|
||||
|
||||
### Add and save a new dashboard
|
||||
|
||||
When you create a new dashboard in a provisioned folder associated with a GitHub repository, you follow the same process you use for any new dashboard.
|
||||
Refer to [Create a dashboard](http://grafana.com/docs/grafana/<GRAFANA_VERSION>/dashboards/build-dashboards/create-dashboard/) for more information.
|
||||
|
||||
After you create the dashboard, the steps are similar to [Save dashboard changes to GitHub](#save-dashboard-changes-to-github).
|
||||
|
||||
1. Select **Save** to preserve the new dashboard.
|
||||
1. Enter a title for the dashboard and a description.
|
||||
1. Select the provisioned folder from the **Folder** drop-down list.
|
||||
1. In **Path**, provide the path for your repository, ending in a JSON or YAML file.
|
||||
1. For **Workflow**, select **Push to main** to make a Git commit directly to the repository or **Push to a new branch** to create a pull request.
|
||||
- **Branch**: Specify the branch name in GitHub (for example, main). This option only appears if you select **Push to a new branch**.
|
||||
1. Select **Save**.
|
||||
|
||||
### Save dashboard changes to GitHub
|
||||
|
||||
When you edit a provisioned resource, you are prompted to save or discard those changes.
|
||||
Saving changes requires opening a pull request in your GitHub repository.
|
||||
|
||||
1. Select **Edit** to update a provisioned dashboard. Make your desired changes.
|
||||
|
||||
1. Click **Save dashboard**.
|
||||
|
||||
1. On the **Provisioned dashboard** panel, choose the options you want to use:
|
||||
- **Update default refresh value**: Check this box to make the current refresh the new default.
|
||||
- **Update default variable values**: Check this box to make the current values the new default.
|
||||
- **Path**: Provide the path for your repository, ending in a JSON or YAML file.
|
||||
- **Workflow:** Select **Push to main** to make a Git commit directly to the repository or **Push to a new branch** to create a pull request.
|
||||
- **Branch**: Specify the branch name in GitHub (for example, main). This option only appears if you select **Push to a new branch**.
|
||||
- **Comment**: Add a comment describing your changes.
|
||||
|
||||
1. Optional: Select the **Changes** tab to view the differences between the updates you made and the original resource.
|
||||
|
||||
1. Select **Save**.
|
||||
|
||||
1. If you chose **Push to a new branch**, select **Open a pull request in GitHub** to open a new PR to your repository. GitHub opens with your dashboard’s code as the contents of the PR.
|
||||
|
||||
1. Follow your usual GitHub workflow to save and merge the PR to your repository.
|
||||
|
||||
### Remove dashboards
|
||||
|
||||
You can remove a provisioned dashboard by deleting the dashboard from the repository. The Grafana UI updates when the changes from the GitHub repository sync.
|
||||
|
||||
To restore a deleted dashboard, raise a PR directly in your GitHub repository. Restoring resources from the UI is currently not possible.
|
||||
|
||||
### Tips
|
||||
|
||||
- Use GitHub pull requests for changes to maintain review processes.
|
||||
- Provide clear commit messages describing your changes.
|
||||
- Regularly sync your repository to keep Grafana up to date.
|
||||
- Review the **Events** tab to monitor sync status.
|
||||
|
||||
## Manage dashboards provisioned with file provisioning
|
||||
|
||||
To update any resources in the local path, you need to edit the files directly and then save them locally.
|
||||
These changes are synchronized to Grafana. However, you can't create, edit, or delete these resources using the Grafana UI.
|
||||
|
||||
Refer to [Set up file provisioning](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/observability-as-code/provision-resources/file-path-setup/) for configuration instructions.
|
||||
@@ -0,0 +1,94 @@
|
||||
---
|
||||
description: Instructions for working with Git Sync to perform common tasks, such as saving dashboards to GitHub and synchronizing changes with Grafana.
|
||||
keywords:
|
||||
- as code
|
||||
- as-code
|
||||
- dashboards
|
||||
- git integration
|
||||
- git sync
|
||||
- github
|
||||
labels:
|
||||
products:
|
||||
- enterprise
|
||||
- oss
|
||||
title: Manage provisioned repositories with Git Sync
|
||||
menuTitle: Manage repositories with Git Sync
|
||||
weight: 400
|
||||
canonical: https://grafana.com/docs/grafana/latest/as-code/observability-as-code/provision-resources/use-git-sync/
|
||||
aliases:
|
||||
- ../../../observability-as-code/provision-resources/use-git-sync/ # /docs/grafana/next/observability-as-code/provision-resources/use-git-sync/
|
||||
---
|
||||
|
||||
# Manage provisioned repositories with Git Sync
|
||||
|
||||
{{< admonition type="caution" >}}
|
||||
|
||||
Git Sync is available in [private preview](https://grafana.com/docs/release-life-cycle/) for Grafana Cloud, and is an [experimental feature](https://grafana.com/docs/release-life-cycle/) in Grafana v12 for open source and Enterprise editions.
|
||||
|
||||
Support and documentation is available but might be limited to enablement, configuration, and some troubleshooting. No SLAs are provided.
|
||||
|
||||
You can sign up to the private preview using the [Git Sync early access form](https://forms.gle/WKkR3EVMcbqsNnkD9).
|
||||
|
||||
{{< /admonition >}}
|
||||
|
||||
After you have set up Git Sync, you can synchronize any changes you make in your existing provisioned folders in the UI with your configured GitHub repository. Similarly, if you push a change into your repository, those changes are mirrored in your Grafana instance.
|
||||
|
||||
## View current status of synchronization
|
||||
|
||||
When you synchronize a repository, Git Sync also creates a dashboard that provides a summary of resources, health, pull status, webhook, sync jobs, resources, and files.
|
||||
|
||||
Use the **View** section in **Provisioning** to see detailed information about the current status of your sync, understand the health of your repository's connection with Grafana, and [troubleshoot](#troubleshoot-synchronization) possible issues:
|
||||
|
||||
1. Log in to your Grafana server with an account that has the Grafana Admin or Editor flag set.
|
||||
1. Select **Administration** in the left-side menu and then **Provisioning**.
|
||||
1. Locate the repository you are interested in.
|
||||
1. If you see a green `Up-to-date` label next to the repository name, then everything is syncing as expected.
|
||||
1. Select **View** to access detailed dashboards and reports about the synchronization history of your repository.
|
||||
|
||||
## Synchronize changes
|
||||
|
||||
Synchronizing resources from provisioned repositories into your Grafana instance pulls the resources into the selected folder. Existing dashboards with the same `uid` are overwritten.
|
||||
|
||||
To sync changes from your Grafana dashboards with your Git repository:
|
||||
|
||||
1. From the left menu, select **Administration** > **Provisioning**.
|
||||
1. Select **Pull** under the repository you want to sync.
|
||||
1. Wait for the synchronization process to complete.
|
||||
|
||||
## Remove a repository
|
||||
|
||||
To delete a repository, follow these steps.
|
||||
|
||||
1. Log in to your Grafana server with an account that has the Grafana Admin or Editor flag set.
|
||||
1. Select **Administration** in the left-side menu and then **Provisioning**.
|
||||
1. Locate the repository you are interested in.
|
||||
1. Select the trashcan icon in the right side to delete the chosen entry.
|
||||
1. Select **Delete** to confirm.
|
||||
|
||||
Refer to [Work with provisioned dashboards](../provisioned-dashboards) for information on removing provisioned files.
|
||||
|
||||
## Troubleshoot synchronization
|
||||
|
||||
{{< admonition type="caution" >}}
|
||||
|
||||
Before you proceed to troubleshoot, understand the [known limitations](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/observability-as-code/provision-resources/intro-git-sync#known-limitations/).
|
||||
|
||||
{{< /admonition >}}
|
||||
|
||||
Monitor the **View** status page for synchronization issues and status updates. Common events include:
|
||||
|
||||
- Sync started
|
||||
- Sync completed
|
||||
- Sync failed (with error details)
|
||||
- Sync issues
|
||||
|
||||
### Dashboard sync errors
|
||||
|
||||
- If dashboards are not syncing, check if the repository URL is correct and accessible from the Grafana instance.
|
||||
- Ensure that the configured repository branch exists and is correctly referenced.
|
||||
- Check for conflicts in the repository that may prevent syncing.
|
||||
|
||||
### Dashboard import errors
|
||||
|
||||
- Validate the JSON format of the dashboard files before importing.
|
||||
- If the import fails, check Grafana logs for error messages and troubleshoot accordingly.
|
||||
Reference in New Issue
Block a user