mirror of
https://github.com/grafana/grafana.git
synced 2025-12-21 03:54:29 +08:00
Compare commits
117 Commits
docs/add-t
...
v9.5.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc353e4b2d | ||
|
|
54bfe7f887 | ||
|
|
26f6191b1d | ||
|
|
df81ebba34 | ||
|
|
57dbd0b18a | ||
|
|
80de6d6d02 | ||
|
|
7a1a8b7a86 | ||
|
|
5790ba49c2 | ||
|
|
02e1181c3b | ||
|
|
827cc6f1c8 | ||
|
|
fa1bd24b47 | ||
|
|
8357ceae7b | ||
|
|
dda934678d | ||
|
|
8bc2a7144a | ||
|
|
6c0aeb452d | ||
|
|
38fdfd6bfc | ||
|
|
900c18ef5b | ||
|
|
ae716112dc | ||
|
|
d153c50454 | ||
|
|
7694ea28e5 | ||
|
|
32869c96df | ||
|
|
2ed30e9831 | ||
|
|
5bb4a9c89f | ||
|
|
dcc5190620 | ||
|
|
006cea2192 | ||
|
|
384a21d03c | ||
|
|
71ebf83dd0 | ||
|
|
581cbe4295 | ||
|
|
3133aa135d | ||
|
|
e9b2eb1607 | ||
|
|
e6eb1df488 | ||
|
|
f0ae1b41b5 | ||
|
|
ad9dd6a1dd | ||
|
|
0315b911ef | ||
|
|
33ff08215c | ||
|
|
6a1a71f8bd | ||
|
|
826e500bf2 | ||
|
|
3fb37e26b5 | ||
|
|
81b78f3af4 | ||
|
|
9afddd77bd | ||
|
|
760146aeab | ||
|
|
bd63388bc5 | ||
|
|
c035abf529 | ||
|
|
68d2179aa2 | ||
|
|
08f57ef45c | ||
|
|
7f1a840f36 | ||
|
|
5e07346da9 | ||
|
|
c5352a10fe | ||
|
|
1433fcb9b2 | ||
|
|
4cd346e66c | ||
|
|
84850f4553 | ||
|
|
5bcc35298f | ||
|
|
ac7eecdb47 | ||
|
|
2fda756320 | ||
|
|
12c2bbfc56 | ||
|
|
6b68549bb4 | ||
|
|
0b9ef6d3f4 | ||
|
|
014b77bb79 | ||
|
|
61fe7dccb8 | ||
|
|
abd9543c14 | ||
|
|
3369033d74 | ||
|
|
b5cb0e5cc6 | ||
|
|
d40a837d5c | ||
|
|
0f4a76c9de | ||
|
|
0f10b98202 | ||
|
|
fde8d81de3 | ||
|
|
12d121a1fc | ||
|
|
c956cd2a32 | ||
|
|
c52f932025 | ||
|
|
522598d650 | ||
|
|
f26e56bc43 | ||
|
|
348ced74b4 | ||
|
|
1ad3ee4255 | ||
|
|
a38b4cf3b0 | ||
|
|
f09b60467e | ||
|
|
122a38543c | ||
|
|
8f9edf19a3 | ||
|
|
fe530beebd | ||
|
|
2e866faac4 | ||
|
|
f5063b3805 | ||
|
|
97164ed37e | ||
|
|
1ef8c02d19 | ||
|
|
345909d74b | ||
|
|
ba3f3ec59d | ||
|
|
37883ed9ef | ||
|
|
c1136a48b2 | ||
|
|
acf9030e26 | ||
|
|
cf31c0b7bd | ||
|
|
7159c79069 | ||
|
|
7dab288d64 | ||
|
|
2f550d1f03 | ||
|
|
5aecd7cf1f | ||
|
|
1bb827d634 | ||
|
|
3b67cebd40 | ||
|
|
8dac8ab37b | ||
|
|
c92d8591cb | ||
|
|
ab8994183d | ||
|
|
e47e901618 | ||
|
|
c9eff57efe | ||
|
|
5f73666f54 | ||
|
|
a63d1714b5 | ||
|
|
9c7b4e0f3f | ||
|
|
a013ee7be4 | ||
|
|
734fb8a3e5 | ||
|
|
ec109a913b | ||
|
|
7104dc3fef | ||
|
|
a6a9e4e0ed | ||
|
|
62e0b45067 | ||
|
|
0f0e2664cc | ||
|
|
1dc26665f3 | ||
|
|
b68716e9eb | ||
|
|
638a277364 | ||
|
|
c7cc68649d | ||
|
|
119fb76938 | ||
|
|
fbb66e6b9f | ||
|
|
ea8d17009f | ||
|
|
f34d0df862 |
@@ -3139,27 +3139,20 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "2"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "4"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "5"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "6"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "4"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "5"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "6"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "7"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "8"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "9"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "10"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "11"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "9"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "10"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "11"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "12"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "13"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "14"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "14"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "15"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "16"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "17"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "18"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "19"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "20"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "21"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "22"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "23"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "24"]
|
||||
[0, 0, 0, "Do not use any type assertions.", "17"]
|
||||
],
|
||||
"public/app/features/plugins/importPanelPlugin.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
|
||||
571
.drone.yml
571
.drone.yml
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@
|
||||
ARG BASE_IMAGE=alpine:3.17
|
||||
ARG JS_IMAGE=node:18-alpine3.17
|
||||
ARG JS_PLATFORM=linux/amd64
|
||||
ARG GO_IMAGE=golang:1.20.1-alpine3.17
|
||||
ARG GO_IMAGE=golang:1.20.3-alpine3.17
|
||||
|
||||
ARG GO_SRC=go-builder
|
||||
ARG JS_SRC=js-builder
|
||||
@@ -31,6 +31,8 @@ RUN yarn build
|
||||
|
||||
FROM ${GO_IMAGE} as go-builder
|
||||
|
||||
ARG COMMIT_SHA=""
|
||||
ARG BUILD_BRANCH=""
|
||||
ARG GO_BUILD_TAGS="oss"
|
||||
ARG WIRE_TAGS="oss"
|
||||
ARG BINGO="true"
|
||||
@@ -62,7 +64,9 @@ COPY pkg pkg
|
||||
COPY scripts scripts
|
||||
COPY conf conf
|
||||
COPY .github .github
|
||||
COPY .git .git
|
||||
|
||||
ENV COMMIT_SHA=${COMMIT_SHA}
|
||||
ENV BUILD_BRANCH=${BUILD_BRANCH}
|
||||
|
||||
RUN make build-go GO_BUILD_TAGS=${GO_BUILD_TAGS} WIRE_TAGS=${WIRE_TAGS}
|
||||
|
||||
|
||||
6
Makefile
6
Makefile
@@ -176,6 +176,8 @@ build-docker-full: ## Build Docker image for development.
|
||||
--build-arg BINGO=false \
|
||||
--build-arg GO_BUILD_TAGS=$(GO_BUILD_TAGS) \
|
||||
--build-arg WIRE_TAGS=$(WIRE_TAGS) \
|
||||
--build-arg COMMIT_SHA=$$(git rev-parse --short HEAD) \
|
||||
--build-arg BUILD_BRANCH=$$(git rev-parse --abbrev-ref HEAD) \
|
||||
--tag grafana/grafana$(TAG_SUFFIX):dev \
|
||||
$(DOCKER_BUILD_ARGS)
|
||||
|
||||
@@ -187,8 +189,10 @@ build-docker-full-ubuntu: ## Build Docker image based on Ubuntu for development.
|
||||
--build-arg BINGO=false \
|
||||
--build-arg GO_BUILD_TAGS=$(GO_BUILD_TAGS) \
|
||||
--build-arg WIRE_TAGS=$(WIRE_TAGS) \
|
||||
--build-arg COMMIT_SHA=$$(git rev-parse --short HEAD) \
|
||||
--build-arg BUILD_BRANCH=$$(git rev-parse --abbrev-ref HEAD) \
|
||||
--build-arg BASE_IMAGE=ubuntu:20.04 \
|
||||
--build-arg GO_IMAGE=golang:1.20.1 \
|
||||
--build-arg GO_IMAGE=golang:1.20.3 \
|
||||
--tag grafana/grafana$(TAG_SUFFIX):dev-ubuntu \
|
||||
$(DOCKER_BUILD_ARGS)
|
||||
|
||||
|
||||
@@ -90,6 +90,14 @@ read_timeout = 0
|
||||
#exampleHeader1 = exampleValue1
|
||||
#exampleHeader2 = exampleValue2
|
||||
|
||||
#################################### GRPC Server #########################
|
||||
[grpc_server]
|
||||
network = "tcp"
|
||||
address = "127.0.0.1:10000"
|
||||
use_tls = false
|
||||
cert_file =
|
||||
key_file =
|
||||
|
||||
#################################### Database ############################
|
||||
[database]
|
||||
# You can configure the database connection by specifying type, host, name, user and password
|
||||
@@ -405,6 +413,21 @@ default_home_dashboard_path =
|
||||
# Upper limit of data sources that Grafana will return. This limit is a temporary configuration and it will be deprecated when pagination will be introduced on the list data sources API.
|
||||
datasource_limit = 5000
|
||||
|
||||
|
||||
################################### SQL Data Sources #####################
|
||||
[sql_datasources]
|
||||
# Default maximum number of open connections maintained in the connection pool
|
||||
# when connecting to SQL based data sources
|
||||
max_open_conns_default = 100
|
||||
|
||||
# Default maximum number of idle connections maintained in the connection pool
|
||||
# when connecting to SQL based data sources
|
||||
max_idle_conns_default = 100
|
||||
|
||||
# Default maximum connection lifetime used when connecting
|
||||
# to SQL based data sources.
|
||||
max_conn_lifetime_default = 14400
|
||||
|
||||
#################################### Users ###############################
|
||||
[users]
|
||||
# disable user signup / registration
|
||||
|
||||
@@ -91,6 +91,14 @@
|
||||
#exampleHeader1 = exampleValue1
|
||||
#exampleHeader2 = exampleValue2
|
||||
|
||||
#################################### GRPC Server #########################
|
||||
;[grpc_server]
|
||||
;network = "tcp"
|
||||
;address = "127.0.0.1:10000"
|
||||
;use_tls = false
|
||||
;cert_file =
|
||||
;key_file =
|
||||
|
||||
#################################### Database ####################################
|
||||
[database]
|
||||
# You can configure the database connection by specifying type, host, name, user and password
|
||||
|
||||
@@ -70,8 +70,8 @@ title: Grafana documentation
|
||||
<h4>Provisioning</h4>
|
||||
<p>Learn how to automate your Grafana configuration.</p>
|
||||
</a>
|
||||
<a href="{{< relref "whatsnew/whats-new-in-v9-4/" >}}" class="nav-cards__item nav-cards__item--guide">
|
||||
<h4>What's new in v9.4</h4>
|
||||
<a href="{{< relref "whatsnew/whats-new-in-v9-5/" >}}" class="nav-cards__item nav-cards__item--guide">
|
||||
<h4>What's new in v9.5</h4>
|
||||
<p>Explore the features and enhancements in the latest release.</p>
|
||||
</a>
|
||||
|
||||
|
||||
@@ -46,7 +46,8 @@ By default, data sources in an organization can be queried by any user in that o
|
||||
|
||||
You can assign data source permissions to users, teams, and roles which will allow access to query or edit the data source.
|
||||
|
||||
1. Navigate to **Administration > Data sources**.
|
||||
1. Click **Connections** in the left-side menu.
|
||||
1. Under Your connections, click **Data sources**.
|
||||
1. Select the data source to which you want to assign permissions.
|
||||
1. On the Permissions tab, click **Add a permission**.
|
||||
1. Select **User**, **Team**, or **Role**.
|
||||
@@ -58,7 +59,8 @@ You can assign data source permissions to users, teams, and roles which will all
|
||||
|
||||
### Edit data source permissions for users, teams, or roles
|
||||
|
||||
1. Navigate to **Administration > Data sources**.
|
||||
1. Click **Connections** in the left-side menu.
|
||||
1. Under Your connections, click **Data sources**.
|
||||
1. Select the data source for which you want to edit permissions.
|
||||
1. On the Permissions tab, find the user, team, or role permission you want to update.
|
||||
1. Select a different option in the **Permission** dropdown.
|
||||
@@ -67,7 +69,8 @@ You can assign data source permissions to users, teams, and roles which will all
|
||||
|
||||
### Remove data source permissions for users, teams, or roles
|
||||
|
||||
1. Navigate to **Administration > Data sources**.
|
||||
1. Click **Connections** in the left-side menu.
|
||||
1. Under Your connections, click **Data sources**.
|
||||
1. Select the data source from which you want to remove permissions.
|
||||
1. On the Permissions tab, find the user, team, or role permission you want to remove.
|
||||
1. Click the **X** next to the permission.
|
||||
@@ -122,9 +125,10 @@ You must be an Org admin or Grafana admin to enable query caching for a data sou
|
||||
|
||||
By default, data source queries are not cached. To enable query caching for a single data source:
|
||||
|
||||
1. On the left-side menu, click **Administration > Data sources**.
|
||||
1. Click **Connections** in the left-side menu.
|
||||
1. Under Your Connections, click **Data sources**.
|
||||
1. In the data source list, click the data source that you want to turn on caching for.
|
||||
1. Open the Cache tab.
|
||||
1. Go to the Cache tab.
|
||||
1. Click **Enable**.
|
||||
1. (Optional) Choose custom TTLs for the data source's queries and resources caching. If you skip this step, then Grafana uses the default TTL.
|
||||
|
||||
@@ -140,9 +144,10 @@ To configure global settings for query caching, refer to the [Query caching sect
|
||||
|
||||
To disable query caching for a single data source:
|
||||
|
||||
1. On the left-side menu, click **Administration > Data sources**.
|
||||
1. Click **Connections** in the left-side menu.
|
||||
1. Under Your Connections, click **Data sources**.
|
||||
1. In the data source list, click the data source that you want to turn off caching for.
|
||||
1. In the Cache tab, click **Disable**.
|
||||
1. On the Cache tab, click **Disable**.
|
||||
|
||||
To disable query caching for an entire Grafana instance, set the `enabled` flag to `false` in the [Query caching section of Enterprise Configuration]({{< relref "../../setup-grafana/configure-grafana/enterprise-configuration/#caching" >}}). You will no longer see the Cache tab on any data sources, and no data source queries will be cached.
|
||||
|
||||
@@ -152,7 +157,8 @@ If you experience performance issues or repeated queries become slower to execut
|
||||
|
||||
> **Note:** This action impacts all cache-enabled data sources. If you are using Memcached, the system clears all data from the Memcached instance.
|
||||
|
||||
1. On the left-side menu, click **Administration > Data sources**.
|
||||
1. Click **Connections** in the left-side menu.
|
||||
1. Under Your Connections, click **Data sources**.
|
||||
1. In the data source list, click the data source that you want to clear the cache for.
|
||||
1. In the Cache tab, click **Clear cache**.
|
||||
|
||||
|
||||
@@ -52,8 +52,8 @@ There is more than one way to add the license to a Grafana instance:
|
||||
This is the preferred option for single instance installations of Grafana Enterprise.
|
||||
|
||||
1. Sign in as a Grafana server administrator.
|
||||
1. Navigate to **Server Admin > Upgrade** within Grafana.
|
||||
1. Click **Upload license token file**.
|
||||
1. Click **Administration > Stats and license** in the side navigation menu.
|
||||
1. Click **Upload a new token**.
|
||||
1. Select your license file, and upload it.
|
||||
|
||||
#### Put the `license.jwt` file into the data directory of Grafana
|
||||
@@ -205,7 +205,7 @@ To determine the number of active users:
|
||||
|
||||
1. Sign in to Grafana Enterprise as a System Administrator.
|
||||
|
||||
1. Click **Administration** in the left-side menu.
|
||||
1. Click **Administration** in the side navigation menu.
|
||||
|
||||
1. Click **Stats and license**.
|
||||
|
||||
|
||||
@@ -32,9 +32,9 @@ You can use AWS Marketplace to make the following modifications to your Grafana
|
||||
|
||||
1. Sign in to Grafana as a Server Administrator.
|
||||
|
||||
1. Click **Administration** in the left-side menu, and then **Stats and license**.
|
||||
1. Click **Administration** in the side navigation menu, and then **Stats and license**.
|
||||
|
||||
1. In the **Token** section under **Enterprise License**, click **Renew License**.
|
||||
1. In the **Token** section under **Enterprise License**, click **Renew token**.
|
||||
|
||||
This action retrieves updated license information from AWS.
|
||||
|
||||
|
||||
@@ -72,18 +72,20 @@ The Plugin catalog allows you to browse and manage plugins from within Grafana.
|
||||
</video>
|
||||
</div>
|
||||
|
||||
_Video shows the Plugin catalog in a previous version of Grafana._
|
||||
|
||||
In order to be able to install / uninstall / update plugins using plugin catalog, you must enable it via the `plugin_admin_enabled` flag in the [configuration]({{< relref "../../setup-grafana/configure-grafana/#plugin_admin_enabled" >}}) file.
|
||||
Before following the steps below, make sure you are logged in as a Grafana administrator.
|
||||
|
||||
<a id="#plugin-catalog-entry"></a>
|
||||
|
||||
- Administrators can find the Plugin catalog at **Configuration > Plugins**.
|
||||
Administrators can find the Plugin catalog at **Administration > Plugins**.
|
||||
|
||||
### Browse plugins
|
||||
|
||||
To browse for available plugins:
|
||||
|
||||
1. In Grafana, [navigate to the Plugin catalog](#plugin-catalog-entry) to view installed plugins.
|
||||
1. In Grafana, click **Administration > Plugins** in the side navigation menu to view installed plugins.
|
||||
1. Click the **All** filter to browse all available plugins.
|
||||
1. Click the **Data sources**, **Panels**, or **Applications** buttons to filter by plugin type.
|
||||
|
||||
@@ -91,7 +93,7 @@ To browse for available plugins:
|
||||
|
||||
To install a plugin:
|
||||
|
||||
1. In Grafana, [navigate to the Plugin catalog](#plugin-catalog-entry) to view installed plugins.
|
||||
1. In Grafana, click **Administration > Plugins** in the side navigation menu to view installed plugins.
|
||||
1. Browse and find a plugin.
|
||||
1. Click on the plugin logo.
|
||||
1. Click **Install**.
|
||||
@@ -102,7 +104,7 @@ When the update is complete, you see a confirmation message that the installatio
|
||||
|
||||
To update a plugin:
|
||||
|
||||
1. In Grafana, [navigate to the Plugin catalog](#plugin-catalog-entry) to view installed plugins.
|
||||
1. In Grafana, click **Administration > Plugins** in the side navigation menu to view installed plugins.
|
||||
1. Click on the plugin logo.
|
||||
1. Click **Update**.
|
||||
|
||||
@@ -112,7 +114,7 @@ When the update is complete, you see a confirmation message that the update was
|
||||
|
||||
To uninstall a plugin:
|
||||
|
||||
1. In Grafana, [navigate to the Plugin catalog](#plugin-catalog-entry) to view installed plugins.
|
||||
1. In Grafana, click **Administration > Plugins** in the side navigation menu to view installed plugins.
|
||||
1. Click on the plugin logo.
|
||||
1. Click **Uninstall**.
|
||||
|
||||
|
||||
@@ -7,6 +7,10 @@ keywords:
|
||||
- query
|
||||
- queries
|
||||
- recorded
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
title: Recorded queries
|
||||
weight: 300
|
||||
---
|
||||
|
||||
@@ -3,6 +3,11 @@ aliases:
|
||||
- ../../enterprise/access-control/
|
||||
- ../../enterprise/access-control/about-rbac/
|
||||
- ../../enterprise/access-control/roles/
|
||||
cascade:
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
description: Role-based access control (RBAC) provides a standardized way of granting,
|
||||
changing, and revoking access so that users can view and modify Grafana resources,
|
||||
such as users and reports.
|
||||
|
||||
@@ -31,7 +31,8 @@ In [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}})
|
||||
> **Note:** Service accounts can only act in the organization they are created for. If you have the same task that is needed for multiple organizations, we recommend creating service accounts in each organization.
|
||||
|
||||
{{< vimeo 742056367 >}}
|
||||
<br>
|
||||
|
||||
_Video shows service accounts in Grafana v9.1. Refer to [Create a service account in Grafana]({{< relref "#create-a-service-account-in-grafana" >}}) for current instructions._
|
||||
|
||||
## Service account tokens
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@ Grafana Alerting is available for Grafana OSS, Grafana Enterprise, or Grafana Cl
|
||||
|
||||
Watch this video to learn more about Grafana Alerting: {{< vimeo 720001629 >}}
|
||||
|
||||
_Video shows Alerting in Grafana v9.0. Refer to [Manage your alert rules]({{< relref "../alerting/alerting-rules/" >}}) for current instructions._
|
||||
|
||||
## Overview
|
||||
|
||||
The following diagram gives you an overview of how Grafana Alerting works and introduces you to some of the key concepts that work together and form the core of our flexible and powerful alerting engine.
|
||||
|
||||
@@ -8,30 +8,45 @@ keywords:
|
||||
- guide
|
||||
- rules
|
||||
- create
|
||||
title: Create Grafana managed alert rules
|
||||
title: Create Grafana-managed alert rules
|
||||
weight: 400
|
||||
---
|
||||
|
||||
# Create a Grafana managed alerting rule
|
||||
# Create Grafana-managed alert rules
|
||||
|
||||
Grafana allows you to create alerting rules that query one or more data sources, reduce or transform the results and compare them to each other or to fixed thresholds. When these are executed, Grafana sends notifications to the contact point. For information on Grafana Alerting, see [About Grafana Alerting]({{< relref "../" >}}) which explains the various components of Grafana Alerting. We also recommend that you familiarize yourself with some of the [fundamental concepts]({{< relref "../fundamentals/" >}}) of Grafana Alerting.
|
||||
Grafana-managed rules are the most flexible alert rule type. They allow you to create alerts that can act on data from any of our supported data sources. In addition to supporting multiple data sources, you can also add expressions to transform your data and set alert conditions. Using images in alert notifications is also supported. This is the only type of rule that allows alerting from multiple data sources in a single rule definition.
|
||||
|
||||
Multiple alert instances can be created as a result of one alert rule (also known as a multi-dimensional alerting).
|
||||
|
||||
For information on Grafana Alerting, see [Introduction to Grafana Alerting](/docs/grafana/next/alerting/fundamentals/), which explains the key concepts and features of Grafana Alerting.
|
||||
|
||||
Watch this video to learn more about creating alerts: {{< vimeo 720001934 >}}
|
||||
|
||||
## Add Grafana managed rule
|
||||
_Video shows Alerting in Grafana v9.0. Refer to [Add Grafana managed rule]({{< relref "#add-grafana-managed-rule" >}}) (following) for current instructions._
|
||||
|
||||
To create a Grafana-managed alert rule, complete the following steps.
|
||||
|
||||
1. In the left-side menu, click **Alerts & IRM** and then **Alerting**.
|
||||
1. Click **Alert rules**.
|
||||
1. Click **+ Create alert rule**. The new alerting rule page opens where the **Grafana managed alerts** option is selected by default.
|
||||
1. In Step 1, add the rule name.
|
||||
2. Click **Alert rules**.
|
||||
3. Click **+ Create alert rule**. The new alert rule page opens where the **Grafana managed alerts** option is selected by default.
|
||||
4. In Step 1, add the rule name.
|
||||
- In **Rule name**, add a descriptive name. This name is displayed in the alert rule list. It is also the `alertname` label for every alert instance that is created from this rule.
|
||||
1. In Step 2, add queries and expressions to evaluate, and then select the alert condition.
|
||||
5. In Step 2, add queries and expressions to evaluate, and then select the alert condition.
|
||||
|
||||
- For queries, select a data source from the dropdown.
|
||||
- Specify a [time range](/docs/grafana/latest/dashboards/use-dashboards/?pg=blog&plcmt=body-txt#time-units-and-relative-ranges).
|
||||
|
||||
**Note:**
|
||||
Grafana Alerting only supports fixed relative time ranges, for example, `now-24hr: now`.
|
||||
|
||||
It does not support absolute time ranges: `2021-12-02 00:00:00 to 2021-12-05 23:59:592` or semi-relative time ranges: `now/d to: now`.
|
||||
|
||||
- Add one or more [queries]({{< relref "/docs/grafana/latest/panels-visualizations/query-transform-data#add-a-query" >}}) or [expressions]({{< relref "/docs/grafana/latest/panels-visualizations/query-transform-data/expression-queries" >}}).
|
||||
- For each expression, select either **Classic condition** to create a single alert rule, or choose from the **Math**, **Reduce**, and **Resample** options to generate separate alert for each series. For details on these options, see [Single and multi dimensional rule](#single-and-multi-dimensional-rule).
|
||||
- Click **Run queries** to verify that the query is successful.
|
||||
- Next, select the query or expression for your alert condition.
|
||||
1. In Step 3, specify the alert evaluation interval.
|
||||
|
||||
6. In Step 3, specify the alert evaluation interval.
|
||||
|
||||
- From the **Condition** dropdown, select the query or expression to trigger the alert rule.
|
||||
- For **Evaluate every**, specify the frequency of evaluation. Must be a multiple of 10 seconds. For examples, `1m`, `30s`.
|
||||
@@ -44,17 +59,17 @@ Watch this video to learn more about creating alerts: {{< vimeo 720001934 >}}
|
||||
|
||||
You can pause alert rule evaluation to prevent noisy alerting while tuning your alerts. Pausing stops alert rule evaluation and does not create any alert instances. This is different to mute timings, which stop notifications from being delivered, but still allow for alert rule evaluation and the creation of alert instances.
|
||||
|
||||
1. In Step 4, add the storage location, rule group, as well as additional metadata associated with the rule.
|
||||
7. In Step 4, add the storage location, rule group, as well as additional metadata associated with the rule.
|
||||
- From the **Folder** dropdown, select the folder where you want to store the rule.
|
||||
- For **Group**, specify a pre-defined group. Newly created rules are appended to the end of the group. Rules within a group are run sequentially at a regular interval, with the same evaluation time.
|
||||
- Add a description and summary to customize alert messages. Use the guidelines in [Annotations and labels for alerting]({{< relref "../fundamentals/annotation-label/" >}}).
|
||||
- Add Runbook URL, panel, dashboard, and alert IDs.
|
||||
1. In Step 5, add custom labels.
|
||||
8. In Step 5, add custom labels.
|
||||
- Add custom labels selecting existing key-value pairs from the drop down, or add new labels by entering the new key or value .
|
||||
1. Click **Save** to save the rule or **Save and exit** to save the rule and go back to the Alerting page.
|
||||
1. Next, create a for the rule.
|
||||
9. Click **Save** to save the rule or **Save and exit** to save the rule and go back to the Alerting page.
|
||||
10. Next, create a for the rule.
|
||||
|
||||
### Single and multi dimensional rule
|
||||
### Single and multi-dimensional rule
|
||||
|
||||
For Grafana managed alerts, you can create a rule with a classic condition or you can create a multi-dimensional rule.
|
||||
|
||||
@@ -62,7 +77,9 @@ For Grafana managed alerts, you can create a rule with a classic condition or yo
|
||||
|
||||
Use the classic condition expression to create a rule that triggers a single alert when its condition is met. For a query that returns multiple series, Grafana does not track the alert state of each series. As a result, Grafana sends only a single alert even when alert conditions are met for multiple series.
|
||||
|
||||
**Multi dimensional rule**
|
||||
For more information, see [expressions documentation]({{< relref "/docs/grafana/latest/panels-visualizations/query-transform-data/expression-queries" >}}).
|
||||
|
||||
**Multi-dimensional rule**
|
||||
|
||||
To generate a separate alert for each series, create a multi-dimensional rule. Use `Math`, `Reduce`, or `Resample` expressions to create a multi-dimensional rule. For example:
|
||||
|
||||
@@ -73,22 +90,24 @@ To generate a separate alert for each series, create a multi-dimensional rule. U
|
||||
|
||||
> **Note:** Grafana does not support alert queries with template variables. More information is available at <https://community.grafana.com/t/template-variables-are-not-supported-in-alert-queries-while-setting-up-alert/2514>.
|
||||
|
||||
#### Rule with classic condition
|
||||
### Configure no data and error handling
|
||||
|
||||
For more information, see [expressions documentation]({{< relref "/docs/grafana/latest/panels-visualizations/query-transform-data/expression-queries" >}}).
|
||||
Configure alerting behavior when your alert rule evaluation returns no data or an error.
|
||||
|
||||
### No data and error handling
|
||||
**Note:** Alert rules that are configured to fire when an evaluation returns no data or error only fire when the entire duration of the evaluation period has finished. This means that rather than immediately firing when the alert rule condition is breached, the alert rule waits until the time set as the **For** field has finished and then fires, reducing alert noise and allowing for temporary data availability issues.
|
||||
|
||||
Configure alerting behavior in the absence of data using information in the following tables.
|
||||
If your alert rule evaluation returns no data, you can set the state on your alert rule to appear as follows:
|
||||
|
||||
| No Data Option | Description |
|
||||
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| No Data | Create a new alert `DatasourceNoData` with the name and UID of the alert rule, and UID of the datasource that returned no data as labels. |
|
||||
| Alerting | Set alert rule state to `Alerting`. This option will respect the configured **Evaluate for** pending period. |
|
||||
| Ok | Set alert rule state to `Normal`. |
|
||||
| No Data | Description |
|
||||
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| No Data | Creates a new alert `DatasourceNoData` with the name and UID of the alert rule, and UID of the datasource that returned no data as labels. |
|
||||
| Alerting | Sets alert rule state to `Alerting`. The alert rule waits until the time set in the **For** field has finished before firing. |
|
||||
| Ok | Sets alert rule state to `Normal`. |
|
||||
|
||||
| Error or timeout option | Description |
|
||||
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Error | Create a new alert `DatasourceError` with the name and UID of the alert rule, and UID of the datasource that returned no data as labels. |
|
||||
| Alerting | Set alert rule state to `Alerting`. This option will respect the configured **Evaluate for** pending period. |
|
||||
| OK | Set alert rule state to `Normal` |
|
||||
If your evaluation returns an error, you can set the state on your alert rule to appear as follows:
|
||||
|
||||
| Error | Description |
|
||||
| -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Error | Creates an alert instance `DatasourceError` with the name and UID of the alert rule, and UID of the datasource that returned no data as labels. |
|
||||
| Alerting | Sets alert rule state to `Alerting`. The alert rule waits until the time set in the **For** field has finished before firing. |
|
||||
| Ok | Sets alert rule state to `Normal`. |
|
||||
|
||||
@@ -30,6 +30,8 @@ Grafana allows you to create alerting rules for an external Grafana Mimir or Lok
|
||||
|
||||
Watch this video to learn more about how to create a Mimir managed alert rule: {{< vimeo 720001865 >}}
|
||||
|
||||
_Video shows Alerting in Grafana v8.5. Refer to [Add a Grafana Mimir or Loki managed alerting rule]({{< relref "#add-a-grafana-mimir-or-loki-managed-alerting-rule" >}}) (following) for current instructions._
|
||||
|
||||
> **Note:** If you do not want to manage alerting rules for a particular Loki or Prometheus data source, go to its settings and clear the **Manage alerts via Alerting UI** checkbox.
|
||||
|
||||
## Add a Grafana Mimir or Loki managed alerting rule
|
||||
|
||||
@@ -54,6 +54,6 @@ The following table lists the contact point integrations supported by Grafana.
|
||||
|
||||
## Useful links
|
||||
|
||||
[Manage contact points](/docs/grafana/next/alerting/manage-notifications/create-contact-point/)
|
||||
[Manage contact points](/docs/grafana/latest/alerting/manage-notifications/create-contact-point/)
|
||||
|
||||
[Create and edit notification templates](/docs/grafana/next/alerting/manage-notifications/create-message-template/)
|
||||
[Create and edit notification templates](/docs/grafana/latest/alerting/manage-notifications/template-notifications/create-notification-templates/)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
description: Configure integrations
|
||||
draft: true
|
||||
keywords:
|
||||
- Grafana
|
||||
- alerting
|
||||
@@ -14,7 +13,7 @@ weight: 100
|
||||
|
||||
# Configure integrations
|
||||
|
||||
Configure integrations in Grafana to select your preferred communication channel for receiving notifications when your alert rules are fire. Each integration has its own configuration options and setup process. In most cases, this involves providing an API key or a Webhook URL.
|
||||
Configure integrations in Grafana to select your preferred communication channel for receiving notifications when your alert rules are firing. Each integration has its own configuration options and setup process. In most cases, this involves providing an API key or a Webhook URL.
|
||||
|
||||
Once configured, you can use integrations as part of your contact points to receive notifications whenever your alert changes its state. In this section, we'll cover the basic steps to configure your integrations, so you can start receiving real-time alerts and stay on top of your monitoring data.
|
||||
|
||||
|
||||
@@ -71,6 +71,16 @@ The name of the annotation is {{ .Name }}, and the value is {{ .Value }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
## The index function
|
||||
|
||||
To print a specific annotation or label use the `index` function.
|
||||
|
||||
```
|
||||
{{ range .Alerts }}
|
||||
The name of the alert is {{ index .Labels "alertname" }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
## If statements
|
||||
|
||||
You can use if statements in templates. For example, to print `There are no alerts` if there are no alerts in `.Alerts` you would write the following:
|
||||
|
||||
@@ -24,22 +24,21 @@ There are three options to choose from:
|
||||
|
||||
For more information on the Alerting Provisioning HTTP API, refer to [Alerting provisioning API](https://grafana.com/docs/grafana/latest/developers/http_api/alerting_provisioning/).
|
||||
|
||||
**Note:**
|
||||
|
||||
Typically, you cannot edit API-provisioned alert rules from the Grafana UI.
|
||||
|
||||
In order to enable editing, add the x-disable-provenance header to the following requests when creating or editing your alert rules in the API:
|
||||
|
||||
POST /api/v1/provisioning/alert-rules
|
||||
|
||||
PUT /api/v1/provisioning/alert-rules/{UID}
|
||||
|
||||
1. Provision your alerting resources using Terraform.
|
||||
|
||||
**Note:**
|
||||
|
||||
Currently, provisioning for Grafana Alerting supports alert rules, contact points, mute timings, and templates. Provisioned alerting resources using file provisioning or Terraform can only be edited in the source that created them and not from within Grafana or any other source. For example, if you provision your alerting resources using files from disk, you cannot edit the data in Terraform or from within Grafana.
|
||||
|
||||
To allow editing of provisioned resources in the Grafana UI, add the `X-Disable-Provenance` header to the following requests in the API:
|
||||
|
||||
- `POST /api/v1/provisioning/alert-rules`
|
||||
- `PUT /api/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}` (calling this endpoint will change provenance for all alert rules within the alert group)
|
||||
- `POST /api/v1/provisioning/contact-points`
|
||||
- `POST /api/v1/provisioning/mute-timings`
|
||||
- `PUT /api/v1/provisioning/policies`
|
||||
- `PUT /api/v1/provisioning/templates/{name}`
|
||||
|
||||
**Useful Links:**
|
||||
|
||||
[Grafana provisioning](/docs/grafana/latest/administration/provisioning/)
|
||||
|
||||
@@ -25,8 +25,8 @@ When you create a library panel, the panel on the source dashboard is converted
|
||||
|
||||
1. Open a panel in edit mode.
|
||||
1. In the panel display options, click the down arrow option to bring changes to the visualization.
|
||||
{{< figure src="/static/img/docs/library-panels/create-lib-panel-from-edit-8-0.png" class="docs-image--no-shadow" max-width= "800px" caption="Screenshot of the edit panel" >}}
|
||||
1. Click the **Library panels** option, and then click **Create library panel** to open the create dialog.
|
||||
{{< figure src="/media/docs/grafana/panels-visualizations/screenshot-create-lib-panel-from-edit-9-5.png" class="docs-image--no-shadow" max-width= "800px" >}}
|
||||
1. Click **Library panels**, and then click **+ Create library panel** to open the create dialog.
|
||||
1. In **Library panel name**, enter the name.
|
||||
1. In **Save in folder**, select the folder to save the library panel.
|
||||
1. Click **Create library panel** to save your changes.
|
||||
@@ -34,14 +34,16 @@ When you create a library panel, the panel on the source dashboard is converted
|
||||
|
||||
Once created, you can modify the library panel using any dashboard on which it appears. After you save the changes, all instances of the library panel reflect these modifications.
|
||||
|
||||
{{< figure src="/static/img/docs/library-panels/create-from-more-8-0.png" class="docs-image--no-shadow" max-width= "900px" caption="Screenshot of the edit panel" >}}
|
||||
You can also create a library panel directly from the edit menu of any panel.
|
||||
|
||||
{{< figure src="/media/docs/grafana/panels-visualizations/screenshot-create-from-more-9-5.png" class="docs-image--no-shadow" max-width= "900px" >}}
|
||||
|
||||
## Add a library panel to a dashboard
|
||||
|
||||
Add a Grafana library panel to a dashboard when you want to provide visualizations to other dashboard users.
|
||||
|
||||
1. Click **Dashboards** in the left-side menu.
|
||||
1. Click **New** and select **New Dashboard**.
|
||||
1. Click **New** and select **New Dashboard** in the dropdown.
|
||||
1. On the empty dashboard, click **+ Import library panel**.
|
||||
|
||||
You will see a list of your library panels.
|
||||
@@ -60,6 +62,7 @@ Unlink a library panel when you want to make a change to the panel and not affec
|
||||
1. Hover over any part of the panel to display the actions menu on the top right corner.
|
||||
1. Click the menu and select **Edit**.
|
||||
1. Click **Unlink** on the top right corner of the page.
|
||||
1. Click **Yes, unlink**.
|
||||
|
||||
## View a list of library panels
|
||||
|
||||
@@ -69,7 +72,7 @@ You can view a list of available library panels and search for a library panel.
|
||||
1. Click **Library panels**.
|
||||
|
||||
You can see a list of previously defined library panels.
|
||||
{{< figure src="/static/img/docs/library-panels/library-panel-list-8-0.png" class="docs-image--no-shadow" max-width= "900px" caption="Screenshot of the edit panel" >}}
|
||||
{{< figure src="/media/docs/grafana/panels-visualizations/screenshot-library-panel-list-9-5.png" class="docs-image--no-shadow" max-width= "900px" >}}
|
||||
|
||||
1. Search for a specific library panel if you know its name.
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ weight: 400
|
||||
|
||||
Whenever you save a version of your dashboard, a copy of that version is saved so that previous versions of your dashboard are never lost. A list of these versions is available by entering the dashboard settings and then selecting "Versions" in the left side menu.
|
||||
|
||||
<img class="no-shadow" src="/static/img/docs/v50/dashboard_versions_list.png">
|
||||

|
||||
|
||||
The dashboard version history feature lets you compare and restore to previously saved dashboard versions.
|
||||
|
||||
@@ -25,20 +25,18 @@ The dashboard version history feature lets you compare and restore to previously
|
||||
|
||||
To compare two dashboard versions, select the two versions from the list that you wish to compare. Once selected, the "Compare versions" button will become clickable. Click the button to view the diff between the two versions.
|
||||
|
||||
<img class="no-shadow" src="/static/img/docs/v50/dashboard_versions_select.png">
|
||||

|
||||
|
||||
Upon clicking the button, you'll be brought to the diff view. By default, you'll see a textual summary of the changes, like in the image below.
|
||||
|
||||
<img class="no-shadow" src="/static/img/docs/v50/dashboard_versions_diff_basic.png">
|
||||

|
||||
|
||||
If you want to view the diff of the raw JSON that represents your dashboard, you can do that as well by clicking the "View JSON Diff" button at the bottom.
|
||||
|
||||
If you want to restore to the version you are diffing against, you can do so by clicking the "Restore to version \<x\>" button in the top right.
|
||||
If you want to view the diff of the raw JSON that represents your dashboard, you can do that as well by clicking the expand icon for the View JSON Diff section at the bottom.
|
||||
|
||||
## Restoring to a previously saved dashboard version
|
||||
|
||||
If you need to restore to a previously saved dashboard version, you can do so by either clicking the "Restore" button on the right of a row in the dashboard version list, or by clicking the "Restore to version \<x\>" button appearing in the diff view. Clicking the button will bring up the following popup prompting you to confirm the restoration.
|
||||
If you need to restore to a previously saved dashboard version, you can do so by either clicking the "Restore" button on the right of a row in the dashboard version list, or by clicking the **Restore to version \<x\>** button appearing in the diff view. Clicking the button will bring up the following popup prompting you to confirm the restoration.
|
||||
|
||||
<img class="no-shadow" src="/static/img/docs/v50/dashboard_versions_restore.png">
|
||||

|
||||
|
||||
After restoring to a previous version, a new version will be created containing the same exact data as the previous version, only with a different version number. This is indicated in the "Notes column" for the row in the new dashboard version. This is done simply to ensure your previous dashboard versions are not affected by the change.
|
||||
|
||||
@@ -26,21 +26,22 @@ Use the information in this section to access existing playlists. Start and cont
|
||||
|
||||
### Access a playlist
|
||||
|
||||
1. Hover your cursor over Grafana’s side menu.
|
||||
1. Click **Playlists**. You will see a list of existing playlists.
|
||||
1. Click **Dashboards** in the left-side menu.
|
||||
1. Click **Playlists** to see a list of existing playlists.
|
||||
|
||||
### Start a playlist
|
||||
|
||||
You can start a playlist in five different view modes. View mode determine how the menus and navigation bar appear on the dashboards.
|
||||
You can start a playlist in five different view modes. View modes determine how the menus and navigation bar appear on the dashboards.
|
||||
|
||||
By default, each dashboard is displayed for the amount of time entered in the Interval field, which you set when you create or edit a playlist. After you start a playlist, you can control it with the navbar at the top of the page.
|
||||
|
||||
1. [Access](#access-playlist) the playlist page to see a list of existing playlists.
|
||||
1. Find the playlist you want to start, then click **Start playlist**. The start playlist dialog opens.
|
||||
1. Select one of the five playlist modes available based on the information in the following table.
|
||||
1. Click **Start <playlist name>**.
|
||||
1. Click **Dashboards** in the left-side menu.
|
||||
1. Click **Playlists** to see a list of existing playlists.
|
||||
1. Find the playlist you want to start, then click **Start playlist**.
|
||||
1. In the modal that opens, select one of the five playlist modes available, based on the information in the table below.
|
||||
1. Click **Start \<playlist name\>**.
|
||||
|
||||
The playlist displays each dashboard for the time specified in the `Interval` field, set when creating or editing a playlist. Once a playlist starts, you can [control](#control-a-playlist) it using the navbar at the top of your screen.
|
||||
The playlist displays each dashboard for the time specified in the **Interval** field, set when creating or editing a playlist. Once a playlist starts, you can [control](#control-a-playlist) it using the navbar at the top of your screen.
|
||||
|
||||
| Mode | Description |
|
||||
| --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
@@ -67,7 +68,9 @@ You can control a playlist in **Normal** or **TV** mode after it's started, usin
|
||||
|
||||
You can create a playlist to present dashboards in a sequence, with a set order and time interval between dashboards.
|
||||
|
||||
1. In the playlist page, click **New playlist**. The New playlist page opens.
|
||||
1. Click **Dashboards** in the left-side menu.
|
||||
1. Click **Playlists** to see a list of existing playlists.
|
||||
1. Click **New playlist**. The New playlist page opens.
|
||||
1. In the **Name** text box, enter a descriptive name.
|
||||
1. In the **Interval** text box, enter a time interval. Grafana displays a particular dashboard for the interval of time specified here before moving on to the next dashboard.
|
||||
1. In Dashboards, add existing dashboards to the playlist using **Add by title** and **Add by tag** drop-down options. The dashboards you add are listed in a sequential order.
|
||||
@@ -82,8 +85,8 @@ You can create a playlist to present dashboards in a sequence, with a set order
|
||||
|
||||
You can save a playlist and add it to your **Playlists** page, where you can start it. Be sure that all the dashboards you want to appear in your playlist are added when creating or editing the playlist before saving it.
|
||||
|
||||
1. To access the Playlist feature, hover your cursor over Grafana's side menu.
|
||||
1. Click **Playlists**.
|
||||
1. Click **Dashboards** in the left-side menu.
|
||||
1. Click **Playlists** to see a list of existing playlists.
|
||||
1. Click on the playlist.
|
||||
1. Edit the playlist.
|
||||
1. Ensure that your playlist has a **Name**, **Interval**, and at least one **Dashboard** added to it.
|
||||
@@ -95,36 +98,47 @@ You can edit a playlist by updating its name, interval time, and by adding, remo
|
||||
|
||||
### Edit a playlist
|
||||
|
||||
1. In the playlist page, click **Edit playlist**. The Edit playlist page opens.
|
||||
1. Click **Dashboards** in the left-side menu.
|
||||
1. Click **Playlists** to see a list of existing playlists.
|
||||
1. Find the playlist you want to update and click **Edit playlist**.
|
||||
1. Update the name and time interval, then add or remove dashboards from the playlist using instructions in [Create a playlist](#create-a-playlist).
|
||||
1. Click **Save** to save your changes.
|
||||
|
||||
### Delete a playlist
|
||||
|
||||
1. Click **Playlists**.
|
||||
1. Next to the Playlist you want to delete, click **Remove[x]**.
|
||||
1. Click **Dashboards** in the left-side menu.
|
||||
1. Click **Playlists** to see a list of existing playlists.
|
||||
1. Find the playlist you want to remove.
|
||||
1. Click **Delete playlist**.
|
||||
|
||||
### Rearrange dashboard order
|
||||
|
||||
1. Next to the dashboard you want to move, click the up or down arrow.
|
||||
1. Click **Dashboards** in the left-side menu.
|
||||
1. Click **Playlists** to see a list of existing playlists.
|
||||
1. Find the playlist you want to update and click **Edit playlist**.
|
||||
1. Click and drag the dashboards into your desired order.
|
||||
1. Click **Save** to save your changes.
|
||||
|
||||
### Remove a dashboard
|
||||
|
||||
1. Click **Remove[x]** to remove a dashboard from the playlist.
|
||||
1. Click **Dashboards** in the left-side menu.
|
||||
1. Click **Playlists** to see a list of existing playlists.
|
||||
1. Find the playlist you want to update and click **Edit playlist**.
|
||||
1. Click **\[x\]** on the name of the dashboard you want to remove from the playlist.
|
||||
1. Click **Save** to save your changes.
|
||||
|
||||
## Share a playlist in a view mode
|
||||
|
||||
You can share a playlist by copying the link address on the view mode you prefer, and pasting the URL to your destination.
|
||||
|
||||
1. From the Dashboards submenu, click **Playlists**.
|
||||
1. Next to the playlist you want to share, click **Start playlist**.
|
||||
1. In the dropdown, right click the view mode you prefer.
|
||||
1. Click **Copy Link Address** to copy the URL to your clipboard.
|
||||
1. Click **Dashboards** in the left-side menu.
|
||||
1. Click **Playlists** to see a list of existing playlists.
|
||||
1. Click the share icon of the playlist you want to share.
|
||||
1. Select the view mode you prefer.
|
||||
1. Click **Copy** next to the Link URL to copy it to your clipboard.
|
||||
|
||||
Example: The URL for the first playlist on the Grafana Play site in Kiosk mode will look like this:
|
||||
For example, the URL for the first playlist on the Grafana Play site in Kiosk mode will look like this:
|
||||
|
||||
[https://play.grafana.org/playlists/play/1?kiosk](https://play.grafana.org/playlists/play/1?kiosk).
|
||||
[https://play.grafana.org/playlists/play/1?kiosk](https://play.grafana.org/playlists/play/1?kiosk).
|
||||
|
||||
1. Paste the URL to your destination.
|
||||
1. Paste the URL to your destination.
|
||||
|
||||
@@ -43,10 +43,11 @@ When [RBAC]({{< relref "../../administration/roles-and-permissions/access-contro
|
||||
|
||||
Only organization administrators can create reports by default. You can customize who can create reports with [Role-based access control]({{< relref "../../administration/roles-and-permissions/access-control/" >}}).
|
||||
|
||||
1. Click on the Reports icon in the side navigation menu.
|
||||
1. Click **Dashboards > Reports** in the side navigation menu.
|
||||
|
||||
The Reports tab allows you to view, create, and update your reports. The report form has a multi-step layout. The steps do not need to be completed in succession and can be skipped over by clicking a step name.
|
||||
The Reports page allows you to view, create, and update your reports. The report form has a multi-step layout. The steps do not need to be completed in succession and can be skipped over by clicking a step name.
|
||||
|
||||
1. Click **+ Create a new report**.
|
||||
1. Select report dashboard.
|
||||
- **Source dashboard:** Select the dashboard from which you want to generate the report.
|
||||
- **Time range:** (optional) Use custom time range for the report. For more information, refer to [Report time range]({{< relref "#report-time-range" >}}).
|
||||
@@ -183,7 +184,7 @@ You can generate and save PDF files of any dashboard.
|
||||
|
||||
> **Note:** Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) version 6.7 and later, and [Grafana Cloud Pro and Advanced](/docs/grafana-cloud/).
|
||||
|
||||
1. In the upper-right corner of the dashboard that you want to export as PDF, click the **Share dashboard** icon.
|
||||
1. In the dashboard that you want to export as PDF, click the **Share dashboard** icon.
|
||||
1. On the PDF tab, select a layout option for the exported dashboard: **Portrait** or **Landscape**.
|
||||
1. Click **Save as PDF** to render the dashboard as a PDF file.
|
||||
|
||||
@@ -230,7 +231,7 @@ font_italic = DejaVuSansCondensed-Oblique.ttf
|
||||
|
||||
> **Note:** Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) version 7.2 and later, and [Grafana Cloud Pro and Advanced](/docs/grafana-cloud/).
|
||||
|
||||
You can configure organization-wide report settings in the **Settings** tab on the **Reporting** page. Settings are applied to all the reports for current organization.
|
||||
You can configure organization-wide report settings in the **Settings** under **Dashboards > Reporting**. Settings are applied to all the reports for current organization.
|
||||
|
||||
You can customize the branding options.
|
||||
|
||||
|
||||
@@ -48,14 +48,16 @@ Folders help you organize and group dashboards, which is useful when you have ma
|
||||
|
||||
**To create a dashboard folder:**
|
||||
|
||||
1. Sign in to Grafana and on the side menu, click **Dashboards > New folder**.
|
||||
1. Sign in to Grafana.
|
||||
1. Click **Dashboards** in the left-side menu.
|
||||
1. On the Dashboards page, click **New** and select **New folder** in the dropdown.
|
||||
1. Enter a unique name and click **Create**.
|
||||
|
||||
When you save a dashboard, you can either select a folder for the dashboard to be saved in or create a new folder.
|
||||
|
||||
## Manage dashboards
|
||||
|
||||
On the **Manage dashboards and folders** page, you can:
|
||||
On the Dashboards page, you can:
|
||||
|
||||
- create a folder
|
||||
- create a dashboard
|
||||
@@ -65,17 +67,17 @@ On the **Manage dashboards and folders** page, you can:
|
||||
|
||||
### Dashboard folder page
|
||||
|
||||
You can complete the following tasks on the **Dashboard Folder** page:
|
||||
You can complete the following tasks on a dashboard folder page:
|
||||
|
||||
- Move or delete dashboards in a folder
|
||||
- Rename a folder (available under the **Settings** tab)
|
||||
- Rename a folder (available on the Settings tab)
|
||||
- Assign permissions to folders (which are inherited by the dashboards in the folder)
|
||||
|
||||
To navigate to the dashboard folder page, click the cog appears when you hover over a folder in the dashboard search result list or the **Manage dashboards and folders** page.
|
||||
To navigate to the dashboard folder page, hover over the name of the folder and click **Go to folder** in the dashboard search result list or on the Dashboards page.
|
||||
|
||||
### Dashboard permissions
|
||||
|
||||
You can assign permissions to a folder. Any permissions you assign are inherited by the dashboards in the folder. An Access Control List (ACL) is used where **Organization Role**, **Team** and a **User** can be assigned permissions.
|
||||
You can assign permissions to a folder. Any permissions you assign are inherited by the dashboards in the folder. An Access Control List (ACL) is used where **Organization Role**, **Team**, and a **User** can be assigned permissions.
|
||||
|
||||
For more information about dashboard permissions, refer to [Dashboard permissions]({{< relref "../../administration/roles-and-permissions/#dashboard-permissions" >}}).
|
||||
|
||||
@@ -87,10 +89,11 @@ You can use the Grafana UI or the [HTTP API]({{< relref "../../developers/http_a
|
||||
|
||||
The dashboard export action creates a Grafana JSON file that contains everything you need, including layout, variables, styles, data sources, queries, and so on, so that you can later import the dashboard.
|
||||
|
||||
1. Click **Dashboards** in the left-side menu.
|
||||
1. Open the dashboard you want to export.
|
||||
2. Click the **Share** icon.
|
||||
3. Click **Export**.
|
||||
4. Click **Save to file**.
|
||||
1. Click the **Share** icon.
|
||||
1. Click **Export**.
|
||||
1. Click **Save to file**.
|
||||
|
||||
Grafana downloads a JSON file to your local machine.
|
||||
|
||||
@@ -102,7 +105,8 @@ A template variable of the type `Constant` will automatically be hidden in the d
|
||||
|
||||
### Import a dashboard
|
||||
|
||||
1. Click **Dashboards > Import** in the side menu.
|
||||
1. Click **Dashboards** in the left-side menu.
|
||||
1. Click **New** and select **Import** in the dropdown menu.
|
||||
1. Perform one of the following steps:
|
||||
|
||||
- Upload a dashboard JSON file
|
||||
@@ -118,7 +122,7 @@ The import process enables you to change the name of the dashboard, pick the dat
|
||||
|
||||
Find dashboards for common server applications at [Grafana.com/dashboards](https://grafana.com/dashboards).
|
||||
|
||||
{{< figure src="/static/img/docs/v50/gcom_dashboard_list.png" max-width="700px" >}}
|
||||
{{< figure src="/media/docs/grafana/dashboards/screenshot-gcom-dashboards.png" >}}
|
||||
|
||||
## Troubleshoot dashboards
|
||||
|
||||
|
||||
@@ -52,10 +52,11 @@ You can share a dashboard as a direct link or as a snapshot. You can also export
|
||||
|
||||
> **Note:** If you change a dashboard, ensure that you save the changes before sharing.
|
||||
|
||||
1. Navigate to the home page of your Grafana instance.
|
||||
1. Click on the share icon in the top navigation.
|
||||
1. Click **Dashboards** in the left-side menu.
|
||||
1. Click the dashboard you want to share.
|
||||
1. Click the share icon at the top of the screen.
|
||||
|
||||
The share dialog opens and shows the **Link** tab.
|
||||
The share dialog opens and shows the Link tab.
|
||||
|
||||
### Share a direct link
|
||||
|
||||
@@ -73,7 +74,8 @@ A dashboard snapshot shares an interactive dashboard publicly. Grafana strips se
|
||||
|
||||
You can publish snapshots to your local instance or to [snapshots.raintank.io](http://snapshots.raintank.io). The latter is a free service provided by Grafana Labs that enables you to publish dashboard snapshots to an external Grafana instance. Anyone with the link can view it. You can set an expiration time if you want the snapshot removed after a certain time period.
|
||||
|
||||
1. Click **Local Snapshot** or **Publish to snapshots.raintank.io**.
|
||||
1. Click the **Snapshot** tab.
|
||||
1. Click **Publish to snapshots.raintank.io** or **Local Snapshot**.
|
||||
|
||||
Grafana generates a link of the snapshot.
|
||||
|
||||
@@ -91,7 +93,9 @@ You can generate and save PDF files of any dashboard.
|
||||
|
||||
> **Note:** Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}).
|
||||
|
||||
1. In the upper-right corner of the dashboard that you want to export as PDF, click the **Share dashboard** icon.
|
||||
1. Click **Dashboards** in the left-side menu.
|
||||
1. Click the dashboard you want to share.
|
||||
1. Click the share icon at the top of the screen.
|
||||
1. On the PDF tab, select a layout option for the exported dashboard: **Portrait** or **Landscape**.
|
||||
1. Click **Save as PDF** to render the dashboard as a PDF file.
|
||||
|
||||
@@ -101,8 +105,8 @@ You can generate and save PDF files of any dashboard.
|
||||
|
||||
You can share a panel as a direct link, as a snapshot, or as an embedded link. You can also create library panels using the **Share** option on any panel.
|
||||
|
||||
1. Click a panel title to open the panel menu.
|
||||
1. Click **Share**.
|
||||
1. Hover over any part of the panel to display the actions menu on the top right corner.
|
||||
1. Click the menu and select **Share**.
|
||||
|
||||
The share dialog opens and shows the **Link** tab.
|
||||
|
||||
@@ -139,8 +143,8 @@ A panel snapshot shares an interactive panel publicly. Grafana strips sensitive
|
||||
|
||||
You can publish snapshots to your local instance or to [snapshots.raintank.io](http://snapshots.raintank.io). The latter is a free service provided by [Grafana Labs](https://grafana.com), that enables you to publish dashboard snapshots to an external Grafana instance. You can optionally set an expiration time if you want the snapshot to be removed after a certain time period.
|
||||
|
||||
1. In the **Share Panel** dialog, click **Snapshot** to open the tab.
|
||||
1. Click **Local Snapshot** or **Publish to snapshots.raintank.io**.
|
||||
1. In the **Share Panel** dialog, click **Snapshot** to go to the tab.
|
||||
1. Click **Publish to snapshots.raintank.io** or **Local Snapshot**.
|
||||
|
||||
Grafana generates the link of the snapshot.
|
||||
|
||||
|
||||
@@ -27,27 +27,28 @@ The dashboard user interface provides a number of features that you can use to c
|
||||
|
||||
The following image and descriptions highlights all dashboards features.
|
||||
|
||||
{{< figure src="/static/img/docs/v91/dashboard-features/dashboard-features.png" width="700px" >}}
|
||||
{{< figure src="/media/docs/grafana/dashboards/screenshot-dashboard-annotated-9-5-0.png" width="700px" >}}
|
||||
|
||||
- **Grafana home** (1): Click the Grafana home icon to be redirected to the home page configured in the Grafana instance.
|
||||
- **Dashboard title** (2): When you click the dashboard title you can search for dashboard contained in the current folder.
|
||||
- **Share dashboard** (3): Use this option to share the current dashboard by link or snapshot. You can also export the dashboard definition from the share modal.
|
||||
- **Add a new panel** (4): Use this option to add a panel, dashboard row, or library panel to the current dashboard.
|
||||
- **Dashboard settings** (5): Use this option to change dashboard name, folder, and tags and manage variables and annotation queries. For more information about dashboard settings, refer to [Modify dashboard settings]({{< relref "../build-dashboards/modify-dashboard-settings/" >}}).
|
||||
- **Time picker dropdown** (6): Click to select relative time range options and set custom absolute time ranges.
|
||||
- (1) **Grafana home**: Click **Home** in the breadcrumb to be redirected to the home page configured in the Grafana instance.
|
||||
- (2) **Dashboard title**: When you click the dashboard title you can search for dashboard contained in the current folder.
|
||||
- (3) **Share dashboard or panel**: Use this option to share the current dashboard or panel by link or snapshot. You can also export the dashboard definition from the share modal.
|
||||
- (4) **Add**: Use this option to add a panel, dashboard row, or library panel to the current dashboard.
|
||||
- (5) **Save dashboard**: Click to save changes to your dashboard.
|
||||
- (6) **Dashboard insights**: Click to view analytics about your dashboard including information about users, activity, query counts.
|
||||
- (7) **Dashboard settings**: Use this option to change dashboard name, folder, and tags and manage variables and annotation queries. For more information about dashboard settings, refer to [Modify dashboard settings]({{< relref "../build-dashboards/modify-dashboard-settings/" >}}).
|
||||
- (8) **Time picker dropdown**: Click to select relative time range options and set custom absolute time ranges.
|
||||
- You can change the **Timezone** and **fiscal year** settings from the time range controls by clicking the **Change time settings** button.
|
||||
- Time settings are saved on a per-dashboard basis.
|
||||
- **Zoom out time range** (7): Click to zoom out the time range. For more information about how to use time range controls, refer to [Common time range controls]({{< relref "#common-time-range-controls" >}}).
|
||||
- **Refresh dashboard** (8): Click to immediately trigger queries and refresh dashboard data.
|
||||
- **Refresh dashboard time interval** (9): Click to select a dashboard auto refresh time interval.
|
||||
- **View mode** (10): Click to display the dashboard on a large screen such as a TV or a kiosk. View mode hides irrelevant information such as navigation menus. For more information about view mode, refer to [How to Create Kiosks to Display Dashboards on a TV](https://grafana.com/blog/2019/05/02/grafana-tutorial-how-to-create-kiosks-to-display-dashboards-on-a-tv/).
|
||||
- **Dashboard panel** (11): The primary building block of a dashboard is the panel. To add a new panel, dashboard row, or library panel, click **Add panel**.
|
||||
- (9) **Zoom out time range**: Click to zoom out the time range. For more information about how to use time range controls, refer to [Common time range controls]({{< relref "#common-time-range-controls" >}}).
|
||||
- (10) **Refresh dashboard**: Click to immediately trigger queries and refresh dashboard data.
|
||||
- (11) **Refresh dashboard time interval**: Click to select a dashboard auto refresh time interval.
|
||||
- (12) **View mode**: Click to display the dashboard on a large screen such as a TV or a kiosk. View mode hides irrelevant information such as navigation menus. For more information about view mode, refer to [How to Create Kiosks to Display Dashboards on a TV](https://grafana.com/blog/2019/05/02/grafana-tutorial-how-to-create-kiosks-to-display-dashboards-on-a-tv/).
|
||||
- (13) **Dashboard panel**: The primary building block of a dashboard is the panel. To add a new panel, dashboard row, or library panel, click **Add panel**.
|
||||
- Library panels can be shared among many dashboards.
|
||||
- To move a panel, drag the panel header to another location.
|
||||
- To resize a panel, click and drag the lower right corner of the panel.
|
||||
- **Graph legend** (12): Change series colors, y-axis and series visibility directly from the legend.
|
||||
- **Search** (13): Click **Search** to search for dashboards by name or panel title.
|
||||
- **Dashboard row** (14): A dashboard row is a logical divider within a dashboard that groups panels together.
|
||||
- (14) **Graph legend**: Change series colors, y-axis and series visibility directly from the legend.
|
||||
- (15) **Dashboard row**: A dashboard row is a logical divider within a dashboard that groups panels together.
|
||||
- Rows can be collapsed or expanded allowing you to hide parts of the dashboard.
|
||||
- Panels inside a collapsed row do not issue queries.
|
||||
- Use [repeating rows]({{< relref "../build-dashboards/create-dashboard/#configure-repeating-rows" >}}) to dynamically create rows based on a template variable.
|
||||
@@ -129,7 +130,7 @@ Hover your cursor over the field to see the exact time stamps in the range and t
|
||||
|
||||
Click the current time range to change it. You can change the current time using a _relative time range_, such as the last 15 minutes, or an _absolute time range_, such as `2020-05-14 00:00:00 to 2020-05-15 23:59:59`.
|
||||
|
||||
<img class="no-shadow" src="/static/img/docs/time-range-controls/change-current-time-range-7-0.png" max-width="900px">
|
||||
<img class="no-shadow" src="/media/docs/grafana/dashboards/screenshot-change-current-time-range.png" max-width="900px">
|
||||
|
||||
#### Relative time range
|
||||
|
||||
|
||||
@@ -44,17 +44,17 @@ weight: 100
|
||||
|
||||
The following table lists the types of variables shipped with Grafana.
|
||||
|
||||
| Variable type | Description |
|
||||
| :---------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Query | Query-generated list of values such as metric names, server names, sensor IDs, data centers, and so on. [Add a query variable]({{< relref "#add-a-query-variable" >}}). |
|
||||
| Custom | Define the variable options manually using a comma-separated list. [Add a custom variable]({{< relref "#add-a-custom-variable" >}}). |
|
||||
| Text box | Display a free text input field with an optional default value. [Add a text box variable]({{< relref "#add-a-text-box-variable" >}}). |
|
||||
| Constant | Define a hidden constant. [Add a constant variable]({{< relref "#add-a-constant-variable" >}}). |
|
||||
| Data source | Quickly change the data source for an entire dashboard. [Add a data source variable]({{< relref "#add-a-data-source-variable" >}}). |
|
||||
| Interval | Interval variables represent time spans. [Add an interval variable]({{< relref "#add-an-interval-variable" >}}). |
|
||||
| Ad hoc filters | Key/value filters that are automatically added to all metric queries for a data source (InfluxDB, Prometheus, and Elasticsearch only). [Add ad hoc filters]({{< relref "#add-ad-hoc-filters" >}}). |
|
||||
| Global variables | Built-in variables that can be used in expressions in the query editor. Refer to [Global variables]({{< relref "#global-variables" >}}). |
|
||||
| Chained variables | Variable queries can contain other variables. Refer to [Chained variables]({{< relref "#chained-variables" >}}). |
|
||||
| Variable type | Description |
|
||||
| :---------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Query | Query-generated list of values such as metric names, server names, sensor IDs, data centers, and so on. [Add a query variable]({{< relref "#add-a-query-variable" >}}). |
|
||||
| Custom | Define the variable options manually using a comma-separated list. [Add a custom variable]({{< relref "#add-a-custom-variable" >}}). |
|
||||
| Text box | Display a free text input field with an optional default value. [Add a text box variable]({{< relref "#add-a-text-box-variable" >}}). |
|
||||
| Constant | Define a hidden constant. [Add a constant variable]({{< relref "#add-a-constant-variable" >}}). |
|
||||
| Data source | Quickly change the data source for an entire dashboard. [Add a data source variable]({{< relref "#add-a-data-source-variable" >}}). |
|
||||
| Interval | Interval variables represent time spans. [Add an interval variable]({{< relref "#add-an-interval-variable" >}}). |
|
||||
| Ad hoc filters | Key/value filters that are automatically added to all metric queries for a data source (Prometheus, Loki, InfluxDB, and Elasticsearch only). [Add ad hoc filters]({{< relref "#add-ad-hoc-filters" >}}). |
|
||||
| Global variables | Built-in variables that can be used in expressions in the query editor. Refer to [Global variables]({{< relref "#global-variables" >}}). |
|
||||
| Chained variables | Variable queries can contain other variables. Refer to [Chained variables]({{< relref "#chained-variables" >}}). |
|
||||
|
||||
## Enter General options
|
||||
|
||||
@@ -194,7 +194,7 @@ Ad hoc filters are one of the most complex and flexible variable options availab
|
||||
|
||||
Interpolating a variable with multiple values selected is tricky as it is not straight forward how to format the multiple values into a string that is valid in the given context where the variable is used. Grafana tries to solve this by allowing each data source plugin to inform the templating interpolation engine what format to use for multiple values.
|
||||
|
||||
> **Note:** The **Custom all value** option on the variable must be blank for Grafana to format all values into a single string. If leave it blank, then the Grafana concatenates (adds together) all the values in the query. Something like `value1,value2,value3`. If a custom `all` value is used, then instead the value will be something like `*` or `all`.
|
||||
> **Note:** The **Custom all value** option on the variable must be blank for Grafana to format all values into a single string. If it is left blank, then Grafana concatenates (adds together) all the values in the query. Something like `value1,value2,value3`. If a custom `all` value is used, then instead the value will be something like `*` or `all`.
|
||||
|
||||
#### Multi-value variables with a Graphite data source
|
||||
|
||||
@@ -281,6 +281,8 @@ This variable is the `$__interval` variable in milliseconds, not a time interval
|
||||
|
||||
This variable is only available in the Singlestat panel and can be used in the prefix or suffix fields on the Options tab. The variable will be replaced with the series name or alias.
|
||||
|
||||
> **Note:** The Singlestat panel is no longer available from Grafana 8.0.
|
||||
|
||||
### $\_\_org
|
||||
|
||||
This variable is the ID of the current organization.
|
||||
@@ -398,7 +400,7 @@ apps.fakesite.web_server_01.cpu.*
|
||||
|
||||
#### InfluxDB example
|
||||
|
||||
In this example, you have several data centers. Each data center has a different subset of hosts. It is based on the [InfluxDB Templated](https://play.grafana.org/d/000000002/influxdb-templated?orgId=1).
|
||||
In this example, you have several data centers. Each data center has a different subset of hosts. It is based on the [InfluxDB Templated](https://play.grafana.org/d/000000002/influxdb-templated?orgId=1) dashboard.
|
||||
|
||||
In this example, when the user changes the value of the `datacenter` variable, it changes the dropdown options returned by the `host` variable. The `host` variable uses the **Multi-value** option and **Include all option**, allowing users to select some or all options presented at any time. The `datacenter` does not use either option, so you can only select one data center at a time.
|
||||
|
||||
@@ -407,7 +409,7 @@ In this example, when the user changes the value of the `datacenter` variable, i
|
||||
The query for this variable basically says, "Give me all the data centers that exist."
|
||||
|
||||
```
|
||||
SHOW TAG VALUES WITH KEY = "datacenter"
|
||||
SHOW TAG VALUES WITH KEY = "datacenter"
|
||||
```
|
||||
|
||||
The values returned are `America`, `Africa`, `Asia`, and `Europe`.
|
||||
|
||||
@@ -28,24 +28,25 @@ When using Prometheus, contact points and notification policies are read-only in
|
||||
|
||||
## Configure the data source
|
||||
|
||||
**To access the data source configuration page:**
|
||||
To configure basic settings for the data source, complete the following steps:
|
||||
|
||||
1. Select the **Data sources** section from the **Administration** menu
|
||||
2. Select the **Alertmanager** data source
|
||||
1. Click **Connections** in the left-side menu.
|
||||
1. Under Your connections, click **Data sources**.
|
||||
1. Enter `Alertmanager` in the search bar.
|
||||
1. Click **Alertmanager**.
|
||||
|
||||
Set the data source's basic configuration options carefully:
|
||||
The **Settings** tab of the data source is displayed.
|
||||
|
||||
| Name | Description |
|
||||
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **Name** | Sets the name you use to refer to the data source |
|
||||
| **Default** | Sets whether the data source is pre-selected for new panels and queries |
|
||||
| **Alertmanager** | |
|
||||
| **Implementation** | Alertmanager implementation. **Mimir**, **Cortex,** and **Prometheus** are supported |
|
||||
| **Receive Grafana Alerts** | When enabled the Alertmanager receives alert instances from Grafana-managed alert rules. **Important:** It works only if Grafana alerting is configured to send its alert instances to external Alertmanagers |
|
||||
| **HTTP** | |
|
||||
| **URL** | Sets the HTTP protocol, IP, and port of your Alertmanager instance, such as `https://alertmanager.example.org:9093` |
|
||||
| **Access** | Only **Server** access mode is functional |
|
||||
| | |
|
||||
1. Set the data source's basic configuration options:
|
||||
|
||||
| Name | Description |
|
||||
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **Name** | Sets the name you use to refer to the data source |
|
||||
| **Default** | Sets whether the data source is pre-selected for new panels and queries |
|
||||
| **Alertmanager Implementation** | Alertmanager implementation. **Mimir**, **Cortex,** and **Prometheus** are supported |
|
||||
| **Receive Grafana Alerts** | When enabled the Alertmanager receives alert instances from Grafana-managed alert rules. **Important:** It works only if Grafana alerting is configured to send its alert instances to external Alertmanagers |
|
||||
| **HTTP URL** | Sets the HTTP protocol, IP, and port of your Alertmanager instance, such as `https://alertmanager.example.org:9093` |
|
||||
| **Access** | Only **Server** access mode is functional |
|
||||
|
||||
## Provision the Alertmanager data source
|
||||
|
||||
|
||||
@@ -31,11 +31,12 @@ Once you've added the data source, you can [configure it]({{< relref "#configure
|
||||
|
||||
## Configure the data source
|
||||
|
||||
**To access the data source configuration page:**
|
||||
1. Click **Connections** in the left-side menu.
|
||||
1. Under Your connections, click **Data sources**.
|
||||
1. Enter `CloudWatch` in the search bar.
|
||||
1. Click **CloudWatch**.
|
||||
|
||||
1. Hover the cursor over the **Configuration** (gear) icon.
|
||||
1. Select **Data Sources**.
|
||||
1. Select the CloudWatch data source.
|
||||
The **Settings** tab of the data source is displayed.
|
||||
|
||||
### Configure AWS authentication
|
||||
|
||||
@@ -375,3 +376,7 @@ For more information, refer to the AWS documentation for [Service Quotas](https:
|
||||
The CloudWatch plugin enables you to monitor and troubleshoot applications across multiple regional accounts. Using cross-account observability, you can seamlessly search, visualize and analyze metrics and logs without worrying about account boundaries.
|
||||
|
||||
To use this feature, configure in the [AWS console under Cloudwatch Settings](https://aws.amazon.com/blogs/aws/new-amazon-cloudwatch-cross-account-observability/), a monitoring and source account, and then add the necessary IAM permissions as described above.
|
||||
|
||||
## CloudWatch Logs data protection
|
||||
|
||||
CloudWatch Logs can safeguard data by using log group data protection policies. If you have data protection enabled for a log group, then any sensitive data that matches the data identifiers you've selected will be masked. In order to view masked data you will need to have the `logs:Unmask` IAM permission enabled. See the AWS documentation on how to [help protect sensitive log data with masking](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/mask-sensitive-log-data.html) to learn more about this.
|
||||
|
||||
@@ -24,26 +24,29 @@ Once you've added the Graphite data source, you can [configure it]({{< relref "#
|
||||
|
||||
## Configure the data source
|
||||
|
||||
**To access the data source configuration page:**
|
||||
To configure basic settings for the data source, complete the following steps:
|
||||
|
||||
1. Hover the cursor over the **Configuration** (gear) icon.
|
||||
1. Select **Data Sources**.
|
||||
1. Select the Graphite data source.
|
||||
1. Click **Connections** in the left-side menu.
|
||||
1. Under Your connections, click **Data sources**.
|
||||
1. Enter `Graphite` in the search bar.
|
||||
1. Click **Graphite**.
|
||||
|
||||
Set the data source's basic configuration options carefully:
|
||||
The **Settings** tab of the data source is displayed.
|
||||
|
||||
| Name | Description |
|
||||
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| **Name** | Sets the name you use to refer to the data source in panels and queries. |
|
||||
| **Default** | Sets whether the data source is pre-selected for new panels. You can set only one default data source per organization. |
|
||||
| **URL** | Sets the HTTP protocol, IP, and port of your graphite-web or graphite-api installation. |
|
||||
| **Auth** | For details, refer to [Configure Authentication]({{< relref "../../setup-grafana/configure-security/configure-authentication/" >}}). |
|
||||
| **Basic Auth** | Enables basic authentication to the data source. |
|
||||
| **User** | Sets the user name for basic authentication. |
|
||||
| **Password** | Sets the password for basic authentication. |
|
||||
| **Custom HTTP Headers** | Click **Add header** to add a custom HTTP header. |
|
||||
| **Header** | Defines the custom header name. |
|
||||
| **Value** | Defines the custom header value. |
|
||||
1. Set the data source's basic configuration options:
|
||||
|
||||
| Name | Description |
|
||||
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| **Name** | Sets the name you use to refer to the data source in panels and queries. |
|
||||
| **Default** | Sets whether the data source is pre-selected for new panels. You can set only one default data source per organization. |
|
||||
| **URL** | Sets the HTTP protocol, IP, and port of your graphite-web or graphite-api installation. |
|
||||
| **Auth** | For details, refer to [Configure Authentication]({{< relref "../../setup-grafana/configure-security/configure-authentication/" >}}). |
|
||||
| **Basic Auth** | Enables basic authentication to the data source. |
|
||||
| **User** | Sets the user name for basic authentication. |
|
||||
| **Password** | Sets the password for basic authentication. |
|
||||
| **Custom HTTP Headers** | Click **Add header** to add a custom HTTP header. |
|
||||
| **Header** | Defines the custom header name. |
|
||||
| **Value** | Defines the custom header value. |
|
||||
|
||||
You can also configure settings specific to the Graphite data source:
|
||||
|
||||
|
||||
@@ -41,14 +41,13 @@ To configure basic settings for the data source, complete the following steps:
|
||||
|
||||
1. Set the data source's basic configuration options carefully:
|
||||
|
||||
| Name | Description |
|
||||
|
||||
| Name | Description |
|
||||
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| **Name** | Sets the name you use to refer to the data source in panels and queries. We recommend something like `InfluxDB-InfluxQL`. |
|
||||
| **Default** | Sets whether the data source is pre-selected for new panels. |
|
||||
| **URL** | The HTTP protocol, IP address, and port of your InfluxDB API. InfluxDB's default API port is 8086. |
|
||||
| **Min time interval** | _(Optional)_ Refer to [Min time interval]({{< relref "#configure-min-time-interval" >}}). |
|
||||
| **Max series** | _(Optional)_ Limits the number of series and tables that Grafana processes. Lower this number to prevent abuse, and increase it if you have many small time series and not all are shown. Defaults to 1,000. |
|
||||
| **Name** | Sets the name you use to refer to the data source in panels and queries. We recommend something like `InfluxDB-InfluxQL`. |
|
||||
| **Default** | Sets whether the data source is pre-selected for new panels. |
|
||||
| **URL** | The HTTP protocol, IP address, and port of your InfluxDB API. InfluxDB's default API port is 8086. |
|
||||
| **Min time interval** | _(Optional)_ Refer to [Min time interval]({{< relref "#configure-min-time-interval" >}}). |
|
||||
| **Max series** | _(Optional)_ Limits the number of series and tables that Grafana processes. Lower this number to prevent abuse, and increase it if you have many small time series and not all are shown. Defaults to 1,000. |
|
||||
|
||||
You can also configure settings specific to the InfluxDB data source. These options are described in the sections below.
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ weight: 300
|
||||
|
||||
# Loki query editor
|
||||
|
||||
The Loki data source's query editor helps you create [log]({{< relref "#create-a-logs-query" >}}) and [metric]({{< relref "#create-a-metrics-query" >}}) queries that use Loki's query language, [LogQL](/docs/loki/latest/logql/).
|
||||
The Loki data source's query editor helps you create [log]({{< relref "#create-a-log-query" >}}) and [metric]({{< relref "#create-a-metric-query" >}}) queries that use Loki's query language, [LogQL](/docs/loki/latest/logql/).
|
||||
|
||||
This topic explains querying specific to the Loki data source.
|
||||
For general documentation on querying data sources in Grafana, see [Query and transform data]({{< relref "../../../panels-visualizations/query-transform-data" >}}).
|
||||
|
||||
@@ -41,19 +41,20 @@ To configure basic settings for the data source, complete the following steps:
|
||||
|
||||
1. Set the data source's basic configuration options:
|
||||
|
||||
| Name | Description |
|
||||
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **Name** | Sets the name you use to refer to the data source in panels and queries. |
|
||||
| **Default** | Sets the data source that's pre-selected for new panels. |
|
||||
| **Host** | Sets the IP address/hostname and optional port of your MS SQL instance. Default port is 0, the driver default. You can specify multiple connection properties, such as `ApplicationIntent`, by separating each property with a semicolon (`;`). |
|
||||
| **Database** | Sets the name of your MS SQL database. |
|
||||
| **Authentication** | Sets the authentication mode, either using SQL Server Authentication or Windows Authentication (single sign-on for Windows users). |
|
||||
| **User** | Defines the database user's username. |
|
||||
| **Password** | Defines the database user's password. |
|
||||
| **Encrypt** | Determines whether to negotiate a secure SSL TCP/IP connection with the server, or to which extent. Default is `false`. |
|
||||
| **Max open** | Sets the maximum number of open connections to the database. Default is `unlimited`. |
|
||||
| **Max idle** | Sets the maximum number of connections in the idle connection pool. Default is `2`. |
|
||||
| **Max lifetime** | Sets the maximum number of seconds that the data source can reuse a connection. Default is `14400` (4 hours). |
|
||||
| Name | Description |
|
||||
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **Name** | Sets the name you use to refer to the data source in panels and queries. |
|
||||
| **Default** | Sets the data source that's pre-selected for new panels. |
|
||||
| **Host** | Sets the IP address/hostname and optional port of your MS SQL instance. Default port is 0, the driver default. You can specify multiple connection properties, such as `ApplicationIntent`, by separating each property with a semicolon (`;`). |
|
||||
| **Database** | Sets the name of your MS SQL database. |
|
||||
| **Authentication** | Sets the authentication mode, either using SQL Server Authentication or Windows Authentication (single sign-on for Windows users). |
|
||||
| **User** | Defines the database user's username. |
|
||||
| **Password** | Defines the database user's password. |
|
||||
| **Encrypt** | Determines whether to negotiate a secure SSL TCP/IP connection with the server, or to which extent. Default is `false`. |
|
||||
| **Max open** | Sets the maximum number of open connections to the database. Default is `100`. |
|
||||
| **Max idle** | Sets the maximum number of connections in the idle connection pool. Default is `100`. |
|
||||
| **Auto (max idle)** | If set will set the maximum number of idle connections to the number of maximum open connections (Grafana v9.5.1+). Default is `true`. |
|
||||
| **Max lifetime** | Sets the maximum number of seconds that the data source can reuse a connection. Default is `14400` (4 hours). |
|
||||
|
||||
You can also configure settings specific to the Microsoft SQL Server data source. These options are described in the sections below.
|
||||
|
||||
@@ -122,8 +123,9 @@ datasources:
|
||||
user: grafana
|
||||
jsonData:
|
||||
database: grafana
|
||||
maxOpenConns: 0 # Grafana v5.4+
|
||||
maxIdleConns: 2 # Grafana v5.4+
|
||||
maxOpenConns: 100 # Grafana v5.4+
|
||||
maxIdleConns: 100 # Grafana v5.4+
|
||||
maxIdleConnsAuto: true # Grafana v9.5.1+
|
||||
connMaxLifetime: 14400 # Grafana v5.4+
|
||||
connectionTimeout: 0 # Grafana v9.3+
|
||||
secureJsonData:
|
||||
|
||||
@@ -35,20 +35,19 @@ Administrators can also [configure the data source via YAML]({{< relref "#provis
|
||||
|
||||
1. Set the data source's basic configuration options.
|
||||
|
||||
### Data source options
|
||||
|
||||
| Name | Description |
|
||||
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `Name` | The data source name. This is how you refer to the data source in panels and queries. |
|
||||
| `Default` | Default data source means that it will be pre-selected for new panels. |
|
||||
| `Host` | The IP address/hostname and optional port of your MySQL instance. |
|
||||
| `Database` | Name of your MySQL database. |
|
||||
| `User` | Database user's login/username |
|
||||
| `Password` | Database user's password |
|
||||
| `Session Timezone` | Specify the time zone used in the database session, such as `Europe/Berlin` or `+02:00`. This is necessary, if the timezone of the database (or the host of the database) is set to something other than UTC. Set the value used in the session with `SET time_zone='...'`. If you leave this field empty, then the time zone is not updated. For more information, refer to the [MySQL documentation](https://dev.mysql.com/doc/refman/8.0/en/time-zone-support.html). |
|
||||
| `Max open` | The maximum number of open connections to the database, default `unlimited` (Grafana v5.4+). |
|
||||
| `Max idle` | The maximum number of connections in the idle connection pool, default `2` (Grafana v5.4+). |
|
||||
| `Max lifetime` | The maximum amount of time in seconds a connection may be reused, default `14400`/4 hours. This should always be lower than configured [wait_timeout](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_wait_timeout) in MySQL (Grafana v5.4+). |
|
||||
| Name | Description |
|
||||
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **Name** | The data source name. This is how you refer to the data source in panels and queries. |
|
||||
| **Default** | Default data source means that it will be pre-selected for new panels. |
|
||||
| **Host** | The IP address/hostname and optional port of your MySQL instance. |
|
||||
| **Database** | Name of your MySQL database. |
|
||||
| **User** | Database user's login/username |
|
||||
| **Password** | Database user's password |
|
||||
| **Session Timezone** | Specify the time zone used in the database session, such as `Europe/Berlin` or `+02:00`. This is necessary, if the timezone of the database (or the host of the database) is set to something other than UTC. Set the value used in the session with `SET time_zone='...'`. If you leave this field empty, then the time zone is not updated. For more information, refer to the [MySQL documentation](https://dev.mysql.com/doc/refman/8.0/en/time-zone-support.html). |
|
||||
| **Max open** | The maximum number of open connections to the database, default `100` (Grafana v5.4+). |
|
||||
| **Max idle** | The maximum number of connections in the idle connection pool, default `100` (Grafana v5.4+). |
|
||||
| **Auto (max idle)** | If set will set the maximum number of idle connections to the number of maximum open connections (Grafana v9.5.1+). Default is `true`. |
|
||||
| **Max lifetime** | The maximum amount of time in seconds a connection may be reused, default `14400`/4 hours. This should always be lower than configured [wait_timeout](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_wait_timeout) in MySQL (Grafana v5.4+). |
|
||||
|
||||
### Min time interval
|
||||
|
||||
@@ -107,8 +106,9 @@ datasources:
|
||||
user: grafana
|
||||
jsonData:
|
||||
database: grafana
|
||||
maxOpenConns: 0 # Grafana v5.4+
|
||||
maxIdleConns: 2 # Grafana v5.4+
|
||||
maxOpenConns: 100 # Grafana v5.4+
|
||||
maxIdleConns: 100 # Grafana v5.4+
|
||||
maxIdleConnsAuto: true # Grafana v9.5.1+
|
||||
connMaxLifetime: 14400 # Grafana v5.4+
|
||||
secureJsonData:
|
||||
password: ${GRAFANA_MYSQL_PASSWORD}
|
||||
@@ -127,8 +127,9 @@ datasources:
|
||||
jsonData:
|
||||
tlsAuth: true
|
||||
database: grafana
|
||||
maxOpenConns: 0 # Grafana v5.4+
|
||||
maxIdleConns: 2 # Grafana v5.4+
|
||||
maxOpenConns: 100 # Grafana v5.4+
|
||||
maxIdleConns: 100 # Grafana v5.4+
|
||||
maxIdleConnsAuto: true # Grafana v9.5.1+
|
||||
connMaxLifetime: 14400 # Grafana v5.4+
|
||||
secureJsonData:
|
||||
password: ${GRAFANA_MYSQL_PASSWORD}
|
||||
@@ -150,8 +151,9 @@ datasources:
|
||||
tlsAuth: true
|
||||
skipTLSVerify: true
|
||||
database: grafana
|
||||
maxOpenConns: 0 # Grafana v5.4+
|
||||
maxIdleConns: 2 # Grafana v5.4+
|
||||
maxOpenConns: 100 # Grafana v5.4+
|
||||
maxIdleConns: 100 # Grafana v5.4+
|
||||
maxIdleConnsAuto: true # Grafana v9.5.1+
|
||||
connMaxLifetime: 14400 # Grafana v5.4+
|
||||
secureJsonData:
|
||||
password: ${GRAFANA_MYSQL_PASSWORD}
|
||||
|
||||
@@ -18,16 +18,25 @@ Grafana ships with built-in support for Parca, a continuous profiling OSS databa
|
||||
|
||||
## Configure the Parca data source
|
||||
|
||||
To access Parca settings, click the **Configuration** (gear) icon, then click **Data Sources** > **Parca**.
|
||||
To configure basic settings for the data source, complete the following steps:
|
||||
|
||||
| Name | Description |
|
||||
| ------------ | ------------------------------------------------------------------ |
|
||||
| `Name` | A name to specify the data source in panels, queries, and Explore. |
|
||||
| `Default` | The default data source will be pre-selected for new panels. |
|
||||
| `URL` | The URL of the Parca instance, e.g., `http://localhost:4100` |
|
||||
| `Basic Auth` | Enable basic authentication to the Parca data source. |
|
||||
| `User` | User name for basic authentication. |
|
||||
| `Password` | Password for basic authentication. |
|
||||
1. Click **Connections** in the left-side menu.
|
||||
1. Under Your connections, click **Data sources**.
|
||||
1. Enter `Parca` in the search bar.
|
||||
1. Click **Parca**.
|
||||
|
||||
The **Settings** tab of the data source is displayed.
|
||||
|
||||
1. Set the data source's basic configuration options:
|
||||
|
||||
| Name | Description |
|
||||
| ------------ | ------------------------------------------------------------------ |
|
||||
| `Name` | A name to specify the data source in panels, queries, and Explore. |
|
||||
| `Default` | The default data source will be pre-selected for new panels. |
|
||||
| `URL` | The URL of the Parca instance, e.g., `http://localhost:4100` |
|
||||
| `Basic Auth` | Enable basic authentication to the Parca data source. |
|
||||
| `User` | User name for basic authentication. |
|
||||
| `Password` | Password for basic authentication. |
|
||||
|
||||
## Querying
|
||||
|
||||
|
||||
@@ -18,17 +18,26 @@ Grafana ships with built-in support for Phlare, a horizontally scalable, highly-
|
||||
|
||||
## Configure the Phlare data source
|
||||
|
||||
To access Phlare settings, click the **Configuration** (gear) icon, then click **Data Sources** > **Phlare**.
|
||||
To configure basic settings for the data source, complete the following steps:
|
||||
|
||||
| Name | Description |
|
||||
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `Name` | A name to specify the data source in panels, queries, and Explore. |
|
||||
| `Default` | The default data source will be pre-selected for new panels. |
|
||||
| `URL` | The URL of the Phlare instance, e.g., `http://localhost:4100` |
|
||||
| `Basic Auth` | Enable basic authentication to the Phlare data source. |
|
||||
| `User` | User name for basic authentication. |
|
||||
| `Password` | Password for basic authentication. |
|
||||
| `Minimal step` | Similar to Prometheus, Phlare scrapes profiles at certain intervals. To prevent querying at smaller interval use Minimal step same or higher than your Phlare scrape interval. |
|
||||
1. Click **Connections** in the left-side menu.
|
||||
1. Under Your connections, click **Data sources**.
|
||||
1. Enter `Phlare` in the search bar.
|
||||
1. Click **Phlare**.
|
||||
|
||||
The **Settings** tab of the data source is displayed.
|
||||
|
||||
1. Set the data source's basic configuration options:
|
||||
|
||||
| Name | Description |
|
||||
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `Name` | A name to specify the data source in panels, queries, and Explore. |
|
||||
| `Default` | The default data source will be pre-selected for new panels. |
|
||||
| `URL` | The URL of the Phlare instance, e.g., `http://localhost:4100` |
|
||||
| `Basic Auth` | Enable basic authentication to the Phlare data source. |
|
||||
| `User` | User name for basic authentication. |
|
||||
| `Password` | Password for basic authentication. |
|
||||
| `Minimal step` | Similar to Prometheus, Phlare scrapes profiles at certain intervals. To prevent querying at smaller interval use Minimal step same or higher than your Phlare scrape interval. |
|
||||
|
||||
## Querying
|
||||
|
||||
|
||||
@@ -33,23 +33,23 @@ To configure basic settings for the data source, complete the following steps:
|
||||
|
||||
1. Set the data source's basic configuration options:
|
||||
|
||||
| Name | Description |
|
||||
|
||||
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **Name** | The data source name. This is how you refer to the data source in panels and queries. |
|
||||
| **Default** | Default data source means that it will be pre-selected for new panels. |
|
||||
| **Host** | The IP address/hostname and optional port of your PostgreSQL instance. _Do not_ include the database name. The connection string for connecting to Postgres will not be correct and it may cause errors. |
|
||||
| **Database** | Name of your PostgreSQL database. |
|
||||
| **User** | Database user's login/username |
|
||||
| **Password** | Database user's password |
|
||||
| **SSL Mode** | Determines whether or with what priority a secure SSL TCP/IP connection will be negotiated with the server. When SSL Mode is disabled, SSL Method and Auth Details would not be visible. |
|
||||
| **SSL Auth Details Method** | Determines whether the SSL Auth details will be configured as a file path or file content. Grafana v7.5+ |
|
||||
| **SSL Auth Details Value** | File path or file content of SSL root certificate, client certificate and client key |
|
||||
| **Max open** | The maximum number of open connections to the database, default `unlimited` (Grafana v5.4+). |
|
||||
| **Max idle** | The maximum number of connections in the idle connection pool, default `2` (Grafana v5.4+). |
|
||||
| **Max lifetime** | The maximum amount of time in seconds a connection may be reused, default `14400`/4 hours (Grafana v5.4+). |
|
||||
| **Version** | Determines which functions are available in the query builder (only available in Grafana 5.3+). |
|
||||
| **TimescaleDB** | A time-series database built as a PostgreSQL extension. When enabled, Grafana uses `time_bucket` in the `$__timeGroup` macro to display TimescaleDB specific aggregate functions in the query builder (only available in Grafana 5.3+). For more information, see [TimescaleDB documentation](https://docs.timescale.com/timescaledb/latest/tutorials/grafana/grafana-timescalecloud/#connect-timescaledb-and-grafana). |
|
||||
| Name | Description |
|
||||
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **Name** | The data source name. This is how you refer to the data source in panels and queries. |
|
||||
| **Default** | Default data source means that it will be pre-selected for new panels. |
|
||||
| **Host** | The IP address/hostname and optional port of your PostgreSQL instance. _Do not_ include the database name. The connection string for connecting to Postgres will not be correct and it may cause errors. |
|
||||
| **Database** | Name of your PostgreSQL database. |
|
||||
| **User** | Database user's login/username |
|
||||
| **Password** | Database user's password |
|
||||
| **SSL Mode** | Determines whether or with what priority a secure SSL TCP/IP connection will be negotiated with the server. When SSL Mode is disabled, SSL Method and Auth Details would not be visible. |
|
||||
| **SSL Auth Details Method** | Determines whether the SSL Auth details will be configured as a file path or file content. Grafana v7.5+ |
|
||||
| **SSL Auth Details Value** | File path or file content of SSL root certificate, client certificate and client key |
|
||||
| **Max open** | The maximum number of open connections to the database, default `100` (Grafana v5.4+). |
|
||||
| **Max idle** | The maximum number of connections in the idle connection pool, default `100` (Grafana v5.4+). |
|
||||
| **Auto (max idle)** | If set will set the maximum number of idle connections to the number of maximum open connections (Grafana v9.5.1+). Default is `true`. |
|
||||
| **Max lifetime** | The maximum amount of time in seconds a connection may be reused, default `14400`/4 hours (Grafana v5.4+). |
|
||||
| **Version** | Determines which functions are available in the query builder (only available in Grafana 5.3+). |
|
||||
| **TimescaleDB** | A time-series database built as a PostgreSQL extension. When enabled, Grafana uses `time_bucket` in the `$__timeGroup` macro to display TimescaleDB specific aggregate functions in the query builder (only available in Grafana 5.3+). For more information, see [TimescaleDB documentation](https://docs.timescale.com/timescaledb/latest/tutorials/grafana/grafana-timescalecloud/#connect-timescaledb-and-grafana). |
|
||||
|
||||
### Min time interval
|
||||
|
||||
@@ -141,8 +141,9 @@ datasources:
|
||||
jsonData:
|
||||
database: grafana
|
||||
sslmode: 'disable' # disable/require/verify-ca/verify-full
|
||||
maxOpenConns: 0 # Grafana v5.4+
|
||||
maxIdleConns: 2 # Grafana v5.4+
|
||||
maxOpenConns: 100 # Grafana v5.4+
|
||||
maxIdleConns: 100 # Grafana v5.4+
|
||||
maxIdleConnsAuto: true # Grafana v9.5.1+
|
||||
connMaxLifetime: 14400 # Grafana v5.4+
|
||||
postgresVersion: 903 # 903=9.3, 904=9.4, 905=9.5, 906=9.6, 1000=10
|
||||
timescaledb: false
|
||||
|
||||
@@ -45,40 +45,28 @@ To configure basic settings for the data source, complete the following steps:
|
||||
|
||||
1. Set the data source's basic configuration options:
|
||||
|
||||
| Name | Description |
|
||||
|
||||
| Name | Description |
|
||||
| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `Name` | The data source name. This is how you refer to the data source in panels and queries. |
|
||||
| `Default` | Default data source that is pre-selected for new panels. |
|
||||
| `URL` | The URL of your Prometheus server, for example, `http://prometheus.example.org:9090`. |
|
||||
| `Access` | Only Server access mode is functional. If Server mode is already selected this option is hidden. Otherwise change to Server mode to prevent errors. |
|
||||
| `Basic Auth` | Enable basic authentication to the Prometheus data source. |
|
||||
| `User` | User name for basic authentication. |
|
||||
| `Password` | Password for basic authentication. |
|
||||
| `Manage alerts via Alerting UI` | Toggle whether to enable Alertmanager integration for this data source. |
|
||||
| `Scrape interval` | Set this to the typical scrape and evaluation interval configured in Prometheus. Defaults to 15s. |
|
||||
| `HTTP method` | Use either POST or GET HTTP method to query your data source. POST is the recommended and pre-selected method as it allows bigger queries. Change this to GET if you have a Prometheus version older than 2.1 or if POST requests are restricted in your network. |
|
||||
| `Type` | The type of your Prometheus server; `Prometheus`, `Cortex`, `Thanos`, `Mimir`. When selected, the **Version** field attempts to populate automatically using the Prometheus [buildinfo](https://semver.org/) API. Some Prometheus types, such as Cortex, don't support this API and must be manually populated. |
|
||||
| `Version` | The version of your Prometheus server, note that this field is not visible until the Prometheus type is selected. |
|
||||
| `Disable metrics lookup` | Checking this option will disable the metrics chooser and metric/label support in the query field's autocomplete. This helps if you have performance issues with bigger Prometheus instances. |
|
||||
| `Custom query parameters` | Add custom parameters to the Prometheus query URL. For example `timeout`, `partial_response`, `dedup`, or `max_source_resolution`. Multiple parameters should be concatenated together with an '&'. |
|
||||
| **Exemplars configuration** | |
|
||||
| `Internal link` | Enable this option is you have an internal link. When you enable this option, you will see a data source selector. Select the backend tracing data store for your exemplar data. |
|
||||
| `Data source` | You will see this option only if you enable `Internal link` option. Select the backend tracing data store for your exemplar data. |
|
||||
| `URL` | You will see this option only if the `Internal link` option is disabled. Enter the full URL of the external link. You can interpolate the value from the field with `${__value.raw }` macro. |
|
||||
| `URL Label` | (Optional) add a custom display label to override the value of the `Label name` field. |
|
||||
| `Label name` | Add a name for the exemplar traceID property. |
|
||||
|
||||
**Exemplars configuration:**
|
||||
|
||||
| Name | Description |
|
||||
|
||||
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **Internal link** | Enable this option if you have an internal link. When enabled, this reveals the data source selector. Select the backend tracing data store for your exemplar data. |
|
||||
| **Data source** | _(Visible only if you enable `Internal link`)_ Selects the backend tracing data store for your exemplar data. |
|
||||
| **URL** | _(Visible only if you disable `Internal link`)_ Defines the external link's full URL. You can interpolate the value from the field by using the [`${__value.raw}` macro]({{< relref "../..//panels-visualizations/configure-data-links/#value-variables" >}}). |
|
||||
| **URL label** | _(Optional)_ Adds a custom display label to override the value of the `Label name` field. |
|
||||
| **Label name** | Adds a name for the exemplar traceID property. |
|
||||
| `Name` | The data source name. This is how you refer to the data source in panels and queries. |
|
||||
| `Default` | Default data source that is pre-selected for new panels. |
|
||||
| `URL` | The URL of your Prometheus server, for example, `http://prometheus.example.org:9090`. |
|
||||
| `Access` | Only Server access mode is functional. If Server mode is already selected this option is hidden. Otherwise change to Server mode to prevent errors. |
|
||||
| `Basic Auth` | Enable basic authentication to the Prometheus data source. |
|
||||
| `User` | User name for basic authentication. |
|
||||
| `Password` | Password for basic authentication. |
|
||||
| `Manage alerts via Alerting UI` | Toggle whether to enable Alertmanager integration for this data source. |
|
||||
| `Scrape interval` | Set this to the typical scrape and evaluation interval configured in Prometheus. Defaults to 15s. |
|
||||
| `HTTP method` | Use either POST or GET HTTP method to query your data source. POST is the recommended and pre-selected method as it allows bigger queries. Change this to GET if you have a Prometheus version older than 2.1 or if POST requests are restricted in your network. |
|
||||
| `Type` | The type of your Prometheus server; `Prometheus`, `Cortex`, `Thanos`, `Mimir`. When selected, the **Version** field attempts to populate automatically using the Prometheus [buildinfo](https://semver.org/) API. Some Prometheus types, such as Cortex, don't support this API and must be manually populated. |
|
||||
| `Version` | The version of your Prometheus server, note that this field is not visible until the Prometheus type is selected. |
|
||||
| `Disable metrics lookup` | Checking this option will disable the metrics chooser and metric/label support in the query field's autocomplete. This helps if you have performance issues with bigger Prometheus instances. |
|
||||
| `Custom query parameters` | Add custom parameters to the Prometheus query URL. For example `timeout`, `partial_response`, `dedup`, or `max_source_resolution`. Multiple parameters should be concatenated together with an '&'. |
|
||||
| **Exemplars configuration** | |
|
||||
| `Internal link` | Enable this option if you have an internal link. When enabled, this reveals the data source selector. Select the backend tracing data store for your exemplar data. |
|
||||
| `Data source` | _(Visible only if you enable `Internal link`)_ Selects the backend tracing data store for your exemplar data. |
|
||||
| `URL` | _(Visible only if you disable `Internal link`)_ Defines the external link's full URL. You can interpolate the value from the field by using the [`${__value.raw}` macro]({{< relref "../..//panels-visualizations/configure-data-links/#value-variables" >}}). |
|
||||
| `URL Label` | _(Optional)_ Adds a custom display label to override the value of the `Label name` field. |
|
||||
| `Label name` | Adds a name for the exemplar traceID property. |
|
||||
|
||||
### Provision the data source
|
||||
|
||||
@@ -113,12 +101,6 @@ datasources:
|
||||
url: 'http://localhost:3000/explore?orgId=1&left=%5B%22now-1h%22,%22now%22,%22Jaeger%22,%7B%22query%22:%22$${__value.raw}%22%7D%5D'
|
||||
```
|
||||
|
||||
## Query the data source
|
||||
|
||||
The Prometheus query editor includes a code editor and visual query builder.
|
||||
|
||||
For details, see the [query editor documentation]({{< relref "./query-editor" >}}).
|
||||
|
||||
## View Grafana metrics with Prometheus
|
||||
|
||||
Grafana exposes metrics for Prometheus on the `/metrics` endpoint.
|
||||
|
||||
@@ -38,15 +38,14 @@ To configure basic settings for the data source, complete the following steps:
|
||||
|
||||
1. Set the data source's basic configuration options:
|
||||
|
||||
| Name | Description |
|
||||
|
||||
| Name | Description |
|
||||
| -------------- | ------------------------------------------------------------------------ |
|
||||
| **Name** | Sets the name you use to refer to the data source in panels and queries. |
|
||||
| **Default** | Sets the data source that's pre-selected for new panels. |
|
||||
| **URL** | Sets the URL of the Tempo instance, such as `http://tempo`. |
|
||||
| **Basic Auth** | Enables basic authentication to the Tempo data source. |
|
||||
| **User** | Sets the user name for basic authentication. |
|
||||
| **Password** | Sets the password for basic authentication. |
|
||||
| **Name** | Sets the name you use to refer to the data source in panels and queries. |
|
||||
| **Default** | Sets the data source that's pre-selected for new panels. |
|
||||
| **URL** | Sets the URL of the Tempo instance, such as `http://tempo`. |
|
||||
| **Basic Auth** | Enables basic authentication to the Tempo data source. |
|
||||
| **User** | Sets the user name for basic authentication. |
|
||||
| **Password** | Sets the password for basic authentication. |
|
||||
|
||||
You can also configure settings specific to the Tempo data source. These options are described in the sections below.
|
||||
|
||||
|
||||
7
docs/sources/datasources/testdata/_index.md
vendored
7
docs/sources/datasources/testdata/_index.md
vendored
@@ -33,11 +33,10 @@ To configure basic settings for the data source, complete the following steps:
|
||||
|
||||
The **Settings** tab of the data source is displayed. The data source doesn't provide any settings beyond the most basic options common to all data sources:
|
||||
|
||||
| Name | Description |
|
||||
|
||||
| Name | Description |
|
||||
| ----------- | ------------------------------------------------------------------------ |
|
||||
| **Name** | Sets the name you use to refer to the data source in panels and queries. |
|
||||
| **Default** | Defines whether this data source is pre-selected for new panels. |
|
||||
| **Name** | Sets the name you use to refer to the data source in panels and queries. |
|
||||
| **Default** | Defines whether this data source is pre-selected for new panels. |
|
||||
|
||||
## Create mock data
|
||||
|
||||
|
||||
@@ -38,15 +38,14 @@ To configure basic settings for the data source, complete the following steps:
|
||||
|
||||
1. Set the data source's basic configuration options:
|
||||
|
||||
| Name | Description |
|
||||
|
||||
| Name | Description |
|
||||
| -------------- | ------------------------------------------------------------------------ |
|
||||
| **Name** | Sets the name you use to refer to the data source in panels and queries. |
|
||||
| **Default** | Defines whether this data source is pre-selected for new panels. |
|
||||
| **URL** | Sets the URL of the Zipkin instance, such as `http://localhost:9411`. |
|
||||
| **Basic Auth** | Enables basic authentication for the Zipkin data source. |
|
||||
| **User** | Defines the user name for basic authentication. |
|
||||
| **Password** | Defines the password for basic authentication. |
|
||||
| **Name** | Sets the name you use to refer to the data source in panels and queries. |
|
||||
| **Default** | Defines whether this data source is pre-selected for new panels. |
|
||||
| **URL** | Sets the URL of the Zipkin instance, such as `http://localhost:9411`. |
|
||||
| **Basic Auth** | Enables basic authentication for the Zipkin data source. |
|
||||
| **User** | Defines the user name for basic authentication. |
|
||||
| **Password** | Defines the password for basic authentication. |
|
||||
|
||||
### Trace to logs
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@ keywords:
|
||||
title: 'Alerting HTTP API '
|
||||
---
|
||||
|
||||
# Alerting API
|
||||
# Legacy Alerting API
|
||||
|
||||
> **Note:** Starting with v9.0, the Alerting HTTP API is deprecated. It will be removed in a future release.
|
||||
> **Note:** Starting with v9.0, the Legacy Alerting HTTP API is deprecated. It will be removed in a future release.
|
||||
|
||||
This topic is relevant for the [legacy dashboard alerts](https://grafana.com/docs/grafana/v8.5/alerting/old-alerting/) only.
|
||||
|
||||
|
||||
@@ -14,7 +14,9 @@ keywords:
|
||||
title: 'Alerting Notification Channels HTTP API '
|
||||
---
|
||||
|
||||
# Alerting Notification Channels API
|
||||
# Legacy Alerting Notification Channels API
|
||||
|
||||
> **Note:** Starting with v9.0, the Legacy Alerting Notification Channels API is deprecated. It will be removed in a future release.
|
||||
|
||||
This page documents the Alerting Notification Channels API.
|
||||
|
||||
|
||||
@@ -96,9 +96,10 @@ DELETE /api/v1/provisioning/alert-rules/{UID}
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Source | Type | Go type | Separator | Required | Default | Description |
|
||||
| ---- | ------ | ------ | -------- | --------- | :------: | ------- | -------------- |
|
||||
| UID | `path` | string | `string` | | ✓ | | Alert rule UID |
|
||||
| Name | Source | Type | Go type | Separator | Required | Default | Description |
|
||||
| -------------------- | -------- | ------ | -------- | --------- | :------: | ------- | -------------- |
|
||||
| UID | `path` | string | `string` | | ✓ | | Alert rule UID |
|
||||
| X-Disable-Provenance | `header` | string | `string` | | | | |
|
||||
|
||||
#### All responses
|
||||
|
||||
@@ -637,9 +638,10 @@ POST /api/v1/provisioning/contact-points
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Source | Type | Go type | Separator | Required | Default | Description |
|
||||
| ---- | ------ | ----------------------------------------------- | ----------------------------- | --------- | :------: | ------- | ----------- |
|
||||
| Body | `body` | [EmbeddedContactPoint](#embedded-contact-point) | `models.EmbeddedContactPoint` | | | | |
|
||||
| Name | Source | Type | Go type | Separator | Required | Default | Description |
|
||||
| -------------------- | -------- | ----------------------------------------------- | ----------------------------- | --------- | :------: | ------- | ----------- |
|
||||
| X-Disable-Provenance | `header` | string | `string` | | | | |
|
||||
| Body | `body` | [EmbeddedContactPoint](#embedded-contact-point) | `models.EmbeddedContactPoint` | | | | |
|
||||
|
||||
#### All responses
|
||||
|
||||
@@ -678,9 +680,10 @@ POST /api/v1/provisioning/mute-timings
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Source | Type | Go type | Separator | Required | Default | Description |
|
||||
| ---- | ------ | --------------------------------------- | ------------------------- | --------- | :------: | ------- | ----------- |
|
||||
| Body | `body` | [MuteTimeInterval](#mute-time-interval) | `models.MuteTimeInterval` | | | | |
|
||||
| Name | Source | Type | Go type | Separator | Required | Default | Description |
|
||||
| -------------------- | -------- | --------------------------------------- | ------------------------- | --------- | :------: | ------- | ----------- |
|
||||
| X-Disable-Provenance | `header` | string | `string` | | | | |
|
||||
| Body | `body` | [MuteTimeInterval](#mute-time-interval) | `models.MuteTimeInterval` | | | | |
|
||||
|
||||
#### All responses
|
||||
|
||||
@@ -762,11 +765,12 @@ PUT /api/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Source | Type | Go type | Separator | Required | Default | Description |
|
||||
| --------- | ------ | ----------------------------------- | ----------------------- | --------- | :------: | ------- | ----------- |
|
||||
| FolderUID | `path` | string | `string` | | ✓ | | |
|
||||
| Group | `path` | string | `string` | | ✓ | | |
|
||||
| Body | `body` | [AlertRuleGroup](#alert-rule-group) | `models.AlertRuleGroup` | | | | |
|
||||
| Name | Source | Type | Go type | Separator | Required | Default | Description |
|
||||
| -------------------- | -------- | ----------------------------------- | ----------------------- | --------- | :------: | ------- | ----------- |
|
||||
| FolderUID | `path` | string | `string` | | ✓ | | |
|
||||
| Group | `path` | string | `string` | | ✓ | | |
|
||||
| X-Disable-Provenance | `header` | string | `string` | | | | |
|
||||
| Body | `body` | [AlertRuleGroup](#alert-rule-group) | `models.AlertRuleGroup` | | | | |
|
||||
|
||||
#### All responses
|
||||
|
||||
@@ -805,10 +809,11 @@ PUT /api/v1/provisioning/contact-points/{UID}
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Source | Type | Go type | Separator | Required | Default | Description |
|
||||
| ---- | ------ | ----------------------------------------------- | ----------------------------- | --------- | :------: | ------- | ------------------------------------------ |
|
||||
| UID | `path` | string | `string` | | ✓ | | UID is the contact point unique identifier |
|
||||
| Body | `body` | [EmbeddedContactPoint](#embedded-contact-point) | `models.EmbeddedContactPoint` | | | | |
|
||||
| Name | Source | Type | Go type | Separator | Required | Default | Description |
|
||||
| -------------------- | -------- | ----------------------------------------------- | ----------------------------- | --------- | :------: | ------- | ------------------------------------------ |
|
||||
| UID | `path` | string | `string` | | ✓ | | UID is the contact point unique identifier |
|
||||
| X-Disable-Provenance | `header` | string | `string` | | | | |
|
||||
| Body | `body` | [EmbeddedContactPoint](#embedded-contact-point) | `models.EmbeddedContactPoint` | | | | |
|
||||
|
||||
#### All responses
|
||||
|
||||
@@ -847,10 +852,11 @@ PUT /api/v1/provisioning/mute-timings/{name}
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Source | Type | Go type | Separator | Required | Default | Description |
|
||||
| ---- | ------ | --------------------------------------- | ------------------------- | --------- | :------: | ------- | ---------------- |
|
||||
| name | `path` | string | `string` | | ✓ | | Mute timing name |
|
||||
| Body | `body` | [MuteTimeInterval](#mute-time-interval) | `models.MuteTimeInterval` | | | | |
|
||||
| Name | Source | Type | Go type | Separator | Required | Default | Description |
|
||||
| -------------------- | -------- | --------------------------------------- | ------------------------- | --------- | :------: | ------- | ---------------- |
|
||||
| name | `path` | string | `string` | | ✓ | | Mute timing name |
|
||||
| X-Disable-Provenance | `header` | string | `string` | | | | |
|
||||
| Body | `body` | [MuteTimeInterval](#mute-time-interval) | `models.MuteTimeInterval` | | | | |
|
||||
|
||||
#### All responses
|
||||
|
||||
@@ -889,9 +895,10 @@ PUT /api/v1/provisioning/policies
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Source | Type | Go type | Separator | Required | Default | Description |
|
||||
| ---- | ------ | --------------- | -------------- | --------- | :------: | ------- | ---------------------------------------- |
|
||||
| Body | `body` | [Route](#route) | `models.Route` | | | | The new notification routing tree to use |
|
||||
| Name | Source | Type | Go type | Separator | Required | Default | Description |
|
||||
| -------------------- | -------- | --------------- | -------------- | --------- | :------: | ------- | ---------------------------------------- |
|
||||
| X-Disable-Provenance | `header` | string | `string` | | | | |
|
||||
| Body | `body` | [Route](#route) | `models.Route` | | | | The new notification routing tree to use |
|
||||
|
||||
#### All responses
|
||||
|
||||
@@ -930,10 +937,11 @@ PUT /api/v1/provisioning/templates/{name}
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Source | Type | Go type | Separator | Required | Default | Description |
|
||||
| ---- | ------ | ------------------------------------------------------------- | ------------------------------------ | --------- | :------: | ------- | ------------- |
|
||||
| name | `path` | string | `string` | | ✓ | | Template Name |
|
||||
| Body | `body` | [NotificationTemplateContent](#notification-template-content) | `models.NotificationTemplateContent` | | | | |
|
||||
| Name | Source | Type | Go type | Separator | Required | Default | Description |
|
||||
| -------------------- | -------- | ------------------------------------------------------------- | ------------------------------------ | --------- | :------: | ------- | ------------- |
|
||||
| name | `path` | string | `string` | | ✓ | | Template Name |
|
||||
| X-Disable-Provenance | `header` | string | `string` | | | | |
|
||||
| Body | `body` | [NotificationTemplateContent](#notification-template-content) | `models.NotificationTemplateContent` | | | | |
|
||||
|
||||
#### All responses
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ Improve an existing plugin with one of our guides:
|
||||
- [Add support for Explore queries]({{< relref "add-support-for-explore-queries.md" >}})
|
||||
- [Add support for variables]({{< relref "add-support-for-variables.md" >}})
|
||||
- [Add a query editor help component]({{< relref "add-query-editor-help.md" >}})
|
||||
- [Add distributed tracing for backend plugins]({{< relref "add-distributed-tracing-for-backend-plugins.md" >}})
|
||||
- [Build a logs data source plugin]({{< relref "build-a-logs-data-source-plugin.md" >}})
|
||||
- [Build a streaming data source plugin]({{< relref "build-a-streaming-data-source-plugin.md" >}}/)
|
||||
- [Error handling]({{< relref "error-handling.md" >}})
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
---
|
||||
title: Add distributed tracing for backend plugins
|
||||
---
|
||||
|
||||
# Add distributed tracing for backend plugins
|
||||
|
||||
> **Note:** This feature requires at least Grafana 9.5.0, and your plugin needs to be built at least with
|
||||
> grafana-plugins-sdk-go v0.157.0. If you run a plugin with tracing features on an older version of Grafana,
|
||||
> tracing will be disabled.
|
||||
|
||||
## Introduction
|
||||
|
||||
Distributed tracing allows backend plugin developers to create custom spans in their plugins, and send them to the same endpoint
|
||||
and with the same propagation format as the main Grafana instance. The tracing context is also propagated from the Grafana instance
|
||||
to the plugin, so the plugin's spans will be correlated to the correct trace.
|
||||
|
||||
## Configuration
|
||||
|
||||
> **Note:** Only OpenTelemetry is supported. If Grafana is configured to use a deprecated tracing system (Jaeger or OpenTracing),
|
||||
> tracing will be disabled in the plugin. Please note that OpenTelemetry + Jaeger propagator is supported.
|
||||
|
||||
OpenTelemetry must be enabled and configured for the Grafana instance. Please refer to [this section](
|
||||
{{< relref "../../setup-grafana/configure-grafana/#tracingopentelemetry" >}}) for more information.
|
||||
|
||||
As of Grafana 9.5.0, plugins tracing must be enabled manually on a per-plugin basis, by specifying `tracing = true` in the plugin's config section:
|
||||
|
||||
```ini
|
||||
[plugin.myorg-myplugin-datasource]
|
||||
tracing = true
|
||||
```
|
||||
|
||||
## Implementing tracing in your plugin
|
||||
|
||||
> **Note:** Make sure you are using at least grafana-plugin-sdk-go v0.157.0. You can update with `go get -u github.com/grafana/grafana-plugin-sdk-go`.
|
||||
|
||||
When OpenTelemetry tracing is enabled on the main Grafana instance and tracing is enabeld for a plugin,
|
||||
the OpenTelemetry endpoint address and propagation format will be passed to the plugin during startup,
|
||||
which will be used to configure a global tracer.
|
||||
|
||||
1. The global tracer is configured automatically if you use <code>datasource.Manage</code> or <code>app.Manage</code> to run your plugin.
|
||||
|
||||
This also allows you to specify custom attributes for the default tracer:
|
||||
|
||||
```go
|
||||
func main() {
|
||||
if err := datasource.Manage("MY_PLUGIN_ID", plugin.NewDatasource, datasource.ManageOpts{
|
||||
TracingOpts: tracing.Opts{
|
||||
// Optional custom attributes attached to the tracer's resource.
|
||||
// The tracer will already have some SDK and runtime ones pre-populated.
|
||||
CustomAttributes: []attribute.KeyValue{
|
||||
attribute.String("my_plugin.my_attribute", "custom value"),
|
||||
},
|
||||
},
|
||||
}); err != nil {
|
||||
log.DefaultLogger.Error(err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
1. Once tracing is configured, you can access the global tracer with:
|
||||
|
||||
```go
|
||||
tracing.DefaultTracer()
|
||||
```
|
||||
|
||||
this returns an [OpenTelemetry trace.Tracer](https://pkg.go.dev/go.opentelemetry.io/otel/trace#Tracer), and can be used to create spans.
|
||||
|
||||
For example:
|
||||
|
||||
```go
|
||||
func (d *Datasource) query(ctx context.Context, pCtx backend.PluginContext, query backend.DataQuery) (backend.DataResponse, error) {
|
||||
ctx, span := tracing.DefaultTracer().Start(
|
||||
ctx,
|
||||
"query processing",
|
||||
trace.WithAttributes(
|
||||
attribute.String("query.ref_id", query.RefID),
|
||||
attribute.String("query.type", query.QueryType),
|
||||
attribute.Int64("query.max_data_points", query.MaxDataPoints),
|
||||
attribute.Int64("query.interval_ms", query.Interval.Milliseconds()),
|
||||
attribute.Int64("query.time_range.from", query.TimeRange.From.Unix()),
|
||||
attribute.Int64("query.time_range.to", query.TimeRange.To.Unix()),
|
||||
),
|
||||
)
|
||||
defer span.End()
|
||||
log.DefaultLogger.Debug("query", "traceID", trace.SpanContextFromContext(ctx).TraceID())
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
Refer to the [OpenTelemetry Go SDK](https://pkg.go.dev/go.opentelemetry.io/otel) for in-depth documentation about all the features provided by OpenTelemetry.
|
||||
|
||||
If tracing is disabled in Grafana, `backend.DefaultTracer()` returns a no-op tracer.
|
||||
|
||||
### Tracing GRPC calls
|
||||
|
||||
A new span is created automatically for each GRPC call (`QueryData`, `CheckHealth`, etc), both on Grafana's side and
|
||||
on the plugin's side.
|
||||
|
||||
This also injects the trace context into the `context.Context` passed to those methods.
|
||||
|
||||
This allows you to retrieve the [trace.SpanContext](https://pkg.go.dev/go.opentelemetry.io/otel/trace#SpanContext) by using `tracing.SpanContextFromContext` by passing the original `context.Context` to it:
|
||||
|
||||
```go
|
||||
func (d *Datasource) query(ctx context.Context, pCtx backend.PluginContext, query backend.DataQuery) (backend.DataResponse, error) {
|
||||
spanCtx := trace.SpanContextFromContext(ctx)
|
||||
traceID := spanCtx.TraceID()
|
||||
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Tracing HTTP requests
|
||||
|
||||
When tracing is enabled, a `TracingMiddleware` is also added to the default middleware stack to all HTTP clients created
|
||||
using the `httpclient.New` or `httpclient.NewProvider`, unless custom middlewares are specified.
|
||||
|
||||
This middleware creates spans for each outgoing HTTP request and provides some useful attributes and events related to the request's lifecycle.
|
||||
|
||||
## Complete plugin example
|
||||
|
||||
You can refer to the [datasource-http-backend plugin example](https://github.com/grafana/grafana-plugin-examples/tree/main/examples/datasource-http-backend) for a complete example of a plugin that has full tracing support.
|
||||
@@ -0,0 +1,26 @@
|
||||
---
|
||||
description: Guide for migrating plugins from Grafana v9.x to v10.x
|
||||
keywords:
|
||||
- grafana
|
||||
- plugins
|
||||
- migration
|
||||
- plugin
|
||||
- documentation
|
||||
title: Migrating plugins from Grafana 9.x to 10.x
|
||||
menutitle: v9.x to v10.x
|
||||
weight: 1900
|
||||
---
|
||||
|
||||
# Migrating plugins from Grafana version 9.x to 10.x
|
||||
|
||||
## Verifying plugin behaviour with React 18
|
||||
|
||||
Grafana 10 includes our upgrade to React 18 and use of the new React client rendering API. These changes were delivered to the core `grafana` repo with [PR 64428](https://github.com/grafana/grafana/pull/64428).
|
||||
|
||||
Whilst this brings us many significant benefits, there's a potential for this to impact the way your plugin works. In particular, there could be unintended side effects caused by the changes around improving consistency with `useEffect` timings and automatic batching of state updates.
|
||||
|
||||
Recommended actions:
|
||||
|
||||
- Review the React 18 [upgrade docs](https://react.dev/blog/2022/03/08/react-18-upgrade-guide)
|
||||
- Test your plugins against one of the latest [grafana-dev docker images](https://hub.docker.com/r/grafana/grafana-dev/tags?page=1) (for example, [this one](https://hub.docker.com/layers/grafana/grafana-dev/10.0.0-111404pre/images/sha256-ac78acf54b44bd2ce7e68b796b1df47030da7f35e53b02bc3eec3f4de05f780f?context=explore))
|
||||
- Add a comment to the [forum discussion](https://community.grafana.com/t/grafana-10-is-upgrading-to-react-18/86051) if your plugin is impacted in any way. Either to socialise the changes needed for your plugin or to reach out and ask for help yourself.
|
||||
@@ -26,7 +26,7 @@ Support for exemplars is available for the Prometheus data source only. Once you
|
||||
|
||||
Grafana shows exemplars alongside a metric in the Explore view and in dashboards. Each exemplar displays as a highlighted star. You can hover your cursor over an exemplar to view the unique traceID, which is a combination of a key value pair. To investigate further, click the blue button next to the `traceID` property.
|
||||
|
||||
{{< figure src="/static/img/docs/v74/exemplars.png" class="docs-image--no-shadow" max-width= "750px" caption="Screenshot showing the detail window of an Exemplar" >}}
|
||||
{{< figure src="/media/docs/grafana/exemplars/screenshot-exemplars.png" class="docs-image--no-shadow" max-width= "750px" caption="Screenshot showing the detail window of an exemplar" >}}
|
||||
|
||||
Refer to [View exemplar data]({{< relref "#view-exemplar-data" >}}) for instructions on how to drill down and view exemplar trace details from metrics and logs. To know more about exemplars, refer to the blogpost [Intro to exemplars, which enable Grafana Tempo’s distributed tracing at massive scale](https://grafana.com/blog/2021/03/31/intro-to-exemplars-which-enable-grafana-tempos-distributed-tracing-at-massive-scale/).
|
||||
|
||||
@@ -42,11 +42,11 @@ To examine the details of an exemplar trace:
|
||||
|
||||
1. Place your cursor over an exemplar (highlighted star). Depending on your backend trace data source, you will see a blue button with the label `Query with <data source name>`. In the following example, the tracing data source is Tempo.
|
||||
|
||||
{{< figure src="/static/img/docs/basics/exemplar-details.png" class="docs-image--no-shadow" max-width= "275px" caption="Screenshot showing Exemplar details" >}}
|
||||
{{< figure src="/media/docs/grafana/exemplars/screenshot-exemplar-details.png" class="docs-image--no-shadow" max-width= "350px" caption="Screenshot showing exemplar details" >}}
|
||||
|
||||
1. Click the **Query with Tempo** option next to the `traceID` property. The trace details, including the spans within the trace are listed in a separate panel on the right.
|
||||
|
||||
{{< figure src="/static/img/docs/basics/exemplar-explore-view.png" class="docs-image--no-shadow" max-width= "750px" caption="Explorer view with panel showing trace details" >}}
|
||||
{{< figure src="/media/docs/grafana/exemplars/screenshot-exemplar-explore-view.png" class="docs-image--no-shadow" max-width= "900px" caption="Explorer view with panel showing trace details" >}}
|
||||
|
||||
For more information on how to drill down and analyze the trace and span details, refer to the [Analyze trace and span details](#analyze-trace-and-spans) section.
|
||||
|
||||
@@ -56,11 +56,11 @@ You can also view exemplar trace details from the Loki logs in Explore. Use rege
|
||||
|
||||
To view the details of an exemplar trace:
|
||||
|
||||
1. Expand a log line and scroll down to the `Detected fields` section. Depending on your backend trace data source, you will see a blue button with the label `<data source name>`.
|
||||
1. Expand a log line and scroll down to the `Fields` section. Depending on your backend trace data source, you will see a blue button with the label `<data source name>`.
|
||||
|
||||
1. Click the blue button next to the `traceID` property. Typically, it will have the name of the backend data source. In the following example, the tracing data source is Tempo. The trace details, including the spans within the trace are listed in a separate panel on the right.
|
||||
|
||||
{{< figure src="/static/img/docs/basics/exemplar-loki-logs.png" class="docs-image--no-shadow" max-width= "750px" caption="Explorer view with panel showing trace details" >}}
|
||||
{{< figure src="/media/docs/grafana/exemplars/screenshot-exemplar-loki-logs.png" class="docs-image--no-shadow" max-width= "750px" caption="Explorer view with panel showing trace details" >}}
|
||||
|
||||
For more information on how to drill down and analyze the trace and span details, refer to the [Analyze trace and span details](#analyze-trace-and-spans) section.
|
||||
|
||||
@@ -84,4 +84,4 @@ This panel shows the details of the trace in different segments.
|
||||
|
||||
This displays additional metadata associated with the span. The metadata itself is initially shown in a narrow strip but you can see more details by clicking the metadata strip.
|
||||
|
||||
{{< figure src="/static/img/docs/basics/exemplar-span-details.png" class="docs-image--no-shadow" max-width= "750px" caption="Span details" >}}
|
||||
{{< figure src="/media/docs/grafana/exemplars/screenshot-exemplar-span-details.png" class="docs-image--no-shadow" max-width= "600px" caption="Span details" >}}
|
||||
|
||||
@@ -8,7 +8,7 @@ weight: 5
|
||||
|
||||
# Grafana OSS
|
||||
|
||||
[Grafana open source software](https://grafana.com/oss/) enables you to query, visualize, alert on, and explore your metrics, logs, and traces wherever they are stored. Grafana OSS provides you with tools to turn your time-series database (TSDB) data into insightful graphs and visualizations.
|
||||
[Grafana open source software](https://grafana.com/oss/) enables you to query, visualize, alert on, and explore your metrics, logs, and traces wherever they are stored. Grafana OSS provides you with tools to turn your time-series database (TSDB) data into insightful graphs and visualizations. The Grafana OSS plugin framework also enables you to connect other data sources like NoSQL/SQL databases, ticketing tools like Jira or ServiceNow, and CI/CD tooling like GitLab.
|
||||
|
||||
After you have [installed Grafana]({{< relref "../setup-grafana/installation/" >}}) and set up your first dashboard using instructions in [Getting started with Grafana]({{< relref "../getting-started/build-first-dashboard.md" >}}), you will have many options to choose from depending on your requirements. For example, if you want to view weather data and statistics about your smart home, then you can create a [playlist]({{< relref "../dashboards/create-manage-playlists/" >}}). If you are the administrator for an enterprise and are managing Grafana for multiple teams, then you can set up [provisioning]({{< relref "../administration/provisioning/" >}}) and [authentication]({{< relref "../setup-grafana/configure-security/configure-authentication/" >}}).
|
||||
|
||||
@@ -71,3 +71,5 @@ In addition to Grafana, Grafana Labs also provides the following open source pro
|
||||
**Grafana Tempo:** Grafana Tempo is an open source, easy-to-use and high-volume distributed tracing backend. For more information, refer to [Grafana Tempo documentation](https://grafana.com/docs/tempo/latest/?pg=oss-tempo&plcmt=hero-txt/).
|
||||
|
||||
**Grafana Mimir:** Grafana Mimir is an open source software project that provides a scalable long-term storage for Prometheus. For more information about Grafana Mimir, refer to [Grafana Mimir documentation](https://grafana.com/docs/mimir/latest/).
|
||||
|
||||
**Grafana Phlare:** Grafana Phlare is an open-source software project for aggregating continuous profiling data. Continuous profiling is an observability signal that enables you to understand your workload's resource (CPU, memory, etc.) usage to the exact line number. For more information about using Grafana Phlare, refer to [Grafana Phlare documentation](https://grafana.com/docs/phlare/latest/).
|
||||
|
||||
@@ -6,6 +6,7 @@ aliases:
|
||||
- ../panels/add-panels-dynamically/about-repeating-panels-rows/
|
||||
- ../panels/add-panels-dynamically/configure-repeating-panels/
|
||||
- ../panels/add-panels-dynamically/configure-repeating-rows/
|
||||
- ../panels/working-with-panels/
|
||||
- ../panels/working-with-panels/add-panel/
|
||||
- ../panels/working-with-panels/navigate-inspector-panel/
|
||||
- ../panels/working-with-panels/navigate-panel-editor/
|
||||
|
||||
@@ -75,7 +75,7 @@ rendering_ignore_https_errors = true
|
||||
enable = newNavigation
|
||||
```
|
||||
|
||||
You can override them on Linux machines with:
|
||||
You can override variables on Linux machines with:
|
||||
|
||||
```bash
|
||||
export GF_DEFAULT_INSTANCE_NAME=my-instance
|
||||
@@ -730,6 +730,22 @@ Path to the default home dashboard. If this value is empty, then Grafana uses St
|
||||
|
||||
<hr />
|
||||
|
||||
## [sql_datasources]
|
||||
|
||||
### max_open_conns_default
|
||||
|
||||
For SQL data sources (MySql, Postgres, MSSQL) you can override the default maximum number of open connections (default: 100). The value configured in data source settings will be preferred over the default value.
|
||||
|
||||
### max_idle_conns_default
|
||||
|
||||
For SQL data sources (MySql, Postgres, MSSQL) you can override the default allowed number of idle connections (default: 100). The value configured in data source settings will be preferred over the default value.
|
||||
|
||||
### max_conn_lifetime_default
|
||||
|
||||
For SQL data sources (MySql, Postgres, MSSQL) you can override the default maximum connection lifetime specified in seconds (default: 14400). The value configured in data source settings will be preferred over the default value.
|
||||
|
||||
<hr/>
|
||||
|
||||
## [users]
|
||||
|
||||
### allow_sign_up
|
||||
@@ -2020,6 +2036,20 @@ ha_engine_address = 127.0.0.1:6379
|
||||
|
||||
<hr>
|
||||
|
||||
## [plugin.plugin_id]
|
||||
|
||||
This section can be used to configure plugin-specific settings. Replace the `plugin_id` attribute with the plugin ID present in `plugin.json`.
|
||||
|
||||
Properties described in this section are available for all plugins, but you must set them individually for each plugin.
|
||||
|
||||
### tracing
|
||||
|
||||
> **Note**: Available in Grafana v9.5.0 or later, and [OpenTelemetry must be configured as well](#tracingopentelemetry).
|
||||
|
||||
If `true`, propagate the tracing context to the plugin backend and enable tracing (if the backend supports it).
|
||||
|
||||
<hr>
|
||||
|
||||
## [plugin.grafana-image-renderer]
|
||||
|
||||
For more information, refer to [Image rendering]({{< relref "../image-rendering/" >}}).
|
||||
|
||||
@@ -19,6 +19,7 @@ weight: 900
|
||||
The enhanced LDAP integration adds additional functionality on top of the [LDAP integration]({{< relref "ldap/" >}}) available in the open source edition of Grafana.
|
||||
|
||||
> **Note:** Available in [Grafana Enterprise]({{< relref "../../../../introduction/grafana-enterprise/" >}}) and [Grafana Cloud Advanced](/docs/grafana-cloud).
|
||||
> If you are a Grafana Cloud customer, please [open a support ticket in the Cloud Portal](/profile/org#support) to request this feature.
|
||||
|
||||
> To control user access with role-based permissions, refer to [role-based access control]({{< relref "../../../../administration/roles-and-permissions/access-control/" >}}).
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
aliases:
|
||||
- ../../auth/saml/
|
||||
- ../../auth/team-sync/
|
||||
- ../../enterprise/team-sync/
|
||||
description: Learn how to use Team Sync to synchronize between your authentication
|
||||
|
||||
@@ -5,6 +5,7 @@ aliases:
|
||||
- ../installation/installation/
|
||||
- ../installation/requirements/
|
||||
- /docs/grafana/v2.1/installation/install/
|
||||
- ./rpm/
|
||||
description: Installation guide for Grafana
|
||||
title: Install Grafana
|
||||
weight: 100
|
||||
@@ -22,8 +23,9 @@ Grafana relies on other open source software to operate. For a list of open sour
|
||||
|
||||
Grafana supports the following operating systems:
|
||||
|
||||
- [Debian / Ubuntu]({{< relref "debian/" >}})
|
||||
- [RPM-based Linux (Fedora, SUSE/OpenSUSE, RedHat)]({{< relref "rpm/" >}})
|
||||
- [Debian/Ubuntu]({{< relref "debian/" >}})
|
||||
- [Red Hat/RHEL/Fedora]({{< relref "redhat-rhel-fedora/" >}})
|
||||
- [SUSE/OpenSUSE]({{< relref "suse-opensuse/" >}})
|
||||
- [macOS]({{< relref "mac/" >}})
|
||||
- [Windows]({{< relref "windows/" >}})
|
||||
|
||||
|
||||
@@ -80,79 +80,6 @@ Complete the following steps to install Grafana using DEB or the standalone bina
|
||||
1. Depending on which system you are running, click the **Linux** or **ARM** tab on the download page.
|
||||
1. Copy and paste the code from the installation page into your command line and run.
|
||||
|
||||
## 2. Start the server
|
||||
|
||||
The following sections provide instructions for starting the `grafana-server` process as the `grafana` user, which was created during the package installation.
|
||||
|
||||
If you installed with the APT repository or `.deb` package, then you can start the server using `systemd` or `init.d`. If you installed a binary `.tar.gz` file, then you need to execute the binary.
|
||||
|
||||
> **Note:** The following subsections describe three methods of starting the Grafana server: with systemd, initd, or by directly running the binary. You should follow only one set of instructions, depending on how your machine is configured.
|
||||
|
||||
### Start the Grafana server with systemd
|
||||
|
||||
Complete the following steps to start the Grafana server with systemd and verify that it is running:
|
||||
|
||||
1. To start the service, run the following commands:
|
||||
|
||||
```bash
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl start grafana-server
|
||||
sudo systemctl status grafana-server
|
||||
```
|
||||
|
||||
1. To verify that the service is running, run the following command:
|
||||
|
||||
```
|
||||
sudo systemctl status grafana-server
|
||||
```
|
||||
|
||||
1. To configure the Grafana server to start at boot, run the following command:
|
||||
|
||||
```bash
|
||||
sudo systemctl enable grafana-server.service
|
||||
```
|
||||
|
||||
#### Serve Grafana on a port < 1024
|
||||
|
||||
{{< docs/shared "systemd/bind-net-capabilities.md" >}}
|
||||
|
||||
### Start the server with init.d
|
||||
|
||||
Complete the following steps to start the Grafana service and verify that it is running:
|
||||
|
||||
1. To start the Grafana server, run the following commands:
|
||||
|
||||
```bash
|
||||
sudo service grafana-server start
|
||||
sudo service grafana-server status
|
||||
```
|
||||
|
||||
1. To verify that the service is running, run the following command:
|
||||
|
||||
```
|
||||
sudo service grafana-server status
|
||||
```
|
||||
|
||||
1. To configure the Grafana server to start at boot, run the following command:
|
||||
|
||||
```bash
|
||||
sudo update-rc.d grafana-server defaults
|
||||
```
|
||||
|
||||
### Start the server using the binary
|
||||
|
||||
The `grafana-server` binary .tar.gz needs the working directory to be the root install directory where the binary and the `public` folder are located.
|
||||
|
||||
To start the Grafana server, run the following command:
|
||||
|
||||
```bash
|
||||
./bin/grafana-server
|
||||
```
|
||||
|
||||
## Upgrade Grafana
|
||||
|
||||
While the process for upgrading Grafana is similar to installing Grafana, there are important backup tasks you should perform. Refer to [Upgrade Grafana]({{< relref "../../../upgrade-guide/" >}}) for guidance on updating an existing installation.
|
||||
|
||||
## Next steps
|
||||
|
||||
- [Start the Grafana server]({{< relref "../../start-restart-grafana/" >}})
|
||||
|
||||
@@ -57,10 +57,6 @@ To install Grafana on macOS using the standalone binaries, complete the followin
|
||||
./bin/grafana-server
|
||||
```
|
||||
|
||||
## Upgrade Grafana
|
||||
|
||||
While the process for upgrading Grafana is very similar to installing Grafana, there are important backup tasks you should perform. Refer to [Upgrade Grafana]({{< relref "../../../upgrade-guide/" >}}) for guidance on updating an existing installation.
|
||||
|
||||
## Next steps
|
||||
|
||||
- [Start the Grafana server]({{< relref "../../start-restart-grafana/" >}})
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
---
|
||||
description: Install guide for Grafana on Red Hat, RHEL, and Fedora.
|
||||
title: Install Grafana on Red Hat, RHEL, or Fedora
|
||||
menuTitle: Redhat, RHEL, or Fedora
|
||||
weight: 400
|
||||
---
|
||||
|
||||
# Install Grafana on Red Hat, RHEL, or Fedora
|
||||
|
||||
This topic explains how to install Grafana dependencies, install Grafana on Redhat, RHEL, or Fedora, and start the Grafana server on your system.
|
||||
|
||||
You can install Grafana using a YUM repository, using RPM, or by downloading a binary `.tar.gz` file.
|
||||
|
||||
If you install via RPM or the `.tar.gz` file, then you must manually update Grafana for each new version.
|
||||
|
||||
## Install Grafana from the YUM repository
|
||||
|
||||
If you install from the YUM repository, then Grafana is automatically updated every time you run `sudo yum update`.
|
||||
|
||||
| Grafana Version | Package | Repository |
|
||||
| ------------------ | ------------------ | ------------------------- |
|
||||
| Grafana Enterprise | grafana-enterprise | `https://rpm.grafana.com` |
|
||||
| Grafana OSS | grafana | `https://rpm.grafana.com` |
|
||||
|
||||
> **Note:** Grafana Enterprise is the recommended and default edition. It is available for free and includes all the features of the OSS edition. You can also upgrade to the [full Enterprise feature set](https://grafana.com/products/enterprise/?utm_source=grafana-install-page), which has support for [Enterprise plugins](https://grafana.com/grafana/plugins/?enterprise=1&utcm_source=grafana-install-page).
|
||||
|
||||
To install Grafana using a YUM repository, complete the following steps:
|
||||
|
||||
1. Add a file to your YUM repository using the method of your choice.
|
||||
|
||||
The following example uses `nano` to add a file to the YUM repo.
|
||||
|
||||
```bash
|
||||
sudo nano /etc/yum.repos.d/grafana.repo
|
||||
```
|
||||
|
||||
```bash
|
||||
[grafana]
|
||||
name=grafana
|
||||
baseurl=https://rpm.grafana.com
|
||||
repo_gpgcheck=1
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
gpgkey=https://rpm.grafana.com/gpg.key
|
||||
sslverify=1
|
||||
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
|
||||
```
|
||||
|
||||
1. To prevent beta versions from being installed, add the following exclude line to your `.repo` file.
|
||||
|
||||
```bash
|
||||
exclude=*beta*
|
||||
```
|
||||
|
||||
1. To install Grafana OSS, run the following command:
|
||||
|
||||
```bash
|
||||
sudo yum install grafana
|
||||
```
|
||||
|
||||
1. To install Grafana Enterprise, run the following command:
|
||||
|
||||
```bash
|
||||
sudo yum install grafana-enterprise
|
||||
```
|
||||
|
||||
## Install the Grafana RPM package manually
|
||||
|
||||
If you install Grafana manually using YUM or RPM, then you must manually update Grafana for each new version. This method varies according to which Linux OS you are running.
|
||||
|
||||
**Note:** The RPM files are signed. You can verify the signature with this [public GPG key](https://rpm.grafana.com/gpg.key).
|
||||
|
||||
1. On the [Grafana download page](https://grafana.com/grafana/download), select the Grafana version you want to install.
|
||||
- The most recent Grafana version is selected by default.
|
||||
- The **Version** field displays only finished releases. If you want to install a beta version, click **Nightly Builds** and then select a version.
|
||||
1. Select an **Edition**.
|
||||
- **Enterprise** - Recommended download. Functionally identical to the open source version, but includes features you can unlock with a license if you so choose.
|
||||
- **Open Source** - Functionally identical to the Enterprise version, but you will need to download the Enterprise version if you want Enterprise features.
|
||||
1. Depending on which system you are running, click **Linux** or **ARM**.
|
||||
1. Copy and paste the RPM package URL and the local RPM package information from the installation page into the pattern shown below, then run the commands.
|
||||
|
||||
```bash
|
||||
sudo yum install -y <rpm package url>
|
||||
```
|
||||
|
||||
## Install Grafana as a standalone binary
|
||||
|
||||
Complete the following steps to install Grafana using the standalone binaries:
|
||||
|
||||
1. Navigate to the [Grafana download page](https://grafana.com/grafana/download).
|
||||
1. Select the Grafana version you want to install.
|
||||
- The most recent Grafana version is selected by default.
|
||||
- The **Version** field displays only tagged releases. If you want to install a nightly build, click **Nightly Builds** and then select a version.
|
||||
1. Select an **Edition**.
|
||||
- **Enterprise:** This is the recommended version. It is functionally identical to the open-source version but includes features you can unlock with a license if you so choose.
|
||||
- **Open Source:** This version is functionally identical to the Enterprise version, but you will need to download the Enterprise version if you want Enterprise features.
|
||||
1. Depending on which system you are running, click the **Linux** or **ARM** tab on the download page.
|
||||
1. Copy and paste the code from the installation page into your command line and run.
|
||||
|
||||
## Next steps
|
||||
|
||||
Refer to [Start the Grafana server]({{< relref "../../start-restart-grafana/" >}}).
|
||||
@@ -1,232 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- ../../installation/installation/rpm/
|
||||
- ../../installation/rpm/
|
||||
description: Grafana Installation guide for RPM-based Linux, such as Centos, Fedora,
|
||||
OpenSuse, and Red Hat.
|
||||
title: Install on RPM-based Linux
|
||||
weight: 400
|
||||
---
|
||||
|
||||
# Install on RPM-based Linux (CentOS, Fedora, OpenSuse, Red Hat)
|
||||
|
||||
This topic explains how to install Grafana dependencies, download and install Grafana, get the service up and running on your RPM-based Linux system, and the installation package details.
|
||||
|
||||
## Repository migration (November 8th 2022)
|
||||
|
||||
From that date, Grafana packages will be served from a new repository (<packages.grafana.com/rpm/{product}> -> <rpm.grafana.com>). The new repository serves, from a single YUM/DNF configuration, all Grafana OSS products, as well as Grafana Enterprise.
|
||||
|
||||
The old URLs will still work, serving the content from the new repository, but you may encounter warnings about some repository attributes changing.
|
||||
|
||||
## Note on upgrading
|
||||
|
||||
While the process for upgrading Grafana is very similar to installing Grafana, there are some key backup steps you should perform. Read [Upgrading Grafana]({{< relref "../../../upgrade-guide/" >}}) for tips and guidance on updating an existing installation.
|
||||
|
||||
## 1. Download and install
|
||||
|
||||
You can install Grafana from a YUM repository, manually using YUM, manually using RPM, or by downloading a binary `.tar.gz` file.
|
||||
|
||||
### Install from YUM repository
|
||||
|
||||
If you install from the YUM repository, then Grafana is automatically updated every time you run `sudo yum update`.
|
||||
|
||||
| Grafana Version | Package | Repository |
|
||||
| ------------------ | ------------------ | ------------------------- |
|
||||
| Grafana Enterprise | grafana-enterprise | `https://rpm.grafana.com` |
|
||||
| Grafana OSS | grafana | `https://rpm.grafana.com` |
|
||||
|
||||
> **Note:** Grafana Enterprise is the recommended and default edition. It is available for free and includes all the features of the OSS Edition. You can also upgrade to the [full Enterprise feature set](https://grafana.com/products/enterprise/?utm_source=grafana-install-page) and has support for [Enterprise plugins](https://grafana.com/grafana/plugins/?enterprise=1&utcm_source=grafana-install-page).
|
||||
|
||||
Add a new file to your YUM repo using the method of your choice. The command below uses `nano`.
|
||||
|
||||
```bash
|
||||
sudo nano /etc/yum.repos.d/grafana.repo
|
||||
```
|
||||
|
||||
```bash
|
||||
[grafana]
|
||||
name=grafana
|
||||
baseurl=https://rpm.grafana.com
|
||||
repo_gpgcheck=1
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
gpgkey=https://rpm.grafana.com/gpg.key
|
||||
sslverify=1
|
||||
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
|
||||
```
|
||||
|
||||
Optionally, add an exclude line to your `.repo` file to prevent beta versions from being installed.
|
||||
|
||||
```bash
|
||||
exclude=*beta*
|
||||
```
|
||||
|
||||
Install Grafana with one of the following commands
|
||||
|
||||
> We recommend all users to install the Enterprise Edition of Grafana, which can be seamlessly upgraded with a Grafana Enterprise [subscription](https://grafana.com/products/enterprise/?utm_source=grafana-install-page).
|
||||
|
||||
```bash
|
||||
sudo yum install grafana
|
||||
|
||||
# or
|
||||
|
||||
sudo yum install grafana-enterprise
|
||||
```
|
||||
|
||||
### Install manually with YUM
|
||||
|
||||
If you install manually with YUM, then you will need to manually update Grafana for each new version. To enable automatic updates for your Grafana installation please use the instructions below to install via our YUM repository.
|
||||
|
||||
1. On the [Grafana download page](https://grafana.com/grafana/download), select the Grafana version you want to install.
|
||||
- The most recent Grafana version is selected by default.
|
||||
- The **Version** field displays only finished releases. If you want to install a beta version, click **Nightly Builds** and then select a version.
|
||||
1. Select an **Edition**.
|
||||
- **Enterprise** - Recommended download. Functionally identical to the open source version, but includes features you can unlock with a license if you so choose.
|
||||
- **Open Source** - Functionally identical to the Enterprise version, but you will need to download the Enterprise version if you want enterprise features.
|
||||
1. Depending on which system you are running, click **Linux** or **ARM**.
|
||||
1. Copy and paste the code from the installation page into your command line and run. It follows the pattern shown below.
|
||||
|
||||
```bash
|
||||
wget <rpm package url>
|
||||
sudo yum localinstall <local rpm package>
|
||||
```
|
||||
|
||||
You can also install Grafana using YUM directly:
|
||||
|
||||
```bash
|
||||
sudo yum install <rpm package url>
|
||||
```
|
||||
|
||||
### Install with RPM
|
||||
|
||||
If you install with RPM, then you will need to manually update Grafana for each new version. This method varies according to which Linux OS you are running. Read the instructions fully before you begin.
|
||||
|
||||
**Note:** The .rpm files are signed, you can verify the signature with this [public GPG key](https://rpm.grafana.com/gpg.key).
|
||||
|
||||
1. On the [Grafana download page](https://grafana.com/grafana/download), select the Grafana version you want to install.
|
||||
- The most recent Grafana version is selected by default.
|
||||
- The **Version** field displays only finished releases. If you want to install a beta version, click **Nightly Builds** and then select a version.
|
||||
1. Select an **Edition**.
|
||||
- **Enterprise** - Recommended download. Functionally identical to the open source version, but includes features you can unlock with a license if you so choose.
|
||||
- **Open Source** - Functionally identical to the Enterprise version, but you will need to download the Enterprise version if you want Enterprise features.
|
||||
1. Depending on which system you are running, click **Linux** or **ARM**.
|
||||
1. Copy and paste the .rpm package URL and the local .rpm package information from the installation page into the pattern shown below, then run the commands.
|
||||
|
||||
**On CentOS, Fedora, Red Hat, or RHEL:**
|
||||
|
||||
```bash
|
||||
sudo yum install initscripts urw-fonts wget
|
||||
wget <rpm package url>
|
||||
sudo rpm -Uvh <local rpm package>
|
||||
```
|
||||
|
||||
**On OpenSUSE or SUSE:**
|
||||
|
||||
```bash
|
||||
wget <rpm package url>
|
||||
sudo rpm -i --nodeps <local rpm package>
|
||||
```
|
||||
|
||||
### Install from binary .tar.gz file
|
||||
|
||||
Download the latest [`.tar.gz` file](https://grafana.com/grafana/download?platform=linux) and extract it. The files are extracted into a folder named after the Grafana version that you downloaded. This folder contains all files required to run Grafana. There are no init scripts or install scripts in this package.
|
||||
|
||||
```bash
|
||||
wget <tar.gz package url>
|
||||
sudo tar -zxvf <tar.gz package>
|
||||
```
|
||||
|
||||
## 2. Start the server
|
||||
|
||||
This starts the `grafana-server` process as the `grafana` user, which was created during the package installation. The systemd commands work in most cases, but some older Linux systems might require init.d. The installer should prompt you with the correct commands.
|
||||
|
||||
If you installed with an `.rpm` package, then you can start the server using `systemd` or `init.d`. If you installed a binary `.tar.gz` file, then you need to execute the binary.
|
||||
|
||||
### Start the server with systemd
|
||||
|
||||
To start the service and verify that the service has started:
|
||||
|
||||
```bash
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl start grafana-server
|
||||
sudo systemctl status grafana-server
|
||||
```
|
||||
|
||||
Configure the Grafana server to start at boot:
|
||||
|
||||
```bash
|
||||
sudo systemctl enable grafana-server
|
||||
```
|
||||
|
||||
> **SUSE or OpenSUSE users:** You might need to start the server with the systemd method, then use the init.d method to configure Grafana to start at boot.
|
||||
|
||||
#### Serving Grafana on a port < 1024
|
||||
|
||||
{{< docs/shared "systemd/bind-net-capabilities.md" >}}
|
||||
|
||||
#### Serving Grafana behind a proxy
|
||||
|
||||
When serving Grafana behind a proxy, you need to configure the `http_proxy` and `https_proxy` environment variables.
|
||||
|
||||
##### Centos 6
|
||||
|
||||
If you are on Centos 6, add the following lines to the `/etc/sysconfig/grafana-server` file.
|
||||
|
||||
```
|
||||
export no_proxy=internal.domain,127.0.0.1
|
||||
export http_proxy=http://proxy.domain:3128/
|
||||
export https_proxy=http://proxy.domain:3128/
|
||||
```
|
||||
|
||||
##### Centos 7
|
||||
|
||||
If you are on Centos 7, add the following lines to the `/etc/sysconfig/grafana-server` file.
|
||||
|
||||
```
|
||||
http_proxy=http://proxy.domain:3128/
|
||||
https_proxy=http://proxy.domain:3128/
|
||||
no_proxy=internal.domain,127.0.0.1
|
||||
```
|
||||
|
||||
### Start the server with init.d
|
||||
|
||||
To start the service and verify that the service has started:
|
||||
|
||||
```bash
|
||||
sudo service grafana-server start
|
||||
sudo service grafana-server status
|
||||
```
|
||||
|
||||
Configure the Grafana server to start at boot:
|
||||
|
||||
```bash
|
||||
sudo /sbin/chkconfig --add grafana-server
|
||||
```
|
||||
|
||||
### Execute the binary
|
||||
|
||||
The `grafana-server` binary needs the working directory to be the root install directory where the binary and the `public` folder are located.
|
||||
|
||||
Start Grafana by running:
|
||||
|
||||
```bash
|
||||
./bin/grafana-server web
|
||||
```
|
||||
|
||||
## Package details
|
||||
|
||||
- Installs binary to `/usr/sbin/grafana-server`
|
||||
- Copies init.d script to `/etc/init.d/grafana-server`
|
||||
- Installs default file (environment vars) to `/etc/sysconfig/grafana-server`
|
||||
- Copies configuration file to `/etc/grafana/grafana.ini`
|
||||
- Installs systemd service (if systemd is available) name `grafana-server.service`
|
||||
- The default configuration uses a log file at `/var/log/grafana/grafana.log`
|
||||
- The default configuration specifies an sqlite3 database at `/var/lib/grafana/grafana.db`
|
||||
|
||||
## Next steps
|
||||
|
||||
Refer to the [Getting Started]({{< relref "../../../getting-started/build-first-dashboard/" >}}) guide for information about logging in, setting up data sources, and so on.
|
||||
|
||||
## Configure Grafana
|
||||
|
||||
Refer to the [Configuration]({{< relref "../../configure-grafana/" >}}) page for details on options for customizing your environment, logging, database, and so on.
|
||||
@@ -0,0 +1,84 @@
|
||||
---
|
||||
description: Install guide for Grafana on SUSE or OpenSUSE.
|
||||
title: Install Grafana on SUSE or OpenSUSE
|
||||
menuTitle: Redhat, RHEL, or Fedora
|
||||
weight: 450
|
||||
---
|
||||
|
||||
# Install Grafana on SUSE or OpenSUSE
|
||||
|
||||
This topic explains how to install Grafana dependencies, install Grafana on SUSE or OpenSUSE and start the Grafana server on your system.
|
||||
|
||||
You can install Grafana using a YUM repository, using RPM, or by downloading a binary `.tar.gz` file.
|
||||
|
||||
If you install via RPM or the `.tar.gz` file, then you must manually update Grafana for each new version.
|
||||
|
||||
## Install Grafana from the YUM repository
|
||||
|
||||
If you install from the YUM repository, then Grafana is automatically updated every time you run `sudo zypper update`.
|
||||
|
||||
| Grafana Version | Package | Repository |
|
||||
| ------------------ | ------------------ | ------------------------- |
|
||||
| Grafana Enterprise | grafana-enterprise | `https://rpm.grafana.com` |
|
||||
| Grafana OSS | grafana | `https://rpm.grafana.com` |
|
||||
|
||||
> **Note:** Grafana Enterprise is the recommended and default edition. It is available for free and includes all the features of the OSS edition. You can also upgrade to the [full Enterprise feature set](https://grafana.com/products/enterprise/?utm_source=grafana-install-page), which has support for [Enterprise plugins](https://grafana.com/grafana/plugins/?enterprise=1&utcm_source=grafana-install-page).
|
||||
|
||||
To install Grafana using a YUM repository, complete the following steps:
|
||||
|
||||
1. Use zypper to add the grafana repo.
|
||||
|
||||
```bash
|
||||
sudo zypper addrepo https://rpm.grafana.com grafana
|
||||
```
|
||||
|
||||
1. To install Grafana OSS, run the following command:
|
||||
|
||||
```bash
|
||||
sudo zypper install grafana
|
||||
```
|
||||
|
||||
1. To install Grafana Enterprise, run the following command:
|
||||
|
||||
```bash
|
||||
sudo zypper install grafana-enterprise
|
||||
```
|
||||
|
||||
## Install the Grafana RPM package manually
|
||||
|
||||
If you install Grafana manually using YUM or RPM, then you must manually update Grafana for each new version. This method varies according to which Linux OS you are running.
|
||||
|
||||
**Note:** The RPM files are signed. You can verify the signature with this [public GPG key](https://rpm.grafana.com/gpg.key).
|
||||
|
||||
1. On the [Grafana download page](https://grafana.com/grafana/download), select the Grafana version you want to install.
|
||||
- The most recent Grafana version is selected by default.
|
||||
- The **Version** field displays only finished releases. If you want to install a beta version, click **Nightly Builds** and then select a version.
|
||||
1. Select an **Edition**.
|
||||
- **Enterprise** - Recommended download. Functionally identical to the open source version, but includes features you can unlock with a license if you so choose.
|
||||
- **Open Source** - Functionally identical to the Enterprise version, but you will need to download the Enterprise version if you want Enterprise features.
|
||||
1. Depending on which system you are running, click **Linux** or **ARM**.
|
||||
1. Copy and paste the RPM package URL and the local RPM package information from the installation page into the pattern shown below, then run the commands.
|
||||
|
||||
```bash
|
||||
sudo zypper install initscripts urw-fonts wget
|
||||
wget <rpm package url>
|
||||
sudo rpm -Uvh <local rpm package>
|
||||
```
|
||||
|
||||
## Install Grafana as a standalone binary
|
||||
|
||||
Complete the following steps to install Grafana using the standalone binaries:
|
||||
|
||||
1. Navigate to the [Grafana download page](https://grafana.com/grafana/download).
|
||||
1. Select the Grafana version you want to install.
|
||||
- The most recent Grafana version is selected by default.
|
||||
- The **Version** field displays only tagged releases. If you want to install a nightly build, click **Nightly Builds** and then select a version.
|
||||
1. Select an **Edition**.
|
||||
- **Enterprise:** This is the recommended version. It is functionally identical to the open-source version but includes features you can unlock with a license if you so choose.
|
||||
- **Open Source:** This version is functionally identical to the Enterprise version, but you will need to download the Enterprise version if you want Enterprise features.
|
||||
1. Depending on which system you are running, click the **Linux** or **ARM** tab on the download page.
|
||||
1. Copy and paste the code from the installation page into your command line and run.
|
||||
|
||||
## Next steps
|
||||
|
||||
Refer to [Start the Grafana server]({{< relref "../../start-restart-grafana/" >}}).
|
||||
@@ -54,10 +54,6 @@ Start Grafana by executing `grafana-server.exe`, located in the `bin` directory,
|
||||
|
||||
Port `8080` should not require extra Windows privileges.
|
||||
|
||||
## Upgrade Grafana
|
||||
|
||||
While the process for upgrading Grafana is very similar to installing Grafana, there are important backup tasks you should perform. Refer to [Upgrade Grafana]({{< relref "../../../upgrade-guide/" >}}) for guidance on updating an existing installation.
|
||||
|
||||
## Next steps
|
||||
|
||||
- [Start the Grafana server]({{< relref "../../start-restart-grafana/" >}})
|
||||
|
||||
@@ -105,9 +105,9 @@ To upgrade Grafana installed from the binary `.tar.gz` package, complete the fol
|
||||
|
||||
1. Extract the downloaded package and overwrite the existing files.
|
||||
|
||||
### CentOS or RHEL
|
||||
### RPM or YUM
|
||||
|
||||
To upgrade Grafana running on CentOS or RHEL, complete the following steps:
|
||||
To upgrade Grafana installed using RPM or YUM complete the following steps:
|
||||
|
||||
1. In your current installation of Grafana, save your custom configuration changes to a file named `<grafana_install_dir>/conf/custom.ini`.
|
||||
|
||||
@@ -115,13 +115,19 @@ To upgrade Grafana running on CentOS or RHEL, complete the following steps:
|
||||
|
||||
1. Perform one of the following steps based on your installation.
|
||||
|
||||
- If you [downloaded an RPM package](https://grafana.com/grafana/download) to install Grafana, then complete the steps documented in [Install on RPM-based Linux]({{< relref "../../setup-grafana/installation/rpm/" >}}) to upgrade Grafana.
|
||||
- If you [downloaded an RPM package](https://grafana.com/grafana/download) to install Grafana, then complete the steps documented in [Install Grafana on Red Hat, RHEL, or Fedora]({{< relref "../../setup-grafana/installation/redhat-rhel-fedora/" >}}) or [Install Grafana on SUSE or OpenSUSE]({{< relref "../../setup-grafana/installation/suse-opensuse/" >}}) to upgrade Grafana.
|
||||
- If you used the Grafana YUM repository, run the following command:
|
||||
|
||||
```bash
|
||||
sudo yum update grafana
|
||||
```
|
||||
|
||||
- If you installed Grafana on OpenSUSE or SUSE, run the following command:
|
||||
|
||||
```bash
|
||||
sudo zypper update
|
||||
```
|
||||
|
||||
### Docker
|
||||
|
||||
To upgrade Grafana running in a Docker container, complete the following steps:
|
||||
|
||||
@@ -57,6 +57,6 @@ sudo yum install freetype*
|
||||
sudo yum install urw-fonts
|
||||
```
|
||||
|
||||
## FAQs
|
||||
## More help
|
||||
|
||||
Check out the [FAQ section](https://community.grafana.com/c/howto/faq) on the Grafana Community page for answers to frequently asked questions.
|
||||
Check out the [Grafana Community](https://community.grafana.com/) for more troubleshooting help (you must be logged in to post or comment).
|
||||
|
||||
@@ -90,7 +90,7 @@ Ensure [age](https://github.com/FiloSottile/age#installation) is installed on yo
|
||||
Add the public key to the `public_keys` setting in the `support_bundle` section of the Grafana configuration file.
|
||||
|
||||
```ini
|
||||
[support_bundle]
|
||||
[support_bundles]
|
||||
public_keys = "age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p"
|
||||
```
|
||||
|
||||
@@ -100,7 +100,7 @@ public_keys = "age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p"
|
||||
Example:
|
||||
|
||||
```ini
|
||||
[support_bundle]
|
||||
[support_bundles]
|
||||
public_keys = "age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p age1yu8vzu554pv3klw46yhdv4raz36k5w3vy30lpxn46923lqngudyqvxacer"
|
||||
```
|
||||
|
||||
|
||||
31
docs/sources/upgrade-guide/upgrade-v9.5/index.md
Normal file
31
docs/sources/upgrade-guide/upgrade-v9.5/index.md
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
description: Guide for upgrading to Grafana v9.5
|
||||
keywords:
|
||||
- grafana
|
||||
- configuration
|
||||
- documentation
|
||||
- upgrade
|
||||
title: Upgrade to Grafana v9.5
|
||||
menuTitle: Upgrade to v9.5
|
||||
weight: 1800
|
||||
---
|
||||
|
||||
# Upgrade to Grafana v9.5
|
||||
|
||||
{{< docs/shared "upgrade/upgrade-common-tasks.md" >}}
|
||||
|
||||
## Technical notes
|
||||
|
||||
### InfluxDB provisioning change
|
||||
|
||||
Beginning in v9.5, the InfluxDB data source deprecates the `database` field in provisioning files.
|
||||
The `dbName` field under `jsonData` must be used to store the database information.
|
||||
For more information and examples, please refer to [InfluxDB Provisioning]({{< relref "../../datasources/influxdb/#provision-the-data-source" >}}).
|
||||
|
||||
### Dashboard previews deprecation notice
|
||||
|
||||
We are deprecating the [Dashboard previews]({{< relref "../../search/dashboard-previews" >}}) feature and will remove it in Grafana v10. We've started exploring alternative ways of adding visual previews using the Scenes framework, and we'll share more information about it in the future.
|
||||
|
||||
### Migrate your API keys to service accounts
|
||||
|
||||
We are upgrading Grafana [API keys]({{< relref "../../administration/api-keys/" >}}) to service accounts. Service accounts are a superset of API keys that include token rotation and compatibility with [Role-based access control]({{< relref "../../administration/roles-and-permissions/access-control/" >}}). In a future release, we'll automatically migrate all existing API keys to service accounts. All of your existing tokens will continue to work; they will simply be migrated to service accounts. You can preempt this change by migrating your existing API keys to service accounts using Grafana's UI or API. Learn how to do this in the [API keys documentation]({{< relref "../../administration/api-keys/#migrate-api-keys-to-grafana-service-accounts" >}}).
|
||||
@@ -72,6 +72,7 @@ For a complete list of every change, with links to pull requests and related iss
|
||||
|
||||
## Grafana 9
|
||||
|
||||
- [What's new in 9.5]({{< relref "whats-new-in-v9-5/" >}})
|
||||
- [What's new in 9.4]({{< relref "whats-new-in-v9-4/" >}})
|
||||
- [What's new in 9.3]({{< relref "whats-new-in-v9-3/" >}})
|
||||
- [What's new in 9.2]({{< relref "whats-new-in-v9-2/" >}})
|
||||
@@ -86,12 +87,3 @@ For a complete list of every change, with links to pull requests and related iss
|
||||
- [What's new in 8.2]({{< relref "whats-new-in-v8-2/" >}})
|
||||
- [What's new in 8.1]({{< relref "whats-new-in-v8-1/" >}})
|
||||
- [What's new in 8.0]({{< relref "whats-new-in-v8-0/" >}})
|
||||
|
||||
## Grafana 7
|
||||
|
||||
- [What's new in 7.5]({{< relref "whats-new-in-v7-5/" >}})
|
||||
- [What's new in 7.4]({{< relref "whats-new-in-v7-4/" >}})
|
||||
- [What's new in 7.3]({{< relref "whats-new-in-v7-3/" >}})
|
||||
- [What's new in 7.2]({{< relref "whats-new-in-v7-2/" >}})
|
||||
- [What's new in 7.1]({{< relref "whats-new-in-v7-1/" >}})
|
||||
- [What's new in 7.0]({{< relref "whats-new-in-v7-0/" >}})
|
||||
|
||||
@@ -296,6 +296,10 @@ We've added support for JWT authentication.
|
||||
|
||||
We've added support for custom session parameters.
|
||||
|
||||
## Postgres, MySQL, and MSSQL data sources
|
||||
|
||||
The `database` property is now under the `jsonData` key in the data source configuration. This change is backward compatible, and existing configurations will continue to work.
|
||||
|
||||
## Before you upgrade
|
||||
|
||||
There are no known breaking changes associated with this version of Grafana.
|
||||
|
||||
204
docs/sources/whatsnew/whats-new-in-v9-5.md
Normal file
204
docs/sources/whatsnew/whats-new-in-v9-5.md
Normal file
@@ -0,0 +1,204 @@
|
||||
---
|
||||
description: Feature and improvement highlights for Grafana v9.5
|
||||
keywords:
|
||||
- grafana
|
||||
- new
|
||||
- documentation
|
||||
- '9.5'
|
||||
- release notes
|
||||
title: What's new in Grafana v9.5
|
||||
weight: -33
|
||||
---
|
||||
|
||||
# What’s new in Grafana v9.5
|
||||
|
||||
Welcome to Grafana 9.5! We're excited to share some major updates to Grafana's navigation, tons of usability improvements to Alerting, and some promising experiments to help you query your Prometheus metrics. Also, read on to learn about our continued migration from API keys to service accounts, as well as deprecation of plugins that use Angular and a field in the InfluxDB data source.
|
||||
|
||||
For more detail about all the changes in this release, refer to the [changelog](https://github.com/grafana/grafana/blob/master/CHANGELOG.md). For the specific steps we recommend when you upgrade to v9.5, check out our [Upgrade Guide]({{< relref "../upgrade-guide/upgrade-v9.5/index.md" >}}).
|
||||
|
||||
<!-- Template below
|
||||
|
||||
## Feature
|
||||
[Generally available | Available in experimental/beta] in Grafana [Open Source, Enterprise, Cloud Free, Cloud Pro, Cloud Advanced]
|
||||
|
||||
Description. Include an overview of the feature and problem it solves, and where to learn more (like a link to the docs).
|
||||
|
||||
> **Note:** You must use relative references when linking to docs within the Grafana repo. Please do not use absolute URLs. For more information about relrefs, refer to [Links and references](/docs/writers-toolkit/writing-guide/references/).-->
|
||||
|
||||
## Grafana's new navigation is generally available
|
||||
|
||||
_Generally available in all editions of Grafana._
|
||||
|
||||
The navigation in Grafana has been updated with a new design and an improved structure to make it easier for you to access the data you need. With this update, you can quickly navigate between pages, giving you full visibility into the health of your systems.
|
||||
|
||||
As Grafana evolved from a visualization platform to a comprehensive observability solution, we added numerous tools to support users throughout the software development life cycle. These tools focus on preventing incidents, monitoring applications or infrastructure, and aiding incident response. However, the added functionality must be easily discoverable and navigable to be truly helpful. These key updates to Grafana’s navigation experience help address this:
|
||||
|
||||
- A redesigned navigation menu that groups related tools together for easy access.
|
||||
- A command palette you can use to take actions in Grafana, like creating a dashboard or navigating to an app or page.
|
||||
- Updated layouts featuring breadcrumbs and a sidebar, allowing you to quickly jump between pages.
|
||||
- A new header that appears on all pages in Grafana, which includes a search function.
|
||||
|
||||
Join the [discussion on GitHub](https://github.com/grafana/grafana/discussions/58910) and share your feedback.
|
||||
|
||||
{{< figure src="/media/docs/grafana/navigation-9-4.png" max-width="750px" caption="Grafana new navigation" >}}
|
||||
|
||||
## Dashboards and visualizations
|
||||
|
||||
### Redesigned empty dashboard state
|
||||
|
||||
_Generally available in all editions of Grafana._
|
||||
|
||||
Dashboards have been updated so that it’s easier to begin building from scratch. The options displayed when you add a new dashboard—adding a visualization, a row, or importing panels—each include brief explanations of what those steps will do, so you can begin building with confidence.
|
||||
|
||||
Also, a text **Add** dropdown with these options has replaced the previous "+" icon at the top of the dashboard. This makes it clearer that this element allows you not only to add new panels, but to take all the actions associated with building a new dashboard.
|
||||
|
||||
{{< figure src="/media/docs/grafana/screenshot-empty-dashboard-whats-new-9-5.png" max-width="750px" caption="Dashboard without any visualizations added" >}}
|
||||
|
||||
### Redesigned dashboard panel is generally available
|
||||
|
||||
_Generally available in all editions of Grafana._
|
||||
|
||||
Dashboard panels contain a lot of information, some of which is difficult to discover or access from the dashboard. With our redesigned panels, we've improved accessibility and made it easier to understand the status of a panel by adding and moving key elements.
|
||||
|
||||
We’ve improved panels without titles, made panel descriptions and errors more succinct, and linked key actions from the header of the panel. All of these are laid out from left to right in a row, so there are no overlapping, unusable components.
|
||||
|
||||
Grafana’s new panel design is available only for React-based panels. No Angular-based panels, like the legacy Graph and Worldmap panels, are redesigned. As a reminder, Angular is deprecated in Grafana and will be removed in a future release. See our [deprecation docs]({{< relref "../developers/angular_deprecation/" >}}) for more information.
|
||||
|
||||
{{< figure src="/media/docs/grafana/panel-redesign-whats-new-9.5.png" max-width="750px" caption="Panel header with open menu" >}}
|
||||
|
||||
## Prometheus performance and usability improvements
|
||||
|
||||
### Prometheus metric encyclopedia
|
||||
|
||||
_Experimental in all editions of Grafana._
|
||||
|
||||
When you have thousands (or millions) of Prometheus metrics, it can be hard to find the exact one you're looking for. Enable feature toggle `prometheusMetricEncyclopedia` to replace the basic metric select dropdown in the Prometheus query builder with a paginated and searchable metric _encyclopedia_.
|
||||
|
||||
Here's what you can do with the metric encyclopedia:
|
||||
|
||||
- Fuzzy search for metrics by name, type, and description
|
||||
- Filter metrics by Prometheus types (gauge, counter, histogram, summary)
|
||||
- Display metrics in a paginated list, sort the results, and choose a number of results per page, so that you don't wait a long time for search results
|
||||
- View metric details, like type and description
|
||||
- [Expert feature] Search metric names by regex using the backend only
|
||||
|
||||
### Prometheus browser cache
|
||||
|
||||
_Experimental in all editions of Grafana._
|
||||
|
||||
New feature toggle `prometheusResourceBrowserCache` provides the ability to cache Prometheus editor API calls in the Prometheus data source configuration.
|
||||
This improves Prometheus query editor performance, with the biggest performance improvements seen by users with high cardinality Prometheus instances.
|
||||
|
||||
## Removal of API key creation from the UI
|
||||
|
||||
With this update we are going one step further in deprecating API keys in favor of [service accounts]({{< relref "../administration/service-accounts/" >}}). We've removed the button for creating new API keys through Grafana's user interface, and now only allow the creation of API keys using our HTTP API. We recommend that you migrate your existing API keys to service accounts, and opt for new service accounts instead of new API keys. This change is part of our long-term strategy for sunsetting API keys.
|
||||
|
||||
Learn more about the deprecation strategy for API keys and how to manage them in our [Sunsetting API keys](https://github.com/grafana/grafana/issues/53567) GitHub issue.
|
||||
|
||||
## Resolve Grafana issues faster with support bundles
|
||||
|
||||
_Generally available in all editions of Grafana._
|
||||
|
||||
Support bundles provide a simple way to collect information about your Grafana instance through Grafana's user interface. In a few clicks, you can create a support bundle containing data about migrations, plugins, settings, and more. Once you've created a support bundle, you can either examine it yourself, or share it with your colleagues or Grafana engineers to aid in troubleshooting of your Grafana instance.
|
||||
|
||||
Learn more about support bundles and how to configure them in our [support bundle documentation]({{< relref "../troubleshooting/support-bundles/" >}}).
|
||||
|
||||
{{< figure src="/static/img/docs/troubleshooting/support-bundle.png" max-width="750px" caption="Create a support bundle to resolve issues faster" >}}
|
||||
|
||||
## Alerting
|
||||
|
||||
_All Alerting improvements are generally available in all editions of Grafana._
|
||||
|
||||
### Search for alert rules from multiple data sources
|
||||
|
||||
Search for and display alert rules for multiple data sources at the same time.
|
||||
|
||||
### Fuzzy search on the Alert rule list view
|
||||
|
||||
Search for namespaces or folders, evaluation groups, and alert rule names on the Alert rules list view with immediate results, and regardless of typos.
|
||||
|
||||
### Access an alert rule from a dashboard or a panel
|
||||
|
||||
Navigate to an alert rule directly from a dashboard or a panel to easily access the alert rule details.
|
||||
|
||||
{{< figure src="/media/docs/alerting/alert-rule-dashboard.png" max-width="750px" caption="Access an alert rule from a dashboard or a panel" >}}
|
||||
|
||||
### Access a dashboard or panel from an alert rule
|
||||
|
||||
Navigate from an alert rule straight to a dashboard or a panel associated with the alert rule to visualize your alerting data.
|
||||
|
||||
{{< figure src="/media/docs/alerting/dashboard-alert-rule-2.png" max-width="750px" caption="Access a dashboard or panel from an alert rule" >}}
|
||||
|
||||
### Preview queries for recording rules
|
||||
|
||||
Visualize queries when creating or editing recording rules, so you can see the results of your query before saving your recording rule.
|
||||
|
||||
{{< figure src="/media/docs/alerting/preview-queries-recording-rule.png" max-width="750px" caption="Preview queries for recording rules" >}}
|
||||
|
||||
### Updated alert behavior when an evaluation returns no data
|
||||
|
||||
Alert rules that are configured to fire when an evaluation returns no data now only fire when the entire duration of the evaluation period has finished. This means that rather than immediately firing when the alert rule condition is breached, the alert rule waits until the time set in the **For** field has finished and then fires, reducing alert noise and allowing for temporary data availability issues.
|
||||
|
||||
### Improved Notification policies view
|
||||
|
||||
Updates to the Notification policies view make it easier to use and manage in the following ways:
|
||||
|
||||
- View default policy and nested policies at a glance
|
||||
- New tab for mute timings
|
||||
- View alert instances for each policy
|
||||
- View contact points and which integrations are configured for each policy
|
||||
- View inherited properties on nested policies
|
||||
- Search for label matchers and for contact points to see which notifications are going where
|
||||
|
||||
{{< figure src="/media/docs/alerting/notification-policies-view.png" max-width="750px" caption="Improved Notification policies view" >}}
|
||||
|
||||
### Guidance for configuring your Alertmanager
|
||||
|
||||
Get additional help while configuring your Alertmanager. If you enter an invalid Alertmanager configuration, an error message displays, and you can choose from a previous working configuration to restart it.
|
||||
|
||||
## InfluxDB plugin database field deprecation
|
||||
|
||||
The `database` field in the provisioning file has been deprecated.
|
||||
This information will be stored in the `jsonData` field using the `dbName` property.
|
||||
The `database` field will be removed in the future to make InfluxDB consistent with other data sources.
|
||||
For more information and examples please refer to the [InfluxDB Provisioning docs]({{< relref "../datasources/influxdb/#provision-the-data-source" >}}).
|
||||
|
||||
## Auth: Lock organization roles synced from auth providers
|
||||
|
||||
_Generally available in all editions of Grafana._
|
||||
|
||||
Grafana v9.4 provided the ability to configure synchronization of organization roles for each OAuth provider. With synchronization on, the organization role was applied to the user from the OAuth provider upon signing in. However, after the user signed in, you could still change the user’s organization role during the session.
|
||||
|
||||
With this release, we are reinforcing organization role syncing behavior by introducing a new feature toggle called `onlyExternalOrgRoleSync`. Once enabled, users signing in to Grafana cannot change organization roles that have been synchronized from an external authentication provider, like Active Directory or Google OAuth. This can help ensure the right users maintain the right level of access at all times.
|
||||
|
||||
This feature should be used if you want to enforce strict role synchronization from your auth provider to the organization roles.
|
||||
|
||||
To use this feature, enable the `onlyExternalOrgRoleSync` feature toggle. If you’re using Grafana Cloud and would like to enable this feature, please contact customer support. We'll also be automatically enabling this feature for Grafana Cloud instances over the upcoming weeks.
|
||||
|
||||
You can also _prevent_ the synchronization of organization roles from a given authentication provider. Learn more in our [skip org role sync]({{< relref "../setup-grafana/configure-grafana/#authgrafana_com-skip_org_role_sync/" >}}) documentation.
|
||||
|
||||
## Reporting UI adapted to match the new navigation style
|
||||
|
||||
_Generally available in Grafana Enterprise, Cloud Pro, and Cloud Advanced._
|
||||
|
||||
We updated the reporting UI to better fit the new navigation style, adding a horizontal slider and moving the **Preview** and **Send** buttons to the Action section in the page. We also fixed the alignment of the different sections.
|
||||
|
||||
{{< figure src="/media/docs/grafana/Screenshot-newUI-report.png" max-width="750px" caption="New Grafana report UI" >}}
|
||||
|
||||
## Experimental support for using JWTs as auth method
|
||||
|
||||
_Experimental in Grafana Open Source and Enterprise._
|
||||
|
||||
This feature adds support for using JWT tokens to store rendering keys instead of relying on “remote caching”. It covers most rendering use cases, though some still rely on the remote cache as a store. You can enable this by enabling the feature flag `renderAuthJWT` in the `custom.ini` configuration file.
|
||||
|
||||
## Note for plugin developers
|
||||
|
||||
One of the major changes coming in Grafana 10 will be our upgrade to React 18 and use of the new React client rendering API. There are many significant benefits we gain from this: access to new React features like [transitions](https://react.dev/reference/react/useTransition) and concurrent rendering, as well as other general performance and security improvements. These changes have now been delivered to the core `grafana` repo with [PR 64428](https://github.com/grafana/grafana/pull/64428).
|
||||
|
||||
As with any major upgrade, there's a potential for this to impact the way your plugin works. In particular, there could be unintended side effects caused by the changes around improving consistency with `useEffect` timings and automatic batching of state updates.
|
||||
|
||||
Recommended actions:
|
||||
|
||||
- Review the React 18 [upgrade docs](https://react.dev/blog/2022/03/08/react-18-upgrade-guide)
|
||||
- Test your plugins against one of the latest [grafana-dev docker images](https://hub.docker.com/r/grafana/grafana-dev/tags?page=1) (for example, [this one](https://hub.docker.com/layers/grafana/grafana-dev/10.0.0-111404pre/images/sha256-ac78acf54b44bd2ce7e68b796b1df47030da7f35e53b02bc3eec3f4de05f780f?context=explore))
|
||||
- Add a comment to the [forum discussion](https://community.grafana.com/t/grafana-10-is-upgrading-to-react-18/86051) if your plugin is impacted in any way. Either to socialise the changes needed for your plugin or to reach out and ask for help yourself.
|
||||
@@ -50,6 +50,7 @@ function provisionAzureMonitorDatasources(datasources: AzureMonitorProvision[])
|
||||
expectedAlertMessage: 'Successfully connected to all Azure Monitor endpoints',
|
||||
// Reduce the timeout from 30s to error faster when an invalid alert message is presented
|
||||
timeout: 10000,
|
||||
awaitHealth: true,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ e2e.scenario({
|
||||
e2e.flows.openDashboard({ uid: 'TkZXxlNG3' });
|
||||
e2e().wait('@query');
|
||||
|
||||
e2e.flows.openPanelMenuItem(e2e.flows.PanelMenuItems.Edit, PANEL_UNDER_TEST, true);
|
||||
e2e.flows.openPanelMenuItem(e2e.flows.PanelMenuItems.Edit, PANEL_UNDER_TEST);
|
||||
|
||||
// New panel editor opens when navigating from Panel menu
|
||||
e2e.components.PanelEditor.General.content().should('be.visible');
|
||||
|
||||
@@ -37,7 +37,7 @@ e2e.scenario({
|
||||
e2e.flows.openDashboard({ uid: 'wfTJJL5Wz' });
|
||||
|
||||
// testing opening inspect drawer directly by clicking on Inspect in header menu
|
||||
e2e.flows.openPanelMenuItem(e2e.flows.PanelMenuItems.Inspect, PANEL_UNDER_TEST, true);
|
||||
e2e.flows.openPanelMenuItem(e2e.flows.PanelMenuItems.Inspect, PANEL_UNDER_TEST);
|
||||
|
||||
expectDrawerTabsAndContent();
|
||||
|
||||
@@ -49,7 +49,7 @@ e2e.scenario({
|
||||
expectSubMenuScenario('Query');
|
||||
expectSubMenuScenario('Panel JSON', 'JSON');
|
||||
|
||||
e2e.flows.openPanelMenuItem(e2e.flows.PanelMenuItems.Edit, PANEL_UNDER_TEST, true);
|
||||
e2e.flows.openPanelMenuItem(e2e.flows.PanelMenuItems.Edit, PANEL_UNDER_TEST);
|
||||
|
||||
e2e.components.QueryTab.queryInspectorButton().should('be.visible').click();
|
||||
|
||||
|
||||
2
go.mod
2
go.mod
@@ -400,7 +400,7 @@ require (
|
||||
)
|
||||
|
||||
// Use fork of crewjam/saml with fixes for some issues until changes get merged into upstream
|
||||
replace github.com/crewjam/saml => github.com/grafana/saml v0.4.13-0.20230203140620-5f476db5c00a
|
||||
replace github.com/crewjam/saml => github.com/grafana/saml v0.4.13-0.20230331080031-67cbfa09c7b6
|
||||
|
||||
// Thema's thema CLI requires cobra, which eventually works its way down to go-hclog@v1.0.0.
|
||||
// Upgrading affects backend plugins: https://github.com/grafana/grafana/pull/47653#discussion_r850508593
|
||||
|
||||
4
go.sum
4
go.sum
@@ -1284,8 +1284,8 @@ github.com/grafana/phlare/api v0.1.3 h1:mYTaE9mLsAW/uzPXlW/PQSLsZ4ojBFA+oAMfR/PD
|
||||
github.com/grafana/phlare/api v0.1.3/go.mod h1:29vcLwFDmZBDce2jwFIMtzvof7fzPadT8VMKw9ks7FU=
|
||||
github.com/grafana/prometheus-alertmanager v0.25.1-0.20230308154952-78fedf89728b h1:VQOGGGJ2lKcVPANyzIESKYhSeA0QIvUQwfA3CbrkDfA=
|
||||
github.com/grafana/prometheus-alertmanager v0.25.1-0.20230308154952-78fedf89728b/go.mod h1:MnBfDPXJqXmmfPwQlCLvVUdqfnvrAw+hSPtDeaaFwj4=
|
||||
github.com/grafana/saml v0.4.13-0.20230203140620-5f476db5c00a h1:aWSTt/pTOI4uGY9DhBMG1l0GOnGjIYtaqxzYR3/q82o=
|
||||
github.com/grafana/saml v0.4.13-0.20230203140620-5f476db5c00a/go.mod h1:igEejV+fihTIlHXYP8zOec3V5A8y3lws5bQBFsTm4gA=
|
||||
github.com/grafana/saml v0.4.13-0.20230331080031-67cbfa09c7b6 h1:oHn/OOUkECNX06DPHksS7R3UY5Qdye04b/sBj2/OJ5E=
|
||||
github.com/grafana/saml v0.4.13-0.20230331080031-67cbfa09c7b6/go.mod h1:igEejV+fihTIlHXYP8zOec3V5A8y3lws5bQBFsTm4gA=
|
||||
github.com/grafana/sqlds/v2 v2.3.10 h1:HWKhE0vR6LoEiE+Is8CSZOgaB//D1yqb2ntkass9Fd4=
|
||||
github.com/grafana/sqlds/v2 v2.3.10/go.mod h1:c6ibxnxRVGxV/0YkEgvy7QpQH/lyifFyV7K/14xvdIs=
|
||||
github.com/grafana/thema v0.0.0-20230302221249-6952e4a999b7 h1:XOxaBjhozlleshff3mKNdp55ul74nXJEX3wz8ckjTpc=
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"npmClient": "yarn",
|
||||
"useWorkspaces": true,
|
||||
"packages": ["packages/*"],
|
||||
"version": "9.5.0-pre"
|
||||
"packages": [
|
||||
"packages/*"
|
||||
],
|
||||
"version": "9.5.1"
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"license": "AGPL-3.0-only",
|
||||
"private": true,
|
||||
"name": "grafana",
|
||||
"version": "9.5.0-pre",
|
||||
"version": "9.5.1",
|
||||
"repository": "github:grafana/grafana",
|
||||
"scripts": {
|
||||
"build": "yarn i18n:compile && NODE_ENV=production webpack --progress --config scripts/webpack/webpack.prod.js",
|
||||
@@ -266,7 +266,7 @@
|
||||
"@grafana/lezer-logql": "0.1.2",
|
||||
"@grafana/monaco-logql": "^0.0.7",
|
||||
"@grafana/runtime": "workspace:*",
|
||||
"@grafana/scenes": "^0.2.0",
|
||||
"@grafana/scenes": "^0.6.0",
|
||||
"@grafana/schema": "workspace:*",
|
||||
"@grafana/ui": "workspace:*",
|
||||
"@kusto/monaco-kusto": "5.3.6",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"author": "Grafana Labs",
|
||||
"license": "Apache-2.0",
|
||||
"name": "@grafana/data",
|
||||
"version": "9.5.0-pre",
|
||||
"version": "9.5.1",
|
||||
"description": "Grafana Data Library",
|
||||
"keywords": [
|
||||
"typescript"
|
||||
@@ -36,7 +36,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@braintree/sanitize-url": "6.0.2",
|
||||
"@grafana/schema": "9.5.0-pre",
|
||||
"@grafana/schema": "9.5.1",
|
||||
"@types/d3-interpolate": "^3.0.0",
|
||||
"d3-interpolate": "3.0.1",
|
||||
"date-fns": "2.29.3",
|
||||
|
||||
@@ -441,6 +441,124 @@ describe('setFieldConfigDefaults', () => {
|
||||
}
|
||||
`);
|
||||
});
|
||||
|
||||
it('applies field config defaults correctly when links property exist in field config and no links are defined in panel', () => {
|
||||
const dsFieldConfig: FieldConfig = {
|
||||
links: [
|
||||
{
|
||||
title: 'Google link',
|
||||
url: 'https://google.com',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const panelFieldConfig: FieldConfig = {};
|
||||
|
||||
const context: FieldOverrideEnv = {
|
||||
data: [],
|
||||
field: { type: FieldType.number } as Field,
|
||||
dataFrameIndex: 0,
|
||||
fieldConfigRegistry: customFieldRegistry,
|
||||
};
|
||||
|
||||
// we mutate dsFieldConfig
|
||||
// @ts-ignore
|
||||
setFieldConfigDefaults(dsFieldConfig, panelFieldConfig, context);
|
||||
|
||||
expect(dsFieldConfig).toMatchInlineSnapshot(`
|
||||
{
|
||||
"custom": {},
|
||||
"links": [
|
||||
{
|
||||
"title": "Google link",
|
||||
"url": "https://google.com",
|
||||
},
|
||||
],
|
||||
}
|
||||
`);
|
||||
});
|
||||
|
||||
it('applies field config defaults correctly when links property exist in panel config and no links are defined in ds field config', () => {
|
||||
const dsFieldConfig: FieldConfig = {};
|
||||
|
||||
const panelFieldConfig: FieldConfig = {
|
||||
links: [
|
||||
{
|
||||
title: 'Google link',
|
||||
url: 'https://google.com',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const context: FieldOverrideEnv = {
|
||||
data: [],
|
||||
field: { type: FieldType.number } as Field,
|
||||
dataFrameIndex: 0,
|
||||
fieldConfigRegistry: customFieldRegistry,
|
||||
};
|
||||
|
||||
// we mutate dsFieldConfig
|
||||
// @ts-ignore
|
||||
setFieldConfigDefaults(dsFieldConfig, panelFieldConfig, context);
|
||||
|
||||
expect(dsFieldConfig).toMatchInlineSnapshot(`
|
||||
{
|
||||
"custom": {},
|
||||
"links": [
|
||||
{
|
||||
"title": "Google link",
|
||||
"url": "https://google.com",
|
||||
},
|
||||
],
|
||||
}
|
||||
`);
|
||||
});
|
||||
|
||||
it('applies a merge strategy for links when they exist in ds config and panel', () => {
|
||||
const dsFieldConfig: FieldConfig = {
|
||||
links: [
|
||||
{
|
||||
title: 'Google link',
|
||||
url: 'https://google.com',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const panelFieldConfig: FieldConfig = {
|
||||
links: [
|
||||
{
|
||||
title: 'Grafana',
|
||||
url: 'https://grafana.com',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const context: FieldOverrideEnv = {
|
||||
data: [],
|
||||
field: { type: FieldType.number } as Field,
|
||||
dataFrameIndex: 0,
|
||||
fieldConfigRegistry: customFieldRegistry,
|
||||
};
|
||||
|
||||
// we mutate dsFieldConfig
|
||||
setFieldConfigDefaults(dsFieldConfig, panelFieldConfig, context);
|
||||
|
||||
expect(dsFieldConfig).toMatchInlineSnapshot(`
|
||||
{
|
||||
"custom": {},
|
||||
"links": [
|
||||
{
|
||||
"title": "Google link",
|
||||
"url": "https://google.com",
|
||||
},
|
||||
{
|
||||
"title": "Grafana",
|
||||
"url": "https://grafana.com",
|
||||
},
|
||||
],
|
||||
}
|
||||
`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('setDynamicConfigValue', () => {
|
||||
|
||||
@@ -293,6 +293,11 @@ export function setDynamicConfigValue(config: FieldConfig, value: DynamicConfigV
|
||||
// config -> from DS
|
||||
// defaults -> from Panel config
|
||||
export function setFieldConfigDefaults(config: FieldConfig, defaults: FieldConfig, context: FieldOverrideEnv) {
|
||||
// For cases where we have links on the datasource config and the panel config, we need to merge them
|
||||
if (config.links && defaults.links) {
|
||||
// Combine the data source links and the panel default config links
|
||||
config.links = [...config.links, ...defaults.links];
|
||||
}
|
||||
for (const fieldConfigProperty of context.fieldConfigRegistry.list()) {
|
||||
if (fieldConfigProperty.isCustom && !config.custom) {
|
||||
config.custom = {};
|
||||
|
||||
@@ -97,7 +97,7 @@ export class AppPlugin<T extends KeyValue = KeyValue> extends GrafanaPlugin<AppP
|
||||
return this._extensionConfigs;
|
||||
}
|
||||
|
||||
configureExtensionLink<Context extends object>(extension: Exclude<PluginExtensionLinkConfig<Context>, 'type'>) {
|
||||
configureExtensionLink<Context extends object>(extension: Omit<PluginExtensionLinkConfig<Context>, 'type'>) {
|
||||
this._extensionConfigs.push({
|
||||
...extension,
|
||||
type: PluginExtensionTypes.link,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { DataQuery } from '@grafana/schema';
|
||||
|
||||
import { RawTimeRange, TimeZone } from './time';
|
||||
|
||||
// Plugin Extensions types
|
||||
@@ -18,7 +20,7 @@ export type PluginExtension = {
|
||||
export type PluginExtensionLink = PluginExtension & {
|
||||
type: PluginExtensionTypes.link;
|
||||
path?: string;
|
||||
onClick?: (event: React.MouseEvent) => void;
|
||||
onClick?: (event?: React.MouseEvent) => void;
|
||||
};
|
||||
|
||||
// Objects used for registering extensions (in app plugins)
|
||||
@@ -43,7 +45,7 @@ export type PluginExtensionLinkConfig<Context extends object = object> = PluginE
|
||||
Context,
|
||||
Pick<PluginExtensionLink, 'path'> & {
|
||||
type: PluginExtensionTypes.link;
|
||||
onClick?: (event: React.MouseEvent, helpers: PluginExtensionEventHelpers<Context>) => void;
|
||||
onClick?: (event: React.MouseEvent | undefined, helpers: PluginExtensionEventHelpers<Context>) => void;
|
||||
}
|
||||
>;
|
||||
|
||||
@@ -73,7 +75,7 @@ export type PluginExtensionPanelContext = {
|
||||
timeRange: RawTimeRange;
|
||||
timeZone: TimeZone;
|
||||
dashboard: Dashboard;
|
||||
targets: Target[];
|
||||
targets: DataQuery[];
|
||||
};
|
||||
|
||||
type Dashboard = {
|
||||
@@ -81,8 +83,3 @@ type Dashboard = {
|
||||
title: string;
|
||||
tags: string[];
|
||||
};
|
||||
|
||||
type Target = {
|
||||
pluginId: string;
|
||||
refId: string;
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"author": "Grafana Labs",
|
||||
"license": "Apache-2.0",
|
||||
"name": "@grafana/e2e-selectors",
|
||||
"version": "9.5.0-pre",
|
||||
"version": "9.5.1",
|
||||
"description": "Grafana End-to-End Test Selectors Library",
|
||||
"keywords": [
|
||||
"cli",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"author": "Grafana Labs",
|
||||
"license": "Apache-2.0",
|
||||
"name": "@grafana/e2e",
|
||||
"version": "9.5.0-pre",
|
||||
"version": "9.5.1",
|
||||
"description": "Grafana End-to-End Test Library",
|
||||
"keywords": [
|
||||
"cli",
|
||||
@@ -63,7 +63,7 @@
|
||||
"@babel/core": "7.20.5",
|
||||
"@babel/preset-env": "7.20.2",
|
||||
"@cypress/webpack-preprocessor": "5.17.0",
|
||||
"@grafana/e2e-selectors": "9.5.0-pre",
|
||||
"@grafana/e2e-selectors": "9.5.1",
|
||||
"@grafana/tsconfig": "^1.2.0-rc1",
|
||||
"@mochajs/json-file-reporter": "^1.2.0",
|
||||
"babel-loader": "9.1.2",
|
||||
|
||||
@@ -14,6 +14,7 @@ export interface AddDataSourceConfig {
|
||||
skipTlsVerify: boolean;
|
||||
type: string;
|
||||
timeout?: number;
|
||||
awaitHealth?: boolean;
|
||||
}
|
||||
|
||||
// @todo this actually returns type `Cypress.Chainable<AddDaaSourceConfig>`
|
||||
@@ -40,8 +41,15 @@ export const addDataSource = (config?: Partial<AddDataSourceConfig>) => {
|
||||
skipTlsVerify,
|
||||
type,
|
||||
timeout,
|
||||
awaitHealth,
|
||||
} = fullConfig;
|
||||
|
||||
if (awaitHealth) {
|
||||
e2e()
|
||||
.intercept(/health/)
|
||||
.as('health');
|
||||
}
|
||||
|
||||
e2e().logToConsole('Adding data source with name:', name);
|
||||
e2e.pages.AddDataSource.visit();
|
||||
e2e.pages.AddDataSource.dataSourcePluginsV2(type)
|
||||
@@ -76,6 +84,10 @@ export const addDataSource = (config?: Partial<AddDataSourceConfig>) => {
|
||||
|
||||
e2e.pages.DataSource.saveAndTest().click();
|
||||
|
||||
if (awaitHealth) {
|
||||
e2e().wait('@health', { timeout: timeout ?? e2e.config().defaultCommandTimeout });
|
||||
}
|
||||
|
||||
// use the timeout passed in if it exists, otherwise, continue to use the default
|
||||
e2e.pages.DataSource.alert()
|
||||
.should('exist')
|
||||
|
||||
@@ -34,6 +34,7 @@ interface ConfigurePanelOptional {
|
||||
panelTitle?: string;
|
||||
timeRange?: TimeRangeConfig;
|
||||
visualizationName?: string;
|
||||
timeout?: number;
|
||||
}
|
||||
|
||||
interface ConfigurePanelRequired {
|
||||
@@ -80,6 +81,7 @@ export const configurePanel = (config: PartialAddPanelConfig | PartialEditPanelC
|
||||
timeRange,
|
||||
visitDashboardAtStart,
|
||||
visualizationName,
|
||||
timeout,
|
||||
} = fullConfig;
|
||||
|
||||
if (visitDashboardAtStart) {
|
||||
@@ -91,15 +93,15 @@ export const configurePanel = (config: PartialAddPanelConfig | PartialEditPanelC
|
||||
e2e.components.Panels.Panel.headerItems('Edit').click();
|
||||
} else {
|
||||
try {
|
||||
e2e.components.PageToolbar.item('Add panel').should('be.visible');
|
||||
e2e.components.PageToolbar.item('Add panel').click();
|
||||
e2e.components.PageToolbar.itemButton('Add panel button').should('be.visible');
|
||||
e2e.components.PageToolbar.itemButton('Add panel button').click();
|
||||
} catch (e) {
|
||||
// Depending on the screen size, the "Add panel" button might be hidden
|
||||
e2e.components.PageToolbar.item('Show more items').click();
|
||||
e2e.components.PageToolbar.item('Add panel').last().click();
|
||||
e2e.components.PageToolbar.item('Add panel button').last().click();
|
||||
}
|
||||
e2e.pages.AddDashboard.addNewPanel().should('be.visible');
|
||||
e2e.pages.AddDashboard.addNewPanel().click();
|
||||
e2e.pages.AddDashboard.itemButton('Add new visualization menu item').should('be.visible');
|
||||
e2e.pages.AddDashboard.itemButton('Add new visualization menu item').click();
|
||||
}
|
||||
|
||||
if (timeRange) {
|
||||
@@ -161,7 +163,7 @@ export const configurePanel = (config: PartialAddPanelConfig | PartialEditPanelC
|
||||
e2e().wait('@chartData');
|
||||
|
||||
// Wait for RxJS
|
||||
e2e().wait(500);
|
||||
e2e().wait(timeout ?? e2e.config().defaultCommandTimeout);
|
||||
|
||||
if (matchScreenshot) {
|
||||
let visualization;
|
||||
|
||||
@@ -7,26 +7,51 @@ export enum PanelMenuItems {
|
||||
Extensions = 'Extensions',
|
||||
}
|
||||
|
||||
export const openPanelMenuItem = (menu: PanelMenuItems, panelTitle = 'Panel Title', isReactPanel = false) => {
|
||||
export const openPanelMenuItem = (menu: PanelMenuItems, panelTitle = 'Panel Title') => {
|
||||
// we changed the way we open the panel menu in react panels with the new panel header
|
||||
if (isReactPanel) {
|
||||
e2e.components.Panels.Panel.menu(panelTitle).click({ force: true }); // force click because menu is hidden and show on hover
|
||||
e2e.components.Panels.Panel.menuItems(menu).should('be.visible').click();
|
||||
} else {
|
||||
// this is the old way of opening the panel menu from the title
|
||||
e2e.components.Panels.Panel.title(panelTitle).should('be.visible').click();
|
||||
e2e.components.Panels.Panel.headerItems(menu).should('be.visible').click();
|
||||
}
|
||||
detectPanelType(panelTitle, (isAngularPanel) => {
|
||||
if (isAngularPanel) {
|
||||
e2e.components.Panels.Panel.title(panelTitle).should('be.visible').click();
|
||||
e2e.components.Panels.Panel.headerItems(menu).should('be.visible').click();
|
||||
} else {
|
||||
e2e.components.Panels.Panel.menu(panelTitle).click({ force: true }); // force click because menu is hidden and show on hover
|
||||
e2e.components.Panels.Panel.menuItems(menu).should('be.visible').click();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const openPanelMenuExtension = (extensionTitle: string, panelTitle = 'Panel Title') => {
|
||||
e2e.components.Panels.Panel.title(panelTitle).should('be.visible').click();
|
||||
|
||||
e2e.components.Panels.Panel.headerItems(PanelMenuItems.Extensions)
|
||||
.should('be.visible')
|
||||
.parent()
|
||||
.parent()
|
||||
.invoke('addClass', 'open');
|
||||
|
||||
e2e.components.Panels.Panel.headerItems(extensionTitle).should('be.visible').click();
|
||||
const menuItem = PanelMenuItems.Extensions;
|
||||
// we changed the way we open the panel menu in react panels with the new panel header
|
||||
detectPanelType(panelTitle, (isAngularPanel) => {
|
||||
if (isAngularPanel) {
|
||||
e2e.components.Panels.Panel.title(panelTitle).should('be.visible').click();
|
||||
e2e.components.Panels.Panel.headerItems(menuItem)
|
||||
.should('be.visible')
|
||||
.parent()
|
||||
.parent()
|
||||
.invoke('addClass', 'open');
|
||||
e2e.components.Panels.Panel.headerItems(extensionTitle).should('be.visible').click();
|
||||
} else {
|
||||
e2e.components.Panels.Panel.menu(panelTitle).click({ force: true }); // force click because menu is hidden and show on hover
|
||||
e2e.components.Panels.Panel.menuItems(menuItem).trigger('mouseover', { force: true });
|
||||
e2e.components.Panels.Panel.menuItems(extensionTitle).click({ force: true });
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function detectPanelType(panelTitle: string, detected: (isAngularPanel: boolean) => void) {
|
||||
e2e.components.Panels.Panel.title(panelTitle).then((el) => {
|
||||
const isAngularPanel = el.find('plugin-component.ng-scope').length > 0;
|
||||
|
||||
if (isAngularPanel) {
|
||||
Cypress.log({
|
||||
name: 'detectPanelType',
|
||||
displayName: 'detector',
|
||||
message: 'Angular panel detected, will use legacy selectors.',
|
||||
});
|
||||
}
|
||||
|
||||
detected(isAngularPanel);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@grafana/eslint-plugin",
|
||||
"description": "ESLint rules for use within the Grafana repo. Not suitable (or supported) for external use.",
|
||||
"version": "9.5.0-pre",
|
||||
"version": "9.5.1",
|
||||
"main": "./index.cjs",
|
||||
"author": "Grafana Labs",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"author": "Grafana Labs",
|
||||
"license": "Apache-2.0",
|
||||
"name": "@grafana/runtime",
|
||||
"version": "9.5.0-pre",
|
||||
"version": "9.5.1",
|
||||
"description": "Grafana Runtime Library",
|
||||
"keywords": [
|
||||
"grafana",
|
||||
@@ -37,10 +37,10 @@
|
||||
"postpack": "mv package.json.bak package.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@grafana/data": "9.5.0-pre",
|
||||
"@grafana/e2e-selectors": "9.5.0-pre",
|
||||
"@grafana/data": "9.5.1",
|
||||
"@grafana/e2e-selectors": "9.5.1",
|
||||
"@grafana/faro-web-sdk": "1.0.2",
|
||||
"@grafana/ui": "9.5.0-pre",
|
||||
"@grafana/ui": "9.5.1",
|
||||
"@sentry/browser": "6.19.7",
|
||||
"history": "4.10.1",
|
||||
"lodash": "4.17.21",
|
||||
|
||||
@@ -307,6 +307,8 @@ describe('DataSourceWithBackend', () => {
|
||||
expect(isExpressionReference('Expression')).toBeTruthy(); // Name
|
||||
expect(isExpressionReference({ type: '__expr__' })).toBeTruthy();
|
||||
expect(isExpressionReference({ type: '-100' })).toBeTruthy();
|
||||
expect(isExpressionReference(null)).toBeFalsy();
|
||||
expect(isExpressionReference(undefined)).toBeFalsy();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"author": "Grafana Labs",
|
||||
"license": "Apache-2.0",
|
||||
"name": "@grafana/schema",
|
||||
"version": "9.5.0-pre",
|
||||
"version": "9.5.1",
|
||||
"description": "Grafana Schema Library",
|
||||
"keywords": [
|
||||
"typescript"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"author": "Grafana Labs",
|
||||
"license": "Apache-2.0",
|
||||
"name": "@grafana/toolkit",
|
||||
"version": "9.5.0-pre",
|
||||
"version": "9.5.1",
|
||||
"description": "Grafana Toolkit",
|
||||
"keywords": [
|
||||
"grafana",
|
||||
@@ -51,10 +51,10 @@
|
||||
"@babel/preset-env": "7.18.9",
|
||||
"@babel/preset-react": "7.18.6",
|
||||
"@babel/preset-typescript": "7.18.6",
|
||||
"@grafana/data": "9.5.0-pre",
|
||||
"@grafana/data": "9.5.1",
|
||||
"@grafana/eslint-config": "5.1.0",
|
||||
"@grafana/tsconfig": "^1.2.0-rc1",
|
||||
"@grafana/ui": "9.5.0-pre",
|
||||
"@grafana/ui": "9.5.1",
|
||||
"@jest/core": "27.5.1",
|
||||
"@types/command-exists": "^1.2.0",
|
||||
"@types/eslint": "8.4.1",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"author": "Grafana Labs",
|
||||
"license": "Apache-2.0",
|
||||
"name": "@grafana/ui",
|
||||
"version": "9.5.0-pre",
|
||||
"version": "9.5.1",
|
||||
"description": "Grafana Components Library",
|
||||
"keywords": [
|
||||
"grafana",
|
||||
@@ -49,10 +49,10 @@
|
||||
"dependencies": {
|
||||
"@emotion/css": "11.10.6",
|
||||
"@emotion/react": "11.10.6",
|
||||
"@grafana/data": "9.5.0-pre",
|
||||
"@grafana/e2e-selectors": "9.5.0-pre",
|
||||
"@grafana/data": "9.5.1",
|
||||
"@grafana/e2e-selectors": "9.5.1",
|
||||
"@grafana/faro-web-sdk": "1.0.2",
|
||||
"@grafana/schema": "9.5.0-pre",
|
||||
"@grafana/schema": "9.5.1",
|
||||
"@leeoniya/ufuzzy": "1.0.6",
|
||||
"@monaco-editor/react": "4.4.6",
|
||||
"@popperjs/core": "2.11.6",
|
||||
|
||||
@@ -392,7 +392,7 @@ func (hs *HTTPServer) registerRoutes() {
|
||||
idScope := datasources.ScopeProvider.GetResourceScope(ac.Parameter(":id"))
|
||||
uidScope := datasources.ScopeProvider.GetResourceScopeUID(ac.Parameter(":uid"))
|
||||
nameScope := datasources.ScopeProvider.GetResourceScopeName(ac.Parameter(":name"))
|
||||
datasourceRoute.Get("/", authorize(reqOrgAdmin, ac.EvalPermission(datasources.ActionRead)), routing.Wrap(hs.GetDataSources))
|
||||
datasourceRoute.Get("/", authorize(reqEditorRole, ac.EvalPermission(datasources.ActionRead)), routing.Wrap(hs.GetDataSources))
|
||||
datasourceRoute.Post("/", authorize(reqOrgAdmin, ac.EvalPermission(datasources.ActionCreate)), quota(string(datasources.QuotaTargetSrv)), routing.Wrap(hs.AddDataSource))
|
||||
datasourceRoute.Put("/:id", authorize(reqOrgAdmin, ac.EvalPermission(datasources.ActionWrite, idScope)), routing.Wrap(hs.UpdateDataSourceByID))
|
||||
datasourceRoute.Put("/uid/:uid", authorize(reqOrgAdmin, ac.EvalPermission(datasources.ActionWrite, uidScope)), routing.Wrap(hs.UpdateDataSourceByUID))
|
||||
|
||||
@@ -469,6 +469,10 @@ func (hs *HTTPServer) InstallPlugin(c *contextmodel.ReqContext) response.Respons
|
||||
if errors.Is(err, plugins.ErrInstallCorePlugin) {
|
||||
return response.Error(http.StatusForbidden, "Cannot install or change a Core plugin", err)
|
||||
}
|
||||
var archError repo.ErrArcNotFound
|
||||
if errors.As(err, &archError) {
|
||||
return response.Error(http.StatusNotFound, archError.Error(), nil)
|
||||
}
|
||||
|
||||
return response.Error(http.StatusInternalServerError, "Failed to install plugin", err)
|
||||
}
|
||||
|
||||
@@ -217,12 +217,22 @@ func ldflags(opts BuildOpts) (string, error) {
|
||||
return "", err
|
||||
}
|
||||
|
||||
commitSha := getGitSha()
|
||||
if v := os.Getenv("COMMIT_SHA"); v != "" {
|
||||
commitSha = v
|
||||
}
|
||||
|
||||
buildBranch := getGitBranch()
|
||||
if v := os.Getenv("BUILD_BRANCH"); v != "" {
|
||||
buildBranch = v
|
||||
}
|
||||
|
||||
var b bytes.Buffer
|
||||
b.WriteString("-w")
|
||||
b.WriteString(fmt.Sprintf(" -X main.version=%s", opts.version))
|
||||
b.WriteString(fmt.Sprintf(" -X main.commit=%s", getGitSha()))
|
||||
b.WriteString(fmt.Sprintf(" -X main.commit=%s", commitSha))
|
||||
b.WriteString(fmt.Sprintf(" -X main.buildstamp=%d", buildStamp))
|
||||
b.WriteString(fmt.Sprintf(" -X main.buildBranch=%s", getGitBranch()))
|
||||
b.WriteString(fmt.Sprintf(" -X main.buildBranch=%s", buildBranch))
|
||||
if v := os.Getenv("LDFLAGS"); v != "" {
|
||||
b.WriteString(fmt.Sprintf(" -extldflags \"%s\"", v))
|
||||
}
|
||||
|
||||
@@ -51,4 +51,22 @@ var (
|
||||
Name: "tag",
|
||||
Usage: "Grafana version tag",
|
||||
}
|
||||
securityFlag = cli.BoolFlag{
|
||||
Name: "security",
|
||||
Usage: "Security release",
|
||||
}
|
||||
srcFlag = cli.StringFlag{
|
||||
Name: "src-bucket",
|
||||
Value: "grafana-prerelease",
|
||||
Usage: "Google Cloud Storage bucket",
|
||||
}
|
||||
securityDestBucketFlag = cli.StringFlag{
|
||||
Name: "security-dest-bucket",
|
||||
Usage: "Google Cloud Storage bucket for security packages (or $SECURITY_DEST_BUCKET)",
|
||||
}
|
||||
destFlag = cli.StringFlag{
|
||||
Name: "dest-bucket",
|
||||
Value: "grafana-downloads",
|
||||
Usage: "Google Cloud Storage bucket for published packages",
|
||||
}
|
||||
)
|
||||
|
||||
@@ -198,42 +198,31 @@ func main() {
|
||||
Usage: "Handle Grafana artifacts",
|
||||
Subcommands: cli.Commands{
|
||||
{
|
||||
Name: "publish",
|
||||
Usage: "Publish Grafana artifacts",
|
||||
Action: PublishArtifactsAction,
|
||||
Name: "storybook",
|
||||
Usage: "Publish Grafana storybook",
|
||||
Action: PublishStorybookAction,
|
||||
Flags: []cli.Flag{
|
||||
&editionFlag,
|
||||
&cli.BoolFlag{
|
||||
Name: "security",
|
||||
Usage: "Security release",
|
||||
},
|
||||
&tagFlag,
|
||||
&srcFlag,
|
||||
&cli.StringFlag{
|
||||
Name: "security-dest-bucket",
|
||||
Usage: "Google Cloud Storage bucket for security packages (or $SECURITY_DEST_BUCKET)",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tag",
|
||||
Usage: "Grafana version tag",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "src-bucket",
|
||||
Value: "grafana-prerelease",
|
||||
Usage: "Google Cloud Storage bucket",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "dest-bucket",
|
||||
Value: "grafana-downloads",
|
||||
Usage: "Google Cloud Storage bucket for published packages",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "enterprise2-dest-bucket",
|
||||
Value: "grafana-downloads-enterprise2",
|
||||
Usage: "Google Cloud Storage bucket for published packages",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "enterprise2-security-prefix",
|
||||
Usage: "Bucket path prefix for enterprise2 security releases (or $ENTERPRISE2_SECURITY_PREFIX)",
|
||||
Name: "storybook-bucket",
|
||||
Value: "grafana-storybook",
|
||||
Usage: "Google Cloud Storage bucket for storybooks",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "static-assets",
|
||||
Usage: "Publish Grafana static assets",
|
||||
Action: PublishStaticAssetsAction,
|
||||
Flags: []cli.Flag{
|
||||
&editionFlag,
|
||||
&securityFlag,
|
||||
&securityDestBucketFlag,
|
||||
&tagFlag,
|
||||
&srcFlag,
|
||||
&destFlag,
|
||||
&cli.StringFlag{
|
||||
Name: "static-assets-bucket",
|
||||
Value: "grafana-static-assets",
|
||||
@@ -243,10 +232,32 @@ func main() {
|
||||
Name: "static-asset-editions",
|
||||
Usage: "All the editions of the static assets (or $STATIC_ASSET_EDITIONS)",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "packages",
|
||||
Usage: "Publish Grafana packages",
|
||||
Action: PublishArtifactsAction,
|
||||
Flags: []cli.Flag{
|
||||
&editionFlag,
|
||||
&securityFlag,
|
||||
&securityDestBucketFlag,
|
||||
&tagFlag,
|
||||
&srcFlag,
|
||||
&destFlag,
|
||||
&cli.StringSliceFlag{
|
||||
Name: "artifacts-editions",
|
||||
Value: cli.NewStringSlice("oss", "enterprise", "enterprise2"),
|
||||
Usage: "Editions for which the artifacts should be delivered (oss,enterprise,enterprise2), (or $ARTIFACTS_EDITIONS)",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storybook-bucket",
|
||||
Value: "grafana-storybook",
|
||||
Usage: "Google Cloud Storage bucket for storybooks",
|
||||
Name: "enterprise2-dest-bucket",
|
||||
Value: "grafana-downloads-enterprise2",
|
||||
Usage: "Google Cloud Storage bucket for published packages",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "enterprise2-security-prefix",
|
||||
Usage: "Bucket path prefix for enterprise2 security releases (or $ENTERPRISE2_SECURITY_PREFIX)",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -3,60 +3,16 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/grafana/grafana/pkg/build/env"
|
||||
"github.com/grafana/grafana/pkg/build/gcloud"
|
||||
"github.com/grafana/grafana/pkg/build/versions"
|
||||
"github.com/grafana/grafana/pkg/build/gcloud/storage"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
type publishConfig struct {
|
||||
tag string
|
||||
srcBucket string
|
||||
destBucket string
|
||||
enterprise2DestBucket string
|
||||
enterprise2SecurityPrefix string
|
||||
staticAssetsBucket string
|
||||
staticAssetEditions []string
|
||||
storybookBucket string
|
||||
security bool
|
||||
}
|
||||
|
||||
// requireListWithEnvFallback first checks the CLI for a flag with the required
|
||||
// name. If this is empty, it falls back to taking the environment variable.
|
||||
// Sadly, we cannot use cli.Flag.EnvVars for this due to it potentially leaking
|
||||
// environment variables as default values in usage-errors.
|
||||
func requireListWithEnvFallback(cctx *cli.Context, name string, envName string) ([]string, error) {
|
||||
result := cctx.StringSlice(name)
|
||||
if len(result) == 0 {
|
||||
for _, v := range strings.Split(os.Getenv(envName), ",") {
|
||||
value := strings.TrimSpace(v)
|
||||
if value != "" {
|
||||
result = append(result, value)
|
||||
}
|
||||
}
|
||||
}
|
||||
if len(result) == 0 {
|
||||
return nil, cli.Exit(fmt.Sprintf("Required flag (%s) or environment variable (%s) not set", name, envName), 1)
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func requireStringWithEnvFallback(cctx *cli.Context, name string, envName string) (string, error) {
|
||||
result := cctx.String(name)
|
||||
if result == "" {
|
||||
result = os.Getenv(envName)
|
||||
}
|
||||
if result == "" {
|
||||
return "", cli.Exit(fmt.Sprintf("Required flag (%s) or environment variable (%s) not set", name, envName), 1)
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// Action implements the sub-command "publish-artifacts".
|
||||
// PublishArtifactsAction Action implements the sub-command "publish-artifacts".
|
||||
func PublishArtifactsAction(c *cli.Context) error {
|
||||
if c.NArg() > 0 {
|
||||
if err := cli.ShowSubcommandHelp(c); err != nil {
|
||||
@@ -65,17 +21,23 @@ func PublishArtifactsAction(c *cli.Context) error {
|
||||
return cli.Exit("", 1)
|
||||
}
|
||||
|
||||
staticAssetEditions, err := requireListWithEnvFallback(c, "static-asset-editions", "STATIC_ASSET_EDITIONS")
|
||||
security := c.Bool("security")
|
||||
var securityDestBucket, enterprise2SecurityPrefix string
|
||||
|
||||
artifactsEditions, err := env.RequireListWithEnvFallback(c, "artifacts-editions", "ARTIFACTS_EDITIONS")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
securityDestBucket, err := requireStringWithEnvFallback(c, "security-dest-bucket", "SECURITY_DEST_BUCKET")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
enterprise2SecurityPrefix, err := requireStringWithEnvFallback(c, "enterprise2-security-prefix", "ENTERPRISE2_SECURITY_PREFIX")
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
if security {
|
||||
securityDestBucket, err = env.RequireStringWithEnvFallback(c, "security-dest-bucket", "SECURITY_DEST_BUCKET")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
enterprise2SecurityPrefix, err = env.RequireStringWithEnvFallback(c, "enterprise2-security-prefix", "ENTERPRISE2_SECURITY_PREFIX")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if err := gcloud.ActivateServiceAccount(); err != nil {
|
||||
@@ -87,10 +49,7 @@ func PublishArtifactsAction(c *cli.Context) error {
|
||||
destBucket: c.String("dest-bucket"),
|
||||
enterprise2DestBucket: c.String("enterprise2-dest-bucket"),
|
||||
enterprise2SecurityPrefix: enterprise2SecurityPrefix,
|
||||
staticAssetsBucket: c.String("static-assets-bucket"),
|
||||
staticAssetEditions: staticAssetEditions,
|
||||
storybookBucket: c.String("storybook-bucket"),
|
||||
security: c.Bool("security"),
|
||||
security: security,
|
||||
tag: strings.TrimPrefix(c.String("tag"), "v"),
|
||||
}
|
||||
|
||||
@@ -98,114 +57,56 @@ func PublishArtifactsAction(c *cli.Context) error {
|
||||
cfg.destBucket = securityDestBucket
|
||||
}
|
||||
|
||||
err = copyStaticAssets(cfg)
|
||||
gcs, err := storage.New()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = copyStorybook(cfg)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = copyDownloads(cfg)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = copyEnterprise2Downloads(cfg)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
for _, edition := range artifactsEditions {
|
||||
switch edition {
|
||||
case "oss", "enterprise":
|
||||
err = copyArtifacts(c, gcs, cfg, edition)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
case "enterprise2":
|
||||
err = copyEnterprise2Artifacts(c, gcs, cfg)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
default:
|
||||
log.Printf("unrecognised artifacts edition: %s\n", edition)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func copyStaticAssets(cfg publishConfig) error {
|
||||
for _, edition := range cfg.staticAssetEditions {
|
||||
log.Printf("Copying static assets for %s", edition)
|
||||
srcURL := fmt.Sprintf("%s/artifacts/static-assets/%s/%s/*", cfg.srcBucket, edition, cfg.tag)
|
||||
destURL := fmt.Sprintf("%s/%s/%s/", cfg.staticAssetsBucket, edition, cfg.tag)
|
||||
err := gcsCopy("static assets", srcURL, destURL)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error copying static assets, %q", err)
|
||||
}
|
||||
func copyArtifacts(c *cli.Context, gcs *storage.Client, cfg publishConfig, edition string) error {
|
||||
bucket := gcs.Bucket(cfg.destBucket)
|
||||
destURL := edition
|
||||
if !cfg.security {
|
||||
destURL = filepath.Join(destURL, "release")
|
||||
}
|
||||
log.Printf("Successfully copied static assets!")
|
||||
return nil
|
||||
}
|
||||
|
||||
func copyStorybook(cfg publishConfig) error {
|
||||
if cfg.security {
|
||||
log.Printf("skipping storybook copy - not needed for a security release")
|
||||
return nil
|
||||
}
|
||||
log.Printf("Copying storybooks...")
|
||||
srcURL := fmt.Sprintf("%s/artifacts/storybook/v%s/*", cfg.srcBucket, cfg.tag)
|
||||
destURL := fmt.Sprintf("%s/%s", cfg.storybookBucket, cfg.tag)
|
||||
err := gcsCopy("storybook", srcURL, destURL)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error copying storybook. %q", err)
|
||||
}
|
||||
stableVersion, err := versions.GetLatestVersion(versions.LatestStableVersionURL)
|
||||
if err != nil {
|
||||
log.Printf("Copying downloads for %s, from %s bucket to %s bucket", edition, cfg.srcBucket, destURL)
|
||||
if err := gcs.CopyRemoteDir(c.Context, gcs.Bucket(cfg.srcBucket), fmt.Sprintf("artifacts/downloads/v%s/%s/release", cfg.tag, edition), bucket, destURL); err != nil {
|
||||
return err
|
||||
}
|
||||
isLatest, err := versions.IsGreaterThanOrEqual(cfg.tag, stableVersion)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if isLatest {
|
||||
log.Printf("Copying storybooks to latest...")
|
||||
srcURL := fmt.Sprintf("%s/artifacts/storybook/v%s/*", cfg.srcBucket, cfg.tag)
|
||||
destURL := fmt.Sprintf("%s/latest", cfg.storybookBucket)
|
||||
err := gcsCopy("storybook (latest)", srcURL, destURL)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error copying storybook to latest. %q", err)
|
||||
}
|
||||
}
|
||||
|
||||
log.Printf("Successfully copied storybook!")
|
||||
return nil
|
||||
}
|
||||
|
||||
func copyDownloads(cfg publishConfig) error {
|
||||
for _, edition := range []string{
|
||||
"oss", "enterprise",
|
||||
} {
|
||||
destURL := fmt.Sprintf("%s/%s/", cfg.destBucket, edition)
|
||||
srcURL := fmt.Sprintf("%s/artifacts/downloads/v%s/%s/release/*", cfg.srcBucket, cfg.tag, edition)
|
||||
if !cfg.security {
|
||||
destURL = filepath.Join(destURL, "release")
|
||||
}
|
||||
log.Printf("Copying downloads for %s, from %s bucket to %s bucket", edition, srcURL, destURL)
|
||||
err := gcsCopy("downloads", srcURL, destURL)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error copying downloads, %q", err)
|
||||
}
|
||||
}
|
||||
log.Printf("Successfully copied downloads.")
|
||||
return nil
|
||||
}
|
||||
|
||||
func copyEnterprise2Downloads(cfg publishConfig) error {
|
||||
func copyEnterprise2Artifacts(c *cli.Context, gcs *storage.Client, cfg publishConfig) error {
|
||||
bucket := gcs.Bucket(cfg.enterprise2DestBucket)
|
||||
var prefix string
|
||||
if cfg.security {
|
||||
prefix = cfg.enterprise2SecurityPrefix
|
||||
}
|
||||
srcURL := fmt.Sprintf("%s/artifacts/downloads-enterprise2/v%s/enterprise2/release/*", cfg.srcBucket, cfg.tag)
|
||||
destURL := fmt.Sprintf("%s/enterprise2/%srelease", cfg.enterprise2DestBucket, prefix)
|
||||
log.Printf("Copying downloads for enterprise2, from %s bucket to %s bucket", srcURL, destURL)
|
||||
err := gcsCopy("enterprise2 downloads", srcURL, destURL)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error copying ")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func gcsCopy(desc, src, dest string) error {
|
||||
args := strings.Split(fmt.Sprintf("-m cp -r gs://%s gs://%s", src, dest), " ")
|
||||
// nolint:gosec
|
||||
cmd := exec.Command("gsutil", args...)
|
||||
out, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to publish %s: %w\n%s", desc, err, out)
|
||||
destURL := fmt.Sprintf("enterprise2/%srelease", prefix)
|
||||
log.Printf("Copying downloads for enterprise2, from %s bucket to %s bucket", cfg.srcBucket, destURL)
|
||||
if err := gcs.CopyRemoteDir(c.Context, gcs.Bucket(cfg.srcBucket), fmt.Sprintf("artifacts/downloads-enterprise2/v%s/enterprise2/release", cfg.tag), bucket, destURL); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
13
pkg/build/cmd/publishconfig.go
Normal file
13
pkg/build/cmd/publishconfig.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package main
|
||||
|
||||
type publishConfig struct {
|
||||
tag string
|
||||
srcBucket string
|
||||
destBucket string
|
||||
enterprise2DestBucket string
|
||||
enterprise2SecurityPrefix string
|
||||
staticAssetsBucket string
|
||||
staticAssetEditions []string
|
||||
storybookBucket string
|
||||
security bool
|
||||
}
|
||||
51
pkg/build/cmd/publishstaticassets.go
Normal file
51
pkg/build/cmd/publishstaticassets.go
Normal file
@@ -0,0 +1,51 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/grafana/grafana/pkg/build/env"
|
||||
"github.com/grafana/grafana/pkg/build/gcloud"
|
||||
"github.com/grafana/grafana/pkg/build/gcloud/storage"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// PublishStaticAssetsAction Action implements the sub-command "artifacts static-assets".
|
||||
func PublishStaticAssetsAction(c *cli.Context) error {
|
||||
if c.NArg() > 0 {
|
||||
if err := cli.ShowSubcommandHelp(c); err != nil {
|
||||
return cli.Exit(err.Error(), 1)
|
||||
}
|
||||
return cli.Exit("", 1)
|
||||
}
|
||||
|
||||
staticAssetEditions, err := env.RequireListWithEnvFallback(c, "static-asset-editions", "STATIC_ASSET_EDITIONS")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := gcloud.ActivateServiceAccount(); err != nil {
|
||||
return fmt.Errorf("error connecting to gcp, %q", err)
|
||||
}
|
||||
|
||||
cfg := publishConfig{
|
||||
srcBucket: c.String("src-bucket"),
|
||||
staticAssetsBucket: c.String("static-assets-bucket"),
|
||||
staticAssetEditions: staticAssetEditions,
|
||||
tag: strings.TrimPrefix(c.String("tag"), "v"),
|
||||
}
|
||||
|
||||
gcs, err := storage.New()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
bucket := gcs.Bucket(cfg.staticAssetsBucket)
|
||||
|
||||
for _, edition := range staticAssetEditions {
|
||||
if err := gcs.CopyRemoteDir(c.Context, gcs.Bucket(cfg.srcBucket), fmt.Sprintf("artifacts/static-assets/%s/%s", edition, cfg.tag), bucket, fmt.Sprintf("%s/%s", edition, cfg.tag)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user