Compare commits
110 Commits
v11.3.2
...
release-11
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
696f41a7c2 | ||
|
|
c8f8c81e1c | ||
|
|
13945ba51b | ||
|
|
8229a4c073 | ||
|
|
bf3be6309a | ||
|
|
5c316a5113 | ||
|
|
0c2af5a880 | ||
|
|
a3a4c2565a | ||
|
|
2451837fb8 | ||
|
|
27251b44fc | ||
|
|
38ae17fbc3 | ||
|
|
bc6beda11e | ||
|
|
dff8f508d5 | ||
|
|
08f66dd50c | ||
|
|
e9f564277f | ||
|
|
ef65865de0 | ||
|
|
33cf9d6cd4 | ||
|
|
10b95276ae | ||
|
|
54db7b0992 | ||
|
|
30e5410f4e | ||
|
|
96c8b4bcdf | ||
|
|
e1cde0f2d9 | ||
|
|
ced52a53ad | ||
|
|
47c6551b50 | ||
|
|
c74bb4952e | ||
|
|
6f95b96fe3 | ||
|
|
d9bfaa0efe | ||
|
|
d41e17725c | ||
|
|
c7917bf9c8 | ||
|
|
3e2b2f35af | ||
|
|
e215d16299 | ||
|
|
ccb40e3bba | ||
|
|
350d9c71ce | ||
|
|
a7ea2a3b73 | ||
|
|
690a223f6b | ||
|
|
8dd4637706 | ||
|
|
0fc69d16e9 | ||
|
|
f433bc770f | ||
|
|
d4331c9d0b | ||
|
|
074a1cf348 | ||
|
|
9aa8526e7d | ||
|
|
122642a6d7 | ||
|
|
805ab7bd8a | ||
|
|
86bb6dd4b1 | ||
|
|
7b5235f06d | ||
|
|
f83e0a8a39 | ||
|
|
0c7f575149 | ||
|
|
696d22a3fe | ||
|
|
fc1d9c1719 | ||
|
|
de310cb88c | ||
|
|
227c8392e0 | ||
|
|
dc2c257c1a | ||
|
|
97517f41cf | ||
|
|
a13443ad11 | ||
|
|
2d06a936c3 | ||
|
|
860a25f7fd | ||
|
|
ede278c767 | ||
|
|
dab5a49df0 | ||
|
|
49ea20d027 | ||
|
|
ed927a143c | ||
|
|
4e072ffe50 | ||
|
|
07841886b6 | ||
|
|
1547a09645 | ||
|
|
ea930b2a51 | ||
|
|
2c408c8139 | ||
|
|
4a6f5ebe23 | ||
|
|
86c21cee85 | ||
|
|
0573e4d9a9 | ||
|
|
6a08b1cdc2 | ||
|
|
b12cab40d1 | ||
|
|
9b1414e2ef | ||
|
|
96060e359f | ||
|
|
cd060b0791 | ||
|
|
f2c2883a0f | ||
|
|
b7fff35a8a | ||
|
|
122c417f8c | ||
|
|
fb86150321 | ||
|
|
e0dd77c05a | ||
|
|
a69e5fb0a2 | ||
|
|
e1ba2dd355 | ||
|
|
4c288f39ee | ||
|
|
d9045acddb | ||
|
|
c705a3eb36 | ||
|
|
03e84aca2b | ||
|
|
20f9416142 | ||
|
|
7e1f67f9d7 | ||
|
|
66a7e6a60a | ||
|
|
620534891d | ||
|
|
de338282c1 | ||
|
|
72acd7f000 | ||
|
|
0e6b320f4d | ||
|
|
bed84aefdf | ||
|
|
cb0f9b4093 | ||
|
|
9bfc35ec25 | ||
|
|
e076682a17 | ||
|
|
01a0baf5c1 | ||
|
|
8a0b736610 | ||
|
|
006d2b2b72 | ||
|
|
df43a3fff4 | ||
|
|
93c507cc8f | ||
|
|
626c15c1a5 | ||
|
|
ac481509c7 | ||
|
|
e4a7eb6b69 | ||
|
|
c9859478ee | ||
|
|
0b732db623 | ||
|
|
88aa744512 | ||
|
|
443dcc026d | ||
|
|
b58701869e | ||
|
|
b12308499b | ||
|
|
80691e4297 |
@@ -5679,9 +5679,6 @@ exports[`better eslint`] = {
|
||||
"public/app/plugins/datasource/cloudwatch/components/ConfigEditor/XrayLinkConfig.tsx:5381": [
|
||||
[0, 0, 0, "Styles should be written using objects.", "0"]
|
||||
],
|
||||
"public/app/plugins/datasource/cloudwatch/components/QueryEditor/LogsQueryEditor/LogsQueryEditor.tsx:5381": [
|
||||
[0, 0, 0, "Styles should be written using objects.", "0"]
|
||||
],
|
||||
"public/app/plugins/datasource/cloudwatch/components/QueryEditor/MetricsQueryEditor/DynamicLabelsField.tsx:5381": [
|
||||
[0, 0, 0, "Styles should be written using objects.", "0"]
|
||||
],
|
||||
@@ -7392,14 +7389,6 @@ exports[`no gf-form usage`] = {
|
||||
"public/app/plugins/datasource/cloudwatch/components/ConfigEditor/XrayLinkConfig.tsx:5381": [
|
||||
[0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"]
|
||||
],
|
||||
"public/app/plugins/datasource/cloudwatch/components/QueryEditor/LogsQueryEditor/LogsQueryEditor.tsx:5381": [
|
||||
[0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"]
|
||||
],
|
||||
"public/app/plugins/datasource/cloudwatch/components/QueryEditor/LogsQueryEditor/LogsQueryField.tsx:5381": [
|
||||
[0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"],
|
||||
[0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"],
|
||||
[0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"]
|
||||
],
|
||||
"public/app/plugins/datasource/cloudwatch/components/shared/LogGroups/LegacyLogGroupNamesSelection.tsx:5381": [
|
||||
[0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"],
|
||||
[0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"]
|
||||
|
||||
386
.drone.yml
386
.drone.yml
File diff suppressed because it is too large
Load Diff
14
.github/CODEOWNERS
vendored
14
.github/CODEOWNERS
vendored
@@ -695,12 +695,14 @@ embed.go @grafana/grafana-as-code
|
||||
/.github/renovate.json5 @grafana/frontend-ops
|
||||
/.github/teams.yml @armandgrillet
|
||||
/.github/workflows/alerting-swagger-gen.yml @grafana/alerting-backend
|
||||
/.github/workflows/auto-milestone.yml @grafana/grafana-release-guild
|
||||
/.github/workflows/backport.yml @grafana/grafana-release-guild
|
||||
/.github/workflows/bump-version.yml @grafana/grafana-release-guild
|
||||
/.github/workflows/close-milestone.yml @grafana/grafana-release-guild
|
||||
/.github/workflows/release-pr.yml @grafana/grafana-release-guild
|
||||
/.github/workflows/release-comms.yml @grafana/grafana-release-guild
|
||||
/.github/workflows/auto-milestone.yml @grafana/grafana-developer-enablement-squad
|
||||
/.github/workflows/backport.yml @grafana/grafana-developer-enablement-squad
|
||||
/.github/workflows/bump-version.yml @grafana/grafana-developer-enablement-squad
|
||||
/.github/workflows/close-milestone.yml @grafana/grafana-developer-enablement-squad
|
||||
/.github/workflows/release-pr.yml @grafana/grafana-developer-enablement-squad
|
||||
/.github/workflows/release-comms.yml @grafana/grafana-developer-enablement-squad
|
||||
/.github/workflows/migrate-prs.yml @grafana/grafana-developer-enablement-squad
|
||||
/.github/workflows/create-next-release-branch.yml @grafana/grafana-developer-enablement-squad
|
||||
/.github/workflows/codeowners-validator.yml @tolzhabayev
|
||||
/.github/workflows/codeql-analysis.yml @DanCech
|
||||
/.github/workflows/commands.yml @torkelo
|
||||
|
||||
15
.github/workflows/backport.yml
vendored
15
.github/workflows/backport.yml
vendored
@@ -10,24 +10,19 @@ jobs:
|
||||
if: github.repository == 'grafana/grafana'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: "grafana/grafana-github-actions"
|
||||
path: ./actions
|
||||
ref: main
|
||||
- name: Install Actions
|
||||
run: npm install --production --prefix ./actions
|
||||
- name: "Generate token"
|
||||
id: generate_token
|
||||
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
|
||||
with:
|
||||
app_id: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }}
|
||||
private_key: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
|
||||
- run: git config --global user.email '132647405+grafana-delivery-bot[bot]@users.noreply.github.com'
|
||||
- run: git config --global user.name 'grafana-delivery-bot[bot]'
|
||||
- run: git remote set-url origin "https://grafana-delivery-bot:${{ steps.generate_token.outputs.token }}@github.com/grafana/grafana.git"
|
||||
- name: Run backport
|
||||
uses: ./actions/backport
|
||||
uses: grafana/grafana-github-actions-go/backport@main
|
||||
with:
|
||||
metricsWriteAPIKey: ${{secrets.GRAFANA_MISC_STATS_API_KEY}}
|
||||
token: ${{ steps.generate_token.outputs.token }}
|
||||
labelsToAdd: "backport"
|
||||
title: "[{{base}}] {{originalTitle}}"
|
||||
|
||||
53
.github/workflows/create-next-release-branch.yml
vendored
Normal file
53
.github/workflows/create-next-release-branch.yml
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
name: Create next release branch
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
ownerRepo:
|
||||
type: string
|
||||
description: Owner/repo of the repository where the branch is created (e.g. 'grafana/grafana')
|
||||
required: true
|
||||
source:
|
||||
description: The release branch to increment (eg providing `release-11.2.3` will result in `release-11.2.4` being created)
|
||||
type: string
|
||||
required: true
|
||||
secrets:
|
||||
GRAFANA_DELIVERY_BOT_APP_ID:
|
||||
required: true
|
||||
GRAFANA_DELIVERY_BOT_APP_PEM:
|
||||
required: true
|
||||
outputs:
|
||||
branch:
|
||||
description: The new branch that was created
|
||||
value: ${{ jobs.main.outputs.branch }}
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
ownerRepo:
|
||||
description: Owner/repo of the repository where the branch is created (e.g. 'grafana/grafana')
|
||||
source:
|
||||
description: The release branch to increment (eg providing `release-11.2.3` will result in `release-11.2.4` being created)
|
||||
type: string
|
||||
required: true
|
||||
secrets:
|
||||
GRAFANA_DELIVERY_BOT_APP_ID:
|
||||
required: true
|
||||
GRAFANA_DELIVERY_BOT_APP_PEM:
|
||||
required: true
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
branch: ${{ steps.branch.outputs.branch }}
|
||||
steps:
|
||||
- name: "Generate token"
|
||||
id: generate_token
|
||||
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
|
||||
with:
|
||||
app_id: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }}
|
||||
private_key: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
|
||||
- name: Create release branch
|
||||
id: branch
|
||||
uses: grafana/grafana-github-actions-go/bump-release@main
|
||||
with:
|
||||
ownerRepo: ${{ inputs.ownerRepo }}
|
||||
source: ${{ inputs.source }}
|
||||
token: ${{ steps.generate_token.outputs.token }}
|
||||
@@ -11,6 +11,7 @@ on:
|
||||
branches:
|
||||
- "main"
|
||||
- "v*.*.*"
|
||||
- "release-*.*.*"
|
||||
|
||||
# This is run before the pull request has been merged, so we'll run against the src branch
|
||||
jobs:
|
||||
|
||||
3
.github/workflows/github-release.yml
vendored
3
.github/workflows/github-release.yml
vendored
@@ -8,7 +8,7 @@ on:
|
||||
type: string
|
||||
latest:
|
||||
required: false
|
||||
default: false
|
||||
default: "0"
|
||||
description: Mark this release as latest (`1`) or not (`0`, default)
|
||||
type: string
|
||||
dry_run:
|
||||
@@ -23,6 +23,7 @@ on:
|
||||
type: string
|
||||
latest:
|
||||
required: false
|
||||
default: "0"
|
||||
description: Mark this release as latest (`1`) or not (`0`, default)
|
||||
type: string
|
||||
dry_run:
|
||||
|
||||
60
.github/workflows/migrate-prs.yml
vendored
Normal file
60
.github/workflows/migrate-prs.yml
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
name: Migrate open PRs
|
||||
# Migrate open PRs from a superseded release branch to the current release branch and notify authors
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
from:
|
||||
description: 'The base branch to check for open PRs'
|
||||
required: true
|
||||
type: string
|
||||
to:
|
||||
description: 'The base branch to migrate open PRs to'
|
||||
required: true
|
||||
type: string
|
||||
ownerRepo:
|
||||
description: Owner/repo of the repository where the branch is created (e.g. 'grafana/grafana')
|
||||
required: true
|
||||
type: string
|
||||
secrets:
|
||||
GRAFANA_DELIVERY_BOT_APP_ID:
|
||||
required: true
|
||||
GRAFANA_DELIVERY_BOT_APP_PEM:
|
||||
required: true
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
from:
|
||||
description: 'The base branch to check for open PRs'
|
||||
required: true
|
||||
type: string
|
||||
to:
|
||||
description: 'The base branch to migrate open PRs to'
|
||||
required: true
|
||||
type: string
|
||||
ownerRepo:
|
||||
description: Owner/repo of the repository where the branch is created (e.g. 'grafana/grafana')
|
||||
required: true
|
||||
type: string
|
||||
secrets:
|
||||
GRAFANA_DELIVERY_BOT_APP_ID:
|
||||
required: true
|
||||
GRAFANA_DELIVERY_BOT_APP_PEM:
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Generate token"
|
||||
id: generate_token
|
||||
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
|
||||
with:
|
||||
app_id: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }}
|
||||
private_key: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
|
||||
- name: Migrate PRs
|
||||
uses: grafana/grafana-github-actions-go/migrate-open-prs@main
|
||||
with:
|
||||
token: ${{ steps.generate_token.outputs.token }}
|
||||
ownerRepo: ${{ inputs.ownerRepo }}
|
||||
from: ${{ inputs.from }}
|
||||
to: ${{ inputs.to }}
|
||||
binary_release_tag: 'dev'
|
||||
@@ -3,7 +3,7 @@ name: publish-technical-documentation-release
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- v[0-9]+.[0-9]+.x
|
||||
- release-[0-9]+.[0-9]+.[0-9]+
|
||||
tags:
|
||||
- v[0-9]+.[0-9]+.[0-9]+
|
||||
paths:
|
||||
@@ -20,10 +20,10 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: grafana/writers-toolkit/publish-technical-documentation-release@publish-technical-documentation-release/v1
|
||||
- uses: grafana/writers-toolkit/publish-technical-documentation-release@publish-technical-documentation-release/v2
|
||||
with:
|
||||
release_tag_regexp: "^v(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
|
||||
release_branch_regexp: "^v(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.x$"
|
||||
release_branch_with_patch_regexp: "^v(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
|
||||
release_tag_regexp: "^v(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
|
||||
release_branch_regexp: "^release-(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
|
||||
release_branch_with_patch_regexp: "^release-(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
|
||||
website_directory: content/docs/grafana
|
||||
version_suffix: ""
|
||||
|
||||
56
.github/workflows/release-comms.yml
vendored
56
.github/workflows/release-comms.yml
vendored
@@ -8,17 +8,18 @@ on:
|
||||
dry_run:
|
||||
required: false
|
||||
default: true
|
||||
type: boolean
|
||||
version:
|
||||
required: true
|
||||
latest:
|
||||
type: bool
|
||||
type: boolean
|
||||
default: false
|
||||
pull_request:
|
||||
types:
|
||||
- closed
|
||||
branches:
|
||||
- 'main'
|
||||
- 'v*.*.*'
|
||||
- 'release-*.*.*'
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
@@ -26,30 +27,77 @@ jobs:
|
||||
name: Setup and establish latest
|
||||
outputs:
|
||||
version: ${{ steps.output.outputs.version }}
|
||||
release_branch: ${{ steps.output.outputs.release_branch }}
|
||||
dry_run: ${{ steps.output.outputs.dry_run }}
|
||||
latest: ${{ steps.output.outputs.latest }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# The github-release action expects a `LATEST` value of a string of either '1' or '0'
|
||||
- if: ${{ github.event_name == 'workflow_dispatch' }}
|
||||
run: |
|
||||
echo setting up GITHUB_ENV for ${{ github.event_name }}
|
||||
echo "VERSION=${{ inputs.version }}" >> $GITHUB_ENV
|
||||
echo "DRY_RUN=${{ inputs.dry_run }}" >> $GITHUB_ENV
|
||||
echo "LATEST=${{ inputs.latest }}" >> $GITHUB_ENV
|
||||
echo "LATEST=${{ inputs.latest && '1' || '0' }}" >> $GITHUB_ENV
|
||||
- if: ${{ github.event.pull_request.merged == true && startsWith(github.head_ref, 'release/') }}
|
||||
run: |
|
||||
echo "VERSION=$(echo ${{ github.head_ref }} | sed -e 's/release\/.*\///g')" >> $GITHUB_ENV
|
||||
echo "DRY_RUN=${{ contains(github.event.pull_request.labels.*.name, 'release/dry-run') }}" >> $GITHUB_ENV
|
||||
echo "LATEST=${{ contains(github.event.pull_request.labels.*.name, 'release/latest') }}" >> $GITHUB_ENV
|
||||
echo "LATEST=${{ contains(github.event.pull_request.labels.*.name, 'release/latest') && '1' || '0' }}" >> $GITHUB_ENV
|
||||
- id: output
|
||||
run: |
|
||||
echo "dry_run: $DRY_RUN"
|
||||
echo "latest: $LATEST"
|
||||
echo "version: $VERSION"
|
||||
|
||||
echo "release_branch=$(echo $VERSION | sed -s 's/^v/release-/g')" >> "$GITHUB_OUTPUT"
|
||||
echo "dry_run=$DRY_RUN" >> "$GITHUB_OUTPUT"
|
||||
echo "latest=$LATEST" >> "$GITHUB_OUTPUT"
|
||||
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
||||
create_next_release_branch_grafana:
|
||||
name: Create next release branch (Grafana)
|
||||
needs: setup
|
||||
uses: ./.github/workflows/create-next-release-branch.yml
|
||||
secrets:
|
||||
GRAFANA_DELIVERY_BOT_APP_ID: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }}
|
||||
GRAFANA_DELIVERY_BOT_APP_PEM: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
|
||||
with:
|
||||
ownerRepo: 'grafana/grafana'
|
||||
source: ${{ needs.setup.outputs.release_branch }}
|
||||
create_next_release_branch_enterprise:
|
||||
name: Create next release branch (Grafana Enterprise)
|
||||
needs: setup
|
||||
uses: ./.github/workflows/create-next-release-branch.yml
|
||||
secrets:
|
||||
GRAFANA_DELIVERY_BOT_APP_ID: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }}
|
||||
GRAFANA_DELIVERY_BOT_APP_PEM: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
|
||||
with:
|
||||
ownerRepo: 'grafana/grafana-enterprise'
|
||||
source: ${{ needs.setup.outputs.release_branch }}
|
||||
migrate_prs_grafana:
|
||||
needs:
|
||||
- setup
|
||||
- create_next_release_branch_grafana
|
||||
uses: ./.github/workflows/migrate-prs.yml
|
||||
secrets:
|
||||
GRAFANA_DELIVERY_BOT_APP_ID: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }}
|
||||
GRAFANA_DELIVERY_BOT_APP_PEM: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
|
||||
with:
|
||||
ownerRepo: 'grafana/grafana'
|
||||
from: ${{ needs.setup.outputs.release_branch }}
|
||||
to: ${{ needs.create_next_release_branch_grafana.outputs.branch }}
|
||||
migrate_prs_enterprise:
|
||||
needs:
|
||||
- setup
|
||||
- create_next_release_branch_enterprise
|
||||
uses: ./.github/workflows/migrate-prs.yml
|
||||
secrets:
|
||||
GRAFANA_DELIVERY_BOT_APP_ID: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }}
|
||||
GRAFANA_DELIVERY_BOT_APP_PEM: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
|
||||
with:
|
||||
ownerRepo: 'grafana/grafana-enterprise'
|
||||
from: ${{ needs.setup.outputs.release_branch }}
|
||||
to: ${{ needs.create_next_release_branch_enterprise.outputs.branch }}
|
||||
post_changelog_on_forum:
|
||||
needs: setup
|
||||
uses: ./.github/workflows/community-release.yml
|
||||
|
||||
18
.github/workflows/release-pr.yml
vendored
18
.github/workflows/release-pr.yml
vendored
@@ -4,7 +4,7 @@
|
||||
# Please refrain from including any processes that do not result in code changes in this workflow. Instead, they should
|
||||
# either be triggered in the release promotion process or in the release comms process (that is triggered by merging
|
||||
# this PR).
|
||||
name: Complete a Grafana release
|
||||
name: Grafana Release PR
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
@@ -19,7 +19,7 @@ on:
|
||||
target:
|
||||
required: true
|
||||
type: string
|
||||
description: The base branch that these changes are being merged into
|
||||
description: The release branch pattern (eg v9.5.x) that these changes are being merged into
|
||||
backport:
|
||||
required: false
|
||||
type: string
|
||||
@@ -61,10 +61,17 @@ jobs:
|
||||
with:
|
||||
app_id: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }}
|
||||
private_key: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
|
||||
- name: Get release branch
|
||||
id: branch
|
||||
uses: grafana/grafana-github-actions-go/latest-release-branch@main
|
||||
with:
|
||||
token: ${{ steps.generate_token.outputs.token }}
|
||||
ownerRepo: 'grafana/grafana'
|
||||
pattern: ${{ inputs.target }}
|
||||
- name: Checkout Grafana
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ inputs.target }}
|
||||
ref: ${{ steps.branch.outputs.branch }}
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
- name: Checkout Grafana (main)
|
||||
@@ -124,7 +131,6 @@ jobs:
|
||||
rm -f CHANGELOG.part changelog_items.md
|
||||
|
||||
git diff CHANGELOG.md
|
||||
|
||||
- name: "Prettify CHANGELOG.md"
|
||||
run: npx prettier --write CHANGELOG.md
|
||||
- name: Commit CHANGELOG.md changes
|
||||
@@ -151,7 +157,7 @@ jobs:
|
||||
$( [ "x${{ inputs.latest }}" == "xtrue" ] && printf %s '-l "release/latest"') \
|
||||
-l "no-changelog" \
|
||||
--dry-run=${{ inputs.dry_run }} \
|
||||
-B "${{ inputs.target }}" \
|
||||
-B "${{ steps.branch.outputs.branch }}" \
|
||||
--title "Release: ${{ inputs.version }}" \
|
||||
--body "These code changes must be merged after a release is complete"
|
||||
env:
|
||||
@@ -165,7 +171,7 @@ jobs:
|
||||
-l "product-approved" \
|
||||
-l "no-changelog" \
|
||||
--dry-run=${{ inputs.dry_run }} \
|
||||
-B "${{ inputs.target }}" \
|
||||
-B "${{ steps.branch.outputs.branch }}" \
|
||||
--title "Release: ${{ inputs.version }}" \
|
||||
--body "These code changes must be merged after a release is complete"
|
||||
env:
|
||||
|
||||
57
CHANGELOG.md
57
CHANGELOG.md
@@ -1,3 +1,60 @@
|
||||
<!-- 11.4.2 START -->
|
||||
|
||||
# 11.4.2 (2025-02-18)
|
||||
|
||||
### Features and enhancements
|
||||
|
||||
- **Docker:** Use our own glibc 2.40 binaries [#99924](https://github.com/grafana/grafana/pull/99924), [@DanCech](https://github.com/DanCech)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- **Auth:** Fix redirect with JWT auth URL login [#100494](https://github.com/grafana/grafana/pull/100494), [@mgyongyosi](https://github.com/mgyongyosi)
|
||||
- **AuthN:** Refetch user on "ErrUserAlreadyExists" [#100585](https://github.com/grafana/grafana/pull/100585), [@kalleep](https://github.com/kalleep)
|
||||
- **Azure:** Correctly set application insights resource values [#99598](https://github.com/grafana/grafana/pull/99598), [@aangelisc](https://github.com/aangelisc)
|
||||
- **Dashboards:** Bring back scripted dashboards [#100629](https://github.com/grafana/grafana/pull/100629), [@dprokop](https://github.com/dprokop)
|
||||
- **Plugin Metrics:** Eliminate data race in plugin metrics middleware [#100077](https://github.com/grafana/grafana/pull/100077), [@clord](https://github.com/clord)
|
||||
- **RBAC:** Don't check folder access if `annotationPermissionUpdate` FT is enabled [#100116](https://github.com/grafana/grafana/pull/100116), [@IevaVasiljeva](https://github.com/IevaVasiljeva)
|
||||
|
||||
<!-- 11.4.2 END -->
|
||||
<!-- 11.4.1 START -->
|
||||
|
||||
# 11.4.1 (2025-01-28)
|
||||
|
||||
### Features and enhancements
|
||||
|
||||
- **Security:** Update to Go 1.23.5 - Backport to v11.4.x [#99123](https://github.com/grafana/grafana/pull/99123), [@Proximyst](https://github.com/Proximyst)
|
||||
- **Security:** Update to Go 1.23.5 - Backport to v11.4.x (Enterprise)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- **Alerting:** AlertingQueryRunner should skip descendant nodes of invalid queries [#97830](https://github.com/grafana/grafana/pull/97830), [@gillesdemey](https://github.com/gillesdemey)
|
||||
- **Alerting:** Fix alert rules unpausing after moving rule to different folder [#97583](https://github.com/grafana/grafana/pull/97583), [@santihernandezc](https://github.com/santihernandezc)
|
||||
- **Alerting:** Fix label escaping in rule export [#98649](https://github.com/grafana/grafana/pull/98649), [@moustafab](https://github.com/moustafab)
|
||||
- **Alerting:** Fix slack image uploading to use new api [#98066](https://github.com/grafana/grafana/pull/98066), [@moustafab](https://github.com/moustafab)
|
||||
- **Azure/GCM:** Improve error display [#97594](https://github.com/grafana/grafana/pull/97594), [@aangelisc](https://github.com/aangelisc)
|
||||
- **Dashboards:** Fix issue where filtered panels would not react to variable changes [#98734](https://github.com/grafana/grafana/pull/98734), [@oscarkilhed](https://github.com/oscarkilhed)
|
||||
- **Dashboards:** Fixes issue with panel header showing even when hide time override was enabled [#98747](https://github.com/grafana/grafana/pull/98747), [@torkelo](https://github.com/torkelo)
|
||||
- **Dashboards:** Fixes week relative time ranges when weekStart was changed [#98269](https://github.com/grafana/grafana/pull/98269), [@torkelo](https://github.com/torkelo)
|
||||
- **Dashboards:** Panel react for `timeFrom` and `timeShift` changes using variables [#98659](https://github.com/grafana/grafana/pull/98659), [@Sergej-Vlasov](https://github.com/Sergej-Vlasov)
|
||||
- **DateTimePicker:** Fixes issue with date picker showing invalid date [#97971](https://github.com/grafana/grafana/pull/97971), [@torkelo](https://github.com/torkelo)
|
||||
- **Fix:** Add support for datasource variable queries [#98119](https://github.com/grafana/grafana/pull/98119), [@sunker](https://github.com/sunker)
|
||||
- **InfluxDB:** Adhoc filters can use template vars as values [#98786](https://github.com/grafana/grafana/pull/98786), [@bossinc](https://github.com/bossinc)
|
||||
- **LibraryPanel:** Fallback to panel title if library panel title is not set [#99410](https://github.com/grafana/grafana/pull/99410), [@ivanortegaalba](https://github.com/ivanortegaalba)
|
||||
|
||||
### Plugin development fixes & changes
|
||||
|
||||
- **Grafana UI:** Re-add react-router-dom as a dependency [#98422](https://github.com/grafana/grafana/pull/98422), [@leventebalogh](https://github.com/leventebalogh)
|
||||
|
||||
<!-- 11.4.1 END -->
|
||||
<!-- 11.4.0 START -->
|
||||
|
||||
# 11.4.0 (2024-12-05)
|
||||
|
||||
### Features and enhancements
|
||||
|
||||
- **Cloudwatch:** OpenSearch PPL and SQL support in Logs Insights
|
||||
|
||||
<!-- 11.4.0 END -->
|
||||
<!-- 11.3.1 START -->
|
||||
|
||||
# 11.3.1 (2024-11-19)
|
||||
|
||||
44
Dockerfile
44
Dockerfile
@@ -1,14 +1,19 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
# to maintain formatting of multiline commands in vscode, add the following to settings.json:
|
||||
# "docker.languageserver.formatter.ignoreMultilineInstructions": true
|
||||
|
||||
ARG BASE_IMAGE=alpine:3.19.1
|
||||
ARG JS_IMAGE=node:20-alpine
|
||||
ARG JS_PLATFORM=linux/amd64
|
||||
ARG GO_IMAGE=golang:1.23.1-alpine
|
||||
ARG GO_IMAGE=golang:1.23.5-alpine
|
||||
|
||||
# Default to building locally
|
||||
ARG GO_SRC=go-builder
|
||||
ARG JS_SRC=js-builder
|
||||
|
||||
FROM --platform=${JS_PLATFORM} ${JS_IMAGE} as js-builder
|
||||
# Javascript build stage
|
||||
FROM --platform=${JS_PLATFORM} ${JS_IMAGE} AS js-builder
|
||||
|
||||
ENV NODE_OPTIONS=--max_old_space_size=8000
|
||||
|
||||
@@ -33,7 +38,8 @@ COPY emails emails
|
||||
ENV NODE_ENV production
|
||||
RUN yarn build
|
||||
|
||||
FROM ${GO_IMAGE} as go-builder
|
||||
# Golang build stage
|
||||
FROM ${GO_IMAGE} AS go-builder
|
||||
|
||||
ARG COMMIT_SHA=""
|
||||
ARG BUILD_BRANCH=""
|
||||
@@ -91,7 +97,8 @@ ENV BUILD_BRANCH=${BUILD_BRANCH}
|
||||
|
||||
RUN make build-go GO_BUILD_TAGS=${GO_BUILD_TAGS} WIRE_TAGS=${WIRE_TAGS}
|
||||
|
||||
FROM ${BASE_IMAGE} as tgz-builder
|
||||
# From-tarball build stage
|
||||
FROM ${BASE_IMAGE} AS tgz-builder
|
||||
|
||||
WORKDIR /tmp/grafana
|
||||
|
||||
@@ -103,8 +110,8 @@ COPY ${GRAFANA_TGZ} /tmp/grafana.tar.gz
|
||||
RUN tar x -z -f /tmp/grafana.tar.gz --strip-components=1
|
||||
|
||||
# helpers for COPY --from
|
||||
FROM ${GO_SRC} as go-src
|
||||
FROM ${JS_SRC} as js-src
|
||||
FROM ${GO_SRC} AS go-src
|
||||
FROM ${JS_SRC} AS js-src
|
||||
|
||||
# Final stage
|
||||
FROM ${BASE_IMAGE}
|
||||
@@ -139,19 +146,20 @@ RUN if grep -i -q alpine /etc/issue; then \
|
||||
fi
|
||||
|
||||
# glibc support for alpine x86_64 only
|
||||
# docker run --rm --env STDOUT=1 sgerrand/glibc-builder 2.40 /usr/glibc-compat > glibc-bin-2.40.tar.gz
|
||||
ARG GLIBC_VERSION=2.40
|
||||
|
||||
RUN if grep -i -q alpine /etc/issue && [ `arch` = "x86_64" ]; then \
|
||||
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
|
||||
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-2.35-r0.apk \
|
||||
-O /tmp/glibc-2.35-r0.apk && \
|
||||
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-bin-2.35-r0.apk \
|
||||
-O /tmp/glibc-bin-2.35-r0.apk && \
|
||||
apk add --force-overwrite --no-cache /tmp/glibc-2.35-r0.apk /tmp/glibc-bin-2.35-r0.apk && \
|
||||
rm -f /lib64/ld-linux-x86-64.so.2 && \
|
||||
ln -s /usr/glibc-compat/lib64/ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2 && \
|
||||
rm -f /tmp/glibc-2.35-r0.apk && \
|
||||
rm -f /tmp/glibc-bin-2.35-r0.apk && \
|
||||
rm -f /lib/ld-linux-x86-64.so.2 && \
|
||||
rm -f /etc/ld.so.cache; \
|
||||
wget -qO- "https://dl.grafana.com/glibc/glibc-bin-$GLIBC_VERSION.tar.gz" | tar zxf - -C / \
|
||||
usr/glibc-compat/lib/ld-linux-x86-64.so.2 \
|
||||
usr/glibc-compat/lib/libc.so.6 \
|
||||
usr/glibc-compat/lib/libdl.so.2 \
|
||||
usr/glibc-compat/lib/libm.so.6 \
|
||||
usr/glibc-compat/lib/libpthread.so.0 \
|
||||
usr/glibc-compat/lib/librt.so.1 \
|
||||
usr/glibc-compat/lib/libresolv.so.2 && \
|
||||
mkdir /lib64 && \
|
||||
ln -s /usr/glibc-compat/lib/ld-linux-x86-64.so.2 /lib64; \
|
||||
fi
|
||||
|
||||
COPY --from=go-src /tmp/grafana/conf ./conf
|
||||
|
||||
2
Makefile
2
Makefile
@@ -8,7 +8,7 @@ WIRE_TAGS = "oss"
|
||||
include .bingo/Variables.mk
|
||||
|
||||
GO = go
|
||||
GO_VERSION = 1.23.1
|
||||
GO_VERSION = 1.23.5
|
||||
GO_LINT_FILES ?= $(shell ./scripts/go-workspace/golangci-lint-includes.sh)
|
||||
GO_TEST_FILES ?= $(shell ./scripts/go-workspace/test-includes.sh)
|
||||
SH_FILES ?= $(shell find ./scripts -name *.sh)
|
||||
|
||||
@@ -26,7 +26,7 @@ require (
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/x448/float16 v0.8.4 // indirect
|
||||
golang.org/x/net v0.29.0 // indirect
|
||||
golang.org/x/text v0.18.0 // indirect
|
||||
golang.org/x/text v0.21.0 // indirect
|
||||
google.golang.org/protobuf v1.34.2 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
|
||||
@@ -79,8 +79,8 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
|
||||
golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
|
||||
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
|
||||
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
|
||||
@@ -15,6 +15,6 @@ require (
|
||||
github.com/prometheus/client_model v0.6.1 // indirect
|
||||
github.com/prometheus/common v0.55.0 // indirect
|
||||
github.com/prometheus/procfs v0.15.1 // indirect
|
||||
golang.org/x/sys v0.22.0 // indirect
|
||||
golang.org/x/sys v0.28.0 // indirect
|
||||
google.golang.org/protobuf v1.34.2 // indirect
|
||||
)
|
||||
|
||||
@@ -20,7 +20,7 @@ github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0leargg
|
||||
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
|
||||
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA=
|
||||
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ=
|
||||
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
|
||||
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
|
||||
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
|
||||
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
aks
|
||||
eror
|
||||
iam
|
||||
wan
|
||||
[Operato Windrose](https://grafana.com/grafana/plugins/operato-windrose-panel/)
|
||||
sergent
|
||||
@@ -1,4 +1,6 @@
|
||||
#!/bin/sh
|
||||
# shellcheck disable=SC2034
|
||||
#
|
||||
# The source of this file is https://raw.githubusercontent.com/grafana/writers-toolkit/main/docs/make-docs.
|
||||
# # `make-docs` procedure changelog
|
||||
#
|
||||
@@ -6,6 +8,26 @@
|
||||
# [Semantic versioning](https://semver.org/) is used to help the reader identify the significance of changes.
|
||||
# Changes are relevant to this script and the support docs.mk GNU Make interface.
|
||||
#
|
||||
# ## 8.4.0 (2025-01-27)
|
||||
#
|
||||
# ### Fixed
|
||||
#
|
||||
# - Correct mount for the /docs/grafana-cloud/send-data/fleet-management/ project.
|
||||
#
|
||||
# ## 8.3.0 (2024-12-27)
|
||||
#
|
||||
# ### Added
|
||||
#
|
||||
# - Debug output of the final command when DEBUG=true.
|
||||
#
|
||||
# Useful to inspect if the script is correctly constructing the final command.
|
||||
#
|
||||
# ## 8.2.0 (2024-12-22)
|
||||
#
|
||||
# ### Removed
|
||||
#
|
||||
# - Special cases for Oracle and Datadog plugins now that they exist in the plugins monorepo.
|
||||
#
|
||||
# ## 8.1.0 (2024-08-22)
|
||||
#
|
||||
# ### Added
|
||||
@@ -13,7 +35,7 @@
|
||||
# - Additional website mounts for projects that use the website repository.
|
||||
#
|
||||
# Mounts are required for `make docs` to work in the website repository or with the website project.
|
||||
# The Makefile is also mounted for convenient development of the procedure that repository.
|
||||
# The Makefile is also mounted for convenient development of the procedure in that repository.
|
||||
#
|
||||
# ## 8.0.1 (2024-07-01)
|
||||
#
|
||||
@@ -290,6 +312,7 @@ PODMAN="$(if command -v podman >/dev/null 2>&1; then echo podman; else echo dock
|
||||
|
||||
if ! command -v curl >/dev/null 2>&1; then
|
||||
if ! command -v wget >/dev/null 2>&1; then
|
||||
# shellcheck disable=SC2016
|
||||
errr 'either `curl` or `wget` must be installed for this script to work.'
|
||||
|
||||
exit 1
|
||||
@@ -297,6 +320,7 @@ if ! command -v curl >/dev/null 2>&1; then
|
||||
fi
|
||||
|
||||
if ! command -v "${PODMAN}" >/dev/null 2>&1; then
|
||||
# shellcheck disable=SC2016
|
||||
errr 'either `podman` or `docker` must be installed for this script to work.'
|
||||
|
||||
exit 1
|
||||
@@ -343,6 +367,10 @@ EOF
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# The following variables comprise a pseudo associative array of project names to source repositories.
|
||||
# You only need to set a SOURCES variable if the project name does not match the source repository name.
|
||||
# You can get a key identifier using the `identifier` function.
|
||||
# To look up the value of any pseudo associative array, use the `aget` function.
|
||||
SOURCES_as_code='as-code-docs'
|
||||
SOURCES_enterprise_metrics='backend-enterprise'
|
||||
SOURCES_enterprise_metrics_='backend-enterprise'
|
||||
@@ -352,13 +380,16 @@ SOURCES_grafana_cloud_alerting_and_irm_slo='slo'
|
||||
SOURCES_grafana_cloud_k6='k6-docs'
|
||||
SOURCES_grafana_cloud_data_configuration_integrations='cloud-onboarding'
|
||||
SOURCES_grafana_cloud_frontend_observability_faro_web_sdk='faro-web-sdk'
|
||||
SOURCES_grafana_cloud_send_data_fleet_management='fleet-management'
|
||||
SOURCES_helm_charts_mimir_distributed='mimir'
|
||||
SOURCES_helm_charts_tempo_distributed='tempo'
|
||||
SOURCES_opentelemetry='opentelemetry-docs'
|
||||
SOURCES_plugins_grafana_datadog_datasource='datadog-datasource'
|
||||
SOURCES_plugins_grafana_oracle_datasource='oracle-datasource'
|
||||
SOURCES_resources='website'
|
||||
|
||||
# The following variables comprise a pseudo associative array of project names to versions.
|
||||
# You only need to set a VERSIONS variable if it is not the default of 'latest'.
|
||||
# You can get a key identifier using the `identifier` function.
|
||||
# To look up the value of any pseudo associative array, use the `aget` function.
|
||||
VERSIONS_as_code='UNVERSIONED'
|
||||
VERSIONS_grafana_cloud='UNVERSIONED'
|
||||
VERSIONS_grafana_cloud_alerting_and_irm_machine_learning='UNVERSIONED'
|
||||
@@ -366,20 +397,21 @@ VERSIONS_grafana_cloud_alerting_and_irm_slo='UNVERSIONED'
|
||||
VERSIONS_grafana_cloud_k6='UNVERSIONED'
|
||||
VERSIONS_grafana_cloud_data_configuration_integrations='UNVERSIONED'
|
||||
VERSIONS_grafana_cloud_frontend_observability_faro_web_sdk='UNVERSIONED'
|
||||
VERSIONS_grafana_cloud_send_data_fleet_management='UNVERSIONED'
|
||||
VERSIONS_opentelemetry='UNVERSIONED'
|
||||
VERSIONS_plugins_grafana_datadog_datasource='latest'
|
||||
VERSIONS_plugins_grafana_oracle_datasource='latest'
|
||||
VERSIONS_resources='UNVERSIONED'
|
||||
VERSIONS_technical_documentation='UNVERSIONED'
|
||||
VERSIONS_website='UNVERSIONED'
|
||||
VERSIONS_writers_toolkit='UNVERSIONED'
|
||||
|
||||
# The following variables comprise a pseudo associative array of project names to source repository paths.
|
||||
# You only need to set a PATHS variable if it is not the default of 'docs/sources'.
|
||||
# You can get a key identifier using the `identifier` function.
|
||||
# To look up the value of any pseudo associative array, use the `aget` function.
|
||||
PATHS_grafana_cloud='content/docs/grafana-cloud'
|
||||
PATHS_helm_charts_mimir_distributed='docs/sources/helm-charts/mimir-distributed'
|
||||
PATHS_helm_charts_tempo_distributed='docs/sources/helm-charts/tempo-distributed'
|
||||
PATHS_mimir='docs/sources/mimir'
|
||||
PATHS_plugins_grafana_datadog_datasource='docs/sources'
|
||||
PATHS_plugins_grafana_oracle_datasource='docs/sources'
|
||||
PATHS_resources='content'
|
||||
PATHS_tempo='docs/sources/tempo'
|
||||
PATHS_website='content'
|
||||
@@ -631,7 +663,7 @@ POSIX_HERESTRING
|
||||
|
||||
case "${_project}" in
|
||||
# Workaround for arbitrary mounts where the version field is expected to be the local directory
|
||||
# and the repo field is expected to be the container directory.
|
||||
# and the repo field is expected to be the container directory.
|
||||
arbitrary)
|
||||
echo "${_project}^${_version}^${_repo}^" # TODO
|
||||
;;
|
||||
@@ -801,10 +833,16 @@ case "${image}" in
|
||||
| sed "s#$(proj_dst "${proj}")#sources#"
|
||||
EOF
|
||||
|
||||
if [ -n "${DEBUG}" ]; then
|
||||
debg "${cmd}"
|
||||
fi
|
||||
|
||||
case "${OUTPUT_FORMAT}" in
|
||||
human)
|
||||
if ! command -v jq >/dev/null 2>&1; then
|
||||
# shellcheck disable=SC2016
|
||||
errr '`jq` must be installed for the `doc-validator` target to work.'
|
||||
# shellcheck disable=SC2016
|
||||
note 'To install `jq`, refer to https://jqlang.github.io/jq/download/,'
|
||||
|
||||
exit 1
|
||||
@@ -837,6 +875,10 @@ EOF
|
||||
/hugo/content/docs
|
||||
EOF
|
||||
|
||||
if [ -n "${DEBUG}" ]; then
|
||||
debg "${cmd}"
|
||||
fi
|
||||
|
||||
case "${OUTPUT_FORMAT}" in
|
||||
human)
|
||||
${cmd} --output=line \
|
||||
|
||||
@@ -256,14 +256,24 @@ The system creates a session when a user signs in to Grafana from a new device,
|
||||
|
||||
When a user reaches the session limit, the fourth connection succeeds and the longest inactive session is signed out.
|
||||
|
||||
### Request usage billing
|
||||
|
||||
You can request Grafana Labs to activate usage billing which allows an unlimited number of active users. When usage billing is enabled, Grafana does not enforce active user limits or display warning banners. Instead, you are charged for active users that exceed the limit, according to your customer contract.
|
||||
|
||||
Usage billing involves a contractual agreement between you and Grafana Labs, and it is only available if Grafana Enterprise is configured to [automatically refresh its license token]({{< relref "../../setup-grafana/configure-grafana/enterprise-configuration/#auto_refresh_license" >}}).
|
||||
|
||||
### Request a change to your license
|
||||
|
||||
To increase the number of licensed users within Grafana, extend a license, or change your licensed URL, contact [Grafana support](/profile/org#support) or your Grafana Labs account team. They will update your license, which you can activate from within Grafana.
|
||||
|
||||
For instructions about how to activate your license after it is updated, refer to [Activate an Enterprise license]({{< relref "#activate-an-enterprise-license" >}}).
|
||||
|
||||
## Usage billing
|
||||
|
||||
Standard Grafana Enterprise licenses include a certain number of seats that can be used, and prevent more users logging into Grafana than have been licensed. This makes sense if you prefer a predictable bill. It can however be a problem if you anticipate uneven usage patterns over time or when it's critical that no user ever be prevented from logging into Grafana due to capacity constraints.
|
||||
|
||||
For those use-cases we support usage-based billing, where your license includes a certain number of included users and you are billed on a monthly basis for any excess active users during the month.
|
||||
|
||||
Usage billing involves a contractual agreement between you and Grafana Labs and an update to your license, and it is only available if Grafana Enterprise version 10.0.0 or higher is configured to [automatically refresh its license token]({{< relref "../../setup-grafana/configure-grafana/enterprise-configuration/#auto_refresh_license" >}}).
|
||||
|
||||
### User deduplication
|
||||
|
||||
If your organization has multiple Grafana Enterprise instances with usage billing enabled, then each active user counts only once toward your license, regardless of how many instances that user signs into. Each Grafana Enterprise instance submits a hashed list of users to Grafana Labs via API every day. Each user email address or anonymous device ID is hashed using a one-way sha256 algorithm, and submitted to Grafana where the hashed users are deduplicated across instances.
|
||||
|
||||
### Request usage billing
|
||||
|
||||
To request usage billing, contact your Grafana Labs account team or [submit a support ticket](https://grafana.com/profile/org#support).
|
||||
|
||||
@@ -36,7 +36,7 @@ cards:
|
||||
description: Choose how, when, and where to send your alert notifications.
|
||||
height: 24
|
||||
- title: Monitor status
|
||||
href: ./manage-notifications/
|
||||
href: ./monitor-status/
|
||||
description: Monitor, respond to, and triage issues within your services.
|
||||
height: 24
|
||||
- title: Additional configuration
|
||||
|
||||
@@ -12,37 +12,59 @@ labels:
|
||||
- oss
|
||||
title: Configure alert rules
|
||||
weight: 120
|
||||
refs:
|
||||
alert-rules:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/
|
||||
configure-grafana-alerts:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/create-grafana-managed-rule/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/create-grafana-managed-rule/
|
||||
configure-ds-alerts:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/create-data-source-managed-rule/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/create-data-source-managed-rule/
|
||||
recording-rules:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/create-recording-rules/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/create-recording-rules/
|
||||
alert-types-comparison-table:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/#comparison-between-alert-rule-types
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/#comparison-between-alert-rule-types
|
||||
templating-labels-annotations:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/templates/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/templates/
|
||||
---
|
||||
|
||||
# Configure alert rules
|
||||
|
||||
An alert rule consists of one or more queries and expressions that select the data you want to measure. It also contains a condition, which is the threshold that an alert rule must meet or exceed in order to fire.
|
||||
[Alert rules](ref:alert-rules) are the central component of your alerting system.
|
||||
|
||||
Create, manage, view, and adjust alert rules to alert on your metrics data or log entries from multiple data sources — no matter where your data is stored.
|
||||
An alert rule consists of one or more queries and expressions that select the data you want to measure. It contains a condition to trigger the alert, an evaluation period that determines how often the rule is evaluated, and additional options to manage alert events and their notifications.
|
||||
|
||||
The main parts of alert rule creation are:
|
||||
Grafana supports two types of alert rules:
|
||||
|
||||
1. Select your data source
|
||||
1. Query your data
|
||||
1. Normalize your data
|
||||
1. Set your threshold
|
||||
1. Grafana-managed alert rules: These can query multiple data sources.
|
||||
|
||||
**Query, expressions, and alert condition**
|
||||
1. Data source-managed alert rules: These can only query Prometheus-based data sources and support horizontal scaling.
|
||||
|
||||
What are you monitoring? How are you measuring it?
|
||||
We recommend using Grafana-managed alert rules whenever possible, and opting for data source-managed alert rules when horizontal scaling is required. Refer to the [comparison table of alert rule types](ref:alert-types-comparison-table) for a more detailed overview.
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
Expressions can only be used for Grafana-managed alert rules.
|
||||
{{< /admonition >}}
|
||||
Both types of alert rules can be configured in Grafana using the **+ New alert rule** flow. For step-by-step instructions, refer to:
|
||||
|
||||
**Evaluation**
|
||||
- [Configure Grafana-managed alert rules](ref:configure-grafana-alerts)
|
||||
- [Configure data source-managed alert rules](ref:configure-ds-alerts)
|
||||
- [Create and link alert rules to panels](ref:templating-labels-annotations)
|
||||
|
||||
How do you want your alert to be evaluated?
|
||||
Alert rules can also query metrics generated by recording rules. To learn more, refer to:
|
||||
|
||||
**Labels and notifications**
|
||||
|
||||
How do you want to route your alert? What kind of additional labels could you add to annotate your alert rules and ease searching?
|
||||
|
||||
**Annotations**
|
||||
|
||||
Do you want to add more context on the alert in your notification messages, for example, what caused the alert to fire? Which server did it happen on?
|
||||
- [Create recording rules](ref:recording-rules)
|
||||
|
||||
@@ -0,0 +1,157 @@
|
||||
---
|
||||
aliases:
|
||||
- ../unified-alerting/alerting-rules/create-mimir-loki-managed-rule/ # /docs/grafana/<GRAFANA_VERSION>/alerting/unified-alerting/alerting-rules/create-mimir-loki-managed-rule/
|
||||
- ../unified-alerting/alerting-rules/edit-cortex-loki-namespace-group/ # /docs/grafana/<GRAFANA_VERSION>/alerting/unified-alerting/alerting-rules/edit-cortex-loki-namespace-group/
|
||||
- ../unified-alerting/alerting-rules/edit-mimir-loki-namespace-group/ # /docs/grafana/<GRAFANA_VERSION>/alerting/unified-alerting/alerting-rules/edit-mimir-loki-namespace-group/
|
||||
- ../alerting-rules/create-mimir-loki-managed-rule/ # /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/create-mimir-loki-managed-rule/
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/alerting-rules/create-data-source-managed-rule/
|
||||
description: Configure data source-managed alert rules alert for an external Grafana Mimir or Loki instance
|
||||
keywords:
|
||||
- grafana
|
||||
- alerting
|
||||
- guide
|
||||
- rules
|
||||
- create
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: Configure data source-managed alert rules
|
||||
weight: 200
|
||||
refs:
|
||||
shared-configure-prometheus-data-source-alerting:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/datasources/prometheus/configure-prometheus-data-source/#alerting
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/connect-externally-hosted/data-sources/prometheus/configure-prometheus-data-source/#alerting
|
||||
configure-grafana-managed-rules:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/create-grafana-managed-rule/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/create-grafana-managed-rule/notification-policies/
|
||||
notification-policies:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/notifications/notification-policies/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/notifications/notification-policies/
|
||||
pending-period:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rule-evaluation/#pending-period
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rule-evaluation/#pending-period
|
||||
alert-rules:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/
|
||||
alert-rule-labels:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/annotation-label/#labels
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/annotation-label/#labels
|
||||
alert-rule-evaluation:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rule-evaluation/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rule-evaluation/
|
||||
shared-provision-alerting-resources:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/set-up/provision-alerting-resources/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/set-up/provision-alerting-resources/
|
||||
shared-alert-rule-template:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/templates/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/templates/
|
||||
shared-annotations:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/annotation-label/#annotations
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/annotation-label/#annotations
|
||||
shared-link-alert-rules-to-panels:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/link-alert-rules-to-panels/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/link-alert-rules-to-panels/
|
||||
---
|
||||
|
||||
# Configure data source-managed alert rules
|
||||
|
||||
Data source-managed alert rules can only be created using Grafana Mimir or Grafana Loki data sources.
|
||||
|
||||
The rules are stored within the data source. In a distributed architecture, they can scale horizontally to provide high-availability. For more details, refer to [alert rule types](ref:alert-rules).
|
||||
|
||||
We recommend using [Grafana-managed alert rules](ref:configure-grafana-managed-rules) whenever possible and opting for data source-managed alert rules when scaling your alerting setup is necessary.
|
||||
|
||||
{{< docs/shared lookup="alerts/note-prometheus-ds-rules.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
To create or edit data source-managed alert rules, follow these instructions.
|
||||
|
||||
## Before you begin
|
||||
|
||||
Verify that you have write permission to the Mimir or Loki data source. Otherwise, you cannot create or update data source-managed alert rules.
|
||||
|
||||
### Enable the Ruler API
|
||||
|
||||
For more information, refer to the [Mimir Ruler API](/docs/mimir/latest/references/http-api/#ruler) or [Loki Ruler API](/docs/loki/latest/api/#ruler).
|
||||
|
||||
- **Mimir** - use the `/prometheus` prefix. The Prometheus data source supports both Grafana Mimir and Prometheus, and Grafana expects that both the [Query API](/docs/mimir/latest/operators-guide/reference-http-api/#querier--query-frontend) and [Ruler API](/docs/mimir/latest/operators-guide/reference-http-api/#ruler) are under the same URL. You cannot provide a separate URL for the Ruler API.
|
||||
|
||||
- **Loki** - The `local` rule storage type, default for the Loki data source, supports only viewing of rules. To edit rules, configure one of the other rule storage types.
|
||||
|
||||
### Permissions
|
||||
|
||||
Alert rules for Mimir or Loki instances can be edited or deleted by users with **Editor** or **Admin** roles.
|
||||
|
||||
If you do not want to manage alert rules for a particular data source, go to its settings and clear the **Manage alerts via Alerting UI** checkbox.
|
||||
|
||||
{{< docs/shared lookup="alerts/configure-provisioning-before-begin.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
{{< docs/shared lookup="alerts/configure-alert-rule-name.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
## Define query and condition
|
||||
|
||||
Define a query to get the data you want to measure and a condition that needs to be met before an alert rule fires.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
By default, new alert rules are Grafana-managed. To switch to **Data source-managed**, follow these instructions.
|
||||
{{% /admonition %}}
|
||||
|
||||
1. Select a Prometheus-based data source from the drop-down list.
|
||||
|
||||
You can also click **Open advanced data source picker** to find more options.
|
||||
|
||||
1. Enter a PromQL or LogQL query, including the alert condition.
|
||||
1. In the **Rule type** option, select **Data source-managed**.
|
||||
1. Click **Preview alerts**.
|
||||
|
||||
## Set alert evaluation behavior
|
||||
|
||||
Use [alert rule evaluation](ref:alert-rule-evaluation) to determine how frequently an alert rule should be evaluated and how quickly it should change its state.
|
||||
|
||||
1. Select a namespace or click **+ New namespace**.
|
||||
1. Select an evaluation group or click **+ New evaluation group**.
|
||||
|
||||
If you are creating a new evaluation group, specify the interval for the group.
|
||||
|
||||
All rules within the same group are evaluated sequentially over the same time interval. You can reorder them from the **Alert rules** page.
|
||||
|
||||
1. Enter a pending period.
|
||||
|
||||
The [pending period](ref:pending-period) is the period in which an alert rule can be in breach of the condition until it fires.
|
||||
|
||||
Once a condition is met, the alert goes into the **Pending** state. If the condition remains active for the duration specified, the alert transitions to the **Firing** state, else it reverts to the **Normal** state.
|
||||
|
||||
## Configure labels and notifications
|
||||
|
||||
Add [labels](ref:alert-rule-labels) to your alert rules to set which [notification policy](ref:notification-policies) should handle your firing alert instances.
|
||||
|
||||
All alert rules and instances, irrespective of their labels, match the default notification policy. If there are no nested policies, or no nested policies match the labels in the alert rule or alert instance, then the default notification policy is the matching policy.
|
||||
|
||||
1. Add labels if you want to change the way your notifications are routed.
|
||||
|
||||
Add custom labels by selecting existing key-value pairs from the drop down, or add new labels by entering the new key or value.
|
||||
|
||||
{{< docs/shared lookup="alerts/configure-notification-message.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
@@ -24,123 +24,144 @@ refs:
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/use-dashboards/#time-units-and-relative-ranges
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/dashboards/use-dashboards/#time-units-and-relative-ranges
|
||||
fundamentals:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/
|
||||
alert-instance-state:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rule-evaluation/state-and-health/#alert-instance-state
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rule-evaluation/state-and-health/#alert-instance-state
|
||||
keep-last-state:
|
||||
modify-the-no-data-or-error-state:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rule-evaluation/state-and-health/#keep-last-state
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rule-evaluation/state-and-health/#modify-the-no-data-or-error-state
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rule-evaluation/state-and-health/#keep-last-state
|
||||
add-a-query:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/query-transform-data/#add-a-query
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/panels-visualizations/query-transform-data/#add-a-query
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rule-evaluation/state-and-health/#modify-the-no-data-or-error-state
|
||||
pending-period:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rule-evaluation/#pending-period
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rule-evaluation/#pending-period
|
||||
alerting-on-numeric-data:
|
||||
alert-rule-evaluation:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/queries-conditions/#alert-on-numeric-data
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rule-evaluation/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/queries-conditions/#alert-on-numeric-data
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rule-evaluation/
|
||||
mute-timings:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/mute-timings/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/mute-timings/
|
||||
alert-rule-query:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/queries-conditions/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/queries-conditions/
|
||||
alert-rule-labels:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/annotation-label/#labels
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/annotation-label/#labels
|
||||
expression-queries:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/query-transform-data/expression-queries/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/queries-conditions/#expression-queries
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/panels-visualizations/query-transform-data/expression-queries/
|
||||
annotation-label:
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/queries-conditions/#expression-queries
|
||||
alert-condition:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/annotation-label/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/queries-conditions/#alert-condition
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/annotation-label/
|
||||
link-alert-rules-to-panels:
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/queries-conditions/#alert-condition
|
||||
contact-points:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/link-alert-rules-to-panels/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/notifications/contact-points/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/link-alert-rules-to-panels/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/notifications/contact-points/
|
||||
notification-policies:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/notifications/notification-policies/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/notifications/notification-policies/
|
||||
data-sources:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/datasources/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
- destination: /docs/grafana-cloud/connect-externally-hosted/data-sources/
|
||||
alert-rules:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/
|
||||
compatible-data-sources:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/#supported-data-sources
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/#supported-data-sources
|
||||
shared-provision-alerting-resources:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/set-up/provision-alerting-resources/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/set-up/provision-alerting-resources/
|
||||
shared-alert-rule-template:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/templates/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/templates/
|
||||
shared-annotations:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/annotation-label/#annotations
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/annotation-label/#annotations
|
||||
shared-link-alert-rules-to-panels:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/link-alert-rules-to-panels/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/link-alert-rules-to-panels/
|
||||
---
|
||||
|
||||
# Configure Grafana-managed alert rules
|
||||
|
||||
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).
|
||||
Grafana-managed rules can query data from multiple data sources in a single alert rule. They are the most flexible [alert rule type](ref:alert-rules). You can also add expressions to transform your data, set alert conditions, and images in alert notifications.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
For Grafana Cloud Free Forever, you can create up to 100 free Grafana-managed alert rules with each alert rule having a maximum of 1000 alert instances.
|
||||
In Grafana Cloud, the number of Grafana-managed alert rules you can create depends on your Grafana Cloud plan.
|
||||
|
||||
For all paid tiers (Cloud Pro and Advanced), there is a soft limit of 2000 alert rules and unlimited alert instances. To increase the limit, open a support ticket from the [Cloud portal](https://grafana.com/docs/grafana-cloud/account-management/support/).
|
||||
- Free Forever plan: You can create up to 100 free alert rules, with each alert rule having a maximum of 1000 alert instances.
|
||||
- All paid plans (Pro and Advanced): They have a soft limit of 2000 alert rules and support unlimited alert instances. To increase the limit, open a support ticket from the [Cloud portal](/docs/grafana-cloud/account-management/support/).
|
||||
|
||||
{{% /admonition %}}
|
||||
|
||||
Grafana-managed alert rules can only be edited or deleted by users with Edit permissions for the folder storing the rules.
|
||||
|
||||
If you delete an alert resource created in the UI, you can no longer retrieve it.
|
||||
To make a backup of your configuration and to be able to restore deleted alerting resources, create your alerting resources using file provisioning, Terraform, or the Alerting API.
|
||||
To create or edit Grafana-managed alert rules, follow the instructions below. For a practical example, check out our [tutorial on getting started with Grafana alerting](http://grafana.com/tutorials/alerting-get-started/).
|
||||
|
||||
## Before you begin
|
||||
|
||||
If you are using Grafana OSS:
|
||||
Verify that the data sources you plan to query in the alert rule are [compatible with Grafana-managed alert rules](ref:compatible-data-sources) and are properly configured.
|
||||
|
||||
1. Configure your [data sources](ref:data-sources).
|
||||
2. Check which [data sources](ref:compatible-data-sources) are compatible with and supported by Grafana Alerting.
|
||||
### Permissions
|
||||
|
||||
If you are using Grafana OSS, Enterprise, or Cloud:
|
||||
Only users with **Edit** permissions for the folder storing the rules can edit or delete Grafana-managed alert rules.
|
||||
|
||||
{{< docs/shared lookup="alerts/configure-provisioning-before-begin.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
### Default vs Advanced options
|
||||
|
||||
You can use default or advanced options for Grafana-managed alert rule creation. The default options streamline rule creation with a cleaner header and a single query and condition. For more complex rules, use advanced options to add multiple queries and expressions.
|
||||
|
||||
Default and advanced options are enabled by default for Grafana Cloud users and this feature is being rolled out progressively.
|
||||
You can toggle between the two options. Once you have created an alert rule, the system defaults to your previous choice for the next alert rule.
|
||||
|
||||
For OSS users,enable the `alertingQueryAndExpressionsStepMode` feature toggle.
|
||||
Switching from advanced to default may result in queries and expressions that cannot be converted. In this case, a warning message asks if you want to continue to reset to default settings.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Once you have created an alert rule using one of the options, the system defaults to this option for the next alert rule you create.
|
||||
Default and advanced options are enabled by default for Grafana Cloud users and this feature is being rolled out progressively. OSS users can enable them via the [`alertingQueryAndExpressionsStepMode` feature toggle](/setup-grafana/configure-grafana/feature-toggles/).
|
||||
|
||||
You can toggle between the two options. However, if you want to switch from advanced options to the default, it may be that your query and expressions cannot be converted. In this case, a warning message checks whether you want to continue to reset to default settings.
|
||||
{{% /admonition %}}
|
||||
|
||||
## Steps
|
||||
|
||||
To create a Grafana-managed alert rule, use the in-product alert creation flow and follow these steps.
|
||||
|
||||
To get started quickly, refer to our [tutorial on getting started with Grafana alerting](http://grafana.com/tutorials/alerting-get-started/).
|
||||
|
||||
## Set alert rule name
|
||||
|
||||
1. Click **Alerts & IRM** -> **Alert rules** -> **+ New alert rule**.
|
||||
1. Enter a name to identify your alert rule.
|
||||
|
||||
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.
|
||||
{{< docs/shared lookup="alerts/configure-alert-rule-name.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
## Define query and condition
|
||||
|
||||
Define a query to get the data you want to measure and a condition that needs to be met before an alert rule fires.
|
||||
|
||||
You can toggle between **Default** and **Advanced** options. If the [Default vs. Advanced feature](#default-vs-advanced-options) is not enabled in your Grafana instance, follow the **Advanced options** instructions.
|
||||
|
||||
{{< collapse title="Default options" >}}
|
||||
|
||||
1. Add a query.
|
||||
1. Add an alert condition.
|
||||
1. Add a [query](ref:alert-rule-query).
|
||||
1. Add an [alert condition](ref:alert-condition).
|
||||
|
||||
The **When** input includes the reducer function and the last input is the threshold.
|
||||
|
||||
@@ -152,15 +173,11 @@ Define a query to get the data you want to measure and a condition that needs to
|
||||
1. Select a data source.
|
||||
1. From the **Options** dropdown, specify a [time range](ref:time-units-and-relative-ranges).
|
||||
|
||||
{{% admonition type="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`.
|
||||
{{% /admonition %}}
|
||||
Note that 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`.
|
||||
|
||||
1. Add a query.
|
||||
|
||||
To add multiple [queries](ref:add-a-query), click **Add query**.
|
||||
To add multiple [queries](ref:alert-rule-query), click **Add query**.
|
||||
|
||||
All alert rules are managed by Grafana by default. If you want to switch to a data source-managed alert rule, click **Switch to data source-managed alert rule**.
|
||||
|
||||
@@ -168,9 +185,7 @@ It does not support absolute time ranges: `2021-12-02 00:00:00 to 2021-12-05 23:
|
||||
|
||||
a. 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.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
When using Prometheus, you can use an instant vector and built-in functions, so you don't need to add additional expressions.
|
||||
{{% /admonition %}}
|
||||
|
||||
b. Click **Preview** to verify that the expression is successful.
|
||||
|
||||
@@ -178,12 +193,24 @@ It does not support absolute time ranges: `2021-12-02 00:00:00 to 2021-12-05 23:
|
||||
|
||||
You can only add one recovery threshold in a query and it must be the alert condition.
|
||||
|
||||
1. Click **Set as alert condition** on the query or expression you want to set as your alert condition.
|
||||
1. Click **Set as alert condition** on the query or expression you want to set as your [alert condition](ref:alert-condition).
|
||||
{{< /collapse >}}
|
||||
|
||||
## Set alert evaluation behavior
|
||||
## Set folder and labels
|
||||
|
||||
Use alert rule evaluation to determine how frequently an alert rule should be evaluated and how quickly it should change its state.
|
||||
Organize your alert rule with a folder and set of labels.
|
||||
|
||||
In the **Labels** section, you can optionally choose whether to add labels to organize your alert rules and their notifications. For more details, refer to [alert rule labels](ref:alert-rule-labels).
|
||||
|
||||
1. Select a folder or click **+ New folder**.
|
||||
|
||||
1. Add labels, if required.
|
||||
|
||||
Add custom labels by selecting existing key-value pairs from the drop down, or add new labels by entering the new key or value.
|
||||
|
||||
## Configure alert evaluation behavior
|
||||
|
||||
Use [alert rule evaluation](ref:alert-rule-evaluation) to determine how frequently an alert rule should be evaluated and how quickly it should change its state.
|
||||
|
||||
To do this, you need to make sure that your alert rule is in the right evaluation group and set a pending period time that works best for your use case.
|
||||
|
||||
@@ -194,7 +221,7 @@ To do this, you need to make sure that your alert rule is in the right evaluatio
|
||||
|
||||
All rules within the same group are evaluated concurrently over the same time interval.
|
||||
|
||||
1. Enter a pending period.
|
||||
1. Enter a [pending period](ref:pending-period).
|
||||
|
||||
The pending period is the period in which an alert rule can be in breach of the condition until it fires.
|
||||
|
||||
@@ -202,15 +229,20 @@ To do this, you need to make sure that your alert rule is in the right evaluatio
|
||||
|
||||
1. Turn on pause alert notifications, if required.
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
You can pause alert rule evaluation to prevent noisy alerting while tuning your alerts.
|
||||
Pausing stops alert rule evaluation and doesn't create any alert instances.
|
||||
This is different to mute timings, which stop notifications from being delivered, but still allows for alert rule evaluation and the creation of alert instances.
|
||||
{{< /admonition >}}
|
||||
This is different to [mute timings](ref:mute-timings), which stop notifications from being delivered, but still allows for alert rule evaluation and the creation of alert instances.
|
||||
|
||||
1. In **Configure no data and error handling**, configure alerting behavior in the absence of data.
|
||||
1. In **Configure no data and error handling**, you can define the alerting behavior and alerting state for two scenarios:
|
||||
|
||||
Use the guidelines in [No data and error handling](#configure-no-data-and-error-handling).
|
||||
- When the evaluation returns **No data** or all values are null.
|
||||
- When the evaluation returns **Error** or timeout.
|
||||
|
||||
### Configure no data and error handling
|
||||
|
||||
{{< docs/shared lookup="alerts/table-configure-no-data-and-error.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
For more details, refer to [alert instance states](ref:alert-instance-state) and [modify the no data or error state](ref:modify-the-no-data-or-error-state).
|
||||
|
||||
## Configure labels and notifications
|
||||
|
||||
@@ -228,7 +260,7 @@ Complete the following steps to set up labels and notifications.
|
||||
|
||||
**Select contact point**
|
||||
|
||||
1. Choose this option to select an existing contact point.
|
||||
1. Choose this option to select an existing [contact point](ref:contact-points).
|
||||
|
||||
All notifications for this alert rule are sent to this contact point automatically and notification policies are not used.
|
||||
|
||||
@@ -239,67 +271,18 @@ Complete the following steps to set up labels and notifications.
|
||||
|
||||
**Use notification policy**
|
||||
|
||||
3. Choose this option to use the notification policy tree to direct your notifications.
|
||||
1. Choose this option to use the [notification policy tree](ref:notification-policies) to direct your notifications.
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
All alert rules and instances, irrespective of their labels, match the default notification policy. If there are no nested policies, or no nested policies match the labels in the alert rule or alert instance, then the default notification policy is the matching policy.
|
||||
{{< /admonition >}}
|
||||
|
||||
4. Preview your alert instance routing set up.
|
||||
2. Preview your alert instance routing set up.
|
||||
|
||||
Based on the labels added, alert instances are routed to the following notification policies displayed.
|
||||
|
||||
5. Expand each notification policy below to view more details.
|
||||
3. Expand each notification policy below to view more details.
|
||||
|
||||
6. Click **See details** to view alert routing details and an email preview.
|
||||
4. Click **See details** to view alert routing details and an email preview.
|
||||
|
||||
## Add annotations
|
||||
|
||||
Add [annotations](ref:annotation-label). to provide more context on the alert in your alert notification message.
|
||||
|
||||
Annotations add metadata to provide more information on the alert in your alert notification message. For example, add a **Summary** annotation to tell you which value caused the alert to fire or which server it happened on.
|
||||
|
||||
1. Optional: Add a summary.
|
||||
|
||||
Short summary of what happened and why.
|
||||
|
||||
1. Optional: Add a description.
|
||||
|
||||
Description of what the alert rule does.
|
||||
|
||||
1. Optional: Add a Runbook URL.
|
||||
|
||||
Webpage where you keep your runbook for the alert
|
||||
|
||||
1. Optional: Add a custom annotation
|
||||
1. Optional: **Link dashboard and panel**.
|
||||
|
||||
[Link the alert rule to a panel](ref:link-alert-rules-to-panels) to facilitate alert investigation.
|
||||
|
||||
1. Click **Save rule**.
|
||||
|
||||
## Configure no data and error handling
|
||||
|
||||
In **Configure no data and error handling**, you can define the alerting behavior when the evaluation returns no data or an error.
|
||||
|
||||
For details about alert states, refer to [lifecycle of alert instances](ref:alert-instance-state).
|
||||
|
||||
You can configure the alert instance state when its evaluation returns no data:
|
||||
|
||||
| No Data configuration | Description |
|
||||
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| No Data | The default option. Sets alert instance state to `No data`. <br/> The alert rule also creates a new alert instance `DatasourceNoData` with the name and UID of the alert rule, and UID of the datasource that returned no data as labels. |
|
||||
| Alerting | Sets the alert instance state to `Pending` and then transitions to `Alerting` once the [pending period](ref:pending-period) ends. If you sent the pending period to 0, the alert instance state is immediately set to `Alerting`. |
|
||||
| Normal | Sets alert instance state to `Normal`. |
|
||||
| Keep Last State | Maintains the alert instance in its last state. Useful for mitigating temporary issues, refer to [Keep last state](ref:keep-last-state). |
|
||||
|
||||
You can also configure the alert instance state when its evaluation returns an error or timeout.
|
||||
|
||||
| Error configuration | Description |
|
||||
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Error | The default option. Sets alert instance state to `Error`. <br/> The alert rule also creates a new 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 instance state to `Alerting`. It transitions from `Pending` to `Alerting` after the [pending period](ref:pending-period) has finished. |
|
||||
| Normal | Sets alert instance state to `Normal`. |
|
||||
| Keep Last State | Maintains the alert instance in its last state. Useful for mitigating temporary issues, refer to [Keep last state](ref:keep-last-state). |
|
||||
|
||||
When you configure the No data or Error behavior to `Alerting` or `Normal`, Grafana will attempt to keep a stable set of fields under notification `Values`. If your query returns no data or an error, Grafana re-uses the latest known set of fields in `Values`, but will use `-1` in place of the measured value.
|
||||
{{< docs/shared lookup="alerts/configure-notification-message.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
@@ -1,144 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- ../unified-alerting/alerting-rules/create-mimir-loki-managed-rule/ # /docs/grafana/<GRAFANA_VERSION>/alerting/unified-alerting/alerting-rules/create-mimir-loki-managed-rule/
|
||||
- ../unified-alerting/alerting-rules/edit-cortex-loki-namespace-group/ # /docs/grafana/<GRAFANA_VERSION>/alerting/unified-alerting/alerting-rules/edit-cortex-loki-namespace-group/
|
||||
- ../unified-alerting/alerting-rules/edit-mimir-loki-namespace-group/ # /docs/grafana/<GRAFANA_VERSION>/alerting/unified-alerting/alerting-rules/edit-mimir-loki-namespace-group/
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/alerting-rules/create-mimir-loki-managed-rule/
|
||||
description: Configure data source-managed alert rules alert for an external Grafana Mimir or Loki instance
|
||||
keywords:
|
||||
- grafana
|
||||
- alerting
|
||||
- guide
|
||||
- rules
|
||||
- create
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: Configure data source-managed alert rules
|
||||
weight: 200
|
||||
refs:
|
||||
alerting:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/
|
||||
annotation-label:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/annotation-label/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/annotation-label/
|
||||
link-alert-rules-to-panels:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/link-alert-rules-to-panels/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/link-alert-rules-to-panels/
|
||||
---
|
||||
|
||||
# Configure data source-managed alert rules
|
||||
|
||||
Create data source-managed alert rules for Grafana Mimir or Grafana Loki data sources, which have been configured to support rule creation.
|
||||
|
||||
To configure your Grafana Mimir or Loki data source for alert rule creation, enable either the Loki Ruler API or the Mimir Ruler API.
|
||||
|
||||
For more information, refer to [Loki Ruler API](/docs/loki/<GRAFANA_VERSION>/api/#ruler) or [Mimir Ruler API](/docs/mimir/<GRAFANA_VERSION>/references/http-api/#ruler).
|
||||
|
||||
**Note**:
|
||||
|
||||
Alert rules for a Grafana Mimir or Loki instance can be edited or deleted by users with Editor or Admin roles.
|
||||
|
||||
If you delete an alerting resource created in the UI, you can no longer retrieve it.
|
||||
To make a backup of your configuration and to be able to restore deleted alerting resources, create your alerting resources using file provisioning, Terraform, or the Alerting API.
|
||||
|
||||
## Before you begin
|
||||
|
||||
- Verify that you have write permission to the Mimir or Loki data source. Otherwise, you cannot create or update Grafana Mimir or Loki-managed alert rules.
|
||||
|
||||
- Enable the Mimir or Loki Ruler API.
|
||||
|
||||
- **Loki** - The `local` rule storage type, default for the Loki data source, supports only viewing of rules. To edit rules, configure one of the other rule storage types.
|
||||
|
||||
- **Grafana Mimir** - use the `/prometheus` prefix. The Prometheus data source supports both Grafana Mimir and Prometheus, and Grafana expects that both the [Query API](/docs/mimir/latest/operators-guide/reference-http-api/#querier--query-frontend) and [Ruler API](/docs/mimir/latest/operators-guide/reference-http-api/#ruler) are under the same URL. You cannot provide a separate URL for the Ruler API.
|
||||
|
||||
Watch this video to learn more about how to create a Mimir-managed alert rule: {{< vimeo 720001865 >}}
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
If you do not want to manage alert rules for a particular Loki or Mimir data source, go to its settings and clear the **Manage alerts via Alerting UI** checkbox.
|
||||
{{% /admonition %}}
|
||||
|
||||
To create a data source-managed alert rule, use the in-product alert creation flow and follow these steps to help you.
|
||||
|
||||
## Set alert rule name
|
||||
|
||||
1. Click **Alerts & IRM** -> **Alert rules** -> **+ New alert rule**.
|
||||
1. Enter a name to identify your alert rule.
|
||||
|
||||
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.
|
||||
|
||||
## Define query and condition
|
||||
|
||||
Define a query to get the data you want to measure and a condition that needs to be met before an alert rule fires.
|
||||
|
||||
**Note**:
|
||||
|
||||
All alert rules are managed by Grafana by default. To switch to a data source-managed alert rule, click **Switch to data source-managed alert rule**.
|
||||
|
||||
1. Select a data source from the drop-down list.
|
||||
|
||||
You can also click **Open advanced data source picker** to see more options, including adding a data source (Admins only).
|
||||
|
||||
1. Enter a PromQL or LogQL query.
|
||||
1. Click **Preview alerts**.
|
||||
|
||||
## Set alert evaluation behavior
|
||||
|
||||
Use alert rule evaluation to determine how frequently an alert rule should be evaluated and how quickly it should change its state.
|
||||
|
||||
1. Select a namespace or click **+ New namespace**.
|
||||
1. Select an evaluation group or click **+ New evaluation group**.
|
||||
|
||||
If you are creating a new evaluation group, specify the interval for the group.
|
||||
|
||||
All rules within the same group are evaluated sequentially over the same time interval.
|
||||
|
||||
1. Enter a pending period.
|
||||
|
||||
The pending period is the period in which an alert rule can be in breach of the condition until it fires.
|
||||
|
||||
Once a condition is met, the alert goes into the **Pending** state. If the condition remains active for the duration specified, the alert transitions to the **Firing** state, else it reverts to the **Normal** state.
|
||||
|
||||
## Configure notifications
|
||||
|
||||
Add labels to your alert rules to set which notification policy should handle your firing alert instances.
|
||||
|
||||
All alert rules and instances, irrespective of their labels, match the default notification policy. If there are no nested policies, or no nested policies match the labels in the alert rule or alert instance, then the default notification policy is the matching policy.
|
||||
|
||||
1. Add labels if you want to change the way your notifications are routed.
|
||||
|
||||
Add custom labels by selecting existing key-value pairs from the drop down, or add new labels by entering the new key or value.
|
||||
|
||||
## Add annotations
|
||||
|
||||
Add [annotations](ref:annotation-label). to provide more context on the alert in your alert notifications.
|
||||
|
||||
Annotations add metadata to provide more information on the alert in your alert notifications. For example, add a **Summary** annotation to tell you which value caused the alert to fire or which server it happened on.
|
||||
|
||||
1. Optional: Add a summary.
|
||||
|
||||
Short summary of what happened and why.
|
||||
|
||||
1. Optional: Add a description.
|
||||
|
||||
Description of what the alert rule does.
|
||||
|
||||
1. Optional: Add a Runbook URL.
|
||||
|
||||
Webpage where you keep your runbook for the alert
|
||||
|
||||
1. Optional: Add a custom annotation
|
||||
1. Optional: **Link dashboard and panel**.
|
||||
|
||||
[Link the alert rule to a panel](ref:link-alert-rules-to-panels) to facilitate alert investigation.
|
||||
|
||||
1. Click **Save rule**.
|
||||
@@ -41,7 +41,7 @@ Note that in data source-managed groups, the alert rules and recording rules wit
|
||||
|
||||
- **Loki** - The `local` rule storage type, default for the Loki data source, supports only viewing of rules. To edit rules, configure one of the other rule storage types.
|
||||
|
||||
- **Grafana Mimir** - use the `/prometheus` prefix. The Prometheus data source supports both Grafana Mimir and Prometheus, and Grafana expects that both the [Query API](/docs/mimir/latest/operators-guide/reference-http-api/#querier--query-frontend) and [Ruler API](/docs/mimir/latest/operators-guide/reference-http-api/#ruler) are under the same URL. You cannot provide a separate URL for the Ruler API.
|
||||
- **Mimir** - use the `/prometheus` prefix. The Prometheus data source supports both Grafana Mimir and Prometheus, and Grafana expects that both the [Query API](/docs/mimir/latest/operators-guide/reference-http-api/#querier--query-frontend) and [Ruler API](/docs/mimir/latest/operators-guide/reference-http-api/#ruler) are under the same URL. You cannot provide a separate URL for the Ruler API.
|
||||
|
||||
## Add new recording rule
|
||||
|
||||
@@ -66,7 +66,9 @@ Select your data source and enter a query. The queries used in data source-manag
|
||||
|
||||
1. From the **Group** dropdown, select an existing group within the selected namespace or add a new one.
|
||||
|
||||
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.
|
||||
Rules within a group are run sequentially at a regular interval, with the same evaluation time.
|
||||
|
||||
Newly created rules are appended to the end of the group, and you can reorder them from the **Alert rules** page.
|
||||
|
||||
## Add labels
|
||||
|
||||
|
||||
@@ -30,9 +30,9 @@ refs:
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/annotation-label/#annotations
|
||||
view-alert-state-on-panels:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/manage-notifications/view-alert-state-on-panels/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/monitor-status/view-alert-state/#view-alert-state-on-panels
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/manage-notifications/view-alert-state-on-panels/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/monitor-status/view-alert-state/#view-alert-state-on-panels
|
||||
---
|
||||
|
||||
# Create and link alert rules to panels
|
||||
|
||||
@@ -63,14 +63,19 @@ refs:
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/reference/#notification-data
|
||||
view-alert-state:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/manage-notifications/view-state-health/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/monitor-status/view-alert-state/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/manage-notifications/view-state-health/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/monitor-status/view-alert-state/
|
||||
preview-notifications:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/manage-notification-templates/#preview-notification-templates
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/manage-notification-templates/#preview-notification-templates
|
||||
labels:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/latest/alerting/fundamentals/alert-rules/annotation-label/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/annotation-label/
|
||||
---
|
||||
|
||||
# Template annotations and labels
|
||||
@@ -213,3 +218,7 @@ For further details on how to template alert rules, refer to:
|
||||
|
||||
- [Annotation and label template reference](ref:alert-rule-template-reference)
|
||||
- [Annotation and label examples](ref:alert-rule-template-examples)
|
||||
|
||||
{{< admonition type="tip" >}}
|
||||
For a practical example of templating, refer to our [Getting Started with Templating tutorial](https://grafana.com/tutorials/alerting-get-started-pt4/).
|
||||
{{< /admonition >}}
|
||||
|
||||
@@ -193,15 +193,11 @@ For additional functions to display or format data, refer to:
|
||||
Here’s an example of creating a `severity` label based on a query value:
|
||||
|
||||
```go
|
||||
{{ if (gt $values.A.Value 90.0) -}}
|
||||
critical
|
||||
{{ else if (gt $values.A.Value 80.0) -}}
|
||||
high
|
||||
{{ else if (gt $values.A.Value 60.0) -}}
|
||||
medium
|
||||
{{ else -}}
|
||||
low
|
||||
{{- end }}
|
||||
{{- if (gt $values.A.Value 90.0) -}}critical
|
||||
{{- else if (gt $values.A.Value 80.0) -}}high
|
||||
{{- else if (gt $values.A.Value 60.0) -}}medium
|
||||
{{- else -}}low
|
||||
{{- end -}}
|
||||
```
|
||||
|
||||
In this example, the `severity` label is determined by the query value:
|
||||
@@ -222,10 +218,13 @@ You should avoid displaying query values in labels, as this may create many aler
|
||||
You can use labels to differentiate alerts coming from various environments (e.g., production, staging, dev). For example, you may want to add a label that sets the environment based on the instance’s label. Here’s how you can template it:
|
||||
|
||||
```go
|
||||
{{ if eq $labels.instance "prod-server-1" }}production
|
||||
{{ else if eq $labels.instance "staging-server-1" }}staging
|
||||
{{ else }}development
|
||||
{{ end }}
|
||||
{{- if eq $labels.instance "prod-server-1" -}}
|
||||
production
|
||||
{{- else if eq $labels.instance "staging-server-1" -}}
|
||||
staging
|
||||
{{- else -}}
|
||||
development
|
||||
{{- end -}}
|
||||
```
|
||||
|
||||
This would print:
|
||||
@@ -237,10 +236,13 @@ This would print:
|
||||
To make this template more flexible, you can use a regular expression that matches the instance name with the instance name prefix using the [`match()`](ref:reference-match) function:
|
||||
|
||||
```go
|
||||
{{ if match "^prod-server-.*" $labels.instance }}production
|
||||
{{ else if match "^staging-server-.*" $labels.instance}}staging
|
||||
{{ else }}development
|
||||
{{ end }}
|
||||
{{- if match "^prod-server-.*" $labels.instance -}}
|
||||
production
|
||||
{{- else if match "^staging-server-.*" $labels.instance -}}
|
||||
staging
|
||||
{{- else -}}
|
||||
development
|
||||
{{- end -}}
|
||||
```
|
||||
|
||||
{{< collapse title="Legacy Alerting templates" >}}
|
||||
|
||||
@@ -51,6 +51,11 @@ refs:
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/templates/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/templates/
|
||||
explore:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/explore/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/explore/
|
||||
---
|
||||
|
||||
# Annotation and label template reference
|
||||
|
||||
@@ -14,29 +14,75 @@ menuTitle: Configure notifications
|
||||
title: Configure notifications
|
||||
weight: 125
|
||||
refs:
|
||||
contact-points:
|
||||
intro-notifications:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/notifications/contact-points/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/notifications/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/notifications/contact-points/
|
||||
notification-policies:
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/notifications/
|
||||
configure-contact-points:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/notifications/notification-policies/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/manage-contact-points/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/notifications/notification-policies/
|
||||
templates-page:
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/manage-contact-points/
|
||||
configure-notification-policies:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/templates/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/create-notification-policy/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/templates/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/create-notification-policy/
|
||||
configure-templates:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/
|
||||
configure-silences:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/create-silence/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/create-silence/
|
||||
configure-mute-timings:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/mute-timings/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/mute-timings/
|
||||
---
|
||||
|
||||
# Configure notifications
|
||||
|
||||
Choose how, when, and where to send your alert notifications.
|
||||
Configuring how, when, and where to send alert notifications is an essential part of your alerting system.
|
||||
|
||||
As a first step, define your [contact points](ref:contact-points) where to send your alert notifications to. A contact point is a set of one or more integrations that are used to deliver notifications.
|
||||
By default, Grafana Alerting provides default notification messages with relevant alert information, so you don't need to configure messages initially. In the alert rule, you need to configure how to forward alerts:
|
||||
|
||||
Next, create a [notification policy](ref:notification-policies) which is a set of rules for where, when and how your alerts are routed to contact points. In a notification policy, you define where to send your alert notifications by choosing one of the contact points you created.
|
||||
1. Directly to a contact point.
|
||||
2. To a contact point via notification policies (more flexible).
|
||||
|
||||
Optionally, you can add [notification templates](ref:templates-page) to contact points for reuse and consistent messaging in your notifications.
|
||||
{{< figure src="/media/docs/alerting/alerting-configure-notifications-v2.png" max-width="750px" alt="In the alert rule, you can configure alert forwarding directly to a contact point or through notification policies" >}}
|
||||
|
||||
Notification setup is essential for an effective alerting system to scale across multiple teams and services. For a quick overview about the various components involved in handling notifications, refer to the [introduction about notifications](ref:intro-notifications).
|
||||
|
||||
The topics in this section include step-by-step instructions for:
|
||||
|
||||
- [Configuring contact points](ref:configure-contact-points) to specify where to receive alert notifications.
|
||||
- [Configuring notification policies](ref:configure-notification-policies) to determine how alerts are routed to contact points.
|
||||
- [Templating notifications](ref:configure-templates) to customize notification messages.
|
||||
- [Configuring silences](ref:configure-silences) or [mute timings](ref:configure-mute-timings) to stop notifications.
|
||||
|
||||
## Alertmanager architecture
|
||||
|
||||
Grafana Alerting is based on the Prometheus Alerting model, whose architecture decouples rule evaluation from notification handling.
|
||||
|
||||
- The alert rule evaluator, either Grafana or the data source, evaluates alert rules and triggers alerts.
|
||||
- The alert notification manager, known as the **Alertmanager**, receives alerts and manages their notifications.
|
||||
|
||||
{{< figure src="/media/docs/alerting/alerting-alertmanager-architecture.png" max-width="750px" alt="A diagram with the alert generator and alert manager architecture" >}}
|
||||
|
||||
In Grafana, you can use different types of alert rules and configure multiple Alertmanagers.
|
||||
|
||||
By default, Grafana uses its built-in Alertmanager, and Grafana Cloud instances include an additional Alertmanager.
|
||||
|
||||
{{< figure src="/media/docs/alerting/alerting-choose-alertmanager.png" max-width="750px" alt="A screenshot choosing an Alertmanager in the notification policies UI" >}}
|
||||
|
||||
When having multiple Alertmanagers, note that each Alertmanager manages its own independent notification resources, such as contact points, templates, policies, silences, mute timings, and active notifications.
|
||||
|
||||
These notification resources cannot be shared across different Alertmanagers.
|
||||
|
||||
Use the **Choose Alertmanager** dropdown to select the Alertmanager you want to configure.
|
||||
|
||||
@@ -20,26 +20,67 @@ labels:
|
||||
title: Configure notification policies
|
||||
weight: 420
|
||||
refs:
|
||||
notification-policies:
|
||||
alertmanager-architecture:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/#alertmanager-architecture
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/#alertmanager-architecture
|
||||
intro-notification-policies:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/notifications/notification-policies/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/notifications/notification-policies/
|
||||
configure-mute-timings:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/mute-timings/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/mute-timings/
|
||||
configure-contact-points:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/manage-contact-points/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/manage-contact-points/
|
||||
policy-routing:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/notifications/notification-policies/#routing
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/notifications/notification-policies/#routing
|
||||
policy-inheritance:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/notifications/notification-policies/#inheritance
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/notifications/notification-policies/#inheritance
|
||||
policy-grouping:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/notifications/group-alert-notifications/#group-notifications
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/notifications/group-alert-notifications/#group-notifications
|
||||
policy-timing-options:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/notifications/group-alert-notifications/#timing-options
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/notifications/group-alert-notifications/#timing-options
|
||||
---
|
||||
|
||||
# Configure notification policies
|
||||
|
||||
Notification policies determine how alerts are routed to contact points.
|
||||
|
||||
Policies have a tree structure and each policy can have one or more child policies. Each policy, except for the default policy, can also match specific alert labels.
|
||||
Policies have a tree structure. Each policy can have one or more child policies and a set of label matchers.
|
||||
|
||||
Each alert is evaluated by the default policy and subsequently by each child policy.
|
||||
Each alert (or alert instance) is evaluated by the default policy and subsequently by each child policy. Alerts are routed to the appropriate notification policy by matching alert labels with the policy's label matchers. For further details, refer to [label matching and routing in notification policies](ref:intro-notification-policies).
|
||||
|
||||
If the **Continue matching subsequent sibling nodes** option is enabled for a child policy, evaluation continues even after one or more matches. A parent policy’s configuration settings and contact point information govern the behavior of an alert that does not match any of the child policies. A default policy governs any alert that does not match a child policy.
|
||||
{{< figure src="/media/docs/alerting//get-started-notification-policy-tree-combo.png" max-width="750px" alt="A diagram displaying how the notification policy tree routes alerts" >}}
|
||||
|
||||
You can configure Grafana-managed notification policies as well as notification policies for an external Alertmanager data source.
|
||||
When an alert instance is assigned to a notification policy, the notification policy is responsible for:
|
||||
|
||||
For more information on notification policies, refer to [fundamentals of Notification Policies](ref:notification-policies).
|
||||
- [Grouping similar alerts](ref:policy-grouping) to minimize the number of notifications.
|
||||
- Controlling when notifications are sent using the [timing options](ref:policy-timing-options).
|
||||
- Determining the [contact points](ref:configure-contact-points) that receive the alert notification.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
The default notification policy and its child policies are assigned to a [specific Alertmanager](ref:alertmanager-architecture), and they cannot use contact points or mute timings from other Alertmanagers.
|
||||
{{% /admonition %}}
|
||||
|
||||
## Edit the default notification policy
|
||||
|
||||
@@ -47,12 +88,12 @@ For more information on notification policies, refer to [fundamentals of Notific
|
||||
1. Click **Notification policies**.
|
||||
1. From the **Choose Alertmanager** dropdown, select an external Alertmanager. By default, the **Grafana Alertmanager** is selected.
|
||||
1. In the Default policy section, click **...** -> **Edit**.
|
||||
1. In **Default contact point**, update the contact point for where to send notifications when alert rules do not match any specific policy.
|
||||
1. In **Group by**, choose labels to group alerts by. If multiple alerts are matched for this policy, then they are grouped by these labels. A notification is sent per group. If the field is empty (default), then all notifications are sent in a single group. Use a special label `...` to group alerts by all labels (which effectively disables grouping).
|
||||
1. In **Timing options**, select from the following options:
|
||||
- **Group wait** Time to wait to buffer alerts of the same group before sending an initial notification. Default is 30 seconds.
|
||||
- **Group interval** Minimum time interval between two notifications for a group. Default is 5 minutes.
|
||||
- **Repeat interval** Minimum time interval for re-sending a notification if no new alerts were added to the group. Default is 4 hours.
|
||||
1. In **Default contact point**, update the [contact point](ref:configure-contact-points) for where to send notifications when alert rules do not match any specific policy.
|
||||
1. In **Group by**, choose labels to group alerts. If multiple alerts match this policy, they are grouped by the selected labels, and notifications are sent per group. For more details on using this option, refer to [Group notifications](ref:policy-grouping).
|
||||
1. In **Timing options**, set the [timing options](ref:policy-timing-options) to configure when notifications are sent.
|
||||
- **Group wait**: the time to wait before sending the first notification for a new group of alerts. Default is 30 seconds.
|
||||
- **Group interval**: the time to wait before sending a notification about changes in the alert group. Default is 5 minutes.
|
||||
- **Repeat interval**: the time to wait before sending a notification if the group has not changed since the last notification. Default is 4 hours.
|
||||
1. Click **Save** to save your changes.
|
||||
|
||||
## Add a child policy
|
||||
@@ -62,15 +103,18 @@ You can create a child policy under a default policy or under an existing child
|
||||
If you want to choose where to position your policy, see the section on **Add a sibling policy**.
|
||||
|
||||
1. In the left-side menu, click **Alerts & IRM** and then **Alerting**.
|
||||
2. Click **Notification policies**.
|
||||
3. From the **Choose Alertmanager** dropdown, select an Alertmanager. By default, the **Grafana Alertmanager** is selected.
|
||||
4. Click **+New child policy** from the default policy.
|
||||
5. In the Matching labels section, add one or more rules for matching alert labels.
|
||||
6. In the **Contact point** dropdown, select the contact point to send notification to if alert matches only this specific policy and not any of the child policies.
|
||||
7. Optionally, enable **Continue matching subsequent sibling nodes** to continue matching sibling policies even after the alert matched the current policy. When this option is enabled, you can get more than one notification for one alert.
|
||||
8. Optionally, enable **Override grouping** to specify the same grouping as the default policy. If this option is not enabled, the default policy grouping is used.
|
||||
9. Optionally, enable **Override general timings** to override the timing options configured in the group notification policy.
|
||||
10. Click **Save policy** to save your changes.
|
||||
1. Click **Notification policies**.
|
||||
1. From the **Choose Alertmanager** dropdown, select an Alertmanager. By default, the **Grafana Alertmanager** is selected.
|
||||
1. Click **+New child policy** from the default policy or an existing child policy.
|
||||
1. In the Matching labels section of the child policy, add one or more matching label rules to narrow down a specific case from the parent policy.
|
||||
|
||||
For instance, a child policy of the default policy handles `team=security` alerts, or a child policy handles only the `severity=critical` alerts of a parent policy.
|
||||
|
||||
1. In the **Contact point** dropdown, select the [contact point](ref:configure-contact-points) to send notifications. If left empty, the contact point of the parent policy is [inherited](ref:policy-inheritance).
|
||||
1. Optionally, enable **Continue matching subsequent sibling nodes** to continue matching sibling policies even after the alert matched the current policy. If enabled, multiple policies can handle the same alert.
|
||||
1. Optionally, enable **Override grouping** to set different [grouping](ref:policy-grouping) than the parent policy. If disabled, the grouping of the parent policy is [inherited](ref:policy-inheritance).
|
||||
1. Optionally, enable **Override general timings** to set different [timing options](ref:policy-timing-options) than the parent policy. If disabled, the timing options of the parent policy are [inherited](ref:policy-inheritance).
|
||||
1. Click **Save policy** to save your changes.
|
||||
|
||||
## Add a sibling policy
|
||||
|
||||
@@ -79,9 +123,11 @@ If you want to choose where to position your policy, see the section on **Add a
|
||||
1. Find the child policy you want to create a sibling for.
|
||||
1. Click **Add new policy** -> **New sibling above** or **New sibling below**.
|
||||
|
||||
Notification policies are evaluated from top to bottom, so it is key to be able to choose which notification policy receives alerts first. Adding sibling notification policies instead of always inserting a child policy as well as being able to choose where to insert is key to managing where your alerts go.
|
||||
It's important to determine which policy receives the alert first and to set the correct order of sibling and child policies.
|
||||
|
||||
1. Click **Save policy** to save your changes.
|
||||
Policies are evaluated from top to bottom. If a matching policy is found, the system continues to evaluate its child policies in the order they are displayed. For more details, refer to [notification policies routing](ref:policy-routing).
|
||||
|
||||
1. Follow the instructions from step 5 onward in [adding a child policy](#add-a-child-policy).
|
||||
|
||||
## Search for policies
|
||||
|
||||
@@ -98,7 +144,7 @@ It is important to note that all matched policies are **exact** matches. Grafana
|
||||
|
||||
## Mute timings
|
||||
|
||||
Mute timings are not inherited from a parent notification policy. They have to be configured in full on each level.
|
||||
Mute timings are not inherited from a parent notification policy, and they have to be configured on each level. For instructions, refer to [Configure mute timings](ref:configure-mute-timings).
|
||||
|
||||
## Example
|
||||
|
||||
|
||||
@@ -22,32 +22,52 @@ labels:
|
||||
title: Configure silences
|
||||
weight: 440
|
||||
refs:
|
||||
alert-labels:
|
||||
configure-alertmanager:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/set-up/configure-alertmanager/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/set-up/configure-alertmanager/
|
||||
silence-url:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/reference/#alert
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/reference/#alert
|
||||
shared-alert-labels:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/annotation-label/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/annotation-label/
|
||||
notification-policies:
|
||||
shared-notification-policies:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/notifications/notification-policies/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/notifications/notification-policies/
|
||||
silences:
|
||||
shared-silences:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/create-silence/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/create-silence/
|
||||
shared-mute-timings:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/mute-timings/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/mute-timings/
|
||||
alertmanager-architecture:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/set-up/configure-alertmanager/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/set-up/configure-alertmanager/
|
||||
---
|
||||
|
||||
# Configure silences
|
||||
|
||||
Silences stop notifications from getting created and last for only a specified window of time.
|
||||
Silences stop notifications from getting created and last for only a specified window of time. Use them to temporarily prevent alert notifications, such as during incident response or a maintenance window.
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
Silences are assigned to a [specific Alertmanager](ref:alertmanager-architecture) and only suppress notifications for alerts managed by that Alertmanager.
|
||||
{{< /admonition >}}
|
||||
|
||||
- Inhibition rules are not supported in the Grafana Alertmanager.
|
||||
- The preview of silenced alerts only applies to alerts in firing state.
|
||||
{{< /admonition >}}
|
||||
{{< docs/shared lookup="alerts/mute-timings-vs-silences.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
## Add silences
|
||||
|
||||
@@ -59,10 +79,12 @@ To add a silence, complete the following steps.
|
||||
1. Click **Create silence** to open the Create silence page.
|
||||
1. In **Silence start and end**, select the start and end date to indicate when the silence should go into effect and expire.
|
||||
1. Optionally, in **Duration**, specify how long the silence is enforced. This automatically updates the end time in the **Silence start and end** field.
|
||||
1. In the **Label** and **Value** fields, enter one or more _Matching Labels_. Matchers determine which rules the silence will apply to. Any matching alerts (in firing state) will show in the **Silenced alert instances** field
|
||||
1. In the **Label** and **Value** fields, enter one or more _Matching Labels_ to determine which alerts the silence applies to.
|
||||
|
||||
{{< docs/shared lookup="alerts/how_label_matching_works.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
Any matching alerts (in the firing state only) will show under **Affected alert rule instances**.
|
||||
|
||||
1. In **Comment**, add details about the silence.
|
||||
1. Click **Submit**.
|
||||
|
||||
@@ -75,14 +97,6 @@ To edit a silence, complete the following steps.
|
||||
1. Find the silence you want to edit, then click **Edit** (pen icon).
|
||||
1. Make the desired changes, then click **Submit** to save your changes.
|
||||
|
||||
## Create a URL to link to a silence form
|
||||
|
||||
When linking to a silence form, provide the default matching labels and comment via `matcher` and `comment` query parameters. The `matcher` parameter should be in the following format `[label][operator][value]` where the `operator` parameter can be one of the following: `=` (equals, not regular expression), `!=` (not equals, not regular expression), `=~` (equals, regular expression), `!~` (not equals, regular expression).
|
||||
The URL can contain many query parameters with the key `matcher`.
|
||||
For example, to link to silence form with matching labels `severity=critical` & `cluster!~europe-.*` and comment `Silence critical EU alerts`, create a URL `https://mygrafana/alerting/silence/new?matcher=severity%3Dcritical&matcher=cluster!~europe-*&comment=Silence%20critical%20EU%20alert`.
|
||||
|
||||
To link to a new silence page for an external Alertmanager, add a `alertmanager` query parameter with the Alertmanager data source name.
|
||||
|
||||
## Remove silences
|
||||
|
||||
To remove a silence, complete the following steps.
|
||||
@@ -95,13 +109,30 @@ To remove a silence, complete the following steps.
|
||||
|
||||
## Rule-specific silences
|
||||
|
||||
Rule-specific silences are silences that apply only to a specific alert rule.
|
||||
They're created when you silence an alert rule directly using the **Silence notifications** action in the UI.
|
||||
Rule-specific silences are silences that apply only to a specific alert rule. They're created when you silence an alert rule directly using the **Silence notifications** action in the UI.
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
As opposed to general silences, rule-specific silence access is tied directly to the alert rule they act on. They can be created manually by including the specific label matcher: `__alert_rule_uid__=<alert rule UID>`.
|
||||
{{< /admonition >}}
|
||||
|
||||
## Useful links
|
||||
## URL link to a silence form
|
||||
|
||||
[Aggregation operators](https://prometheus.io/docs/prometheus/latest/querying/operators/#aggregation-operators)
|
||||
Default notification messages often include a link to silence alerts.
|
||||
|
||||
In custom notification templates, you can use [`.Alert.SilenceURL`](ref:silence-url) to redirect users to the UI where they can silence the given alert.
|
||||
|
||||
If [`.Alert.SilenceURL`](ref:silence-url) doesn’t fit your specific use case, you can also create a custom silence link for your custom templates.
|
||||
|
||||
{{< collapse title="Create a custom silence link" >}}
|
||||
|
||||
When linking to a silence form, provide the default matching labels and comment via `matcher` and `comment` query parameters. The `matcher` parameter should be in the following format `[label][operator][value]` where the `operator` parameter can be one of the following: `=` (equals, not regular expression), `!=` (not equals, not regular expression), `=~` (equals, regular expression), `!~` (not equals, regular expression).
|
||||
The URL can contain many query parameters with the key `matcher`.
|
||||
For example, to link to silence form with matching labels `severity=critical` & `cluster!~europe-.*` and comment `Silence critical EU alerts`, create a URL `https://mygrafana/alerting/silence/new?matcher=severity%3Dcritical&matcher=cluster!~europe-*&comment=Silence%20critical%20EU%20alert`.
|
||||
|
||||
To link to a new silence page for an external Alertmanager, add a `alertmanager` query parameter with the Alertmanager data source name.
|
||||
|
||||
{{< /collapse >}}
|
||||
|
||||
## Inhibition rules
|
||||
|
||||
Inhibition rules are supported in the Prometheus Alertmanager. You can [configure a Prometheus Alertmanager](ref:configure-alertmanager) to handle the notification of alerts and suppress notifications via inhibition rules.
|
||||
|
||||
Inhibition rules are not currently supported in the Grafana Alertmanager. For tracking the progress of this feature request, follow [this GitHub issue](https://github.com/grafana/grafana/issues/68822).
|
||||
|
||||
@@ -81,16 +81,21 @@ refs:
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/manage-contact-points/integrations/configure-teams/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/manage-contact-points/integrations/configure-teams/
|
||||
external-alertmanager:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/set-up/configure-alertmanager/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/set-up/configure-alertmanager/
|
||||
mqtt:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/manage-contact-points/integrations/configure-mqtt/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/manage-contact-points/integrations/configure-mqtt/
|
||||
alertmanager-architecture:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/#alertmanager-architecture
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/#alertmanager-architecture
|
||||
external-alertmanager:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/set-up/configure-alertmanager/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/set-up/configure-alertmanager/
|
||||
manage-notification-templates:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/manage-notification-templates/
|
||||
@@ -113,6 +118,10 @@ On the **Contact Points** tab, you can:
|
||||
- Export individual contact points or all contact points in JSON, YAML, or Terraform format.
|
||||
- Delete contact points. Note that you cannot delete contact points that are in use by a notification policy. To proceed, either delete the notification policy or update it to use another contact point.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Contact points are assigned to a [specific Alertmanager](ref:alertmanager-architecture) and cannot be used by notification policies in other Alertmanagers.
|
||||
{{% /admonition %}}
|
||||
|
||||
## Add a contact point
|
||||
|
||||
Complete the following steps to add a contact point.
|
||||
@@ -150,6 +159,16 @@ Testing a contact point is only available for Grafana Alertmanager. Complete the
|
||||
1. Choose whether to send a predefined test notification or choose custom to add your own custom annotations and labels to include in the notification.
|
||||
1. Click **Send test notification** to fire the alert.
|
||||
|
||||
## Customize notification messages
|
||||
|
||||
In contact points, you can also customize notification messages. For example, when setting up an email contact point integration, click **Message** or **Subject** to modify it.
|
||||
|
||||
By default, notification messages include common alert details, which are usually sufficient for most cases.
|
||||
|
||||
If necessary, you can customize the content and format of notification messages. You can create a custom notification template, which can then be applied to one or more contact points.
|
||||
|
||||
On the **Notification templates** tab, you can view, edit, copy or delete notification templates. Refer to [manage notification templates](ref:manage-notification-templates) for instructions on selecting or creating a template for a contact point.
|
||||
|
||||
## List of supported integrations
|
||||
|
||||
Each contact point integration has its own configuration options and setup process. In most cases, this involves providing an API key or a Webhook URL.
|
||||
@@ -182,13 +201,3 @@ The following table lists the contact point integrations supported by Grafana.
|
||||
| WeCom | `wecom` |
|
||||
|
||||
Some of these integrations are not compatible with [external Alertmanagers](ref:external-alertmanager). For the list of Prometheus Alertmanager integrations, refer to the [Prometheus Alertmanager receiver settings](https://prometheus.io/docs/alerting/latest/configuration/#receiver-integration-settings).
|
||||
|
||||
## Customize notification messages
|
||||
|
||||
In contact points, you can also customize notification messages. For example, when setting up an email contact point integration, click **Message** or **Subject** to modify it.
|
||||
|
||||
By default, notification messages include common alert details, which are usually sufficient for most cases.
|
||||
|
||||
If necessary, you can customize the content and format of notification messages. You can create a custom notification template, which can then be applied to one or more contact points.
|
||||
|
||||
On the **Notification templates** tab, you can view, edit, copy or delete notification templates. Refer to [manage notification templates](ref:manage-notification-templates) for instructions on selecting or creating a template for a contact point.
|
||||
|
||||
@@ -18,31 +18,34 @@ labels:
|
||||
- enterprise
|
||||
- oss
|
||||
title: Configure mute timings
|
||||
weight: 450
|
||||
weight: 430
|
||||
refs:
|
||||
external-alertmanager:
|
||||
alertmanager-architecture:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/set-up/configure-alertmanager/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/#alertmanager-architecture
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/set-up/configure-alertmanager/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/#alertmanager-architecture
|
||||
shared-silences:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/create-silence/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/create-silence/
|
||||
shared-mute-timings:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/mute-timings/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/mute-timings/
|
||||
---
|
||||
|
||||
# Configure mute timings
|
||||
|
||||
A mute timing is a recurring interval of time when no new notifications for a policy are generated or sent. Use them to prevent alerts from firing a specific and reoccurring period, for example, a regular maintenance period.
|
||||
A mute timing is a recurring interval of time when no new notifications for a policy are generated or sent. Use them to prevent alerts from firing a specific and reoccurring period, for example, a regular maintenance period or weekends.
|
||||
|
||||
Similar to silences, mute timings do not prevent alert rules from being evaluated, nor do they stop alert instances from being shown in the user interface. They only prevent notifications from being created.
|
||||
{{< admonition type="note" >}}
|
||||
Mute timings are assigned to a [specific Alertmanager](ref:alertmanager-architecture) and only suppress notifications for alerts managed by that Alertmanager.
|
||||
{{< /admonition >}}
|
||||
|
||||
You can configure Grafana managed mute timings as well as mute timings for an [external Alertmanager](ref:external-alertmanager).
|
||||
|
||||
## Mute timings vs silences
|
||||
|
||||
The following table highlights the key differences between mute timings and silences.
|
||||
|
||||
| Mute timing | Silence |
|
||||
| -------------------------------------------------- | ---------------------------------------------------------------------------- |
|
||||
| Uses time interval definitions that can reoccur | Has a fixed start and end time |
|
||||
| Is created and then added to notification policies | Uses labels to match against an alert to determine whether to silence or not |
|
||||
{{< docs/shared lookup="alerts/mute-timings-vs-silences.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
## Add mute timings
|
||||
|
||||
@@ -65,6 +68,8 @@ The following table highlights the key differences between mute timings and sile
|
||||
|
||||
A time interval is a specific duration during which alerts are suppressed. The duration typically consists of a specific time range and the days of the week, month, or year.
|
||||
|
||||
A mute timing can contain multiple time intervals.
|
||||
|
||||
Supported time interval options are:
|
||||
|
||||
- Time range: The time inclusive of the start and exclusive of the end time (in UTC if no location has been selected, otherwise local time).
|
||||
@@ -76,9 +81,13 @@ Supported time interval options are:
|
||||
|
||||
All fields are lists; to match the field, at least one list element must be satisfied. Fields also support ranges using `:` (e.g., `monday:thursday`).
|
||||
|
||||
If a field is left blank, any moment of time matches the field. For an instant of time to match a complete time interval, all fields must match. A mute timing can contain multiple time intervals.
|
||||
If a field is left blank, any moment of time matches the field. For an instant of time to match a complete time interval, all fields must match.
|
||||
|
||||
If you want to specify an exact duration, specify all the options. For example, if you wanted to create a time interval for the first Monday of the month, for March, June, September, and December, between the hours of 12:00 and 24:00 UTC your time interval specification would be:
|
||||
If you want to specify an exact duration, specify all the options.
|
||||
|
||||
**Example**
|
||||
|
||||
If you wanted to create a time interval for the first Monday of the month, for March, June, September, and December, between the hours of 12:00 and 24:00 UTC your time interval specification would be:
|
||||
|
||||
- Time range:
|
||||
- Start time: `12:00`
|
||||
|
||||
@@ -14,7 +14,7 @@ labels:
|
||||
- enterprise
|
||||
- oss
|
||||
title: Template notifications
|
||||
weight: 430
|
||||
weight: 450
|
||||
refs:
|
||||
template-annotations-and-labels:
|
||||
- pattern: /docs/grafana/
|
||||
@@ -108,3 +108,7 @@ For further details on how to write notification templates, refer to:
|
||||
- [Select, create, and preview a notification template](ref:manage-notification-templates)
|
||||
- [Notification template reference](ref:reference)
|
||||
- [Notification template examples](ref:examples)
|
||||
|
||||
{{< admonition type="tip" >}}
|
||||
For a practical example of templating, refer to our [Getting Started with Templating tutorial](https://grafana.com/tutorials/alerting-get-started-pt4/).
|
||||
{{< /admonition >}}
|
||||
|
||||
@@ -111,6 +111,12 @@ The name of the alert is {{ .Labels.alertname }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
You can then use the template by passing the [notification data (dot `.`)](ref:reference-notification-data):
|
||||
|
||||
```go
|
||||
{{ template "custom_message" . }}
|
||||
```
|
||||
|
||||
```template_output
|
||||
The name of the alert is InstanceDown
|
||||
|
||||
@@ -140,7 +146,11 @@ In this example:
|
||||
- A template (`alert.summary_and_description`) is defined to print the `summary`, `status`, and `description` of one [alert](ref:reference-alert).
|
||||
- The main template `custom.alerts` iterates the list of alerts (`.Alerts`) in [notification data](ref:reference-notification-data), executing the `alert.summary_and_description` template to print the details of each alert.
|
||||
|
||||
The notification message would look like this:
|
||||
Execute the template by passing the dot (`.`):
|
||||
|
||||
```go
|
||||
{{ template "custom.alerts" . }}
|
||||
```
|
||||
|
||||
```template_output
|
||||
2 alert(s)
|
||||
@@ -178,7 +188,11 @@ The following example is similar to the previous one, but it separates firing an
|
||||
|
||||
Instead of `.Alerts`, the template accesses `.Alerts.Firing` and `.Alerts.Resolved` separately to print details for each alert.
|
||||
|
||||
The output might now look like this:
|
||||
Run the template by passing the dot (`.`):
|
||||
|
||||
```go
|
||||
{{ template "custom.firing_and_resolved_alerts" . }}
|
||||
```
|
||||
|
||||
```template_output
|
||||
1 resolved alert(s)
|
||||
@@ -215,6 +229,12 @@ Common annotations: {{ len .CommonAnnotations.SortedPairs }}
|
||||
|
||||
Note that `.CommonAnnotations` and `.CommonLabels` are part of [notification data](ref:reference-notification-data).
|
||||
|
||||
Execute the template by passing the dot (`.`) as argument:
|
||||
|
||||
```go
|
||||
{{ template "custom.common_labels_and_annotations" . }}
|
||||
```
|
||||
|
||||
```template_output
|
||||
1 resolved alert(s)
|
||||
1 firing alert(s)
|
||||
@@ -257,6 +277,12 @@ In this example:
|
||||
- The `custom.alert_labels_and_annotations` template iterates over the list of resolved and firing alerts, similar to previous examples. It then executes `alert.labels_and_annotations` for each alert.
|
||||
- The `alert.labels_and_annotations` template prints all the alert labels and annotations by accessing `.Labels.SortedPairs` and `.Annotations.SortedPairs`.
|
||||
|
||||
Run the template by passing the dot (`.`):
|
||||
|
||||
```go
|
||||
{{ template "custom.alert_labels_and_annotations" . }}
|
||||
```
|
||||
|
||||
```template_output
|
||||
1 resolved alert(s)
|
||||
|
||||
@@ -307,7 +333,11 @@ Note that the following example works only for Grafana-managed alerts. It displa
|
||||
{{ end -}}
|
||||
```
|
||||
|
||||
The output of this template looks like this:
|
||||
Pass the dot (`.`) to execute the template:
|
||||
|
||||
```go
|
||||
{{ template "custom.alert_additional_details" . }}
|
||||
```
|
||||
|
||||
```template_output
|
||||
1 resolved alert(s)
|
||||
@@ -339,6 +369,12 @@ Here’s a basic example that displays the number of firing and resolved alerts
|
||||
{{ end -}}
|
||||
```
|
||||
|
||||
Execute the template by passing the dot (`.`) as argument:
|
||||
|
||||
```go
|
||||
{{ template "custom_title" . }}
|
||||
```
|
||||
|
||||
```template_output
|
||||
🚨 1 firing alerts. ✅ 1 resolved alerts.
|
||||
```
|
||||
@@ -357,6 +393,12 @@ This is a more advanced example:
|
||||
- Outputs `.GroupLabels`, the labels used to [group multiple alerts in one notification](ref:group-alert-notifications).
|
||||
- Prints `CommonLabels`, excluding labels in `.GroupLabels`.
|
||||
|
||||
Execute the template by passing the dot (`.`):
|
||||
|
||||
```go
|
||||
{{ template "copy_of_default_title" . }}
|
||||
```
|
||||
|
||||
```template_output
|
||||
[FIRING:1, RESOLVED:1] api warning (sql_db)
|
||||
```
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
aliases:
|
||||
- ../manage-notifications/images-in-notifications/ # /docs/grafana/<GRAFANA_VERSION>/alerting/manage-notifications/images-in-notifications/
|
||||
- ../../manage-notifications/images-in-notifications/ # /docs/grafana/<GRAFANA_VERSION>/alerting/manage-notifications/images-in-notifications/
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/configure-notifications/template-notifications/images-in-notifications/
|
||||
description: Use images in notifications to help users better understand why alerts are firing or have been resolved
|
||||
keywords:
|
||||
|
||||
@@ -28,6 +28,11 @@ refs:
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/reference/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/reference/
|
||||
notification-template-examples:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/examples/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/examples/
|
||||
---
|
||||
|
||||
# Manage notification templates
|
||||
|
||||
@@ -86,6 +86,12 @@ Here's an example that prints all available notification data from dot (`.`):
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
You can execute this template by passing the dot (`.`):
|
||||
|
||||
```go
|
||||
{{ template "custom_template" . }}
|
||||
```
|
||||
|
||||
## Alert
|
||||
|
||||
`Alert` contains data for an individual alert:
|
||||
@@ -133,6 +139,12 @@ This example iterates over the list of firing and resolved alerts (`.Alerts`) in
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
You can run this template by passing the dot (`.`):
|
||||
|
||||
```go
|
||||
{{ template "custom_template" . }}
|
||||
```
|
||||
|
||||
## KV
|
||||
|
||||
`KV` is a set of key value pairs, where each key and value is a string.
|
||||
|
||||
@@ -44,35 +44,58 @@ There are three key components that help you understand how your alerts behave d
|
||||
|
||||
An alert instance can be in either of the following states:
|
||||
|
||||
| State | Description |
|
||||
| ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **Normal** | The state of an alert when the condition (threshold) is not met. |
|
||||
| **Pending** | The state of an alert that has breached the threshold but for less than the [pending period](ref:pending-period). |
|
||||
| **Alerting** | The state of an alert that has breached the threshold for longer than the [pending period](ref:pending-period). |
|
||||
| **NoData** | The state of an alert whose query returns no data or all values are null. You can [change the default behavior of the no data state](#modify-the-no-data-and-error-state). |
|
||||
| **Error** | The state of an alert when an error or timeout occurred evaluating the alert rule. You can [change the default behavior of the error state](#modify-the-no-data-and-error-state). |
|
||||
| State | Description |
|
||||
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **Normal** | The state of an alert when the condition (threshold) is not met. |
|
||||
| **Pending** | The state of an alert that has breached the threshold but for less than the [pending period](ref:pending-period). |
|
||||
| **Alerting** | The state of an alert that has breached the threshold for longer than the [pending period](ref:pending-period). |
|
||||
| **No Data<sup>\*</sup>** | The state of an alert whose query returns no data or all values are null. <br/> An alert in this state generates a new [DatasourceNoData alert](#no-data-and-error-alerts). You can [modify the default behavior of the no data state](#modify-the-no-data-or-error-state). |
|
||||
| **Error<sup>\*</sup>** | The state of an alert when an error or timeout occurred evaluating the alert rule. <br/> An alert in this state generates a new [DatasourceError alert](#no-data-and-error-alerts). You can [modify the default behavior of the error state](#modify-the-no-data-or-error-state). |
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
|
||||
`No Data` and `Error` states are supported only for Grafana-managed alert rules.
|
||||
|
||||
{{< /admonition >}}
|
||||
|
||||
{{< figure src="/media/docs/alerting/alert-instance-states-v3.png" caption="Alert instance state diagram" alt="A diagram of the distinct alert instance states and transitions." max-width="750px" >}}
|
||||
|
||||
### Notifications
|
||||
### Notification routing
|
||||
|
||||
Alert instances will be routed for [notifications](ref:notifications) when they are in the `Alerting` state or have been `Resolved`, transitioning from `Alerting` to `Normal` state.
|
||||
|
||||
{{< figure src="/media/docs/alerting/alert-rule-evaluation-overview-statediagram-v2.png" alt="A diagram of the alert instance states and when to route their notifications." max-width="750px" >}}
|
||||
|
||||
### `No Data` and `Error` alerts
|
||||
|
||||
When evaluation of an alert rule produces state `No Data` or `Error`, Grafana Alerting generates a new alert instance that have the following additional labels:
|
||||
|
||||
- `alertname`: Either `DatasourceNoData` or `DatasourceError` depending on the state.
|
||||
- `datasource_uid`: The UID of the data source that caused the state.
|
||||
|
||||
You can manage these alerts like regular ones by using their labels to apply actions such as adding a silence, routing via notification policies, and more.
|
||||
|
||||
### Lifecycle of stale alert instances
|
||||
|
||||
An alert instance is considered stale if its dimension or series has disappeared from the query results entirely for two evaluation intervals.
|
||||
|
||||
Stale alert instances that are in the **Alerting**, **NoData**, or **Error** states transition to the **Normal** state as **Resolved**. Once transitioned, these resolved alert instances are routed for notifications like other resolved alerts.
|
||||
Stale alert instances that are in the **Alerting**, **No Data**, or **Error** states transition to the **Normal** state as **Resolved**. Once transitioned, these resolved alert instances are routed for notifications like other resolved alerts.
|
||||
|
||||
### Modify the no data and error state
|
||||
## Modify the `No Data` or `Error` state
|
||||
|
||||
In [Configure no data and error handling](ref:no-data-and-error-handling), you can change the default behaviour when the evaluation returns no data or an error. You can set the alert instance state to `Alerting`, `Normal`, or keep the last state.
|
||||
|
||||
Note that `No Data` and `Error` states are supported only for Grafana-managed alert rules.
|
||||
|
||||
{{< figure src="/media/docs/alerting/alert-rule-configure-no-data-and-error.png" alt="A screenshot of the `Configure no data and error handling` option in Grafana Alerting." max-width="500px" >}}
|
||||
|
||||
To reduce the number of **No Data** or **Error** state alerts received, try the following.
|
||||
{{< docs/shared lookup="alerts/table-configure-no-data-and-error.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
Note that when you configure the **No Data** or **Error** behavior to `Alerting` or `Normal`, Grafana attempts to keep a stable set of fields under notification `Values`. If your query returns no data or an error, Grafana reuses the latest known set of fields in `Values`, but will use `-1` in place of the measured value.
|
||||
|
||||
### Reduce `No Data` or `Error` alerts
|
||||
|
||||
To minimize the number of **No Data** or **Error** state alerts received, try the following.
|
||||
|
||||
1. Use the **Keep last state** option. For more information, refer to the section below. This option allows the alert to retain its last known state when there is no data available, rather than switching to a **No Data** state.
|
||||
1. For **No Data** alerts, you can optimize your alert rule by expanding the time range of the query. However, if the time range is too big, it affects the performance of the query and can lead to errors due to timeout.
|
||||
@@ -81,38 +104,29 @@ To reduce the number of **No Data** or **Error** state alerts received, try the
|
||||
|
||||
1. Change the default [evaluation time out](https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#evaluation_timeout). The default is set at 30 seconds. To increase the default evaluation timeout, open a support ticket from the [Cloud Portal](https://grafana.com/docs/grafana-cloud/account-management/support/#grafana-cloud-support-options). Note that this should be a last resort, because it may affect the performance of all alert rules and cause missed evaluations if the timeout is too long.
|
||||
|
||||
#### Keep last state
|
||||
### Keep last state
|
||||
|
||||
The "Keep Last State" option helps mitigate temporary data source issues, preventing alerts from unintentionally firing, resolving, and re-firing.
|
||||
|
||||
However, in situations where strict monitoring is critical, relying solely on the "Keep Last State" option may not be appropriate. Instead, consider using an alternative or implementing additional alert rules to ensure that issues with prolonged data source disruptions are detected.
|
||||
|
||||
### `grafana_state_reason` annotation
|
||||
## `grafana_state_reason` for troubleshooting
|
||||
|
||||
Occasionally, an alert instance may be in a state that isn't immediately clear to everyone. For example:
|
||||
|
||||
- Stale alert instances in the `Alerting` state transition to the `Normal` state when the series disappear.
|
||||
- If "no data" handling is configured to transition to a state other than `NoData`.
|
||||
- If "no data" handling is configured to transition to a state other than `No Data`.
|
||||
- If "error" handling is configured to transition to a state other than `Error`.
|
||||
- If the alert rule is deleted, paused, or updated in some cases, the alert instance also transitions to the `Normal` state.
|
||||
|
||||
In these situations, the evaluation state may differ from the alert state, and it might be necessary to understand the reason for being in that state when receiving the notification.
|
||||
|
||||
The `grafana_state_reason` annotation is included in these situations, providing the reason in the notifications that explain why the alert instance transitioned to its current state. For example:
|
||||
The `grafana_state_reason` annotation is included in these situations, providing the reason that explains why the alert instance transitioned to its current state. For example:
|
||||
|
||||
- Stale alert instances in the `Normal` state include the `grafana_state_reason` annotation with the value **MissingSeries**.
|
||||
- If "no data" or "error" handling transitions to the `Normal` state, the `grafana_state_reason` annotation is included with the value **NoData** or **Error**, respectively.
|
||||
- If "no data" or "error" handling transitions to the `Normal` state, the `grafana_state_reason` annotation is included with the value **No Data** or **Error**, respectively.
|
||||
- If the alert rule is deleted or paused, the `grafana_state_reason` is set to **Paused** or **RuleDeleted**. For some updates, it is set to **Updated**.
|
||||
|
||||
### Special alerts for `NoData` and `Error`
|
||||
|
||||
When evaluation of an alert rule produces state `NoData` or `Error`, Grafana Alerting generates a new alert instance that have the following additional labels:
|
||||
|
||||
- `alertname`: Either `DatasourceNoData` or `DatasourceError` depending on the state.
|
||||
- `datasource_uid`: The UID of the data source that caused the state.
|
||||
|
||||
You can manage these alerts like regular ones by using their labels to apply actions such as adding a silence, routing via notification policies, and more.
|
||||
|
||||
## Alert rule state
|
||||
|
||||
The alert rule state is determined by the “worst case” state of the alert instances produced. For example, if one alert instance is `Alerting`, the alert rule state is firing.
|
||||
@@ -133,5 +147,5 @@ An alert rule can have one of the following health statuses:
|
||||
| ---------------------- | -------------------------------------------------------------------------------------------------------- |
|
||||
| **Ok** | No error when evaluating an alerting rule. |
|
||||
| **Error** | An error occurred when evaluating an alerting rule. |
|
||||
| **NoData** | The absence of data in at least one time series returned during a rule evaluation. |
|
||||
| **No Data** | The absence of data in at least one time series returned during a rule evaluation. |
|
||||
| **{status}, KeepLast** | The rule would have received another status but was configured to keep the last state of the alert rule. |
|
||||
|
||||
@@ -18,6 +18,11 @@ labels:
|
||||
title: Alert rules
|
||||
weight: 100
|
||||
refs:
|
||||
shared-configure-prometheus-data-source-alerting:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/datasources/prometheus/configure-prometheus-data-source/#alerting
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/connect-externally-hosted/data-sources/prometheus/configure-prometheus-data-source/#alerting
|
||||
queries-and-conditions:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/queries-conditions/
|
||||
@@ -72,8 +77,9 @@ Grafana-managed alert rules are the most flexible alert rule type. They allow yo
|
||||
|
||||
{{< figure src="/media/docs/alerting/grafana-managed-alerting-architecture.png" max-width="750px" caption="How Grafana-managed alerting works by default" >}}
|
||||
|
||||
1. Alert rules are created within Grafana and query one or more data sources.
|
||||
1. Alert rules are evaluated by the Alert Rule Evaluation Engine from within Grafana.
|
||||
1. Alert rules are created and stored within Grafana.
|
||||
1. Alert rules can query one or more supported data sources.
|
||||
1. Alert rules are evaluated by the Alert Rule Evaluation Engine within Grafana.
|
||||
1. Firing and resolved alert instances are forwarded to [handle their notifications](ref:notifications).
|
||||
|
||||
### Supported data sources
|
||||
@@ -84,36 +90,38 @@ Find the public data sources supporting Alerting in the [Grafana Plugins directo
|
||||
|
||||
## Data source-managed alert rules
|
||||
|
||||
Data source-managed alert rules can query Prometheus-based data sources, such as Grafana Mimir or Grafana Loki. Alert rules are stored within the data source when the Ruler API is enabled (e.g., [Mimir Ruler API](/docs/mimir/<GRAFANA_VERSION>/references/http-api/#ruler) or [Loki Ruler API](/docs/loki/<GRAFANA_VERSION>/api/#ruler)).
|
||||
|
||||
In this setup, the distributed architecture can provide high-availability and fault tolerance.
|
||||
Data source-managed alert rules can only be created using Grafana Mimir or Grafana Loki data sources. Both data source backends can provide high availability and fault tolerance, enabling you to scale your alerting setup.
|
||||
|
||||
{{< figure src="/media/docs/alerting/mimir-managed-alerting-architecture-v2.png" max-width="750px" caption="Mimir-managed alerting architecture" >}}
|
||||
|
||||
1. Alert rules are created and stored within the data source itself.
|
||||
1. Alert rules can only query Prometheus-based data.
|
||||
1. Alert rules are evaluated by the Alert Rule Evaluation Engine.
|
||||
1. Alert rules are stored within the Mimir or Loki data source.
|
||||
1. Alert rules can query only their specific data source.
|
||||
1. Alert rules are evaluated by the Alert Rule Evaluation Engine within the data source.
|
||||
1. Firing and resolved alert instances are forwarded to [handle their notifications](ref:notifications).
|
||||
|
||||
## Recording rules
|
||||
|
||||
A recording rule pre-compute frequently used or computationally expensive queries, and saves the results as a new time series metric.
|
||||
|
||||
The new metric can then be used in alert rules and dashboards to optimize their queries.
|
||||
|
||||
Similar to alert rules, recording rules are evaluated periodically. For more details, refer to [Create recording rules](ref:create-recording-rules).
|
||||
{{< docs/shared lookup="alerts/note-prometheus-ds-rules.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
## Comparison between alert rule types
|
||||
|
||||
When choosing which alert rule type to use, consider the following comparison between Grafana-managed and data source-managed alert rules.
|
||||
We recommend using Grafana-managed alert rules whenever possible, and opting for data source-managed alert rules when you need to scale your alerting setup.
|
||||
|
||||
| <div style="width:200px">Feature</div> | <div style="width:200px">Grafana-managed alert rule</div> | <div style="width:200px">Data source-managed alert rule |
|
||||
| ----------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Create alert rules<wbr /> that query [data sources supporting Alerting](#supported-data-sources) | Yes | No. Only query Prometheus-based data sources. |
|
||||
| Mix and match data sources | Yes | No |
|
||||
| Add [expressions](ref:expression-queries) to transform<wbr /> your data and set [alert conditions](ref:alert-condition) | Yes | No |
|
||||
| Use [images in alert notifications](ref:notification-images) | Yes | No |
|
||||
| Support for [recording rules](#recording-rules) | Yes | Yes |
|
||||
| Organization | Organize and manage access with folders | Use namespaces |
|
||||
| Scaling | More resource intensive, depend on the database, and are likely to suffer from transient errors. They only scale vertically. | Store alert rules within the data source itself and allow for “infinite” scaling. Generate and send alert notifications from the location of your data. |
|
||||
| Alert rule evaluation and delivery | Alert rule evaluation and delivery is done from within Grafana, using an external Alertmanager; or both. | Alert rule evaluation and alert delivery is distributed, meaning there is no single point of failure. |
|
||||
The table below compares Grafana-managed and data source-managed alert rules.
|
||||
|
||||
| <div style="width:200px">Feature</div> | <div style="width:200px">Grafana-managed alert rule</div> | <div style="width:200px">Data source-managed alert rule |
|
||||
| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
|
||||
| Create alert rules<wbr /> that query [data sources supporting Alerting](#supported-data-sources) | Yes | Only supports creating rules for Mimir and Loki. |
|
||||
| Mix and match data sources | Yes | No |
|
||||
| Add [expressions](ref:expression-queries) to transform<wbr /> your data and set [alert conditions](ref:alert-condition) | Yes | No |
|
||||
| Use [images in alert notifications](ref:notification-images) | Yes | No |
|
||||
| Support for [recording rules](#recording-rules) | Yes | Yes |
|
||||
| Organization | Organize and manage access with folders | Use namespaces |
|
||||
| Alert rule evaluation and delivery | Alert evaluation is done in Grafana, while delivery can be handled by Grafana or an external Alertmanager. | Alert rule evaluation and alert delivery are distributed. |
|
||||
| Scaling | Alert rules are stored in the Grafana database, which may experience transient errors. It only scales vertically. | Alert rules are stored within the data source and allow for horizontal scaling. |
|
||||
|
||||
## Recording rules
|
||||
|
||||
Similar to alert rules, recording rules are evaluated periodically. A recording rule pre-computes frequently used or computationally expensive queries, and saves the results as a new time series metric.
|
||||
|
||||
The new recording metric can then be used in alert rules and dashboards to optimize their queries.
|
||||
|
||||
For more details, refer to [Create recording rules](ref:create-recording-rules).
|
||||
|
||||
@@ -134,6 +134,4 @@ Grafana Alerting is based on the Prometheus model for designing alerting systems
|
||||
|
||||
{{< figure src="/media/docs/alerting/alerting-alertmanager-architecture.png" max-width="750px" alt="A diagram with the alert generator and alert manager architecture" >}}
|
||||
|
||||
Grafana uses a custom Alertmanager to manage and deliver alert notifications, as detailed in this guide. This custom Alertmanager extends the capabilities of the [Prometheus Alertmanager](https://prometheus.io/docs/alerting/latest/alertmanager/).
|
||||
|
||||
If you already run a Prometheus Alertmanager instance, you can configure Grafana Alerting to forward alerts to your [external Alertmanager for handling notifications](ref:configure-alertmanager).
|
||||
Grafana provides a custom Alertmanager, extending the Prometheus Alertmanager, to manage and deliver alert notifications. If you run a Prometheus or Mimir Alertmanager, you can configure Grafana Alerting to manage them and handle notifications for Grafana-managed alerts. For details, refer to [configure Alertmanagers](ref:configure-alertmanager).
|
||||
|
||||
@@ -21,19 +21,48 @@ labels:
|
||||
title: Contact points
|
||||
weight: 112
|
||||
refs:
|
||||
contact-point-integrations:
|
||||
configure-contact-points:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/manage-contact-points#list-of-supported-integrations
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/manage-contact-points
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/manage-contact-points#list-of-supported-integrations
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/manage-contact-points
|
||||
---
|
||||
|
||||
# Contact points
|
||||
|
||||
Contact points contain the configuration for sending alert notifications. You can assign a contact point either in the alert rule or notification policy options.
|
||||
|
||||
A contact point is a [list of integrations](ref:contact-point-integrations), each of which sends a notification to a particular email, webhook, or service such as Slack, Pagerduty, or Grafana OnCall. Each contact point also defines the notification message to be sent, which can use the predefined message, a custom message, or notification templates.
|
||||
A contact point includes one or more contact point integrations for sending alert notifications, such as:
|
||||
|
||||
Contact points can have multiple integrations of the same kind, or a combination of integrations of different kinds. For example, a contact point could contain a Pagerduty integration; an email and Slack integration; or a Pagerduty integration, a Slack integration, and two email integrations.
|
||||
{{< column-list >}}
|
||||
|
||||
You can also configure a contact point with no integrations; in which case no notifications are sent.
|
||||
- Alertmanager
|
||||
- Amazon SNS
|
||||
- Cisco Webex Teams
|
||||
- DingDing
|
||||
- Discord
|
||||
- Email
|
||||
- Google Chat
|
||||
- Grafana Oncall
|
||||
- Kafka REST Proxy
|
||||
- Line
|
||||
- Microsoft Teams
|
||||
- MQTT
|
||||
- Opsgenie
|
||||
- Pagerduty
|
||||
- Pushover
|
||||
- Sensu Go
|
||||
- Slack
|
||||
- Telegram
|
||||
- Threema Gateway
|
||||
- VictorOps
|
||||
- Webhook
|
||||
- WeCom
|
||||
|
||||
{{< /column-list >}}
|
||||
|
||||
For example, a contact point could contain a Pagerduty integration; an email and Slack integration; or a Pagerduty integration, a Slack integration, and two email integrations. You can also configure a contact point with no integrations; in which case no notifications are sent.
|
||||
|
||||
Each contact point integration can also define the notification message to be sent, which can use the predefined message, a custom message, or notification templates.
|
||||
|
||||
For a complete list of supported integrations and more details about contact points, refer to [Configure contact points](ref:configure-contact-points).
|
||||
|
||||
@@ -35,6 +35,10 @@ refs:
|
||||
|
||||
Grouping in Grafana Alerting allows you to batch relevant alerts together into a smaller number of notifications. This is particularly important if notifications are delivered to first-responders, such as engineers on-call, where receiving lots of notifications in a short period of time can be overwhelming. In some cases, it can negatively impact a first-responders ability to respond to an incident. For example, consider a large outage where many of your systems are down. In this case, grouping can be the difference between receiving 1 phone call and 100 phone calls.
|
||||
|
||||
{{< admonition type="tip" >}}
|
||||
For a practical example of grouping, refer to our [Getting Started with Grouping tutorial](https://grafana.com/tutorials/alerting-get-started-pt3/).
|
||||
{{< /admonition >}}
|
||||
|
||||
## Group notifications
|
||||
|
||||
Grouping combines similar alert instances within a specific period into a single notification, reducing alert noise.
|
||||
|
||||
@@ -18,6 +18,21 @@ labels:
|
||||
title: Notification policies
|
||||
weight: 113
|
||||
refs:
|
||||
shared-alert-labels:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/annotation-label/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/annotation-label/
|
||||
shared-notification-policies:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/notifications/notification-policies/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/notifications/notification-policies/
|
||||
shared-silences:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/create-silence/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/create-silence/
|
||||
contact-points:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/notifications/contact-points/
|
||||
@@ -60,6 +75,10 @@ Each policy consists of a set of label matchers (0 or more) that specify which a
|
||||
|
||||
{{< figure src="/media/docs/alerting/notification-routing.png" max-width="750px" caption="Matching alert instances with notification policies" alt="Example of a notification policy tree" >}}
|
||||
|
||||
{{< admonition type="tip" >}}
|
||||
For a practical example of routing with notification policies, refer to our [Getting Started with Alert Instances and Notification Routing tutorial](https://grafana.com/tutorials/alerting-get-started-pt4/).
|
||||
{{< /admonition >}}
|
||||
|
||||
## Routing
|
||||
|
||||
To determine which notification policies handle an alert instance, the system looks for matching policies starting from the top of the tree—beginning with the default notification policy.
|
||||
|
||||
@@ -69,6 +69,10 @@ In Grafana, you have various options to template your alert notification message
|
||||
- Template notifications when you want to customize the appearance and information of your notifications.
|
||||
- Avoid using notification templates to add extra information to alert instances—use annotations instead.
|
||||
|
||||
{{< admonition type="tip" >}}
|
||||
For a practical example of templating, refer to our [Getting Started with Templating tutorial](https://grafana.com/tutorials/alerting-get-started-pt4/).
|
||||
{{< /admonition >}}
|
||||
|
||||
This diagram illustrates the entire templating process, from querying labels and templating the alert summary and notification to the final alert notification message.
|
||||
|
||||
{{< figure src="/media/docs/alerting/how-notification-templates-works.png" max-width="1200px" caption="How templating works" >}}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
---
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/manage-notifications/
|
||||
description: Detect and respond for day-to-day triage and analysis of what’s going on and action you need to take
|
||||
keywords:
|
||||
- grafana
|
||||
- detect
|
||||
- respond
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
menuTitle: Monitor status
|
||||
title: Monitor status
|
||||
weight: 130
|
||||
---
|
||||
|
||||
# Monitor status
|
||||
|
||||
Use Grafana Alerting to track and generate alerts and send notifications, providing an efficient way for engineers to monitor, respond, and triage issues within their services.
|
||||
|
||||
Alerts and alert notifications provide a lot of value as key indicators to issues during the triage process, providing engineers with the information they need to understand what is going on in their system or service.
|
||||
@@ -1,56 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- ../../alerting/alerting-rules/declare-incident-from-alert/ # /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/declare-incident-from-alert/
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/manage-notifications/declare-incident-from-alert/
|
||||
description: Declare an incident from a firing alert
|
||||
keywords:
|
||||
- grafana
|
||||
- alert rules
|
||||
- incident
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: Declare incidents from firing alerts
|
||||
weight: 1010
|
||||
---
|
||||
|
||||
# Declare incidents from firing alerts
|
||||
|
||||
Declare an incident from a firing alert to streamline your alert to incident workflow.
|
||||
|
||||
## Before you begin
|
||||
|
||||
- Ensure you have Grafana Incident installed
|
||||
- You must have a firing alert
|
||||
|
||||
## Procedure
|
||||
|
||||
To declare an incident from a firing alert, complete the following steps.
|
||||
|
||||
1. Navigate to Alerts & Incidents -> Alerting -> Alert rules.
|
||||
2. From the Alert rules list view, click the firing alert that you want to declare an incident for.
|
||||
|
||||
**Note:**
|
||||
|
||||
You can also access **Declare Incident** from the alert details page.
|
||||
|
||||
3. Click **Declare Incident**.
|
||||
The **Declare Incident** pop-up opens in the Grafana Incident application.
|
||||
4. In the **Declare Incident** pop-up, enter what's going on.
|
||||
|
||||
**Note**: This field is pre-filled with the name of the alert rule, but you can edit it as required.
|
||||
|
||||
The alert rule is also linked to the incident.
|
||||
|
||||
5. Select a severity.
|
||||
6. Add labels, as required.
|
||||
7. Click **More options** to include a channel prefix and status.
|
||||
8. Click **Declare Incident**.
|
||||
|
||||
## Next steps
|
||||
|
||||
View and track the incident in the Grafana Incident application.
|
||||
|
||||
For more information, refer to [Grafana Incident documentation](/docs/grafana-cloud/incident/configure-settings/).
|
||||
@@ -1,67 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- ../../alerting/unified-alerting/alerting-rules/rule-list/ # /docs/grafana/<GRAFANA_VERSION>/alerting/unified-alerting/alerting-rules/rule-list
|
||||
- ../../alerting/alerting-rules/view-alert-rules/ # /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/view-alert-rules
|
||||
- ../../alerting/alerting-rules/rule-list/ # /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/rule-list
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/manage-notifications/view-alert-rules/
|
||||
description: View alert rules
|
||||
keywords:
|
||||
- grafana
|
||||
- alerting
|
||||
- guide
|
||||
- rules
|
||||
- view
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: View alert rules
|
||||
weight: 410
|
||||
---
|
||||
|
||||
# View alert rules
|
||||
|
||||
The Alert rules list view page lists all existing alert rules. By default, alert rules are grouped by alert rule type: Grafana-managed (Grafana) or data source-managed (Mimir/Cortex/Loki). The Grafana section also contains alert rules for Prometheus-compatible data sources. You can view alert rules for Prometheus compatible data sources, but you cannot edit them.
|
||||
|
||||
When managing large volumes of alerts, you can use extended alert rule search capabilities to filter on folders, evaluation groups, and rules. Additionally, you can filter alert rules by their properties like labels, state, type, and health.
|
||||
|
||||
From the Alert rule list page, you can duplicate alert rules, silence notifications and pause or resume evaluation. If you pause evaluation, the alert rule state shows as **Paused**.
|
||||
|
||||
### Grouped view
|
||||
|
||||
Grouped view shows Grafana alert rules grouped by folder and Loki or Prometheus alert rules grouped by `namespace` + `group`. This is the default rule list view, intended for managing alert rules. You can expand each group to view a list of rules in this group.
|
||||
|
||||
### State view
|
||||
|
||||
State view shows alert rules grouped by state. Use this view to get an overview of which rules are in which state. You can expand each group to view more details.
|
||||
|
||||
## View alert rule details
|
||||
|
||||
To view alert rule details, complete the following steps.
|
||||
|
||||
1. Click **Alerts & IRM** -> **Alert rules**.
|
||||
1. Click to expand an alert rule.
|
||||
1. In **Actions**, click **View** (the eye icon).
|
||||
|
||||
The namespace and group are shown in the breadcrumb navigation. They are interactive and can be used to filter rules by namespace or group.
|
||||
|
||||
The rest of the alert detail content is split up into tabs:
|
||||
|
||||
**Query and conditions**
|
||||
|
||||
View the details of the query that is used for the alert rule, including the expressions and intermediate values for each step of the expression pipeline. A graph view is included for range queries and data sources that return time series-like data frames.
|
||||
|
||||
**Instances**
|
||||
|
||||
Explore each alert instance, its status, labels and various other metadata for multi-dimensional alert rules.
|
||||
|
||||
Use **Search by label** to enter search criteria using label selectors. For example, `environment=production,region=~US|EU,severity!=warning`.
|
||||
|
||||
**History**
|
||||
|
||||
Explore the recorded history for an alert rule. You can also filter by alert state.
|
||||
|
||||
**Details**
|
||||
|
||||
Debug or audit using the alert rule metadata and view the alert rule annotations.
|
||||
@@ -1,54 +0,0 @@
|
||||
---
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/manage-notifications/view-alert-state-on-panels/
|
||||
description: View alert rules
|
||||
keywords:
|
||||
- grafana
|
||||
- alerting
|
||||
- guide
|
||||
- rules
|
||||
- view
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: View alert state on panels
|
||||
weight: 430
|
||||
refs:
|
||||
time-series-visualizations:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/visualizations/time-series/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/panels-visualizations/visualizations/time-series/
|
||||
alert-list-panel:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/visualizations/alert-list/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/panels-visualizations/visualizations/alert-list/
|
||||
link-alert-rules-to-panels:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/link-alert-rules-to-panels/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/link-alert-rules-to-panels/
|
||||
---
|
||||
|
||||
# View alert state on panels
|
||||
|
||||
When an [alert rule is linked to a time series panel](ref:link-alert-rules-to-panels), the time series panel displays the alert state and alert events.
|
||||
|
||||
A heart icon near the panel title shows the current alert state:
|
||||
|
||||
- A broken red heart when the alert is in `Alerting` state.
|
||||
- A green heart when the alert is in `Normal` state.
|
||||
|
||||
Colored annotations indicate changes in alert state, such as pending, alerting, and resolving.
|
||||
|
||||
{{< figure src="/media/docs/alerting/panel-displays-alert-state.png" max-width="1200px" alt="A panel with a firing alert and annotations that display the pending and alerting state changes." >}}
|
||||
|
||||
Additionally, Grafana provides an [alert list panel](ref:alert-list-panel) that you can add to a dashboard to display a list of alerts and their states.
|
||||
|
||||
{{< figure src="/static/img/docs/alert-list-panel/alert-list-panel.png" max-width="850px" alt="Two alert list panels displaying distinct lists of alerts." >}}
|
||||
|
||||
You can configure the alert list panel with various visualization options and filters to control how alerts are displayed. For more details, refer to the [Alert list documentation](ref:alert-list-panel).
|
||||
|
||||
{{< docs/play title="this demo dashboard with alert list panels and linked alert rules" url="https://play.grafana.org/d/000000074/" >}}
|
||||
42
docs/sources/alerting/monitor-status/_index.md
Normal file
42
docs/sources/alerting/monitor-status/_index.md
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
aliases:
|
||||
- ./manage-notifications/ # /docs/grafana/<GRAFANA_VERSION>/alerting/manage-notifications/
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/monitor-status/
|
||||
description: Detect and respond for day-to-day triage and analysis of what’s going on and action you need to take
|
||||
keywords:
|
||||
- grafana
|
||||
- detect
|
||||
- respond
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: Monitor alerts
|
||||
weight: 130
|
||||
refs:
|
||||
configure-alert-rules:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/
|
||||
configure-notifications:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/
|
||||
---
|
||||
|
||||
# Monitor alerts
|
||||
|
||||
Alerts and alert notifications should provide key information to help alert responders and incident participants understand what happened in their system and how to respond.
|
||||
|
||||
Grafana Alerting offers the ability to monitor your alerts and manage your alerting setup. You can get an overview of your alerts, track the history of alert states, and monitor notification statuses. These can help you start investigating alert issues within Grafana and improve the reliability of your alerting implementation.
|
||||
|
||||
{{< figure src="/media/docs/alerting/alert-history-page.png" max-width="750px" alt="History page in Grafana Alerting" >}}
|
||||
|
||||
The previous sections explain how to [configure alert rules](ref:configure-alert-rules) and [configure notifications](ref:configure-notifications) to generate alerts and send their notifications.
|
||||
|
||||
This section focuses on finding and understanding the state of your alert rules, alert instances, and their notifications. For more details, refer to:
|
||||
|
||||
{{< section >}}
|
||||
@@ -0,0 +1,57 @@
|
||||
---
|
||||
aliases:
|
||||
- ../../alerting/alerting-rules/declare-incident-from-alert/ # /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/declare-incident-from-alert/
|
||||
- ../../alerting/manage-notifications/declare-incident-from-alert/ # /docs/grafana/<GRAFANA_VERSION>/alerting/manage-notifications/declare-incident-from-alert/
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/monitor-status/declare-incident-from-alert/
|
||||
description: Declare an incident from a firing alert
|
||||
keywords:
|
||||
- grafana
|
||||
- alert rules
|
||||
- incident
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
title: Declare incidents from firing alerts
|
||||
weight: 1010
|
||||
---
|
||||
|
||||
# Declare incidents from firing alerts
|
||||
|
||||
Declare an incident from a firing alert to streamline your alert to incident workflow.
|
||||
|
||||
## Before you begin
|
||||
|
||||
- Ensure you have [Grafana Incident](/docs/grafana-cloud/incident/) installed.
|
||||
- You must have a firing alert.
|
||||
|
||||
## Procedure
|
||||
|
||||
To declare an incident from a firing alert, complete the following steps.
|
||||
|
||||
1. Navigate to **Alerts & IRM** -> **Alerting** -> **Alert rules**.
|
||||
1. From the Alert rules page, find the firing alert that you want to declare an incident for.
|
||||
1. Click **More** -> **Declare Incident**.
|
||||
|
||||
Alternatively, you can declare an incident from the Alert details page.
|
||||
|
||||
The **Declare Incident** pop-up opens in the Grafana Incident application.
|
||||
|
||||
1. In the **Declare Incident** pop-up, enter the **What's going on?** field.
|
||||
|
||||
This field is pre-filled with the name of the alert rule, but you can edit it as required.
|
||||
|
||||
The alert rule is also linked to the incident.
|
||||
|
||||
1. Select a severity.
|
||||
1. Add labels, as required.
|
||||
1. Click **More options** to include a channel prefix and status.
|
||||
1. Click **Automated options** to enable automated actions configured by admins.
|
||||
1. Click **Declare Incident**.
|
||||
|
||||
## Next steps
|
||||
|
||||
View and manage the incident in the **Grafana Incident** application.
|
||||
|
||||
{{< figure src="/media/docs/alerting/incident-response-management-timeline-ui.png" max-width="750px" alt="Incident timeline view in Grafana Incident" >}}
|
||||
|
||||
For more information, refer to the [Grafana Incident documentation](/docs/grafana-cloud/incident/configure-settings/).
|
||||
@@ -5,8 +5,9 @@ aliases:
|
||||
- ../../alerting/alert-groups/view-alert-grouping/ # /docs/grafana/<GRAFANA_VERSION>/alerting/alert-groups/view-alert-grouping/
|
||||
- ../../alerting/unified-alerting/alert-groups/ # /docs/grafana/<GRAFANA_VERSION>/alerting/unified-alerting/alert-groups/
|
||||
- ../../alerting/manage-notifications/view-notification-errors/ # /docs/grafana/<GRAFANA_VERSION>/alerting/manage-notifications/view-notification-errors/
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/manage-notifications/view-alert-groups/
|
||||
description: The Groups view lists grouped alerts that are actively triggering notifications.
|
||||
- ../../alerting/manage-notifications/view-alert-groups/ # /docs/grafana/<GRAFANA_VERSION>/alerting/manage-notifications/view-alert-groups/
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/monitor-status/view-active-notifications/
|
||||
description: The Active notifications view lists grouped alerts that are actively triggering notifications.
|
||||
keywords:
|
||||
- grafana
|
||||
- alerting
|
||||
@@ -19,7 +20,7 @@ labels:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: View the status of notifications
|
||||
title: View active notifications
|
||||
weight: 800
|
||||
refs:
|
||||
alertmanager:
|
||||
@@ -34,20 +35,27 @@ refs:
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/notifications/group-alert-notifications/
|
||||
---
|
||||
|
||||
# View the status of notifications
|
||||
# View active notifications
|
||||
|
||||
The Groups view page lists grouped alerts that are actively triggering notifications.
|
||||
The Active notifications page lists groups of alerts (or alert instances) that are actively triggering notifications.
|
||||
|
||||
By default, Grafana Alerting groups similar firing alerts (or alert instances) to prevent notification overload. For details on how notification grouping works, refer to [Group alert notifications](ref:grouping).
|
||||
By default, Grafana Alerting [groups similar alerts into a single notification](ref:grouping).
|
||||
|
||||
In the Groups view, you can see alert groups, check the state of their notifications, and also filter for alert instances that match specific criteria. This view is useful for debugging and verifying your grouping settings of notification policies.
|
||||
In this view, you can:
|
||||
|
||||
- Find alert groups and the state of their notifications.
|
||||
- Filter for alert instances that match specific criteria.
|
||||
|
||||
The Active notifications view is useful for debugging and verifying how notifications are grouped based on your notification policy settings.
|
||||
|
||||
## View alert groups and notification state
|
||||
|
||||
To view alert groups, complete the following steps.
|
||||
|
||||
1. Click **Alerts & IRM** -> **Alerting**.
|
||||
1. Click **Groups** to view the list of groups firing notifications.
|
||||
1. Click **Active notifications** to view the list of groups firing notifications.
|
||||
|
||||
{{< figure src="/media/docs/alerting/active-notifications-view2.png" max-width="750px" alt="Active notifications view in Grafana Alerting" >}}
|
||||
|
||||
By default, alert groups are grouped by the notification policies grouping.
|
||||
|
||||
58
docs/sources/alerting/monitor-status/view-alert-rules.md
Normal file
58
docs/sources/alerting/monitor-status/view-alert-rules.md
Normal file
@@ -0,0 +1,58 @@
|
||||
---
|
||||
aliases:
|
||||
- ../../alerting/unified-alerting/alerting-rules/rule-list/ # /docs/grafana/<GRAFANA_VERSION>/alerting/unified-alerting/alerting-rules/rule-list
|
||||
- ../../alerting/alerting-rules/view-alert-rules/ # /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/view-alert-rules
|
||||
- ../../alerting/alerting-rules/rule-list/ # /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/rule-list
|
||||
- ../../alerting/manage-notifications/view-alert-rules/ # /docs/grafana/<GRAFANA_VERSION>/alerting/manage-notifications/view-alert-rules/
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/monitor-status/view-alert-rules/
|
||||
description: View alert rules
|
||||
keywords:
|
||||
- grafana
|
||||
- alerting
|
||||
- guide
|
||||
- rules
|
||||
- view
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: View alert rules
|
||||
weight: 410
|
||||
refs:
|
||||
view-alert-state:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/monitor-status/view-alert-state/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/monitor-status/view-alert-state/
|
||||
---
|
||||
|
||||
# View alert rules
|
||||
|
||||
The Alert rules list view page lists all existing recording and alert rules, including those created in Grafana and those available in configured data sources.
|
||||
|
||||
To access the Alert rules page, click **Alerts & IRM** -> **Alerting** -> **Alert rules**.
|
||||
|
||||
{{< figure src="/media/docs/alerting/alert-rules-page.png" max-width="750px" alt="Alert rule view page in Grafana Alerting" >}}
|
||||
|
||||
By default, alert rules are grouped by alert rule type: Grafana-managed or data source-managed.
|
||||
|
||||
In this view, you can find and edit rules created in Grafana. However, rules created in Prometheus-compatible data sources are displayed but cannot be edited.
|
||||
|
||||
This view includes filters to simplify managing large volumes of alerts.
|
||||
|
||||
You can filter by data sources, dashboards, and alert rule properties such as state, type, health, and contact points. The **Search** input allows you to filter by additional parameters like folders, evaluation groups, labels, and more.
|
||||
|
||||
You can also change how the rule list is displayed using the **View as** option.
|
||||
|
||||
- **Grouped**: Displays Grafana rules grouped by folder and evaluation group, and data-source rules by namespace and evaluation group. This is the default view.
|
||||
|
||||
- **List**: Displays Grafana rules grouped only by folder.
|
||||
|
||||
- **State**: Displays rules grouped by state, providing an overview for each state.
|
||||
|
||||
Select a group to expand it and view the list of alert rules within that group.
|
||||
|
||||
{{< figure src="/media/docs/alerting/view-alert-rule-list-with-actions.png" max-width="750px" alt="View alert rule state and alert rule health in Grafana Alerting" >}}
|
||||
|
||||
For details on how rule states and alert instance states are displayed, refer to [View alert state](ref:view-alert-state).
|
||||
@@ -1,60 +1,29 @@
|
||||
---
|
||||
aliases:
|
||||
- ../../alerting/alerting-rules/view-state-health/ # /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/view-state-health
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/manage-notifications/view-state-health/
|
||||
description: View the state and health of alert rules
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/monitor-status/view-alert-state-history/
|
||||
description: View alert rules
|
||||
keywords:
|
||||
- grafana
|
||||
- alert rules
|
||||
- keep last state
|
||||
- alerting
|
||||
- guide
|
||||
- state
|
||||
- health
|
||||
- rules
|
||||
- view
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: View alert state and history
|
||||
weight: 420
|
||||
refs:
|
||||
alert-rule-state:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rule-evaluation/state-and-health/#alert-rule-state
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rule-evaluation/state-and-health/#alert-rule-state
|
||||
alert-rule-evaluation:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rule-evaluation/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rule-evaluation/
|
||||
alert-instance-state:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rule-evaluation/state-and-health/#alert-instance-state
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rule-evaluation/state-and-health/#alert-instance-state
|
||||
title: View alert state history
|
||||
weight: 440
|
||||
---
|
||||
|
||||
# View alert state and history
|
||||
|
||||
An alert rule and its corresponding alert instances can transition through distinct states during their [evaluation](ref:alert-rule-evaluation). There are three key components that helps us understand the behavior of our alerts:
|
||||
|
||||
- [Alert Instance State](ref:alert-instance-state): Refers to the state of the individual alert instances.
|
||||
- [Alert Rule State](ref:alert-rule-state): Determined by the "worst state" among its alert instances.
|
||||
- [Alert Rule Health](ref:alert-rule-health): Indicates the status in cases of `Error` or `NoData` events.
|
||||
|
||||
To view the state and health of your alert rules:
|
||||
|
||||
1. In the left-side menu, click **Alerts & IRM** and then **Alerting**.
|
||||
1. Click **Alert rules** to view the list of existing alerts.
|
||||
1. Click an alert rule to view its state, health, and state history.
|
||||
|
||||
## View state history using the History page
|
||||
# View alert state history
|
||||
|
||||
View a history of all alert events generated by your Grafana-managed alert rules from one centralized page. This helps you see patterns in your alerts over time, observe trends, make predictions, and even debug alerts that might be firing too often.
|
||||
|
||||
An alert event is displayed each time an alert instance changes its state over a period of time. All alert events are displayed regardless of whether silences or mute timings are set, so you’ll see a complete set of your data history even if you’re not necessarily being notified.
|
||||
|
||||
## View from the History page
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
For Grafana Enterprise and OSS users:
|
||||
The feature is available starting with Grafana 11.2.
|
||||
@@ -65,22 +34,26 @@ Users can only see the history and transitions of alert rules they have access t
|
||||
|
||||
To access the History view, complete the following steps.
|
||||
|
||||
1. Navigate to **Alerts & IRM** -> **Alerting** -> History.
|
||||
1. Navigate to **Alerts & IRM** -> **Alerting** -> **History**.
|
||||
|
||||
{{< figure src="/media/docs/alerting/alert-history-page.png" max-width="750px" alt="History page in Grafana Alerting" >}}
|
||||
|
||||
An Alert Events chart shows your alert activity within a specific time frame. Each alert event represents an alert instance that changed its state at a particular point in time. The history of the data is displayed over a period of time.
|
||||
|
||||
1. Filter by labels either by entering a label or clicking a label of an instance in the list of events.
|
||||
1. Filter by current state and previous state by selecting a state from the drop-down or by clicking the states from the list of events.
|
||||
2. Filter by labels either by entering a label or clicking a label of an instance in the list of events.
|
||||
3. Filter by current state and previous state by selecting a state from the drop-down or by clicking the states from the list of events.
|
||||
Zoom in by dragging on the chart or use the time picker.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
If you exceed the 5000 alerts limit, you may see data missing from the chart. To see complete results, narrow the time frame.
|
||||
{{% /admonition %}}
|
||||
|
||||
1. Under the chart, there is a list of events. Each event represents a state change on an alert instance. Expand a row to see the number of transitions for the alert instance, a state graph, and the value in the transition.
|
||||
1. Click the alert rule name to jump to the History tab in the Alert Rule view.
|
||||
4. Under the chart, there is a list of events. Each event represents a state change on an alert instance. Expand a row to see the number of transitions for the alert instance, a state graph, and the value in the transition.
|
||||
5. Click the alert rule name to jump to the History tab in the Alert Rule view.
|
||||
|
||||
## View state history using the State history view
|
||||
{{< figure src="/media/docs/alerting/alerting-alert-history-tab.png" max-width="750px" alt="Alert History tab in Grafana Alerting" >}}
|
||||
|
||||
## View from the State history view
|
||||
|
||||
Use the State history view to get insight into how your individual alert instances behave over time.
|
||||
|
||||
@@ -96,7 +69,7 @@ To access the State history view, complete the following steps.
|
||||
1. Click an alert rule.
|
||||
1. Select **Show state history**.
|
||||
|
||||
The State history view opens.
|
||||
{{< figure src="/media/docs/alerting/alerting-state-history-view.png" max-width="750px" alt="State history view in Grafana Alerting" >}}
|
||||
|
||||
The timeline view at the top displays a timeline of changes for the past hour, so you can track how your alert instances are behaving over time.
|
||||
|
||||
138
docs/sources/alerting/monitor-status/view-alert-state.md
Normal file
138
docs/sources/alerting/monitor-status/view-alert-state.md
Normal file
@@ -0,0 +1,138 @@
|
||||
---
|
||||
aliases:
|
||||
- ../../alerting/alerting-rules/view-state-health/ # /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/view-state-health
|
||||
- ../../alerting/manage-notifications/view-state-health/ # /docs/grafana/<GRAFANA_VERSION>/alerting/manage-notifications/view-state-health/
|
||||
- ../../alerting/manage-notifications/view-alert-state-on-panels/ # /docs/grafana/<GRAFANA_VERSION>/alerting/manage-notifications/view-alert-state-on-panels/
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/monitor-status/view-alert-state/
|
||||
description: View the state and health of alert rules
|
||||
keywords:
|
||||
- grafana
|
||||
- alert rules
|
||||
- keep last state
|
||||
- guide
|
||||
- state
|
||||
- health
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: View alert state
|
||||
weight: 420
|
||||
refs:
|
||||
time-series-visualizations:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/visualizations/time-series/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/panels-visualizations/visualizations/time-series/
|
||||
alert-list-panel:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/visualizations/alert-list/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/panels-visualizations/visualizations/alert-list/
|
||||
link-alert-rules-to-panels:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/link-alert-rules-to-panels/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/link-alert-rules-to-panels/
|
||||
alert-rule-state:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rule-evaluation/state-and-health/#alert-rule-state
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rule-evaluation/state-and-health/#alert-rule-state
|
||||
alert-instance-state:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rule-evaluation/state-and-health/#alert-instance-state
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rule-evaluation/state-and-health/#alert-instance-state
|
||||
alert-instance-state:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rule-evaluation/state-and-health/#alert-instance-state
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rule-evaluation/state-and-health/#alert-instance-state
|
||||
alert-rule-health:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rule-evaluation/state-and-health/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rule-evaluation/state-and-health/
|
||||
---
|
||||
|
||||
# View alert state
|
||||
|
||||
An alert rule and its corresponding alert instances can transition through distinct states during the alert rule evaluation.
|
||||
|
||||
{{< figure src="/media/docs/alerting/alert-instance-states-v3.png" alt="A diagram of the distinct alert instance states and transitions." max-width="750px" >}}
|
||||
|
||||
There are three key components that helps us understand the behavior of our alerts:
|
||||
|
||||
- [Alert Instance State](ref:alert-instance-state): Refers to the state of the individual alert instances.
|
||||
- [Alert Rule State](ref:alert-rule-state): Determined by the "worst state" among its alert instances.
|
||||
- [Alert Rule Health](ref:alert-rule-health): Indicates the status in cases of `Error` or `NoData` events.
|
||||
|
||||
## View alert rule and instance states
|
||||
|
||||
To view the state and health of your alert rules and the status of alert instances:
|
||||
|
||||
1. Click **Alerts & IRM** -> **Alerting**.
|
||||
1. Click **Alert rules** to view the list of existing alert rules.
|
||||
|
||||
{{< figure src="/media/docs/alerting/view-alert-rule-list-with-actions.png" max-width="750px" alt="View alert rule state and alert rule health in Grafana Alerting" >}}
|
||||
|
||||
Each alert rule shows its state, health, summary, next evaluation time, and available actions such as **Pause evaluation**, **Silence notifications**, **Export**, **Delete**, and more.
|
||||
|
||||
1. Click on an alert rule to view additional details and its resulting alert instances.
|
||||
|
||||
{{< figure src="/media/docs/alerting/view-alert-instance-state.png" max-width="750px" alt="View alert rule state and alert rule health in Grafana Alerting" >}}
|
||||
|
||||
### View from the alert rule details page
|
||||
|
||||
To view more alert rule details, complete the following steps.
|
||||
|
||||
1. Click **Alerts & IRM** -> **Alerting** -> **Alert rules**.
|
||||
1. Click to expand an alert rule.
|
||||
1. In **Actions**, click **View** (the eye icon).
|
||||
|
||||
{{< figure src="/media/docs/alerting/alert-rule-view-page-with-breadcrumb.png" max-width="750px" alt="Alert rule view page in Grafana Alerting" >}}
|
||||
|
||||
The namespace and group are shown in the breadcrumb navigation. They are interactive and can be used to filter rules by namespace or group.
|
||||
|
||||
The rest of the alert detail content is split up into tabs:
|
||||
|
||||
**Query and conditions**
|
||||
|
||||
View the details of the query that is used for the alert rule, including the expressions and intermediate values for each step of the expression pipeline. A graph view is included for range queries and data sources that return time series-like data frames.
|
||||
|
||||
**Instances**
|
||||
|
||||
Explore each alert instance, its status, labels and various other metadata for multi-dimensional alert rules.
|
||||
|
||||
Use **Search by label** to enter search criteria using label selectors. For example, `environment=production,region=~US|EU,severity!=warning`.
|
||||
|
||||
**History**
|
||||
|
||||
Explore the recorded history for an alert rule. You can also filter by alert state.
|
||||
|
||||
**Details**
|
||||
|
||||
Debug or audit using the alert rule metadata and view the alert rule annotations.
|
||||
|
||||
## View alert state on panels
|
||||
|
||||
When an [alert rule is linked to a time series panel](ref:link-alert-rules-to-panels), the time series panel displays the alert state and alert events.
|
||||
|
||||
A heart icon near the panel title shows the current alert state:
|
||||
|
||||
- A broken red heart when the alert is in `Alerting` state.
|
||||
- A green heart when the alert is in `Normal` state.
|
||||
|
||||
Colored annotations indicate changes in alert state, such as pending, alerting, and resolving.
|
||||
|
||||
{{< figure src="/media/docs/alerting/panel-displays-alert-state.png" max-width="1200px" alt="A panel with a firing alert and annotations that display the pending and alerting state changes." >}}
|
||||
|
||||
Additionally, Grafana provides an [alert list panel](ref:alert-list-panel) that you can add to a dashboard to display a list of alerts and their states.
|
||||
|
||||
{{< figure src="/static/img/docs/alert-list-panel/alert-list-panel.png" max-width="850px" alt="Two alert list panels displaying distinct lists of alerts." >}}
|
||||
|
||||
You can configure the alert list panel with various visualization options and filters to control how alerts are displayed. For more details, refer to the [Alert list documentation](ref:alert-list-panel).
|
||||
|
||||
{{< docs/play title="this demo dashboard with alert list panels and linked alert rules" url="https://play.grafana.org/d/000000074/" >}}
|
||||
108
docs/sources/alerting/set-up/configure-alertmanager/_index.md
Normal file
108
docs/sources/alerting/set-up/configure-alertmanager/_index.md
Normal file
@@ -0,0 +1,108 @@
|
||||
---
|
||||
aliases:
|
||||
- ../../configure-alertmanager/ # /docs/grafana/<GRAFANA_VERSION>/configure-alertmanager/
|
||||
- ../unified-alerting/fundamentals/alertmanager/ # /docs/grafana/<GRAFANA_VERSION>/alerting/unified-alerting/fundamentals/alertmanager/
|
||||
- ../manage-notifications/alertmanager/ # /docs/grafana/<GRAFANA_VERSION>/alerting/manage-notifications/alertmanager/
|
||||
- ../fundamentals/alertmanager/ # /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alertmanager/
|
||||
- ../fundamentals/notifications/alertmanager/ # /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/notifications/alertmanager
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/set-up/configure-alertmanager/
|
||||
description: Learn about Alertmanagers and set up Alerting to use an external Alertmanager
|
||||
keywords:
|
||||
- grafana
|
||||
- alerting
|
||||
- set up
|
||||
- configure
|
||||
- external Alertmanager
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: Configure Alertmanagers
|
||||
weight: 200
|
||||
refs:
|
||||
alertmanager-data-source:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/datasources/alertmanager/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/connect-externally-hosted/data-sources/alertmanager/
|
||||
notifications:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/notifications/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/notifications/
|
||||
---
|
||||
|
||||
# Configure Alertmanagers
|
||||
|
||||
Grafana Alerting is based on the architecture of the Prometheus alerting system. Grafana sends firing and resolved alerts to an Alertmanager, which is responsible for [handling notifications](ref:notifications). This architecture decouples alert rule evaluation from notification handling, improving scalability.
|
||||
|
||||
{{< figure src="/media/docs/alerting/alerting-alertmanager-architecture.png" max-width="750px" alt="A diagram with the alert generator and alert manager architecture" >}}
|
||||
|
||||
Grafana can enable one or more Alertmanagers to receive Grafana-managed alerts for notification handling. It’s important to note that each Alertmanager manages its own independent alerting resources, such as:
|
||||
|
||||
- Contact points and notification templates
|
||||
- Notification policies and mute timings
|
||||
- Silences
|
||||
- Active notifications
|
||||
|
||||
Use the `Choose Alertmanager` dropdown on these pages to switch between Alertmanagers and view or manage their resources.
|
||||
|
||||
{{< figure src="/media/docs/alerting/alerting-choose-alertmanager.png" max-width="750px" alt="A screenshot choosing an Alertmanager in the notification policies UI" >}}
|
||||
|
||||
## Types of Alertmanagers in Grafana
|
||||
|
||||
Grafana can be configured to handle alert notifications using various Alertmanagers.
|
||||
|
||||
- **Grafana Alertmanager**: Grafana includes a built-in Alertmanager that extends the [Prometheus Alertmanager](https://prometheus.io/docs/alerting/latest/alertmanager/). This is the default Alertmanager and is referred to as "Grafana" in the user interface. It can only handle Grafana-managed alerts.
|
||||
|
||||
- **Cloud Alertmanager**: Each Grafana Cloud instance comes preconfigured with an additional Alertmanager (`grafanacloud-STACK_NAME-ngalertmanager`) from the Mimir (Prometheus) instance running in the Grafana Cloud Stack.
|
||||
|
||||
The Cloud Alertmanager is available exclusively in Grafana Cloud and can handle both Grafana-managed and data source-managed alerts.
|
||||
|
||||
Some Grafana Cloud services, such as **Kubernetes Monitoring** and **Synthetic Monitoring** use the Cloud Alertmanager to create and manage alerts.
|
||||
|
||||
- **Other Alertmanagers**: Grafana Alerting also supports sending alerts to other Alertmanagers, such as the [Prometheus Alertmanager](https://prometheus.io/docs/alerting/latest/alertmanager/), which can handle both Grafana-managed and data source-managed alerts.
|
||||
|
||||
Grafana Alerting supports using a combination of Alertmanagers and can [enable other Alertmanagers to receive Grafana-managed alerts](#enable-an-alertmanager-to-receive-grafana-managed-alerts). The decision often depends on your alerting setup and where your alerts are generated.
|
||||
|
||||
For example, if you already have an Alertmanager running in your on-premises or cloud infrastructure to handle Prometheus alerts, you can forward Grafana-managed alerts to the same Alertmanager for unified notification handling.
|
||||
|
||||
## Add an Alertmanager
|
||||
|
||||
Alertmanagers should be configured as data sources using Grafana Configuration from the main Grafana navigation menu. To add an Alertmanager, complete the following steps.
|
||||
|
||||
{{< docs/shared lookup="alerts/add-alertmanager-ds.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
For provisioning instructions, refer to the [Alertmanager data source documentation](ref:alertmanager-data-source).
|
||||
|
||||
After adding an Alertmanager, you can use the Grafana Alerting UI to manage notification policies, contact points, silences, and other alerting resources from within Grafana.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
When using Prometheus, you can manage silences in the Grafana Alerting UI. However, other Alertmanager resources such as contact points, notification policies, and templates are read-only because the Prometheus Alertmanager HTTP API does not support updates for these resources.
|
||||
{{% /admonition %}}
|
||||
|
||||
When using multiple Alertmanagers, use the `Choose Alertmanager` dropdown to switch between Alertmanagers.
|
||||
|
||||
## Enable an Alertmanager to receive Grafana-managed alerts
|
||||
|
||||
After enabling **Receive Grafana Alerts** in the Data Source Settings, you must also configure the Alertmanager in the Alerting Settings page. Grafana supports enabling one or multiple Alertmanagers to receive all generated Grafana-managed alerts.
|
||||
|
||||
1. In the left-side menu, click **Alerts & IRM** and then **Alerting**.
|
||||
1. Click **Settings** to view the list of configured Alertmanagers.
|
||||
1. For the selected Alertmanager, click the **Enable/Disable** button to toggle receiving Grafana-managed alerts. When activated, the Alertmanager displays `Receiving Grafana-managed alerts`.
|
||||
|
||||
{{< figure src="/media/docs/alerting/grafana-alerting-settings.png" max-width="750px" alt="Grafana Alerting Settings page" >}}
|
||||
|
||||
All Grafana-managed alerts are forwarded to Alertmanagers marked as `Receiving Grafana-managed alerts`.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Grafana Alerting does not support forwarding Grafana-managed alerts to the AlertManager in Amazon Managed Service for Prometheus. For more details, refer to [this GitHub issue](https://github.com/grafana/grafana/issues/64064).
|
||||
{{% /admonition %}}
|
||||
|
||||
## Manage Alertmanager configurations
|
||||
|
||||
On the Settings page, you can also manage your Alertmanager configurations.
|
||||
|
||||
- Manage version snapshots for the built-in Alertmanager, which allows administrators to roll back unintentional changes or mistakes in the Alertmanager configuration.
|
||||
- Compare the historical snapshot with the latest configuration to see which changes were made.
|
||||
@@ -1,102 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- ../../configure-alertmanager/ # /docs/grafana/<GRAFANA_VERSION>/configure-alertmanager/
|
||||
- ../unified-alerting/fundamentals/alertmanager/ # /docs/grafana/<GRAFANA_VERSION>/alerting/unified-alerting/fundamentals/alertmanager/
|
||||
- ../manage-notifications/alertmanager/ # /docs/grafana/<GRAFANA_VERSION>/alerting/manage-notifications/alertmanager/
|
||||
- ../fundamentals/alertmanager/ # /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alertmanager/
|
||||
- ../fundamentals/notifications/alertmanager/ # /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/notifications/alertmanager
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/set-up/configure-alertmanager/
|
||||
description: Learn about Alertmanagers and set up Alerting to use an external Alertmanager
|
||||
keywords:
|
||||
- grafana
|
||||
- alerting
|
||||
- set up
|
||||
- configure
|
||||
- external Alertmanager
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: Configure Alertmanagers
|
||||
weight: 200
|
||||
refs:
|
||||
notifications:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/notifications/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/notifications/
|
||||
---
|
||||
|
||||
# Configure Alertmanagers
|
||||
|
||||
Grafana Alerting is based on the architecture of the Prometheus alerting system. Grafana sends firing and resolved alerts to an Alertmanager, which is responsible for [handling notifications](ref:notifications).
|
||||
|
||||
{{< figure src="/media/docs/alerting/alerting-alertmanager-architecture.png" max-width="750px" alt="A diagram with the alert generator and alert manager architecture" >}}
|
||||
|
||||
This architecture decouples alert rule evaluation from notification handling, allowing alerts to be forwarded to other Alertmanagers.
|
||||
|
||||
Grafana can use different Alertmanagers. It’s important to note that each Alertmanager manages its own independent alerting resources, such as:
|
||||
|
||||
- Contact points and notification templates
|
||||
- Notification policies and mute timings
|
||||
- Silences
|
||||
- Active notifications
|
||||
|
||||
Use the `Choose Alertmanager` on these pages to switch between Alertmanagers.
|
||||
|
||||
{{< figure src="/media/docs/alerting/alerting-choose-alertmanager.png" max-width="750px" alt="A screenshot choosing an Alertmanager in the notification policies UI" >}}
|
||||
|
||||
## Types of Alertmanagers in Grafana
|
||||
|
||||
Grafana can be configured to manage both Grafana-managed and data source-managed alerts using various Alertmanagers, depending on your infrastructure and alerting requirements.
|
||||
|
||||
- **Grafana Alertmanager**: Grafana has its own built-in Alertmanager, referred to as "Grafana" in the user interface. It is the default Alertmanager and can only handle Grafana-managed alerts.
|
||||
|
||||
- **Cloud Alertmanager**: Each Grafana Cloud instance comes preconfigured with an additional Alertmanager (`grafanacloud-STACK_NAME-ngalertmanager`) from the Mimir (Prometheus) instance running in the Grafana Cloud Stack.
|
||||
|
||||
The Cloud Alertmanager is available exclusively in Grafana Cloud and can handle both Grafana-managed and data source-managed alerts.
|
||||
|
||||
Some Grafana Cloud services, such as **Kubernetes Monitoring** and **Synthetic Monitoring** use the Cloud Alertmanager to create and manage alerts.
|
||||
|
||||
- **Other Alertmanagers**: Grafana Alerting also supports sending alerts to other Alertmanagers, such as the [Prometheus Alertmanager](https://prometheus.io/docs/alerting/latest/alertmanager/), which can handle Grafana-managed alerts and data sources-managed alerts such as alerts from Loki, Mimir, and Prometheus.
|
||||
|
||||
You can use a combination of Alertmanagers. The decision often depends on your alerting setup and where your alerts are being generated. Here are two examples of when you may want to add an Alertmanager and send your alerts there instead of using the built-in Grafana Alertmanager.
|
||||
|
||||
1. You may already have Alertmanagers on-premises in your own Cloud infrastructure that you still want to use because you have other alert generators, such as Prometheus.
|
||||
|
||||
2. You want to use both Prometheus on-premises and hosted Grafana to send alerts to the same Alertmanager that runs in your Cloud infrastructure.
|
||||
|
||||
## Add an Alertmanager
|
||||
|
||||
From Grafana, you can configure and administer your own Alertmanager to receive Grafana alerts.
|
||||
|
||||
After adding an Alertmanager, you can use the Grafana Alerting UI to manage notification policies, contact points, and other alerting resources from within Grafana, with support for HTTP basic authentication credentials.
|
||||
|
||||
Alertmanagers should be configured as data sources using Grafana Configuration from the main Grafana navigation menu. To add an Alertmanager, complete the following steps.
|
||||
|
||||
1. Click **Connections** in the left-side menu.
|
||||
1. On the Connections page, search for `Alertmanager`.
|
||||
1. Click the **Create a new data source** button.
|
||||
|
||||
If you don't see this button, you may need to install the plugin, relaunch your Cloud instance, and then repeat steps 1 and 2.
|
||||
|
||||
1. Fill out the fields on the page, as required.
|
||||
|
||||
If you are provisioning your data source, set the flag `handleGrafanaManagedAlerts` in the `jsonData` field to `true` to send Grafana-managed alerts to this Alertmanager.
|
||||
|
||||
**Note:** Prometheus, Grafana Mimir, and Cortex implementations of Alertmanager are supported. For Prometheus, contact points and notification policies are read-only in the Grafana Alerting UI.
|
||||
|
||||
1. Click **Save & test**.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Grafana Alerting does not support sending alerts to the AWS Managed Service for Prometheus due to the lack of sigv4 support in Prometheus.
|
||||
{{% /admonition %}}
|
||||
|
||||
## Manage Alertmanager configurations
|
||||
|
||||
On the Settings page, you can manage your Alertmanager configurations and configure where Grafana-managed alert instances are forwarded.
|
||||
|
||||
- Manage which Alertmanagers receive alert instances from Grafana-managed rules without navigating and editing data sources.
|
||||
- Manage version snapshots for the built-in Alertmanager, which allows administrators to roll back unintentional changes or mistakes in the Alertmanager configuration.
|
||||
- Compare the historical snapshot with the latest configuration to see which changes were made.
|
||||
@@ -21,9 +21,9 @@ weight: 600
|
||||
refs:
|
||||
state-history:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/manage-notifications/view-state-health/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/monitor-status/view-alert-state-history/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/manage-notifications/view-state-health/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/monitor-status/view-alert-state-history/
|
||||
meta-monitoring:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/monitor/
|
||||
|
||||
@@ -100,7 +100,7 @@ When sharing URLs with ad hoc filters, remember to encode the URL. In the preced
|
||||
|
||||
### Example
|
||||
|
||||
[This dashboard in Grafana Play](https://play.grafana.org/d/000000002/influxdb-templated?orgId=1&var-datacenter=America&var-host=All&var-summarize=1m&var-adhoc=datacenter%7C%3D%7CAmerica) passes the ad hoc filter variable `adhoc` with the filter value `datacenter = America`.
|
||||
[This dashboard in Grafana Play](https://play.grafana.org/d/p-k6QtkGz/template-redux?var-interval=$__auto&orgId=1&from=now-5m&to=now&timezone=utc&var-query=$__all&var-query2=$__all&var-query3=$__all&var-Filters=job%7C%3D%7Cmetrictank%2Ftsdb-gw&var-textbox=foo&var-custom=lisa&var-datasource=grafanacloud-demoinfra-prom) passes the ad hoc filter variable `Filters` with the filter value `job = metrictank/tsdb-gw`.
|
||||
|
||||
## Time range control using the URL
|
||||
|
||||
|
||||
@@ -190,7 +190,10 @@ guaranteed because plugin developers can override this functionality. The follow
|
||||
<tr>
|
||||
<td>
|
||||
<ul>
|
||||
<li>DynamoDB</li>
|
||||
<li>Dynatrace</li>
|
||||
<li>Graphite</li>
|
||||
<li>Google Sheets</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -220,7 +223,6 @@ guaranteed because plugin developers can override this functionality. The follow
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>Dynatrace</li>
|
||||
<li>GitHub</li>
|
||||
<li>Google BigQuery</li>
|
||||
<li>Grafana for YNAB</li>
|
||||
@@ -260,7 +262,7 @@ guaranteed because plugin developers can override this functionality. The follow
|
||||
## Limitations
|
||||
|
||||
- Panels that use frontend data sources will fail to fetch data.
|
||||
- Template variables are not supported.
|
||||
- Variables and queries including variables are not supported.
|
||||
- Exemplars will be omitted from the panel.
|
||||
- Only annotations that query the `-- Grafana --` data source are supported.
|
||||
- Organization annotations are not supported.
|
||||
|
||||
@@ -60,7 +60,7 @@ You must have an authorized viewer permission to see an image rendered by a dire
|
||||
The same permission is also required to view embedded links unless you have anonymous access permission enabled for your Grafana instance.
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
As of Grafana 8.0, anonymous access permission is not available in Grafana Cloud.
|
||||
As of Grafana 8.0, anonymous access permission is not available in Grafana Cloud. This feature is only supported for Grafana Enterprise and Grafana Open Source.
|
||||
{{< /admonition >}}
|
||||
|
||||
When you share a panel or dashboard as a snapshot, a snapshot (which is a panel or dashboard at the moment you take the snapshot) is publicly available on the web. Anyone with a link to it can access it. Because snapshots do not require any authorization to view, Grafana removes information related to the account it came from, as well as any sensitive data from the snapshot.
|
||||
@@ -220,10 +220,10 @@ The snapshot is immediately deleted. You may need to clear your browser cache or
|
||||
|
||||
### Embed panel
|
||||
|
||||
You can embed a panel using an iframe on another web site. A viewer must be signed into Grafana to view the graph.
|
||||
You can embed a panel using an iframe on another web site. A viewer must be signed into Grafana to view the graph unless you have anonymous access permission enabled for your Grafana instance.
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
As of Grafana 8.0, anonymous access permission is no longer available for Grafana Cloud.
|
||||
As of Grafana 8.0, anonymous access permission is no longer available for Grafana Cloud even for panels in [Public dashboards](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/dashboards/dashboard-public/). This feature is only supported for Grafana Enterprise and Grafana Open Source.
|
||||
{{< /admonition >}}
|
||||
|
||||
Here is an example of the HTML code:
|
||||
|
||||
@@ -23,6 +23,11 @@ refs:
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/
|
||||
configure-alertmanager:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/set-up/configure-alertmanager/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/set-up/configure-alertmanager/
|
||||
data-sources:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/administration/provisioning/#datasources
|
||||
@@ -33,36 +38,22 @@ refs:
|
||||
# Alertmanager data source
|
||||
|
||||
Grafana includes built-in support for Alertmanager implementations in Prometheus and Mimir.
|
||||
Once you add it as a data source, you can use the [Grafana Alerting UI](ref:alerting) to manage silences, contact points, and notification policies.
|
||||
To switch between Grafana and any configured Alertmanager data sources, you can select your preference from a drop-down option in those databases' data source settings pages.
|
||||
|
||||
Once you add an Alertmanager as a data source, you can use the `Choose Alertmanager` drop-down on [Grafana Alerting](ref:alerting) to view and manage Alertmanager resources, such as silences, contact points, and notification policies. Additionally, you can enable the Alertmanager to receive Grafana-managed alerts.
|
||||
|
||||
For more details about using other Alertmanagers, refer to [Alertmanagers in the Grafana Alerting documentation](ref:configure-alertmanager).
|
||||
|
||||
## Alertmanager implementations
|
||||
|
||||
The data source supports [Prometheus](https://prometheus.io/) and [Grafana Mimir](/docs/mimir/latest/) (default) implementations of Alertmanager.
|
||||
You can specify the implementation in the data source's Settings page.
|
||||
When using Prometheus, contact points and notification policies are read-only in the Grafana Alerting UI, because it doesn't support updates to the configuration using HTTP API.
|
||||
The data source supports [Prometheus](https://prometheus.io/) and [Grafana Mimir](/docs/mimir/latest/) (default) implementations of Alertmanager. You can specify the implementation in the data source's Settings page.
|
||||
|
||||
When using Prometheus, you can manage silences in the Grafana Alerting UI. However, other Alertmanager resources such as contact points, notification policies, and templates are read-only because the Prometheus Alertmanager HTTP API does not support updates for these resources.
|
||||
|
||||
## Configure the data source
|
||||
|
||||
To configure basic settings for the data source, complete the following steps:
|
||||
|
||||
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**.
|
||||
|
||||
The **Settings** tab of the data source is displayed.
|
||||
|
||||
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 |
|
||||
{{< docs/shared lookup="alerts/add-alertmanager-ds.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
## Provision the Alertmanager data source
|
||||
|
||||
|
||||
@@ -230,17 +230,40 @@ The label field allows you to override the default name of the metric legend usi
|
||||
## Query CloudWatch Logs
|
||||
|
||||
The logs query editor helps you write CloudWatch Logs Query Language queries across defined regions and log groups.
|
||||
It supports querying Cloudwatch logs with Logs Insights Query Language, OpenSearch PPL and OpenSearch SQL.
|
||||
|
||||
### Create a CloudWatch Logs query
|
||||
|
||||
1. Select the query language you would like to use in the Query Language dropdown.
|
||||
1. Select the region and up to 20 log groups to query.
|
||||
1. Use the main input area to write your query in [CloudWatch Logs Query Language](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html).
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
Region and log groups are mandatory fields when querying with Logs Insights QL and OpenSearch PPL. Log group selection is not necessary when querying with OpenSearch SQL. However, selecting log groups simplifies writing logs queries by populating syntax suggestions with discovered log group fields.
|
||||
{{< /admonition >}}
|
||||
|
||||
1. Use the main input area to write your logs query. AWS Cloudwatch only supports a subset of OpenSearch SQL and PPL commands. To find out more about the syntax supported, consult [Amazon CloudWatch Logs documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_AnalyzeLogData_Languages.html)
|
||||
|
||||
#### Querying Log groups with OpenSearch SQL
|
||||
|
||||
When querying log groups with OpenSearch SQL, the log group identifier or ARN _must_ be explicitly stated in the `FROM` clause:
|
||||
|
||||
```sql
|
||||
SELECT window.start, COUNT(*) AS exceptionCount
|
||||
FROM `log_group`
|
||||
WHERE `@message` LIKE '%Exception%'
|
||||
```
|
||||
|
||||
or, when querying multiple log groups:
|
||||
|
||||
```sql
|
||||
SELECT window.start, COUNT(*) AS exceptionCount
|
||||
FROM `logGroups( logGroupIdentifier: ['LogGroup1', 'LogGroup2'])`
|
||||
WHERE `@message` LIKE '%Exception%'
|
||||
```
|
||||
|
||||
You can also write queries returning time series data by using the [`stats` command](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_Insights-Visualizing-Log-Data.html).
|
||||
When making `stats` queries in [Explore](ref:explore), make sure you are in Metrics Explore mode.
|
||||
|
||||
{{< figure src="/static/img/docs/v70/explore-mode-switcher.png" max-width="500px" class="docs-image--right" caption="Explore mode switcher" >}}
|
||||
|
||||
## Cross-account observability
|
||||
|
||||
The CloudWatch plugin allows monitoring and troubleshooting applications that span multiple accounts within a region. Using cross-account observability, you can seamlessly search, visualize, and analyze metrics and logs without worrying about account boundaries.
|
||||
|
||||
@@ -116,6 +116,7 @@ For details, refer to [Configuring using Workload Identity](#configuring-using-w
|
||||
| **Application (client) ID** | Sets the application/client ID for the Azure AD app registration to use for authentication. |
|
||||
| **Client secret** | Sets the application client secret for the Azure AD app registration to use for authentication. For details, see the [Azure application secret docs](https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal#option-2-create-a-new-application-secret). |
|
||||
| **Default subscription** | _(Optional)_ Sets a default subscription for template variables to use. |
|
||||
| **Enable Basic Logs** | Allows this data source to execute queries against [Basic Logs tables](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/basic-logs-query?tabs=portal-1) in supported Log Analytics Workspaces. These queries may incur additional costs. |
|
||||
|
||||
### Provision the data source
|
||||
|
||||
@@ -211,6 +212,10 @@ The public cloud name is `AzureCloud`, the Chinese national cloud name is `Azure
|
||||
|
||||
### Configure Managed Identity
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
Managed Identity is available only in [Azure Managed Grafana](https://azure.microsoft.com/en-us/products/managed-grafana) or Grafana Enterprise when deployed in Azure. It is not available in Grafana Cloud.
|
||||
{{< /admonition >}}
|
||||
|
||||
You can use managed identity to configure Azure Monitor in Grafana if you host Grafana in Azure (such as an App Service or with Azure Virtual Machines) and have managed identity enabled on your VM.
|
||||
This lets you securely authenticate data sources without manually configuring credentials via Azure AD App Registrations.
|
||||
For details on Azure managed identities, refer to the [Azure documentation](https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview).
|
||||
|
||||
@@ -126,6 +126,8 @@ Azure Monitor Logs collects and organises log and performance data from [support
|
||||
While Azure Monitor Metrics stores only simplified numerical data, Logs can store different data types, each with their own structure.
|
||||
You can also perform complex analysis of Logs data by using KQL.
|
||||
|
||||
The Azure Monitor data source also supports querying of [Basic Logs](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/basic-logs-query?tabs=portal-1) tables (if they exist in your Log Analytics workspace). This feature must be enabled in the data source configuration.
|
||||
|
||||
{{< figure src="/static/img/docs/azure-monitor/query-editor-logs.png" max-width="800px" class="docs-image--no-shadow" caption="Azure Monitor Logs sample query comparing successful requests to failed requests" >}}
|
||||
|
||||
### Create a Logs query
|
||||
@@ -146,6 +148,21 @@ You can also perform complex analysis of Logs data by using KQL.
|
||||
|
||||
You can also augment queries by using [template variables]({{< relref "./template-variables" >}}).
|
||||
|
||||
**To create a Basic Logs query:**
|
||||
|
||||
1. Ensure that the data source has the `Enable Basic Logs` toggle enabled.
|
||||
1. In a Grafana panel, select the **Azure Monitor** data source.
|
||||
1. Select the **Logs** service.
|
||||
1. Select a resource to query. Multiple resources can be selected as long as they are of the same type.
|
||||
1. Switch the `Logs` toggle from `Analytics` to `Basic`. A modal will display to notify users of potential additional costs.
|
||||
{{% admonition type="note" %}}
|
||||
Basic Logs queries do not support time-ranges specified in the query. The time-range will be hardcoded to the dashboard time-range. There are also other query limitations. See the
|
||||
[documentation for details.](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/basic-logs-query?tabs=portal-1#limitations)
|
||||
{{% /admonition %}}
|
||||
1. Enter your KQL query.
|
||||
|
||||
You can also augment queries by using [template variables](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/datasources/azure-monitor/template-variables/).
|
||||
|
||||
### Logs query examples
|
||||
|
||||
Azure Monitor Logs queries are written using the Kusto Query Language (KQL), a rich language similar to SQL.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
aliases:
|
||||
- ../data-sources/mysql/
|
||||
- ../features/datasources/mysql/
|
||||
description: Guide for using MySQL in Grafana
|
||||
description: introduction to the MySQL data source in Grafana
|
||||
keywords:
|
||||
- grafana
|
||||
- mysql
|
||||
@@ -16,592 +16,52 @@ menuTitle: MySQL
|
||||
title: MySQL data source
|
||||
weight: 1000
|
||||
refs:
|
||||
add-template-variables-interval:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/variables/add-template-variables/#__interval
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/variables/add-template-variables/#__interval
|
||||
query-transform-data:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/query-transform-data/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/query-transform-data/
|
||||
add-template-variables-interval-ms:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/variables/add-template-variables/#__interval_ms
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/variables/add-template-variables/#__interval_ms
|
||||
variables:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/variables/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/variables/
|
||||
provisioning-data-sources:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/administration/provisioning/#data-sources
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/administration/provisioning/#data-sources
|
||||
variable-syntax-advanced-variable-format-options:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/variables/variable-syntax/#advanced-variable-format-options
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/variables/variable-syntax/#advanced-variable-format-options
|
||||
data-source-management:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/administration/data-source-management/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/administration/data-source-management/
|
||||
configure-standard-options-display-name:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/configure-standard-options/#display-name
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/configure-standard-options/#display-name
|
||||
annotate-visualizations:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/build-dashboards/annotate-visualizations/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/build-dashboards/annotate-visualizations/
|
||||
destination: /docs/grafana-cloud/visualizations/dashboards/build-dashboards/annotate-visualizations/
|
||||
configure-mysql-data-source:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/datasources/mysql/configuration/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/datasources/mysql/configuration/
|
||||
mysql-query-editor:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/datasources/mysql/query-editor/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/datasources/mysql/query-editor/
|
||||
alerting:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/
|
||||
transformations:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/query-transform-data/transform-data/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/panels-visualizations/query-transform-data/transform-data/
|
||||
---
|
||||
|
||||
# MySQL data source
|
||||
|
||||
> Starting from Grafana v5.1 you can name the time column _time_ in addition to earlier supported _time_sec_. Usage of _time_sec_ will eventually be deprecated.
|
||||
Grafana ships with a built-in MySQL data source plugin that allows you to query and visualize data from a MySQL-compatible database like MariaDB or Percona Server. You don't need to install a plugin in order to add the MySQL data source to your Grafana instance.
|
||||
|
||||
Grafana ships with a built-in MySQL data source plugin that allows you to query and visualize data from a MySQL compatible database like MariaDB or Percona Server.
|
||||
Grafana offers several configuration options for this data source as well as a visual and code-based query editor.
|
||||
|
||||
For instructions on how to add a data source to Grafana, refer to the [administration documentation](ref:data-source-management).
|
||||
Only users with the organization administrator role can add data sources.
|
||||
Administrators can also [configure the data source via YAML](#provision-the-data-source) with Grafana's provisioning system.
|
||||
## Get started with the MySQL data source
|
||||
|
||||
The following documents will help you get started with the MySQL data source in Grafana:
|
||||
|
||||
- [Configure the MySQL data source](ref:configure-mysql-data-source)
|
||||
- [MySQL query editor](ref:mysql-query-editor)
|
||||
|
||||
Once you have configured the data source you can:
|
||||
|
||||
- Add [annotations](ref:annotate-visualizations)
|
||||
- Set up [alerting](ref:alerting)
|
||||
- Add [transformations](ref:transformations)
|
||||
|
||||
View a MySQL overview on Grafana Play:
|
||||
|
||||
{{< docs/play title="MySQL Overview" url="https://play.grafana.org/d/edyh1ib7db6rkb/mysql-overview" >}}
|
||||
|
||||
## 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 `MySQL` in the search bar.
|
||||
1. Select **MySQL**.
|
||||
|
||||
The **Settings** tab of the data source is displayed.
|
||||
|
||||
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 MySQL instance. |
|
||||
| **Database** | Name of your MySQL database. |
|
||||
| **User** | Database user's login/username |
|
||||
| **Password** | Database user's password |
|
||||
| **Session Timezone** | Specifies the timezone used in the database session, such as `Europe/Berlin` or `+02:00`. Required if the timezone of the database (or the host of the database) is set to something other than UTC. Set this to `+00:00` so Grafana can handle times properly. Set the value used in the session with `SET time_zone='...'`. If you leave this field empty, the timezone will not be updated. For more information, refer to [MySQL Server Time Zone Support](https://dev.mysql.com/doc/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)** | Toggle to set the maximum number of idle connections to the number of maximum open connections (available in Grafana v9.5.1+). Default is `true`. |
|
||||
| **Allow cleartext passwords** | Allows the use of the [cleartext client side plugin](https://dev.mysql.com/doc/en/cleartext-pluggable-authentication.html) as required by a specific type of account, such as one defined with the [PAM authentication plugin](https://dev.mysql.com/doc/en/pam-pluggable-authentication.html). <br />**Sending passwords in clear text may be a security problem in some configurations**. To avoid password issues, it is recommended that clients connect to a MySQL server using a method that protects the password. Possibilities include [TLS / SSL](https://github.com/go-sql-driver/mysql#tls), IPsec, or a private network. Default is `false`. |
|
||||
| **Max lifetime** | The maximum amount of time in seconds a connection may be reused. This should always be lower than configured [wait_timeout](https://dev.mysql.com/doc/en/server-system-variables.html#sysvar_wait_timeout) in MySQL (Grafana v5.4+). The default is `14400` or 4 hours. |
|
||||
|
||||
### Min time interval
|
||||
|
||||
The **Min time interval** setting defines a lower limit for the [`$__interval`](ref:add-template-variables-interval) and [`$__interval_ms`](ref:add-template-variables-interval-ms) variables.
|
||||
|
||||
This value _must_ be formatted as a number followed by a valid time identifier:
|
||||
|
||||
| Identifier | Description |
|
||||
| ---------- | ----------- |
|
||||
| `y` | year |
|
||||
| `M` | month |
|
||||
| `w` | week |
|
||||
| `d` | day |
|
||||
| `h` | hour |
|
||||
| `m` | minute |
|
||||
| `s` | second |
|
||||
| `ms` | millisecond |
|
||||
|
||||
We recommend setting this value to match your MySQL write frequency.
|
||||
For example, use `1m` if MySQL writes data every minute.
|
||||
|
||||
You can also override this setting in a dashboard panel under its data source options.
|
||||
|
||||
### Database User Permissions (Important!)
|
||||
|
||||
The database user you specify when you add the data source should only be granted SELECT permissions on
|
||||
the specified database and tables you want to query. Grafana does not validate that the query is safe. The query
|
||||
could include any SQL statement. For example, statements like `USE otherdb;` and `DROP TABLE user;` would be
|
||||
executed. To protect against this we **Highly** recommend you create a specific mysql user with restricted permissions.
|
||||
|
||||
Example:
|
||||
|
||||
```sql
|
||||
CREATE USER 'grafanaReader' IDENTIFIED BY 'password';
|
||||
GRANT SELECT ON mydatabase.mytable TO 'grafanaReader';
|
||||
```
|
||||
|
||||
You can use wildcards (`*`) in place of database or table if you want to grant access to more databases and tables.
|
||||
|
||||
### Provision the data source
|
||||
|
||||
You can define and configure the data source in YAML files as part of Grafana's provisioning system.
|
||||
For more information about provisioning, and for available configuration options, refer to [Provisioning Grafana](ref:provisioning-data-sources).
|
||||
|
||||
#### Provisioning examples
|
||||
|
||||
##### Basic Provisioning
|
||||
|
||||
```yaml
|
||||
apiVersion: 1
|
||||
|
||||
datasources:
|
||||
- name: MySQL
|
||||
type: mysql
|
||||
url: localhost:3306
|
||||
user: grafana
|
||||
jsonData:
|
||||
database: grafana
|
||||
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}
|
||||
```
|
||||
|
||||
##### Using TLS verification
|
||||
|
||||
```yaml
|
||||
apiVersion: 1
|
||||
|
||||
datasources:
|
||||
- name: MySQL
|
||||
type: mysql
|
||||
url: localhost:3306
|
||||
user: grafana
|
||||
jsonData:
|
||||
tlsAuth: true
|
||||
database: grafana
|
||||
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}
|
||||
tlsClientCert: ${GRAFANA_TLS_CLIENT_CERT}
|
||||
tlsCACert: ${GRAFANA_TLS_CA_CERT}
|
||||
```
|
||||
|
||||
##### Use TLS and Skip Certificate Verification
|
||||
|
||||
```yaml
|
||||
apiVersion: 1
|
||||
|
||||
datasources:
|
||||
- name: MySQL
|
||||
type: mysql
|
||||
url: localhost:3306
|
||||
user: grafana
|
||||
jsonData:
|
||||
tlsAuth: true
|
||||
tlsSkipVerify: true
|
||||
database: grafana
|
||||
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}
|
||||
tlsClientCert: ${GRAFANA_TLS_CLIENT_CERT}
|
||||
tlsCACert: ${GRAFANA_TLS_CA_CERT}
|
||||
```
|
||||
|
||||
## Query builder
|
||||
|
||||
{{< figure src="/static/img/docs/v92/mysql_query_builder.png" class="docs-image--no-shadow" >}}
|
||||
|
||||
The MySQL query builder is available when editing a panel using a MySQL data source.
|
||||
|
||||
This topic explains querying specific to the MySQL data source.
|
||||
For general documentation on querying data sources in Grafana, see [Query and transform data](ref:query-transform-data).
|
||||
|
||||
You can run the built query by pressing the `Run query` button in the top right corner of the editor.
|
||||
|
||||
### Format
|
||||
|
||||
The response from MySQL can be formatted as either a table or as a time series. To use the time series format one of the columns must be named `time`.
|
||||
|
||||
### Dataset and Table selection
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
If your table or database name contains a reserved word or a [prohibited character](https://dev.mysql.com/doc/en/identifiers.html) the editor will put quotes around the name. For example, the name `table-name` will be quoted with backticks - `` `table-name` ``.
|
||||
{{% /admonition %}}
|
||||
|
||||
In the dataset dropdown, choose the MySQL database to query. The dropdown is be populated with the databases that the user has access to.
|
||||
When the dataset is selected, the table dropdown is populated with the tables that are available.
|
||||
|
||||
**Note:** If a default database has been configured through the Data Source Configuration page (or through a provisioning configuration file), the user will only be able to use that single preconfigured database for querying.
|
||||
|
||||
### Columns and Aggregation functions (SELECT)
|
||||
|
||||
Using the dropdown, select a column to include in the data. You can also specify an optional aggregation function.
|
||||
|
||||
Add further value columns by clicking the plus button and another column dropdown appears.
|
||||
|
||||
### Filter data (WHERE)
|
||||
|
||||
To add a filter, toggle the **Filter** switch at the top of the editor.
|
||||
This reveals a **Filter by column value** section with two dropdown selectors.
|
||||
|
||||
Use the first dropdown to choose whether all of the filters need to match (`AND`), or if only one of the filters needs to match (`OR`).
|
||||
Use the second dropdown to choose a filter.
|
||||
|
||||
To filter on more columns, click the plus (`+`) button to the right of the condition dropdown.
|
||||
|
||||
To remove a filter, click the `x` button next to that filter's dropdown.
|
||||
|
||||
After selecting a date type column, you can choose Macros from the operators list and select timeFilter which will add the $\_\_timeFilter macro to the query with the selected date column.
|
||||
|
||||
### Group By
|
||||
|
||||
To group the results by column, flip the group switch at the top of the editor. You can then choose which column to group the results by. The group by clause can be removed by pressing the X button.
|
||||
|
||||
### Preview
|
||||
|
||||
By flipping the preview switch at the top of the editor, you can get a preview of the SQL query generated by the query builder.
|
||||
|
||||
## Code editor
|
||||
|
||||
{{< figure src="/static/img/docs/v92/sql_code_editor.png" class="docs-image--no-shadow" >}}
|
||||
|
||||
To make advanced queries, switch to the code editor by clicking `code` in the top right corner of the editor. The code editor support autocompletion of tables, columns, SQL keywords, standard sql functions, Grafana template variables and Grafana macros. Columns cannot be completed before a table has been specified.
|
||||
|
||||
You can expand the code editor by pressing the `chevron` pointing downwards in the lower right corner of the code editor.
|
||||
|
||||
`CTRL/CMD + Return` works as a keyboard shortcut to run the query.
|
||||
|
||||
## Macros
|
||||
|
||||
To simplify syntax and to allow for dynamic parts, like date range filters, the query can contain macros.
|
||||
|
||||
| Macro example | Description |
|
||||
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `$__time(dateColumn)` | Will be replaced by an expression to convert to a UNIX timestamp and rename the column to `time_sec`. For example, _UNIX_TIMESTAMP(dateColumn) as time_sec_ |
|
||||
| `$__timeEpoch(dateColumn)` | Will be replaced by an expression to convert to a UNIX timestamp and rename the column to `time_sec`. For example, _UNIX_TIMESTAMP(dateColumn) as time_sec_ |
|
||||
| `$__timeFilter(dateColumn)` | Will be replaced by a time range filter using the specified column name. For example, _dateColumn BETWEEN FROM_UNIXTIME(1494410783) AND FROM_UNIXTIME(1494410983)_ |
|
||||
| `$__timeFrom()` | Will be replaced by the start of the currently active time selection. For example, _FROM_UNIXTIME(1494410783)_ |
|
||||
| `$__timeTo()` | Will be replaced by the end of the currently active time selection. For example, _FROM_UNIXTIME(1494410983)_ |
|
||||
| `$__timeGroup(dateColumn,'5m')` | Will be replaced by an expression usable in GROUP BY clause. For example, *cast(cast(UNIX_TIMESTAMP(dateColumn)/(300) as signed)*300 as signed),\* |
|
||||
| `$__timeGroup(dateColumn,'5m', 0)` | Same as above but with a fill parameter so missing points in that series will be added by grafana and 0 will be used as value (only works with time series queries). |
|
||||
| `$__timeGroup(dateColumn,'5m', NULL)` | Same as above but NULL will be used as value for missing points (only works with time series queries). |
|
||||
| `$__timeGroup(dateColumn,'5m', previous)` | Same as above but the previous value in that series will be used as fill value if no value has been seen yet NULL will be used (only works with time series queries). |
|
||||
| `$__timeGroupAlias(dateColumn,'5m')` | Will be replaced identical to $\_\_timeGroup but with an added column alias (only available in Grafana 5.3+). |
|
||||
| `$__unixEpochFilter(dateColumn)` | Will be replaced by a time range filter using the specified column name with times represented as Unix timestamp. For example, _dateColumn > 1494410783 AND dateColumn < 1494497183_ |
|
||||
| `$__unixEpochFrom()` | Will be replaced by the start of the currently active time selection as Unix timestamp. For example, _1494410783_ |
|
||||
| `$__unixEpochTo()` | Will be replaced by the end of the currently active time selection as Unix timestamp. For example, _1494497183_ |
|
||||
| `$__unixEpochNanoFilter(dateColumn)` | Will be replaced by a time range filter using the specified column name with times represented as nanosecond timestamp. For example, _dateColumn > 1494410783152415214 AND dateColumn < 1494497183142514872_ |
|
||||
| `$__unixEpochNanoFrom()` | Will be replaced by the start of the currently active time selection as nanosecond timestamp. For example, _1494410783152415214_ |
|
||||
| `$__unixEpochNanoTo()` | Will be replaced by the end of the currently active time selection as nanosecond timestamp. For example, _1494497183142514872_ |
|
||||
| `$__unixEpochGroup(dateColumn,'5m', [fillmode])` | Same as $\_\_timeGroup but for times stored as Unix timestamp (`fillMode` only works with time series queries). |
|
||||
| `$__unixEpochGroupAlias(dateColumn,'5m', [fillmode])` | Same as above but also adds a column alias (`fillMode` only works with time series queries). |
|
||||
|
||||
We plan to add many more macros. If you have suggestions for what macros you would like to see, please [open an issue](https://github.com/grafana/grafana) in our GitHub repo.
|
||||
|
||||
The query editor has a link named `Generated SQL` that shows up after a query has been executed, while in panel edit mode. Click on it and it will expand and show the raw interpolated SQL string that was executed.
|
||||
|
||||
## Table queries
|
||||
|
||||
If the `Format as` query option is set to `Table` then you can basically do any type of SQL query. The table panel will automatically show the results of whatever columns and rows your query returns.
|
||||
|
||||
Query editor with example query:
|
||||
|
||||
{{< figure src="/static/img/docs/v45/mysql_table_query.png" >}}
|
||||
|
||||
The query:
|
||||
|
||||
```sql
|
||||
SELECT
|
||||
title as 'Title',
|
||||
user.login as 'Created By' ,
|
||||
dashboard.created as 'Created On'
|
||||
FROM dashboard
|
||||
INNER JOIN user on user.id = dashboard.created_by
|
||||
WHERE $__timeFilter(dashboard.created)
|
||||
```
|
||||
|
||||
You can control the name of the Table panel columns by using regular `as ` SQL column selection syntax.
|
||||
|
||||
The resulting table panel:
|
||||
|
||||

|
||||
|
||||
## Time series queries
|
||||
|
||||
The examples in this section query the following table:
|
||||
|
||||
```text
|
||||
+---------------------+--------------+---------------------+----------+
|
||||
| time_date_time | value_double | CreatedAt | hostname |
|
||||
+---------------------+--------------+---------------------+----------+
|
||||
| 2020-01-02 03:05:00 | 3.0 | 2020-01-02 03:05:00 | 10.0.1.1 |
|
||||
| 2020-01-02 03:06:00 | 4.0 | 2020-01-02 03:06:00 | 10.0.1.2 |
|
||||
| 2020-01-02 03:10:00 | 6.0 | 2020-01-02 03:10:00 | 10.0.1.1 |
|
||||
| 2020-01-02 03:11:00 | 7.0 | 2020-01-02 03:11:00 | 10.0.1.2 |
|
||||
| 2020-01-02 03:20:00 | 5.0 | 2020-01-02 03:20:00 | 10.0.1.2 |
|
||||
+---------------------+--------------+---------------------+----------+
|
||||
```
|
||||
|
||||
If the `Format as` query option is set to `Time Series` then the query must have a column named time that returns either a SQL datetime or any numeric datatype representing Unix epoch in seconds. In addition, result sets of time series queries must be sorted by time for panels to properly visualize the result.
|
||||
|
||||
A time series query result is returned in a [wide data frame format](https://grafana.com/developers/plugin-tools/key-concepts/data-frames#wide-format). Any column except time or of type string transforms into value fields in the data frame query result. Any string column transforms into field labels in the data frame query result.
|
||||
|
||||
> For backward compatibility, there's an exception to the above rule for queries that return three columns including a string column named metric. Instead of transforming the metric column into field labels, it becomes the field name, and then the series name is formatted as the value of the metric column. See the example with the metric column below.
|
||||
|
||||
To optionally customize the default series name formatting, refer to [Standard options definitions](ref:configure-standard-options-display-name).
|
||||
|
||||
**Example with `metric` column:**
|
||||
|
||||
```sql
|
||||
SELECT
|
||||
$__timeGroupAlias(time_date_time,'5m'),
|
||||
min(value_double),
|
||||
'min' as metric
|
||||
FROM test_data
|
||||
WHERE $__timeFilter(time_date_time)
|
||||
GROUP BY time
|
||||
ORDER BY time
|
||||
```
|
||||
|
||||
Data frame result:
|
||||
|
||||
```text
|
||||
+---------------------+-----------------+
|
||||
| Name: time | Name: min |
|
||||
| Labels: | Labels: |
|
||||
| Type: []time.Time | Type: []float64 |
|
||||
+---------------------+-----------------+
|
||||
| 2020-01-02 03:05:00 | 3 |
|
||||
| 2020-01-02 03:10:00 | 6 |
|
||||
| 2020-01-02 03:20:00 | 5 |
|
||||
+---------------------+-----------------+
|
||||
```
|
||||
|
||||
**Example using the fill parameter in the $\_\_timeGroupAlias macro to convert null values to be zero instead:**
|
||||
|
||||
```sql
|
||||
SELECT
|
||||
$__timeGroupAlias(createdAt,'5m',0),
|
||||
sum(value_double) as value,
|
||||
hostname
|
||||
FROM test_data
|
||||
WHERE
|
||||
$__timeFilter(createdAt)
|
||||
GROUP BY time, hostname
|
||||
ORDER BY time
|
||||
```
|
||||
|
||||
Given the data frame result in the following example and using the graph panel, you will get two series named _value 10.0.1.1_ and _value 10.0.1.2_. To render the series with a name of _10.0.1.1_ and _10.0.1.2_ , use a [Standard options definitions](ref:configure-standard-options-display-name) display value of `${__field.labels.hostname}`.
|
||||
|
||||
Data frame result:
|
||||
|
||||
```text
|
||||
+---------------------+---------------------------+---------------------------+
|
||||
| Name: time | Name: value | Name: value |
|
||||
| Labels: | Labels: hostname=10.0.1.1 | Labels: hostname=10.0.1.2 |
|
||||
| Type: []time.Time | Type: []float64 | Type: []float64 |
|
||||
+---------------------+---------------------------+---------------------------+
|
||||
| 2020-01-02 03:05:00 | 3 | 4 |
|
||||
| 2020-01-02 03:10:00 | 6 | 7 |
|
||||
| 2020-01-02 03:15:00 | 0 | 0 |
|
||||
| 2020-01-02 03:20:00 | 0 | 5 |
|
||||
+---------------------+---------------------------+---------------------------+
|
||||
```
|
||||
|
||||
**Example with multiple columns:**
|
||||
|
||||
```sql
|
||||
SELECT
|
||||
$__timeGroupAlias(time_date_time,'5m'),
|
||||
min(value_double) as min_value,
|
||||
max(value_double) as max_value
|
||||
FROM test_data
|
||||
WHERE $__timeFilter(time_date_time)
|
||||
GROUP BY time
|
||||
ORDER BY time
|
||||
```
|
||||
|
||||
Data frame result:
|
||||
|
||||
```text
|
||||
+---------------------+-----------------+-----------------+
|
||||
| Name: time | Name: min_value | Name: max_value |
|
||||
| Labels: | Labels: | Labels: |
|
||||
| Type: []time.Time | Type: []float64 | Type: []float64 |
|
||||
+---------------------+-----------------+-----------------+
|
||||
| 2020-01-02 03:05:00 | 3 | 4 |
|
||||
| 2020-01-02 03:10:00 | 6 | 7 |
|
||||
| 2020-01-02 03:20:00 | 5 | 5 |
|
||||
+---------------------+-----------------+-----------------+
|
||||
```
|
||||
|
||||
Currently, there is no support for a dynamic group by time based on time range and panel width.
|
||||
This is something we plan to add.
|
||||
|
||||
## Templating
|
||||
|
||||
This feature is currently available in the nightly builds and will be included in the 5.0.0 release.
|
||||
|
||||
Instead of hard-coding things like server, application and sensor name in your metric queries you can use variables in their place. Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns make it easy to change the data being displayed in your dashboard.
|
||||
|
||||
Check out the [Templating](ref:variables) documentation for an introduction to the templating feature and the different types of template variables.
|
||||
|
||||
### Query Variable
|
||||
|
||||
If you add a template variable of the type `Query`, you can write a MySQL query that can
|
||||
return things like measurement names, key names or key values that are shown as a dropdown select box.
|
||||
|
||||
For example, you can have a variable that contains all values for the `hostname` column in a table if you specify a query like this in the templating variable _Query_ setting.
|
||||
|
||||
```sql
|
||||
SELECT hostname FROM my_host
|
||||
```
|
||||
|
||||
A query can return multiple columns and Grafana will automatically create a list from them. For example, the query below will return a list with values from `hostname` and `hostname2`.
|
||||
|
||||
```sql
|
||||
SELECT my_host.hostname, my_other_host.hostname2 FROM my_host JOIN my_other_host ON my_host.city = my_other_host.city
|
||||
```
|
||||
|
||||
To use time range dependent macros like `$__timeFilter(column)` in your query the refresh mode of the template variable needs to be set to _On Time Range Change_.
|
||||
|
||||
```sql
|
||||
SELECT event_name FROM event_log WHERE $__timeFilter(time_column)
|
||||
```
|
||||
|
||||
Another option is a query that can create a key/value variable. The query should return two columns that are named `__text` and `__value`. The `__text` column value should be unique (if it is not unique then the first value is used). The options in the dropdown will have a text and value that allows you to have a friendly name as text and an id as the value. An example query with `hostname` as the text and `id` as the value:
|
||||
|
||||
```sql
|
||||
SELECT hostname AS __text, id AS __value FROM my_host
|
||||
```
|
||||
|
||||
You can also create nested variables. For example if you had another variable named `region`. Then you could have
|
||||
the hosts variable only show hosts from the current selected region with a query like this (if `region` is a multi-value variable then use the `IN` comparison operator rather than `=` to match against multiple values):
|
||||
|
||||
```sql
|
||||
SELECT hostname FROM my_host WHERE region IN($region)
|
||||
```
|
||||
|
||||
#### Using `__searchFilter` to filter results in Query Variable
|
||||
|
||||
> Available from Grafana 6.5 and above
|
||||
|
||||
Using `__searchFilter` in the query field will filter the query result based on what the user types in the dropdown select box.
|
||||
When nothing has been entered by the user the default value for `__searchFilter` is `%`.
|
||||
|
||||
> Important that you surround the `__searchFilter` expression with quotes as Grafana does not do this for you.
|
||||
|
||||
The example below shows how to use `__searchFilter` as part of the query field to enable searching for `hostname` while the user types in the dropdown select box.
|
||||
|
||||
Query
|
||||
|
||||
```sql
|
||||
SELECT hostname FROM my_host WHERE hostname LIKE '$__searchFilter'
|
||||
```
|
||||
|
||||
### Using Variables in Queries
|
||||
|
||||
From Grafana 4.3.0 to 4.6.0, template variables are always quoted automatically so if it is a string value do not wrap them in quotes in where clauses.
|
||||
|
||||
From Grafana 4.7.0, template variable values are only quoted when the template variable is a `multi-value`.
|
||||
|
||||
If the variable is a multi-value variable then use the `IN` comparison operator rather than `=` to match against multiple values.
|
||||
|
||||
There are two syntaxes:
|
||||
|
||||
`$<varname>` Example with a template variable named `hostname`:
|
||||
|
||||
```sql
|
||||
SELECT
|
||||
UNIX_TIMESTAMP(atimestamp) as time,
|
||||
aint as value,
|
||||
avarchar as metric
|
||||
FROM my_table
|
||||
WHERE $__timeFilter(atimestamp) and hostname in($hostname)
|
||||
ORDER BY atimestamp ASC
|
||||
```
|
||||
|
||||
`[[varname]]` Example with a template variable named `hostname`:
|
||||
|
||||
```sql
|
||||
SELECT
|
||||
UNIX_TIMESTAMP(atimestamp) as time,
|
||||
aint as value,
|
||||
avarchar as metric
|
||||
FROM my_table
|
||||
WHERE $__timeFilter(atimestamp) and hostname in([[hostname]])
|
||||
ORDER BY atimestamp ASC
|
||||
```
|
||||
|
||||
#### Disabling Quoting for Multi-value Variables
|
||||
|
||||
Grafana automatically creates a quoted, comma-separated string for multi-value variables. For example: if `server01` and `server02` are selected then it will be formatted as: `'server01', 'server02'`. To disable quoting, use the csv formatting option for variables:
|
||||
|
||||
`${servers:csv}`
|
||||
|
||||
Read more about variable formatting options in the [Variables](ref:variable-syntax-advanced-variable-format-options) documentation.
|
||||
|
||||
## Annotations
|
||||
|
||||
[Annotations](ref:annotate-visualizations) allow you to overlay rich event information on top of graphs. You add annotation queries via the Dashboard menu / Annotations view.
|
||||
|
||||
**Example query using time column with epoch values:**
|
||||
|
||||
```sql
|
||||
SELECT
|
||||
epoch_time as time,
|
||||
metric1 as text,
|
||||
CONCAT(tag1, ',', tag2) as tags
|
||||
FROM
|
||||
public.test_data
|
||||
WHERE
|
||||
$__unixEpochFilter(epoch_time)
|
||||
```
|
||||
|
||||
**Example region query using time and timeend columns with epoch values:**
|
||||
|
||||
> Only available in Grafana v6.6+.
|
||||
|
||||
```sql
|
||||
SELECT
|
||||
epoch_time as time,
|
||||
epoch_timeend as timeend,
|
||||
metric1 as text,
|
||||
CONCAT(tag1, ',', tag2) as tags
|
||||
FROM
|
||||
public.test_data
|
||||
WHERE
|
||||
$__unixEpochFilter(epoch_time)
|
||||
```
|
||||
|
||||
**Example query using time column of native SQL date/time data type:**
|
||||
|
||||
```sql
|
||||
SELECT
|
||||
native_date_time as time,
|
||||
metric1 as text,
|
||||
CONCAT(tag1, ',', tag2) as tags
|
||||
FROM
|
||||
public.test_data
|
||||
WHERE
|
||||
$__timeFilter(native_date_time)
|
||||
```
|
||||
|
||||
| Name | Description |
|
||||
| --------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `time` | The name of the date/time field. Could be a column with a native SQL date/time data type or epoch value. |
|
||||
| `timeend` | Optional name of the end date/time field. Could be a column with a native SQL date/time data type or epoch value. (Grafana v6.6+) |
|
||||
| `text` | Event description field. |
|
||||
| `tags` | Optional field name to use for event tags as a comma separated string. |
|
||||
|
||||
## Alerting
|
||||
|
||||
Time series queries should work in alerting conditions. Table formatted queries are not yet supported in alert rule conditions.
|
||||
|
||||
211
docs/sources/datasources/mysql/configuration/_index.md
Normal file
211
docs/sources/datasources/mysql/configuration/_index.md
Normal file
@@ -0,0 +1,211 @@
|
||||
---
|
||||
description: This document provides instructions for configuring the MySQL data source and explains available configuration options.
|
||||
keywords:
|
||||
- grafana
|
||||
- mysql
|
||||
- guide
|
||||
- configure
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
menuTitle: Configure the MySQL data source
|
||||
title: Configure the MySQL data source
|
||||
weight: 10
|
||||
refs:
|
||||
add-template-variables-interval:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/variables/add-template-variables/#__interval
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/dashboards/variables/add-template-variables/#__interval
|
||||
add-template-variables-interval-ms:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/variables/add-template-variables/#__interval_ms
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: docs/grafana-cloud/visualizations/dashboards/variables/add-template-variables/#__interval_ms
|
||||
provisioning-data-sources:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/administration/provisioning/#data-sources
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/administration/provisioning/#data-sources
|
||||
data-source-management:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/administration/data-source-management/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/administration/data-source-management/
|
||||
---
|
||||
|
||||
# Configure the MySQL data source
|
||||
|
||||
This document provides instructions for configuring the MySQL data source and explains available configuration options. For general information on managing data sources refer to [Data source management](ref:data-source-management).
|
||||
|
||||
## Before you begin
|
||||
|
||||
You must have the `Organization administrator` role in order to configure the MySQL data source.
|
||||
Administrators can also [configure the data source via YAML](#provision-the-data-source) with Grafana's provisioning system.
|
||||
|
||||
Grafana ships with the MySQL plugin, so no additional installation is required.
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
When adding a data source, ensure the database user you specify has only `SELECT` permissions on the relevant database and tables. Grafana does not validate the safety of queries, which means they can include potentially harmful SQL statements, such as `USE otherdb;` or `DROP TABLE user;`, which could get executed. To minimize this risk, Grafana strongly recommends creating a dedicated MySQL user with restricted permissions.
|
||||
{{< /admonition >}}
|
||||
|
||||
Example:
|
||||
|
||||
```sql
|
||||
CREATE USER 'grafanaReader' IDENTIFIED BY 'password';
|
||||
GRANT SELECT ON mydatabase.mytable TO 'grafanaReader';
|
||||
```
|
||||
|
||||
Use wildcards (`*`) in place of a database or table if you want to grant access to more databases and tables.
|
||||
|
||||
## Add the MySQL data source
|
||||
|
||||
To add the MySQL data source complete the following steps:
|
||||
|
||||
1. Click **Connections** in the left-side menu.
|
||||
1. Click **Add new connection** and type `MySQL` in the search bar.
|
||||
1. Select the **MySQL data source** option.
|
||||
1. Click **Add new data source** in the upper right.
|
||||
|
||||
You are taken to the **Settings** tab where you will configure the data source.
|
||||
|
||||
## MySQL configuration options
|
||||
|
||||
Following is a list of MySQL configuration options:
|
||||
|
||||
- **Name** - Sets the name you use to refer to the data source in panels and queries. Examples:
|
||||
`mysql-assets-1`, `mysqldb1`.
|
||||
- **Default** - Toggle to make this specific MySQL data source the default pre-selected data source in panels and visualizations.
|
||||
|
||||
**Connection:**
|
||||
|
||||
- **Host URL** - Enter the IP address/hostname and optional port of your MySQL instance. If the port is omitted the default 3306 port will be used.
|
||||
- **Database** - Enter the name of your MySQL database.
|
||||
|
||||
**Authentication:**
|
||||
|
||||
- **Username**- Enter the username used to connect to your MySQL database.
|
||||
- **Password** - Enter the password used to connect to the MySQL database.
|
||||
- **Use TLS Client Auth** - Toggle to enable TLS authentication using the client certificate specified in the secure JSON configuration. Refer to [Using TLS Connections](https://dev.mysql.com/doc/refman/8.4/en/mysql-cluster-tls-using.html) and [Configuring MySQL to Use Encrypted Connections](https://dev.mysql.com/doc/refman/8.4/en/using-encrypted-connections.html) for more information regarding TLS and configuring encrypted connections in MySQL. Provide the client certificate under **TLS/SSL Client Certificate**. Provide the key under **TLS/SSL Client Key**.
|
||||
- **With CA Cert** - Toggle to authenticate using a CA certificate. Required for verifying self-signed TLS Certs. Follow the instructions of your CA (Certificate Authority) to download the certificate file. Provide the root certificate under **TLS/SSL Root Certificate** if TLS/SSL mode requires it.
|
||||
- **Skip TLS Verification** - Toggle to skip verification of the MySQL server's TLS certificate chain and host name.
|
||||
- **Allow Cleartext Passwords** - Toggle to allow the use of the [cleartext client-side plugin](https://dev.mysql.com/doc/en/cleartext-pluggable-authentication.html) when required by a specific type of account, such as one defined with the [PAM authentication plugin](https://dev.mysql.com/doc/refman/8.4/en/pam-pluggable-authentication.html). Note that transmitting passwords in plain text can pose a security risk in certain configurations. To prevent password-related issues, it is recommended that clients connect to a MySQL server using a secure method that protects the password. Options include [TLS/SSL](https://github.com/go-sql-driver/mysql#tls), IPsec, or a private network.
|
||||
|
||||
## Additional settings
|
||||
|
||||
The following are additional MySQL settings.
|
||||
|
||||
**MySQL options:**
|
||||
|
||||
- **Session Timezone** - Specifies the timezone used in the database session, such as `Europe/Berlin` or `+02:00`. Required if the timezone of the database (or the host of the database) is set to something other than UTC. Set this to `+00:00` so Grafana can handle times properly. Set the value used in the session with `SET time_zone='...'`. If you leave this field empty, the timezone will not be updated. For more information, refer to [MySQL Server Time Zone Support](https://dev.mysql.com/doc/en/time-zone-support.html).
|
||||
- **Min time interval** - Defines a lower limit for the [`$__interval`](ref:add-template-variables-interval) and [`$__interval_ms`](ref:add-template-variables-interval-ms) variables. Grafana recommends aligning this setting with the data write frequency. For example, set it to `1m` if your data is written every minute. Refer to [Min time interval](#min-time-interval) for format examples.
|
||||
|
||||
**Connection limits:**
|
||||
|
||||
- **Max open** - The maximum number of open connections to the database, default `100`.
|
||||
- **Max idle** - The maximum number of connections in the idle connection pool, default `100`.
|
||||
- **Auto (max idle)** - Toggle to set the maximum number of idle connections to the number of maximum open connections. The default is `true`.
|
||||
- **Max lifetime** - The maximum amount of time in seconds a connection may be reused. This should always be lower than configured [wait_timeout](https://dev.mysql.com/doc/en/server-system-variables.html#sysvar_wait_timeout) in MySQL. The default is `14400`, or 4 hours.
|
||||
|
||||
**Private data source connect:**
|
||||
|
||||
**Private data source connect** - _Only for Grafana Cloud users._ Private data source connect, or PDC, allows you to establish a private, secured connection between a Grafana Cloud instance, or stack, and data sources secured within a private network. Click the drop-down to locate the URL for PDC. For more information regarding Grafana PDC refer to [Private data source connect (PDC)](https://grafana.com/docs/grafana-cloud/connect-externally-hosted/private-data-source-connect/).
|
||||
|
||||
Click **Manage private data source connect** to be taken to your PDC connection page, where you’ll find your PDC configuration details.
|
||||
|
||||
Once you have added your MySQL connection settings, click **Save & test** to test and save the data source connection.
|
||||
|
||||
### Min time interval
|
||||
|
||||
The **Min time interval** setting defines a lower limit for the [`$__interval`](ref:add-template-variables-interval) and [`$__interval_ms`](ref:add-template-variables-interval-ms) variables.
|
||||
|
||||
This value must be formatted as a number followed by a valid time identifier:
|
||||
|
||||
| Identifier | Description |
|
||||
| ---------- | ----------- |
|
||||
| `y` | year |
|
||||
| `M` | month |
|
||||
| `w` | week |
|
||||
| `d` | day |
|
||||
| `h` | hour |
|
||||
| `m` | minute |
|
||||
| `s` | second |
|
||||
| `ms` | millisecond |
|
||||
|
||||
You can override this setting in a dashboard panel under its data source options.
|
||||
|
||||
## Provision the data source
|
||||
|
||||
You can define and configure the data source in YAML files as part of Grafana's provisioning system.
|
||||
For more information about provisioning, and available configuration options, refer to [Provision Grafana](ref:provisioning-data-sources).
|
||||
|
||||
### MySQL provisioning examples
|
||||
|
||||
**Basic provisioning:**
|
||||
|
||||
```yaml
|
||||
apiVersion: 1
|
||||
|
||||
datasources:
|
||||
- name: MySQL
|
||||
type: mysql
|
||||
url: localhost:3306
|
||||
user: grafana
|
||||
jsonData:
|
||||
database: grafana
|
||||
maxOpenConns: 100
|
||||
maxIdleConns: 100
|
||||
maxIdleConnsAuto: true
|
||||
connMaxLifetime: 14400
|
||||
secureJsonData:
|
||||
password: ${GRAFANA_MYSQL_PASSWORD}
|
||||
```
|
||||
|
||||
**Using TLS verification:**
|
||||
|
||||
```yaml
|
||||
apiVersion: 1
|
||||
|
||||
datasources:
|
||||
- name: MySQL
|
||||
type: mysql
|
||||
url: localhost:3306
|
||||
user: grafana
|
||||
jsonData:
|
||||
tlsAuth: true
|
||||
database: grafana
|
||||
maxOpenConns: 100
|
||||
maxIdleConns: 100
|
||||
maxIdleConnsAuto: true
|
||||
connMaxLifetime: 14400
|
||||
secureJsonData:
|
||||
password: ${GRAFANA_MYSQL_PASSWORD}
|
||||
tlsClientCert: ${GRAFANA_TLS_CLIENT_CERT}
|
||||
tlsCACert: ${GRAFANA_TLS_CA_CERT}
|
||||
```
|
||||
|
||||
**Use TLS and skip certificate verification:**
|
||||
|
||||
```yaml
|
||||
apiVersion: 1
|
||||
|
||||
datasources:
|
||||
- name: MySQL
|
||||
type: mysql
|
||||
url: localhost:3306
|
||||
user: grafana
|
||||
jsonData:
|
||||
tlsAuth: true
|
||||
tlsSkipVerify: true
|
||||
database: grafana
|
||||
maxOpenConns: 100
|
||||
maxIdleConns: 100
|
||||
maxIdleConnsAuto: true
|
||||
connMaxLifetime: 14400
|
||||
secureJsonData:
|
||||
password: ${GRAFANA_MYSQL_PASSWORD}
|
||||
tlsClientCert: ${GRAFANA_TLS_CLIENT_CERT}
|
||||
tlsCACert: ${GRAFANA_TLS_CA_CERT}
|
||||
```
|
||||
440
docs/sources/datasources/mysql/query-editor/_index.md
Normal file
440
docs/sources/datasources/mysql/query-editor/_index.md
Normal file
@@ -0,0 +1,440 @@
|
||||
---
|
||||
description: This document describes the MySQL query editor.
|
||||
keywords:
|
||||
- grafana
|
||||
- mysql
|
||||
- query
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
menuTitle: MySQL query editor
|
||||
title: MySQL query editor
|
||||
weight: 30
|
||||
refs:
|
||||
variables:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/variables/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/dashboards/variables/
|
||||
variable-syntax-advanced-variable-format-options:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/variables/variable-syntax/#advanced-variable-format-options
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/dashboards/variables/variable-syntax/#advanced-variable-format-options
|
||||
annotate-visualizations:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/build-dashboards/annotate-visualizations/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/dashboards/build-dashboards/annotate-visualizations/
|
||||
explore:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/explore/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/explore/
|
||||
query-transform-data:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/query-transform-data/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/panels-visualizations/query-transform-data/
|
||||
panel-inspector:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/panel-inspector/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/panels-visualizations/panel-inspector/
|
||||
query-editor:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/query-transform-data/#query-editors
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/panels-visualizations/query-transform-data/#query-editors
|
||||
alert-rules:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/
|
||||
template-annotations-and-labels:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/templates/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/templates/
|
||||
---
|
||||
|
||||
# MySQL query editor
|
||||
|
||||
Grafana’s query editors are unique for each data source. For general information on Grafana query editors, refer to [Query editors](ref:query-editor). For general information on querying data sources in Grafana, refer to [Query and transform data](ref:query-transform-data).
|
||||
|
||||
The MySQL query editor is located on the [Explore page](ref:explore). You can also access the MySQL query editor from a dashboard panel. Click the ellipsis in the upper right of the panel and select **Edit**.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
If a default database is configured in the **Data Source Configuration page**, or via a provisioning configuration file, users will be restricted to querying only that pre-configured database. This feature is behind a feature flag and is available once you enable `sqlDatasourceDatabaseSelection`.
|
||||
{{% /admonition %}}
|
||||
|
||||
## MySQL query editor components
|
||||
|
||||
The MySQL query editor has two modes: **Builder** and **Code**.
|
||||
|
||||
Builder mode helps you build a query using a visual interface. Code mode allows for advanced querying and offers support for complex SQL query writing.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
If your table or database name contains a reserved word or a [prohibited character](https://dev.mysql.com/doc/en/identifiers.html) the editor will put quotes around the name. For example, the name `table-name` will be quoted with backticks - `` `table-name` ``.
|
||||
{{% /admonition %}}
|
||||
|
||||
## MySQL Builder mode
|
||||
|
||||
{{< figure alt="Builder mode" src="/media/docs/mysql/screenshot-mysql-query-editor.v11.3.png" class="docs-image--no-shadow" >}}
|
||||
|
||||
The following components will help you build a MySQL query:
|
||||
|
||||
- **Format** - Select a format response from the drop-down for the MySQL query. The default is **Table**. If you use the **Time series** format option, one of the columns must be `time`.
|
||||
|
||||
- **Dataset** - Select a database to query from the drop-down.
|
||||
|
||||
- **Table** - Select a table from the drop-down. Tables correspond to the chosen database.
|
||||
|
||||
- **Data operations** - _Optional_ Select an aggregation from the drop-down. You can add multiple data operations by clicking the **+ sign**. Click the **X** to remove a data operation. Click the **garbage can icon** to remove the entire column.
|
||||
|
||||
- **Column** - Select a column on which to run the aggregation.
|
||||
|
||||
- **Alias** - _Optional_ Add an alias from the drop-down. You can also add your own alias by typing it in the box and clicking **Enter**. Remove an alias by clicking the **X**.
|
||||
|
||||
- **Filter** - Toggle to add filters.
|
||||
|
||||
- **Filter by column value** - _Optional_ If you toggle **Filter** you can add a column to filter by from the drop-down. To filter on more columns, click the **+ sign** to the right of the condition drop-down. You can choose a variety of operators from the drop-down next to the condition. When multiple filters are added you can add an `AND` operator to display all true conditions or an `OR` operator to display any true conditions. Use the second drop-down to choose a filter. To remove a filter, click the `X` button next to that filter's drop-down. After selecting a date type column, you can choose **Macros** from the operators list and select `timeFilter` which will add the `$\_\_timeFilter` macro to the query with the selected date column.
|
||||
|
||||
- **Group** - Toggle to add **Group by column**.
|
||||
|
||||
- **Group by column** - Select a column to filter by from the drop-down. Click the **+ sign** to filter by multiple columns. Click the **X** to remove a filter.
|
||||
|
||||
- **Order** - Toggle to add an ORDER BY statement.
|
||||
|
||||
- **Order by** - Select a column to order by from the drop-down. Select ascending (`ASC`) or descending (`DESC`) order.
|
||||
- **Limit** - You can add an optional limit on the number of retrieved results. Default is 50.
|
||||
|
||||
- **Preview** - Toggle for a preview of the SQL query generated by the query builder. Preview is toggled on by default.
|
||||
|
||||
## MySQL Code mode
|
||||
|
||||
To create advanced queries, switch to **Code mode** by clicking **Code** in the upper right of the editor window. Code mode supports the auto-completion of tables, columns, SQL keywords, standard SQL functions, Grafana template variables, and Grafana macros. Columns cannot be completed before a table has been specified.
|
||||
|
||||
{{< figure src="/static/img/docs/v92/sql_code_editor.png" class="docs-image--no-shadow" >}}
|
||||
|
||||
Select **Table** or **Time Series** as the format. Click the **{}** in the bottom right to format the query. Click the **downward caret** to expand the Code mode editor. **CTRL/CMD + Return** serves as a keyboard shortcut to execute the query.
|
||||
|
||||
{{% admonition type="warning" %}}
|
||||
Changes made to a query in Code mode will not transfer to Builder mode and will be discarded. You will be prompted to copy your code to the clipboard to save any changes.
|
||||
{{% /admonition %}}
|
||||
|
||||
## Macros
|
||||
|
||||
You can add macros to your queries to simplify the syntax and enable dynamic elements, such as date range filters.
|
||||
|
||||
| Macro example | Description |
|
||||
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `$__time(dateColumn)` | Replaces the value with an expression to convert to a UNIX timestamp and renames the column to `time_sec`. Example: _UNIX_TIMESTAMP(dateColumn) AS time_sec_. |
|
||||
| `$__timeEpoch(dateColumn)` | Replaces the value with an expression to convert to a UNIX Epoch timestamp and renames the column to `time_sec`. Example: _UNIX_TIMESTAMP(dateColumn) AS time_sec_. |
|
||||
| `$__timeFilter(dateColumn)` | Replaces the value a time range filter using the specified column name. Example: _dateColumn BETWEEN FROM_UNIXTIME(1494410783) AND FROM_UNIXTIME(1494410983)_ |
|
||||
| `$__timeFrom()` | Replaces the value with the start of the currently active time selection. Example: _FROM_UNIXTIME(1494410783)_ |
|
||||
| `$__timeTo()` | Replaces the value with the end of the currently active time selection. Example: _FROM_UNIXTIME(1494410983)_ |
|
||||
| `$__timeGroup(dateColumn,'5m')` | Replaces the value with an expression suitable for use in a GROUP BY clause. Example: *cast(cast(UNIX_TIMESTAMP(dateColumn)/(300) as signed)*300 as signed),\* |
|
||||
| `$__timeGroup(dateColumn,'5m', 0)` | Same as the `$__timeGroup(dateColumn,'5m')` macro, but includes a fill parameter to ensure missing points in the series are added by Grafana, using 0 as the default value. **This applies only to time series queries.** |
|
||||
| `$__timeGroup(dateColumn,'5m', NULL)` | Same as the `$__timeGroup(dateColumn,'5m', 0)` but NULL is used as the value for missing points. **This applies only to time series queries.** |
|
||||
| `$__timeGroup(dateColumn,'5m', previous)` | Same as the `$__timeGroup(dateColumn,'5m', previous)` macro, but uses the previous value in the series as the fill value. If no previous value exists,`NULL` will be used. **This applies only to time series queries.** |
|
||||
| `$__timeGroupAlias(dateColumn,'5m')` | Replaces the value identical to $\_\_timeGroup but with an added column alias. |
|
||||
| `$__unixEpochFilter(dateColumn)` | Replaces the value by a time range filter using the specified column name with times represented as a UNIX timestamp. Example: _dateColumn > 1494410783 AND dateColumn < 1494497183_ |
|
||||
| `$__unixEpochFrom()` | Replaces the value with the start of the currently active time selection as a UNIX timestamp. Example: _1494410783_ |
|
||||
| `$__unixEpochTo()` | Replaces the value with the end of the currently active time selection as UNIX timestamp. Example: _1494497183_ |
|
||||
| `$__unixEpochNanoFilter(dateColumn)` | Replaces the value with a time range filter using the specified column name with time represented as a nanosecond timestamp. Example: _dateColumn > 1494410783152415214 AND dateColumn < 1494497183142514872_ |
|
||||
| `$__unixEpochNanoFrom()` | Replaces the value with the start of the currently active time selection as nanosecond timestamp. Example: _1494410783152415214_ |
|
||||
| `$__unixEpochNanoTo()` | Replaces the value with the end of the currently active time selection as nanosecond timestamp. Example: _1494497183142514872_ |
|
||||
| `$__unixEpochGroup(dateColumn,'5m', [fillmode])` | Same as $\_\_timeGroup but for times stored as Unix timestamp. **Note that `fillMode` only works with time series queries.** |
|
||||
| `$__unixEpochGroupAlias(dateColumn,'5m', [fillmode])` | Same as $\_\_timeGroup but also adds a column alias. **Note that `fillMode` only works with time series queries.** |
|
||||
|
||||
## Table SQL queries
|
||||
|
||||
If the **Format** option is set to **Table**, you can execute virtually any type of SQL query. The Table panel will automatically display the resulting columns and rows from your query.
|
||||
|
||||
You can change or customize the name of a Table panel column by using the SQL keyword `AS` syntax.
|
||||
|
||||
```sql
|
||||
SELECT
|
||||
title as 'Title',
|
||||
user.login as 'Created By' ,
|
||||
dashboard.created as 'Created On'
|
||||
FROM dashboard
|
||||
INNER JOIN user on user.id = dashboard.created_by
|
||||
WHERE $__timeFilter(dashboard.created)
|
||||
```
|
||||
|
||||
Table panel results:
|
||||
|
||||

|
||||
|
||||
## Time series queries
|
||||
|
||||
Set the **Format** option to **Time series** to create and run time series queries.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
To run a time series query you must include a column named `time` that returns either a SQL datetime value or a numeric datatype representing the UNIX epoch time in seconds. Additionally, the query results must be sorted by the `time` column for proper visualization in panels.
|
||||
{{% /admonition %}}
|
||||
|
||||
The examples in this section refer to the data in the following table:
|
||||
|
||||
```text
|
||||
+---------------------+--------------+---------------------+----------+
|
||||
| time_date_time | value_double | CreatedAt | hostname |
|
||||
+---------------------+--------------+---------------------+----------+
|
||||
| 2020-01-02 03:05:00 | 3.0 | 2020-01-02 03:05:00 | 10.0.1.1 |
|
||||
| 2020-01-02 03:06:00 | 4.0 | 2020-01-02 03:06:00 | 10.0.1.2 |
|
||||
| 2020-01-02 03:10:00 | 6.0 | 2020-01-02 03:10:00 | 10.0.1.1 |
|
||||
| 2020-01-02 03:11:00 | 7.0 | 2020-01-02 03:11:00 | 10.0.1.2 |
|
||||
| 2020-01-02 03:20:00 | 5.0 | 2020-01-02 03:20:00 | 10.0.1.2 |
|
||||
+---------------------+--------------+---------------------+----------+
|
||||
```
|
||||
|
||||
A time series query result is returned in a [wide data frame format](https://grafana.com/developers/plugin-tools/key-concepts/data-frames#wide-format). Any column except time or of type string transforms into value fields in the data frame query result. Any string column transforms into field labels in the data frame query result.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
For backward compatibility, an exception to the aforementioned rule applies to queries returning three columns, including a string column named `metric`. Instead of converting the metric column into field labels, it is used as the field name, and the series name is set to the value of the metric column. Refer to the following example with a metric column.
|
||||
{{% /admonition %}}
|
||||
|
||||
**Example with `metric` column:**
|
||||
|
||||
```sql
|
||||
SELECT
|
||||
$__timeGroupAlias(time_date_time,'5m'),
|
||||
min(value_double),
|
||||
'min' as metric
|
||||
FROM test_data
|
||||
WHERE $__timeFilter(time_date_time)
|
||||
GROUP BY time
|
||||
ORDER BY time
|
||||
```
|
||||
|
||||
Data frame result:
|
||||
|
||||
```text
|
||||
+---------------------+-----------------+
|
||||
| Name: time | Name: min |
|
||||
| Labels: | Labels: |
|
||||
| Type: []time.Time | Type: []float64 |
|
||||
+---------------------+-----------------+
|
||||
| 2020-01-02 03:05:00 | 3 |
|
||||
| 2020-01-02 03:10:00 | 6 |
|
||||
| 2020-01-02 03:20:00 | 5 |
|
||||
+---------------------+-----------------+
|
||||
```
|
||||
|
||||
To customize the default series name formatting (optional), refer to [Standard options definitions](ref:configure-standard-options-display-name).
|
||||
|
||||
**Example using the fill parameter in the $\_\_timeGroupAlias macro to convert null values to be zero instead:**
|
||||
|
||||
```sql
|
||||
SELECT
|
||||
$__timeGroupAlias(createdAt,'5m',0),
|
||||
sum(value_double) as value,
|
||||
hostname
|
||||
FROM test_data
|
||||
WHERE
|
||||
$__timeFilter(createdAt)
|
||||
GROUP BY time, hostname
|
||||
ORDER BY time
|
||||
```
|
||||
|
||||
Given the data frame result in the following example and using the graph panel, you will get two series named _value 10.0.1.1_ and _value 10.0.1.2_. To render the series with a name of _10.0.1.1_ and _10.0.1.2_ , use a [Standard options definitions](ref:configure-standard-options-display-name) display value of `${__field.labels.hostname}`.
|
||||
|
||||
Data frame result:
|
||||
|
||||
```text
|
||||
+---------------------+---------------------------+---------------------------+
|
||||
| Name: time | Name: value | Name: value |
|
||||
| Labels: | Labels: hostname=10.0.1.1 | Labels: hostname=10.0.1.2 |
|
||||
| Type: []time.Time | Type: []float64 | Type: []float64 |
|
||||
+---------------------+---------------------------+---------------------------+
|
||||
| 2020-01-02 03:05:00 | 3 | 4 |
|
||||
| 2020-01-02 03:10:00 | 6 | 7 |
|
||||
| 2020-01-02 03:15:00 | 0 | 0 |
|
||||
| 2020-01-02 03:20:00 | 0 | 5 |
|
||||
+---------------------+---------------------------+---------------------------+
|
||||
```
|
||||
|
||||
**Example with multiple columns:**
|
||||
|
||||
```sql
|
||||
SELECT
|
||||
$__timeGroupAlias(time_date_time,'5m'),
|
||||
min(value_double) as min_value,
|
||||
max(value_double) as max_value
|
||||
FROM test_data
|
||||
WHERE $__timeFilter(time_date_time)
|
||||
GROUP BY time
|
||||
ORDER BY time
|
||||
```
|
||||
|
||||
Data frame result:
|
||||
|
||||
```text
|
||||
+---------------------+-----------------+-----------------+
|
||||
| Name: time | Name: min_value | Name: max_value |
|
||||
| Labels: | Labels: | Labels: |
|
||||
| Type: []time.Time | Type: []float64 | Type: []float64 |
|
||||
+---------------------+-----------------+-----------------+
|
||||
| 2020-01-02 03:05:00 | 3 | 4 |
|
||||
| 2020-01-02 03:10:00 | 6 | 7 |
|
||||
| 2020-01-02 03:20:00 | 5 | 5 |
|
||||
+---------------------+-----------------+-----------------+
|
||||
```
|
||||
|
||||
## Templating
|
||||
|
||||
Instead of hardcoding values like server, application, or sensor names in your metric queries, you can use variables. Variables appear as drop-down select boxes at the top of the dashboard. These drop-downs make it easy to change the data being displayed in your dashboard.
|
||||
|
||||
Refer to [Templates](ref:variables) for an introduction to creating template variables as well as the different types.
|
||||
|
||||
### Query variable
|
||||
|
||||
If you add a `Query` template variable you can write a MySQL query to retrieve items such as measurement names, key names, or key values, which will be displayed in the drop-down menu.
|
||||
|
||||
For example, you can use a variable to retrieve all the values from the `hostname` column in a table by creating the following query in the templating variable _Query_ setting.
|
||||
|
||||
```sql
|
||||
SELECT hostname FROM my_host
|
||||
```
|
||||
|
||||
A query can return multiple columns, and Grafana will automatically generate a list based on the query results. For example, the following query returns a list with values from `hostname` and `hostname2`.
|
||||
|
||||
```sql
|
||||
SELECT my_host.hostname, my_other_host.hostname2 FROM my_host JOIN my_other_host ON my_host.city = my_other_host.city
|
||||
```
|
||||
|
||||
To use time range dependent macros like `$__timeFilter(column)` in your query,you must set the template variable's refresh mode to _On Time Range Change_.
|
||||
|
||||
```sql
|
||||
SELECT event_name FROM event_log WHERE $__timeFilter(time_column)
|
||||
```
|
||||
|
||||
Another option is a query that can create a key/value variable. The query should return two columns that are named `__text` and `__value`. The `__text` column must contain unique values (if not, only the first value is used). This allows the drop-down options to display a text-friendly name as the text while using an ID as the value. For example, a query could use `hostname` as the text and `id` as the value:
|
||||
|
||||
```sql
|
||||
SELECT hostname AS __text, id AS __value FROM my_host
|
||||
```
|
||||
|
||||
You can also create nested variables. For example, if you have a variable named `region`, you can configure the `hosts` variable to display only the hosts within the currently selected region as shown in the following example. If `region` is a multi-value variable, use the `IN` operator instead of `=` to match multiple values.
|
||||
|
||||
```sql
|
||||
SELECT hostname FROM my_host WHERE region IN($region)
|
||||
```
|
||||
|
||||
#### Use `__searchFilter` to filter results in a query variable
|
||||
|
||||
Using `__searchFilter` in the query field allows the query results to be filtered based on the user’s input in the drop-down selection box. If you do not enter anything, the default value for `__searchFilter` is %
|
||||
|
||||
Note that you must enclose the `__searchFilter` expression in quotes as Grafana does not add them automatically.
|
||||
|
||||
The following example demonstrates how to use `__searchFilter` in the query field to enable real-time searching for `hostname` as the user type in the drop-down selection box.
|
||||
|
||||
```sql
|
||||
SELECT hostname FROM my_host WHERE hostname LIKE '$__searchFilter'
|
||||
```
|
||||
|
||||
### Using variables in queries
|
||||
|
||||
Template variable values are only quoted when the template variable is a `multi-value`.
|
||||
|
||||
If the variable is a multi-value variable, use the `IN` comparison operator instead of `=` to match against multiple values.
|
||||
|
||||
You can use two different syntaxes:
|
||||
|
||||
`$<varname>` Example with a template variable named `hostname`:
|
||||
|
||||
```sql
|
||||
SELECT
|
||||
UNIX_TIMESTAMP(atimestamp) as time,
|
||||
aint as value,
|
||||
avarchar as metric
|
||||
FROM my_table
|
||||
WHERE $__timeFilter(atimestamp) and hostname in($hostname)
|
||||
ORDER BY atimestamp ASC
|
||||
```
|
||||
|
||||
`[[varname]]` Example with a template variable named `hostname`:
|
||||
|
||||
```sql
|
||||
SELECT
|
||||
UNIX_TIMESTAMP(atimestamp) as time,
|
||||
aint as value,
|
||||
avarchar as metric
|
||||
FROM my_table
|
||||
WHERE $__timeFilter(atimestamp) and hostname in([[hostname]])
|
||||
ORDER BY atimestamp ASC
|
||||
```
|
||||
|
||||
#### Disabling quoting for multi-value variables
|
||||
|
||||
Grafana automatically creates a quoted, comma-separated string for multi-value variables. For example: if `server01` and `server02` are selected then it will be formatted as: `'server01', 'server02'`. To disable quoting, use the csv formatting option for variables:
|
||||
|
||||
Grafana automatically formats multi-value variables as a quoted, comma-separated string. For example, if `server01` and `server02` are selected, they are formatted as `'server01'`, `'server02'`. To remove the quotes, enable the CSV formatting option for the variables.
|
||||
|
||||
`${servers:csv}`
|
||||
|
||||
Read more about variable formatting options in the [Variables](ref:variable-syntax-advanced-variable-format-options) documentation.
|
||||
|
||||
## Annotations
|
||||
|
||||
[Annotations](ref:annotate-visualizations) allow you to overlay rich event information on top of graphs. You add annotation queries via the **Dashboard settings > Annotations view**.
|
||||
|
||||
**Example query using a`time` column with epoch values:**
|
||||
|
||||
```sql
|
||||
SELECT
|
||||
epoch_time as time,
|
||||
metric1 as text,
|
||||
CONCAT(tag1, ',', tag2) as tags
|
||||
FROM
|
||||
public.test_data
|
||||
WHERE
|
||||
$__unixEpochFilter(epoch_time)
|
||||
```
|
||||
|
||||
**Example region query using `time` and `timeend` columns with epoch values:**
|
||||
|
||||
```sql
|
||||
SELECT
|
||||
epoch_time as time,
|
||||
epoch_timeend as timeend,
|
||||
metric1 as text,
|
||||
CONCAT(tag1, ',', tag2) as tags
|
||||
FROM
|
||||
public.test_data
|
||||
WHERE
|
||||
$__unixEpochFilter(epoch_time)
|
||||
```
|
||||
|
||||
**Example query using a `time` column with a native SQL date/time data type:**
|
||||
|
||||
```sql
|
||||
SELECT
|
||||
native_date_time as time,
|
||||
metric1 as text,
|
||||
CONCAT(tag1, ',', tag2) as tags
|
||||
FROM
|
||||
public.test_data
|
||||
WHERE
|
||||
$__timeFilter(native_date_time)
|
||||
```
|
||||
|
||||
| Name | Description |
|
||||
| --------- | --------------------------------------------------------------------------------------------------------------------- |
|
||||
| `time` | The name of the date/time field, which can be a column with a native SQL date/time data type or epoch value. |
|
||||
| `timeend` | Optional name of the end date/time field, which can be a column with a native SQL date/time data type or epoch value. |
|
||||
| `text` | Event description field. |
|
||||
| `tags` | Optional field name to use for event tags as a comma separated string. |
|
||||
|
||||
## Alerting
|
||||
|
||||
Use time series queries to create alerts. Table formatted queries aren't yet supported in alert rule conditions.
|
||||
|
||||
For more information regarding alerting refer to the following:
|
||||
|
||||
- [Alert rules](ref:alert-rules)
|
||||
- [Template annotations and labels](ref:template-annotations-and-labels)
|
||||
@@ -31,6 +31,11 @@ refs:
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/configure-data-links/#value-variables
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/configure-data-links/#value-variables
|
||||
alerting-alert-rules:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/
|
||||
---
|
||||
|
||||
# Configure Prometheus
|
||||
@@ -115,7 +120,7 @@ Following are additional configuration options.
|
||||
|
||||
### Alerting
|
||||
|
||||
- **Manage alerts via Alerting UI** - Toggle to enable `Alertmanager` integration for this data source.
|
||||
- **Manage alerts via Alerting UI** - Toggle to enable [data source-managed rules in Grafana Alerting](ref:alerting-alert-rules) for this data source. For `Mimir`, it enables managing data source-managed rules and alerts. For `Prometheus`, it only supports viewing existing rules and alerts, which are displayed as data source-managed.
|
||||
|
||||
### Interval behavior
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ aliases:
|
||||
description: Horizontally-scalable, highly-available, multi-tenant continuous profiling
|
||||
aggregation system. OSS profiling solution from Grafana Labs.
|
||||
keywords:
|
||||
- grafana
|
||||
- phlare
|
||||
- guide
|
||||
- profiling
|
||||
@@ -39,11 +38,17 @@ refs:
|
||||
destination: https://grafana.com/docs/grafana/<GRAFANA_VERSION>/administration/provisioning/#datasources
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: https://grafana.com/docs/grafana/<GRAFANA_VERSION>/administration/provisioning/#datasources
|
||||
flame-graph-panel:
|
||||
- pattern: /docs/grafana/
|
||||
destination: https://grafana.com/docs/grafana/<GRAFANA_VERSION>/panels-visualizations/visualizations/flame-graph/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: https://grafana.com/docs/grafana-cloud/visualizations/panels-visualizations/visualizations/flame-graph/
|
||||
---
|
||||
|
||||
# Grafana Pyroscope data source
|
||||
|
||||
Grafana Pyroscope is a horizontally scalable, highly available, multi-tenant, OSS, continuous profiling aggregation system. Add it as a data source, and you are ready to query your profiles in [Explore](ref:explore).
|
||||
Grafana Pyroscope is a horizontally scalable, highly available, multi-tenant, OSS, continuous profiling aggregation system.
|
||||
Add a Pyroscope data source to query your profiles in [Explore](ref:explore).
|
||||
|
||||
Refer to [Introduction to Pyroscope](https://grafana.com/docs/pyroscope/<PYROSCOPE_VERSION>/introduction/) to understand profiling and Pyroscope.
|
||||
|
||||
@@ -53,9 +58,36 @@ To use profiling data, you should:
|
||||
- [Configure the Grafana Pyroscope data source](./configure-pyroscope-data-source/).
|
||||
- [View and query profiling data using Explore Profiles or the query editor ](./query-profile-data/)
|
||||
|
||||
## Continuous profiling
|
||||
|
||||
While code profiling has been a long-standing practice, continuous profiling represents a modern and more advanced approach to performance monitoring.
|
||||
|
||||
This technique adds two critical dimensions to traditional profiles:
|
||||
|
||||
Time
|
||||
: Profiling data is collected _continuously_, providing a time-centric view that allows querying performance data from any point in the past.
|
||||
|
||||
Metadata
|
||||
: Profiles are enriched with metadata, adding contextual depth to the performance data.
|
||||
|
||||
These dimensions, coupled with the detailed nature of performance profiles, make continuous profiling a uniquely valuable tool.
|
||||
|
||||
### Flame graphs
|
||||
|
||||
<!-- vale Grafana.We = NO -->
|
||||
|
||||
Flame graphs help you visualize resource allocation and performance bottlenecks, and you even get suggested recommendations and performance fixes via AI-driven flame graph analysis, as well as line-level insights from our GitHub integration.
|
||||
|
||||
<!-- vale Grafana.We = YES -->
|
||||
|
||||
On views with a flame graph, you can use **Explain flame graph** to provide an AI flame graph analysis that explains the performance bottleneck, root cause, and recommended fix.
|
||||
For more information, refer to [Flame graph AI](https://grafana.com/docs/grafana-cloud/monitor-applications/profiles/flamegraph-ai/).
|
||||
|
||||
## Integrate profiles into dashboards
|
||||
|
||||
Using the Pyroscope data source, you can integrate profiles into your dashboards.
|
||||
For example, you can embed flame graphs using the [flame graph panel](ref:flame-graph-panel).
|
||||
|
||||
In this case, the screenshot shows memory profiles alongside panels for logs and metrics to be able to debug out of memory (OOM) errors alongside the associated logs and metrics.
|
||||
|
||||

|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
title: Configure traces to profiles
|
||||
menuTitle: Configure traces to profiles
|
||||
description: Learn how to configure the traces to profiles integration in Grafana and Grafana Cloud.
|
||||
weight: 300
|
||||
keywords:
|
||||
- continuous profiling
|
||||
- tracing
|
||||
---
|
||||
|
||||
# Configure traces to profiles
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
|
||||
Your application must be instrumented for profiles and traces. For more information, refer to [Link traces to profiles](https://grafana.com/docs/pyroscope/<PYROSCOPE_VERSION>/configure-client/trace-span-profiles/).
|
||||
|
||||
{{< /admonition >}}
|
||||
|
||||
[//]: # 'Shared content for Trace to profiles in the Tempo data source'
|
||||
|
||||
{{< docs/shared source="grafana" lookup="datasources/tempo-traces-to-profiles.md" version="<GRAFANA VERSION>" >}}
|
||||
@@ -11,7 +11,7 @@ labels:
|
||||
- oss
|
||||
title: Query profile data
|
||||
menuTitle: Query profile data
|
||||
weight: 300
|
||||
weight: 400
|
||||
refs:
|
||||
configure-tempo-data-source:
|
||||
- pattern: /docs/grafana/
|
||||
@@ -43,11 +43,24 @@ refs:
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/administration/provisioning/#datasources
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/administration/provisioning/#datasources
|
||||
flame-graph-panel:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/visualizations/flame-graph/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/panels-visualizations/visualizations/flame-graph/
|
||||
---
|
||||
|
||||
https://grafana.com/docs/grafana-cloud/visualizations/panels-visualizations/visualizations/flame-graph/
|
||||
|
||||
# Query profile data
|
||||
|
||||
You can query your profile data using the built-in data source query editor or you can use the open source Grafana Explore Profiles app.
|
||||
You can query your profile data using the open source Grafana Explore Profiles app or the built-in Grafana Pyroscope data source query editor.
|
||||
|
||||
- Explore Profiles provides a queryless experience for inspecting your profiling data with opinionated workflows to assist your investigation.
|
||||
- Data source query editor provides complete control over your data exploration and is recommended for experienced users.
|
||||
|
||||
In addition, you can embed flame graph panels in Grafana dashboards.
|
||||
Refer to the [Flame graph panel](ref:flame-graph-panel) documentation for details.
|
||||
|
||||
## Explore Profiles
|
||||
|
||||
@@ -56,6 +69,8 @@ You can query your profile data using the built-in data source query editor or y
|
||||
You can use Explore Profiles in Grafana Cloud or in your own Grafana instance.
|
||||
For more information, refer to [Access or install Explore Profiles](ref:explore-profiles-install).
|
||||
|
||||

|
||||
|
||||
### Use cases
|
||||
|
||||
There are several different modes for viewing, analyzing, and comparing profiling data.
|
||||
@@ -65,7 +80,7 @@ The main use cases are the following:
|
||||
- Proactive: Cutting costs, addressing latency issues, or optimizing memory usage for applications
|
||||
- Reactive: Resolving incidents with line-level accuracy or debugging active latency/memory issues
|
||||
|
||||
Explore Profiles provides an intuitive interface to specifically support these use cases.
|
||||
Explore Profiles provides an intuitive interface to specifically support proactivee and reactive use cases.
|
||||
You get a holistic view of all of your services and how they're functioning, but also the ability to drill down for more targeted root cause analysis.
|
||||
|
||||
Explore Profiles offers a convenient platform to analyze profiles and get insights that are impossible to get from using other traditional signals like logs, metrics, or tracing.
|
||||
@@ -74,31 +89,6 @@ Explore Profiles offers a convenient platform to analyze profiles and get insigh
|
||||
|
||||
{{< docs/play title="the Grafana Play site" url="https://play.grafana.org/a/grafana-pyroscope-app/profiles-explorer" >}}
|
||||
|
||||
### Continuous profiling
|
||||
|
||||
While code profiling has been a long-standing practice, continuous profiling represents a modern and more advanced approach to performance monitoring.
|
||||
|
||||
This technique adds two critical dimensions to traditional profiles:
|
||||
|
||||
Time
|
||||
: Profiling data is collected _continuously_, providing a time-centric view that allows querying performance data from any point in the past.
|
||||
|
||||
Metadata
|
||||
: Profiles are enriched with metadata, adding contextual depth to the performance data.
|
||||
|
||||
These dimensions, coupled with the detailed nature of performance profiles, make continuous profiling a uniquely valuable tool.
|
||||
|
||||
### Flame graphs
|
||||
|
||||
<!-- vale Grafana.We = NO -->
|
||||
|
||||
Flame graphs help you visualize resource allocation and performance bottlenecks, and you even get suggested recommendations and performance fixes via AI-driven flame graph analysis, as well as line-level insights from our GitHub integration.
|
||||
|
||||
<!-- vale Grafana.We = YES -->
|
||||
|
||||
On views with a flame graph, you can use **Explain flame graph** to provide an AI flame graph analysis that explains the performance bottleneck, root cause, and recommended fix.
|
||||
For more information, refer to [Flame graph AI](https://grafana.com/docs/grafana-cloud/monitor-applications/profiles/flamegraph-ai/).
|
||||
|
||||
## Pyroscope query editor
|
||||
|
||||
The Pyroscope data source query editor gives you access to a profile type selector, a label selector, and collapsible options.
|
||||
@@ -135,7 +125,9 @@ Using **Group by**, you can group metric data by a specified label.
|
||||
Without any **Group by** label, metric data aggregates over all the labels into single time series.
|
||||
You can use multiple labels to group by. Group by only effects the metric data and doesn't change the profile data results.
|
||||
|
||||
## Profiles query results
|
||||
In conjunction with **Group by**, you can set a positive number in the **Limit** input to limit the maximum number of time series returned by the data source. The series returned are always ordered by descending value for the total aggregated data over the time period.
|
||||
|
||||
### Profiles query results
|
||||
|
||||
Profiles can be visualized in a flame graph.
|
||||
Refer to the [Flame Graph documentation](ref:flame-graph) to learn about the visualization and its features.
|
||||
@@ -146,7 +138,7 @@ Pyroscope returns profiles aggregated over a selected time range.
|
||||
The absolute values in the flame graph grow as the time range gets bigger while keeping the relative values meaningful.
|
||||
You can zoom in on the time range to get a higher granularity profile up to the point of a single scrape interval.
|
||||
|
||||
## Metrics query results
|
||||
### Metrics query results
|
||||
|
||||
Metrics results represent the aggregated sum value over time of the selected profile type.
|
||||
|
||||
|
||||
@@ -387,8 +387,8 @@ datasources:
|
||||
query: 'method="$${__span.tags.method}"'
|
||||
tracesToMetrics:
|
||||
datasourceUid: 'prom'
|
||||
spanStartTimeShift: '1h'
|
||||
spanEndTimeShift: '-1h'
|
||||
spanStartTimeShift: '-1h'
|
||||
spanEndTimeShift: '1h'
|
||||
tags: [{ key: 'service.name', value: 'service' }, { key: 'job' }]
|
||||
queries:
|
||||
- name: 'Sample query'
|
||||
@@ -407,8 +407,8 @@ datasources:
|
||||
hide: false
|
||||
traceQuery:
|
||||
timeShiftEnabled: true
|
||||
spanStartTimeShift: '1h'
|
||||
spanEndTimeShift: '-1h'
|
||||
spanStartTimeShift: '-1h'
|
||||
spanEndTimeShift: '1h'
|
||||
spanBar:
|
||||
type: 'Tag'
|
||||
tag: 'http.path'
|
||||
|
||||
@@ -62,7 +62,15 @@ You have the option to customize the display of logs and choose which columns to
|
||||
|
||||
### Download log lines
|
||||
|
||||
Click **Download** to download log results in either `TXT` or `JSON` format. This feature allows you to save log data for further analysis or to share it with others in a convenient and accessible format.
|
||||
This feature lets you save log data for further analysis or to share it with others in a convenient and accessible format.
|
||||
|
||||
In Explore there are three export options:
|
||||
|
||||
- **TXT** - will export the data as visible on the screen, meaning it will take into account formatting, like `line_format`.
|
||||
- **JSON** - will export the raw data, regardless of the formatting, like `line_format`.
|
||||
- **CSV** - will export the raw data, regardless of the formatting, like `line_format`.
|
||||
|
||||
Click **Download** and select `TXT`, `JSON` or `CSV` to download log results.
|
||||
|
||||
### Log result meta information
|
||||
|
||||
|
||||
@@ -75,9 +75,9 @@ Grafana Enterprise adds the following features:
|
||||
With a Grafana Enterprise license, you also get access to premium data sources, including:
|
||||
|
||||
- [Adobe Analytics](/grafana/plugins/grafana-adobeanalytics-datasource)
|
||||
- [Amazon Aurora](/grafana/plugins/grafana-aurora-datasource)
|
||||
- [AppDynamics](/grafana/plugins/dlopes7-appdynamics-datasource)
|
||||
- [Atlassian Statuspage](/grafana/plugins/grafana-atlassianstatuspage-datasource)
|
||||
- [Aurora](/grafana/plugins/grafana-aurora-datasource)
|
||||
- [Azure CosmosDB](/grafana/plugins/grafana-azurecosmosdb-datasource)
|
||||
- [Azure Devops](/grafana/plugins/grafana-azuredevops-datasource)
|
||||
- [Catchpoint](/grafana/plugins/grafana-catchpoint-datasource)
|
||||
@@ -86,10 +86,15 @@ With a Grafana Enterprise license, you also get access to premium data sources,
|
||||
- [Databricks](/grafana/plugins/grafana-databricks-datasource)
|
||||
- [DataDog](/grafana/plugins/grafana-datadog-datasource)
|
||||
- [Drone](/grafana/plugins/grafana-drone-datasource)
|
||||
- [DynamoDB](/grafana/plugins/grafana-dynamodb-datasource/)
|
||||
- [Dynatrace](/grafana/plugins/grafana-dynatrace-datasource)
|
||||
- [Gitlab](/grafana/plugins/grafana-gitlab-datasource)
|
||||
- [Grafana Enterprise Logs](/grafana/plugins/grafana-enterprise-logs-app/)
|
||||
- [Grafana Enterprise Metrics](/grafana/plugins/grafana-metrics-enterprise-app/)
|
||||
- [Grafana Enterprise Traces](/grafana/plugins/grafana-enterprise-traces-app/)
|
||||
- [Honeycomb](/grafana/plugins/grafana-honeycomb-datasource)
|
||||
- [Jira](/grafana/plugins/grafana-jira-datasource)
|
||||
- [Looker](/grafana/plugins/grafana-looker-datasource/)
|
||||
- [MongoDB](/grafana/plugins/grafana-mongodb-datasource)
|
||||
- [Netlify](/grafana/plugins/grafana-netlify-datasource)
|
||||
- [New Relic](/grafana/plugins/grafana-newrelic-datasource)
|
||||
|
||||
@@ -135,7 +135,7 @@ On visualizations that support thresholds, Grafana has the following default thr
|
||||
- 80 = red
|
||||
- Base = green
|
||||
- Mode = Absolute
|
||||
- Show thresholds = Off (for some visualizations); for more information, see the [Show thresholds](#show-threshold) option.
|
||||
- Show thresholds = Off (for some visualizations); for more information, see the [Show thresholds](#show-thresholds) option.
|
||||
|
||||
## Thresholds options
|
||||
|
||||
|
||||
@@ -24,13 +24,23 @@ refs:
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/
|
||||
create-dashboard:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/build-dashboards/create-dashboard/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/dashboards/build-dashboards/create-dashboard/
|
||||
alert-label:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/annotation-label/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/annotation-label/
|
||||
---
|
||||
|
||||
# Alert list
|
||||
|
||||
Alert lists allow you to display a list of important alerts that you want to track. You can configure the alert list to show the current state of your alert, such as firing, pending, or normal. Learn more about alerts in [Grafana Alerting overview](ref:grafana-alerting-overview).
|
||||
|
||||
{{< figure src="/static/img/docs/alert-list-panel/alert-list-panel.png" max-width="850px" alt="An alert list visualization" >}}
|
||||

|
||||
|
||||
On each dashboard load, this visualization queries the alert list, always providing the most up-to-date results.
|
||||
|
||||
@@ -38,37 +48,41 @@ On each dashboard load, this visualization queries the alert list, always provid
|
||||
|
||||
## Configure an alert list
|
||||
|
||||
Once you’ve created a [dashboard](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/dashboards/build-dashboards/create-dashboard/), the following video shows you how to configure an alert list visualization:
|
||||
Once you’ve [created a dashboard](ref:create-dashboard), the following video shows you how to configure an alert list visualization:
|
||||
|
||||
{{< youtube id="o4rK7_AXZ9Y" >}}
|
||||
|
||||
## Panel options
|
||||
## Configuration options
|
||||
|
||||
{{< docs/shared lookup="visualizations/config-options-intro.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
### Panel options
|
||||
|
||||
{{< docs/shared lookup="visualizations/panel-options.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
## Options
|
||||
### Options
|
||||
|
||||
Use the following options to refine your alert list visualization.
|
||||
|
||||
### View mode
|
||||
<!-- prettier-ignore-start -->
|
||||
|
||||
Choose between **List** to display alerts in a detailed list format with comprehensive information, or **Stat** to show alerts as a summarized single-value statistic.
|
||||
| Option | Description |
|
||||
| ---------- | --------------------------------------------------------------------------------------------------------- |
|
||||
| View mode | Choose between **List** to display alerts in a detailed list format with comprehensive information, or **Stat** to show alerts as a summarized single-value statistic. |
|
||||
| Group mode | Choose between **Default grouping** to show alert instances grouped by their alert rule, or **Custom grouping** to show alert instances grouped by a custom set of labels. |
|
||||
| Max items | Sets the maximum number of alerts to list. By default, Grafana sets this value to 10. |
|
||||
| [Sort order](#sort-order) | Select how to order the alerts displayed. |
|
||||
| Alerts linked to this dashboard | Toggle the switch on to only show alerts from the dashboard the alert list is in. |
|
||||
|
||||
### Group mode
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
Choose between **Default grouping** to show alert instances grouped by their alert rule, or **Custom grouping** to show alert instances grouped by a custom set of labels.
|
||||
|
||||
### Max items
|
||||
|
||||
Sets the maximum number of alerts to list. By default, Grafana sets this value to 10.
|
||||
|
||||
### Sort order
|
||||
#### Sort order
|
||||
|
||||
Select how to order the alerts displayed. Choose from:
|
||||
|
||||
- **Alphabetical (asc) -** Alphabetical order.
|
||||
- **Alphabetical (desc) -** Reverse alphabetical order.
|
||||
- **Importance -** By importance according to the following values, with 1 being the highest:
|
||||
- **Alphabetical (asc)** - Alphabetical order.
|
||||
- **Alphabetical (desc)** - Reverse alphabetical order.
|
||||
- **Importance** - By importance according to the following values, with 1 being the highest:
|
||||
- alerting: 1
|
||||
- firing: 1
|
||||
- no_data: 2
|
||||
@@ -76,39 +90,34 @@ Select how to order the alerts displayed. Choose from:
|
||||
- ok: 4
|
||||
- paused: 5
|
||||
- inactive: 5
|
||||
- **Time (asc) -** Newest active alert instances first.
|
||||
- **Time (desc) -** Oldest active alert instances first.
|
||||
- **Time (asc)** - Newest active alert instances first.
|
||||
- **Time (desc)** - Oldest active alert instances first.
|
||||
|
||||
### Alerts linked to this dashboard
|
||||
|
||||
Toggle the switch on to only show alerts from the dashboard the alert list is in.
|
||||
|
||||
## Filter
|
||||
### Filter options
|
||||
|
||||
These options allow you to limit alerts shown to only those that match the query, folder, or tags you choose.
|
||||
|
||||
### Alert name
|
||||
<!-- prettier-ignore-start -->
|
||||
|
||||
Filter alerts by name.
|
||||
| Option | Description |
|
||||
| ---------- | --------------------------------------------------------------------------------------------------------- |
|
||||
| Alert name | Filter alerts by name. |
|
||||
| Alert instance label | Filter alert instances using [label](ref:alert-label) querying. For example,`{severity="critical", instance=~"cluster-us-.+"}`. |
|
||||
| Datasource | Filter alerts from the selected data source. |
|
||||
| Folder | Filter alerts by the selected folder. Only alerts from dashboards in this folder are displayed. |
|
||||
|
||||
### Alert instance label
|
||||
|
||||
Filter alert instances using [label](https://grafana.com/docs/grafana/latest/alerting/fundamentals/alert-rules/annotation-label/) querying. For example,`{severity="critical", instance=~"cluster-us-.+"}`.
|
||||
|
||||
### Datasource
|
||||
|
||||
Filter alerts from the selected data source.
|
||||
|
||||
### Folder
|
||||
|
||||
Filter alerts by the selected folder. Only alerts from dashboards in this folder are displayed.
|
||||
|
||||
## Alert state filter
|
||||
### Alert state filter options
|
||||
|
||||
Choose which alert states to display in this visualization.
|
||||
|
||||
- **Alerting / Firing -** Shows alerts that are currently active and triggering an alert condition.
|
||||
- **Pending -** Shows alerts that are in a transitional state, waiting for conditions to be met before triggering.
|
||||
- **No Data -** Shows alerts where the data source is not returning any data, which could indicate an issue with data collection.
|
||||
- **Normal -** Shows alerts that are in a normal or resolved state, where no alert condition is currently met.
|
||||
- **Error -** Shows alerts where an error has occurred, typically related to an issue in the alerting process.
|
||||
<!-- prettier-ignore-start -->
|
||||
|
||||
| Option | Description |
|
||||
| ---------- | --------------------------------------------------------------------------------------------------------- |
|
||||
| Alerting / Firing | Shows alerts that are currently active and triggering an alert condition. |
|
||||
| Pending | Shows alerts that are in a transitional state, waiting for conditions to be met before triggering. |
|
||||
| No Data | Shows alerts where the data source is not returning any data, which could indicate an issue with data collection. |
|
||||
| Normal | Shows alerts that are in a normal or resolved state, where no alert condition is currently met. |
|
||||
| Error | Shows alerts where an error has occurred, typically related to an issue in the alerting process. |
|
||||
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
@@ -27,7 +27,7 @@ refs:
|
||||
|
||||
Gauges are single-value visualizations that allow you to quickly visualize where a value falls within a defined or calculated min and max range. With repeat options, you can display multiple gauges, each corresponding to a different series, column, or row.
|
||||
|
||||
{{< figure src="/static/img/docs/v66/gauge_panel_cover.png" max-width="1025px" alt="A gauge visualization">}}
|
||||
{{< figure src="/media/docs/grafana/panels-visualizations/screenshot-gauge-visualization-v11.4.png" alt="A gauge visualization">}}
|
||||
|
||||
You can use gauges if you need to track:
|
||||
|
||||
@@ -35,11 +35,11 @@ You can use gauges if you need to track:
|
||||
- How full a piece of equipment is
|
||||
- How fast a vehicle is moving within a set of limits
|
||||
- Network latency
|
||||
- Equipment state with setpoint and alarm thresholds
|
||||
- Equipment state with set point and alarm thresholds
|
||||
- CPU consumption (0-100%)
|
||||
- RAM availability
|
||||
|
||||
## Configure a time series visualization
|
||||
## Configure a gauge visualization
|
||||
|
||||
The following video provides beginner steps for creating gauge panels. You'll learn the data requirements and caveats, special customizations, and much more:
|
||||
|
||||
@@ -57,13 +57,13 @@ To create a gauge visualization you need a dataset containing at least one numer
|
||||
| --------- | ---------- |
|
||||
| MyGauge | 5 |
|
||||
|
||||

|
||||

|
||||
|
||||
This dataset generates a visualization with one empty gauge showing the numeric value. This is because the gauge visualization automatically defines the upper and lower range from the minimum and maximum values in the dataset. This dataset has only one value, so it’s set as both minimum and maximum.
|
||||
|
||||
If you only have one value, but you want to define a different minimum and maximum, you can set them manually in the [Standard options](#standard-options) settings to generate a more typical looking gauge.
|
||||
|
||||

|
||||

|
||||
|
||||
### Example - One row, multiple values
|
||||
|
||||
@@ -73,7 +73,7 @@ The gauge visualization can support multiple fields in a dataset. <!-- In this c
|
||||
| ---------- | ------ | ------ | ------ |
|
||||
| Gauges | 5 | 3 | 10 |
|
||||
|
||||

|
||||

|
||||
|
||||
When there are multiple values in the dataset, the visualization displays multiple gauges and automatically defines the minimum and maximum. In this case, those are 3 and 10. Because the minimum and maximum values are defined, each gauge is shaded in to show that value in relation to the minimum and maximum.
|
||||
|
||||
@@ -87,7 +87,7 @@ The gauge visualization can display datasets with multiple rows of data or even
|
||||
| Indicators | 6 | 9 | 15 |
|
||||
| Defaults | 1 | 4 | 8 |
|
||||
|
||||

|
||||

|
||||
|
||||
By default, the visualization is configured to [calculate](#value-options) a single value per column or series and to display only the last row of data. However, it derives the minimum and maximum from the full dataset, even if those values aren’t visible.
|
||||
|
||||
@@ -95,7 +95,7 @@ In this example, that means only the last row of data is displayed in the gauges
|
||||
|
||||
If you want to show one gauge per table cell, you can change the **Show** setting from **Calculate** to **All values**, and each gauge is labeled by concatenating the text column with each value's column name.
|
||||
|
||||

|
||||

|
||||
|
||||
### Example - Defined min and max
|
||||
|
||||
@@ -105,118 +105,84 @@ You can also define minimum and maximum values as part of the dataset.
|
||||
| ---------- | ----- | --- | --- |
|
||||
| Gauges | 5 | 10 | 2 |
|
||||
|
||||

|
||||

|
||||
|
||||
If you don’t want to display gauges for the `min` and `max` values, you can configure only one field to be displayed as described in the [value options](#value-options) section.
|
||||
|
||||

|
||||

|
||||
|
||||
Even when minimum and maximum values aren’t displayed, the visualization still pulls the range from them.
|
||||
|
||||
## Panel options
|
||||
## Configuration options
|
||||
|
||||
{{< docs/shared lookup="visualizations/config-options-intro.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
### Panel options
|
||||
|
||||
{{< docs/shared lookup="visualizations/panel-options.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
## Value options
|
||||
### Value options
|
||||
|
||||
Use the following options to refine how your visualization displays the value:
|
||||
|
||||
### Show
|
||||
<!-- prettier-ignore-start -->
|
||||
|
||||
Choose how Grafana displays your data.
|
||||
| Option | Description |
|
||||
| ------ | ----------- |
|
||||
| Show | Set how Grafana displays your data. Choose from:<ul><li>**Calculate** - Show a calculated value based on all rows.</li><li>**All values** - Show a separate value for every row. If you select this option, then you can also limit the number of rows to display.</li></ul> |
|
||||
| Calculation | If you chose **Calculate** as your **Show** option, select a reducer function that Grafana will use to reduce many fields to a single value. For a list of available calculations, refer to [Calculation types](ref:calculation-types). |
|
||||
| Limit | If you chose **All values** as your **Show** option, enter the maximum number of rows to display. The default is 5,000. |
|
||||
| Fields | Select the fields display in the panel. |
|
||||
|
||||
#### Calculate
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
Show a calculated value based on all rows.
|
||||
|
||||
- **Calculation -** Select a reducer function that Grafana will use to reduce many fields to a single value. For a list of available calculations, refer to [Calculation types](ref:calculation-types).
|
||||
- **Fields -** Select the fields display in the panel.
|
||||
|
||||
#### All values
|
||||
|
||||
Show a separate stat for every row. If you select this option, then you can also limit the number of rows to display.
|
||||
|
||||
- **Limit -** The maximum number of rows to display. Default is 5,000.
|
||||
- **Fields -** Select the fields display in the panel.
|
||||
|
||||
## Gauge
|
||||
### Gauge options
|
||||
|
||||
Adjust how the gauge is displayed.
|
||||
|
||||
### Orientation
|
||||
<!-- prettier-ignore-start -->
|
||||
|
||||
Choose a stacking direction.
|
||||
| Option | Description |
|
||||
| ------ | ----------- |
|
||||
| Orientation | Choose a stacking direction:<ul><li>**Auto** - Gauges display in rows and columns.</li><li>**Horizontal** - Gauges display top to bottom.</li><li>**Vertical** - Gauges display left to right.</li></ul> |
|
||||
| Show threshold labels | Controls if threshold values are shown. |
|
||||
| [Show threshold markers](#show-threshold-markers) | Controls if a threshold band is shown outside the inner gauge value band. |
|
||||
| Gauge size | Choose a gauge size mode:<ul><li>**Auto** - Grafana determines the best gauge size.</li><li>**Manual** - Manually configure the gauge size.</li></ul>This option only applies when **Orientation** is set to **Horizontal** or **Vertical**. |
|
||||
| Min width | Set the minimum width of vertically-oriented gauges. If you set a minimum width, the x-axis scrollbar is automatically displayed when there's a large amount of data. This option only applies when **Gauge size** is set to **Manual**. |
|
||||
| Min height | Set the minimum height of horizontally-oriented gauges. If you set a minimum height, the y-axis scrollbar is automatically displayed when there's a large amount of data. This option only applies when **Gauge size** is set to **Manual**. |
|
||||
| Neutral | Set the starting value from which every gauge will be filled. |
|
||||
|
||||
- **Auto -** Gauges display in rows and columns.
|
||||
- **Horizontal -** Gauges display top to bottom.
|
||||
- **Vertical -** Gauges display left to right.
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
### Show threshold labels
|
||||
#### Show threshold markers
|
||||
|
||||
Controls if threshold values are shown.
|
||||
Controls if a threshold band is shown around the inner gauge value band.
|
||||
|
||||
### Show threshold markers
|
||||

|
||||
|
||||
Controls if a threshold band is shown outside the inner gauge value band.
|
||||
|
||||
### Gauge size
|
||||
|
||||
Choose a gauge size mode.
|
||||
|
||||
- **Auto -** Grafana determines the best gauge size.
|
||||
- **Manual -** Manually configure the gauge size.
|
||||
|
||||
### Min width
|
||||
|
||||
Set the minimum width of vertically-oriented gauges.
|
||||
|
||||
If you set a minimum width, the x-axis scrollbar is automatically displayed when there's a large amount of data.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
This option only applies when gauge size is set to manual.
|
||||
{{% /admonition %}}
|
||||
|
||||
### Min height
|
||||
|
||||
Set the minimum height of horizontally-oriented gauges.
|
||||
|
||||
If you set a minimum height, the y-axis scrollbar is automatically displayed when there's a large amount of data.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
This option only applies when gauge size is set to manual.
|
||||
{{% /admonition %}}
|
||||
|
||||
### Neutral
|
||||
|
||||
Set the starting value from which every gauge will be filled.
|
||||
|
||||
## Text size
|
||||
### Text size
|
||||
|
||||
Adjust the sizes of the gauge text.
|
||||
|
||||
- **Title -** Enter a numeric value for the gauge title size.
|
||||
- **Value -** Enter a numeric value for the gauge value size.
|
||||
- **Title** - Enter a numeric value for the gauge title size.
|
||||
- **Value** - Enter a numeric value for the gauge value size.
|
||||
|
||||
## Standard options
|
||||
### Standard options
|
||||
|
||||
{{< docs/shared lookup="visualizations/standard-options.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
## Data links
|
||||
### Data links
|
||||
|
||||
{{< docs/shared lookup="visualizations/datalink-options.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
## Value mappings
|
||||
### Value mappings
|
||||
|
||||
{{< docs/shared lookup="visualizations/value-mappings-options.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
## Thresholds
|
||||
### Thresholds
|
||||
|
||||
{{< docs/shared lookup="visualizations/thresholds-options-2.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
Last, gauge colors and thresholds (the outer bar markers) of the gauge can be configured as described above.
|
||||
|
||||

|
||||
|
||||
## Field overrides
|
||||
### Field overrides
|
||||
|
||||
{{< docs/shared lookup="visualizations/overrides-options.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
@@ -16,16 +16,26 @@ labels:
|
||||
title: Heatmap
|
||||
weight: 100
|
||||
refs:
|
||||
introduction-to-histograms-and-heatmaps:
|
||||
intro-histograms-heatmaps:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/fundamentals/intro-histograms/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/fundamentals/intro-histograms/
|
||||
histograms:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/visualizations/histogram/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/panels-visualizations/visualizations/histogram/
|
||||
dashboards:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/dashboards/build-dashboards/create-dashboard/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/dashboards/build-dashboards/create-dashboard/
|
||||
---
|
||||
|
||||
# Heatmap
|
||||
|
||||
Heatmaps allow you to view [histograms](https://grafana.com/docs/grafana/latest/panels-visualizations/visualizations/histogram/) over time. While histograms display the data distribution that falls in a specific value range, heatmaps allow you to identify patterns in the histogram data distribution over time. For more information about heatmaps, refer to [Introduction to histograms and heatmaps](https://grafana.com/docs/grafana/latest/fundamentals/intro-histograms/).
|
||||
Heatmaps allow you to view [histograms](ref:histograms) over time. While histograms display the data distribution that falls in a specific value range, heatmaps allow you to identify patterns in the histogram data distribution over time. For more information about heatmaps, refer to [Introduction to histograms and heatmaps](ref:intro-histograms-heatmaps).
|
||||
|
||||
For example, if you want to understand the temperature changes for the past few years, you can use a heatmap visualization to identify trends in your data:
|
||||
|
||||
@@ -42,7 +52,7 @@ You can use a heatmap visualization if you need to:
|
||||
|
||||
## Configure a heatmap visualization
|
||||
|
||||
Once you’ve created a [dashboard](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/dashboards/build-dashboards/create-dashboard/), the following video shows you how to configure a heatmap visualization:
|
||||
Once you’ve created a [dashboard](ref:dashboards), the following video shows you how to configure a heatmap visualization:
|
||||
|
||||
{{< youtube id="SGWBzQ54koE" >}}
|
||||
|
||||
@@ -68,99 +78,111 @@ The data is converted as follows:
|
||||
|
||||
{{< figure src="/static/img/docs/heatmap-panel/heatmap.png" max-width="1025px" alt="A heatmap visualization showing the random walk distribution over time" >}}
|
||||
|
||||
## Panel options
|
||||
## Configuration options
|
||||
|
||||
{{< docs/shared lookup="visualizations/config-options-intro.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
### Panel options
|
||||
|
||||
{{< docs/shared lookup="visualizations/panel-options.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
## Heatmap options
|
||||
### Heatmap options
|
||||
|
||||
### Calculate from data
|
||||
The following options control how data in the heatmap is calculated and grouped.
|
||||
|
||||
This setting determines if the data is already a calculated heatmap (from the data source/transformer), or one that should be calculated in the panel.
|
||||
<!-- prettier-ignore-start -->
|
||||
|
||||
### X Bucket
|
||||
| Options | Description |
|
||||
| ------- | ----------- |
|
||||
| Calculate from data | This setting determines if the data is already a calculated heatmap (from the data source/transformer), or one that should be calculated in the panel. |
|
||||
| X Bucket | This setting determines how the x-axis is split into buckets. You can specify a time interval in the **Size** input. For example, a time range of `1h` makes the cells 1-hour wide on the x-axis. You can also set an interval based on **Count**. |
|
||||
| Y Bucket | This setting determines how the y-axis is split into buckets. Choose from **Size** or **Count**. |
|
||||
| Y Bucket scale | Select one of the following y-axis value scales:<ul><li>**Linear** - Linear scale.</li><li>**Logarithmic** - Choose a **Log base** of **2** or **10**.</li><li>**Symlog** - Symlog scale. Choose a **Log base** of **2** or **10** and enter a value for the **Linear threshold**.</li></ul> |
|
||||
|
||||
This setting determines how the X-axis is split into buckets. You can specify a time interval in the **Size** input. For example, a time range of `1h` makes the cells 1-hour wide on the X-axis.
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
### Y Bucket
|
||||
### Y-Axis options
|
||||
|
||||
This setting determines how the Y-axis is split into buckets.
|
||||
The following options define the display of the y-axis.
|
||||
|
||||
### Y Bucket scale
|
||||
<!-- prettier-ignore-start -->
|
||||
|
||||
Select one of the following Y-axis value scales:
|
||||
| Options | Description |
|
||||
| ------- | ----------- |
|
||||
| Placement | Set where the y-axis is displayed. Choose from: **Left**, **Right**, or **Hidden**. |
|
||||
| Unit | Unit configuration. |
|
||||
| Decimals | This setting determines decimal configuration. |
|
||||
| Min/Max value | These settings configure the axis range. |
|
||||
| Axis width | This setting configures the width for the axis. |
|
||||
| Axis label | This setting configures the axis value. |
|
||||
| Tick alignment | Sets the alignment of the tick marks on the visualization. Choose from: **Auto**, **Top (LE)**, **Middle**, and **Bottom (GE)**. This option is only displayed when your **Calculate from data** setting is **No**. |
|
||||
| Reverse| When selected, the axis appears in reverse order. |
|
||||
|
||||
- **linear -** Linear scale.
|
||||
- **log (base 2) -** Logarithmic scale with base 2.
|
||||
- **log (base 10) -** Logarithmic scale with base 10.
|
||||
- **symlog -** Symlog scale.
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
## Y Axes
|
||||
{{< docs/shared lookup="visualizations/multiple-y-axes.md" source="grafana" version="<GRAFANA_VERSION>" leveloffset="+3" >}}
|
||||
|
||||
Defines how the Y axis is displayed
|
||||
|
||||
### Placement
|
||||
|
||||
- **Left** On the left
|
||||
- **Right** On the right
|
||||
- **Hidden** Hidden
|
||||
|
||||
### Unit
|
||||
|
||||
Unit configuration
|
||||
|
||||
### Decimals
|
||||
|
||||
This setting determines decimal configuration.
|
||||
|
||||
### Min/Max value
|
||||
|
||||
This setting configures the axis range.
|
||||
|
||||
### Axis width
|
||||
|
||||
This setting configures the width for the axis.
|
||||
|
||||
### Axis value
|
||||
|
||||
This setting configures the axis value.
|
||||
|
||||
### Reverse
|
||||
|
||||
When selected, the axis appears in reverse order.
|
||||
|
||||
{{< docs/shared lookup="visualizations/multiple-y-axes.md" source="grafana" version="<GRAFANA_VERSION>" leveloffset="+2" >}}
|
||||
|
||||
## Colors
|
||||
### Colors options
|
||||
|
||||
The color spectrum controls the mapping between value count (in each bucket) and the color assigned to each bucket. The leftmost color on the spectrum represents the minimum count and the color on the right most side represents the maximum count. Some color schemes are automatically inverted when using the light theme.
|
||||
|
||||
You can also change the color mode to Opacity. In this case, the color will not change but the amount of opacity will change with the bucket count
|
||||
|
||||
- **Mode**
|
||||
- **Scheme -** Bucket value represented by cell color.
|
||||
- **Scheme -** If the mode is **scheme**, then select a color scheme.
|
||||
- **opacity -** Bucket value represented by cell opacity. Opaque cell means maximum value.
|
||||
- **Color -** Cell base color.
|
||||
- **Scale -** Scale for mapping bucket values to the opacity.
|
||||
- **linear -** Linear scale. Bucket value maps linearly to the opacity.
|
||||
- **sqrt -** Power scale. Cell opacity calculated as `value ^ k`, where `k` is a configured **Exponent** value. If exponent is less than `1`, you will get a logarithmic scale. If exponent is greater than `1`, you will get an exponential scale. In case of `1`, scale will be the same as linear.
|
||||
- **Exponent -** value of the exponent, greater than `0`.
|
||||
#### Mode
|
||||
|
||||
### Start/end color from value
|
||||
Use the following options to define the heatmap colors.
|
||||
|
||||
- **Scheme** - Bucket value represented by cell color.
|
||||
- **Scheme** - If the mode is **Scheme**, then select a color scheme.
|
||||
- **Opacity** - Bucket value represented by cell opacity. Opaque cell means maximum value.
|
||||
- **Color** - Cell base color.
|
||||
- **Scale** - Scale for mapping bucket values to the opacity.
|
||||
- **Exponential** - Power scale. Cell opacity calculated as `value ^ k`, where `k` is a configured **Exponent** value. If exponent is less than `1`, you will get a logarithmic scale. If exponent is greater than `1`, you will get an exponential scale. In case of `1`, scale will be the same as linear.
|
||||
- **Exponent** - Value of the exponent, greater than `0`.
|
||||
- **Linear** - Linear scale. Bucket value maps linearly to the opacity.
|
||||
|
||||
#### Steps
|
||||
|
||||
Set a value between `1` and `128`.
|
||||
|
||||
#### Reverse
|
||||
|
||||
Toggle the switch to reverse the color scheme. This option only applies the **Scheme** color mode.
|
||||
|
||||
#### Start/end color scale from value
|
||||
|
||||
By default, Grafana calculates cell colors based on minimum and maximum bucket values. With Min and Max you can overwrite those values. Consider a bucket value as a Z-axis and Min and Max as Z-Min and Z-Max, respectively.
|
||||
|
||||
- **Start -** Minimum value using for cell color calculation. If the bucket value is less than Min, then it is mapped to the "minimum" color. The series min value is the default value.
|
||||
- **End -** Maximum value using for cell color calculation. If the bucket value is greater than Max, then it is mapped to the "maximum" color. The series max value is the default value.
|
||||
- **Start** - Minimum value using for cell color calculation. If the bucket value is less than Min, then it is mapped to the "minimum" color. The series min value is the default value.
|
||||
- **End** - Maximum value using for cell color calculation. If the bucket value is greater than Max, then it is mapped to the "maximum" color. The series max value is the default value.
|
||||
|
||||
## Cell display
|
||||
### Cell display options
|
||||
|
||||
Use these settings to refine your visualization.
|
||||
Use these settings to control the display of heatmap cells.
|
||||
|
||||
## Additional display options
|
||||
<!-- prettier-ignore-start -->
|
||||
|
||||
### Tooltip
|
||||
| Option | Description |
|
||||
| ------ | ----------- |
|
||||
| Unit | Unit configuration. |
|
||||
| Decimals | This setting determines decimal configuration. |
|
||||
| Cell gap | Set how much space there is between cells. |
|
||||
| Hide cells with values <= | Enter a value. |
|
||||
| Hide cells with values >= | Enter a value. |
|
||||
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
### Tooltip options
|
||||
|
||||
Tooltip options control the information overlay that appears when you hover over data points in the visualization.
|
||||
|
||||
| Option | Description |
|
||||
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| [Tooltip mode](#tooltip-mode) | When you hover your cursor over the visualization, Grafana can display tooltips. Choose how tooltips behave. |
|
||||
| Show histogram (Y axis) | When you set the **Tooltip mode** to **Single**, this option is displayed. This option controls whether or not the tooltip includes a histogram representing the y-axis. |
|
||||
| [Show color scale](#show-color-scale) | This option controls whether or not the tooltip includes the color scale that's also represented in the legend. |
|
||||
| Max width | Set the maximum width of the tooltip box. |
|
||||
| Max height | Set the maximum height of the tooltip box. The default is 600 pixels. |
|
||||
|
||||
#### Tooltip mode
|
||||
|
||||
@@ -172,20 +194,20 @@ When you hover your cursor over the visualization, Grafana can display tooltips.
|
||||
|
||||
Use an override to hide individual series from the tooltip.
|
||||
|
||||
#### Show histogram (Y axis)
|
||||
|
||||
When you set the **Tooltip mode** to **Single**, this option is displayed. This option controls whether or not the tooltip includes a histogram representing the y-axis.
|
||||
|
||||
#### Show color scale
|
||||
|
||||
When you set the **Tooltip mode** to **Single**, this option is displayed. This option controls whether or not the tooltip includes the color scale that's also represented in the legend. When the color scale is included in the tooltip, it shows the hovered value on the scale:
|
||||
|
||||

|
||||
|
||||
### Legend
|
||||
### Legend options
|
||||
|
||||
Choose whether you want to display the heatmap legend on the visualization by toggling the **Show legend** switch.
|
||||
|
||||
### Exemplars
|
||||
|
||||
Set the color used to show exemplar data.
|
||||
|
||||
### Data links
|
||||
|
||||
{{< docs/shared lookup="visualizations/datalink-options.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
@@ -193,7 +215,3 @@ Choose whether you want to display the heatmap legend on the visualization by to
|
||||
### Field overrides
|
||||
|
||||
{{< docs/shared lookup="visualizations/overrides-options.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
### Exemplars
|
||||
|
||||
Set the color used to show exemplar data.
|
||||
|
||||
@@ -19,13 +19,18 @@ refs:
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/query-transform-data/calculation-types/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/panels-visualizations/query-transform-data/calculation-types/
|
||||
configure-legends:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/configure-legend/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/panels-visualizations/configure-legend/
|
||||
---
|
||||
|
||||
# Pie chart
|
||||
|
||||
A pie chart is a graph that displays data as segments of a circle proportional to the whole, making it look like a sliced pie. Each slice corresponds to a value or measurement.
|
||||
|
||||
{{< figure src="/static/img/docs/pie-chart-panel/pie-chart-example.png" max-width="1200px" lightbox="true" alt="Pie charts" >}}
|
||||

|
||||
|
||||
The pie chart visualization is ideal when you have data that adds up to a total and you want to show the proportion of each value compared to other slices, as well as to the whole of the pie.
|
||||
|
||||
@@ -98,116 +103,85 @@ If you want to display only the values from a given field (or column), once the
|
||||
|
||||

|
||||
|
||||
## Panel options
|
||||
## Configuration options
|
||||
|
||||
{{< docs/shared lookup="visualizations/config-options-intro.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
### Panel options
|
||||
|
||||
{{< docs/shared lookup="visualizations/panel-options.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
## Value options
|
||||
### Value options
|
||||
|
||||
Use the following options to refine the value in your visualization.
|
||||
|
||||
### Show
|
||||
<!-- prettier-ignore-start -->
|
||||
|
||||
Choose how much information to show.
|
||||
| Option | Description |
|
||||
| ------ | ----------- |
|
||||
| Show | Set how much information to show. Choose from:<ul><li>**Calculate** - Reduces each value to a single value per series.</li><li>**All values** - Displays every value from a single series.</li></ul> |
|
||||
| Calculation | If you chose **Calculate** as your **Show** option, select a calculation to reduce each series. For information about available calculations, refer to [Calculation types](ref:calculation-types). |
|
||||
| Limit | If you chose **All values** as your **Show** option, enter a value to limit the number of values displayed. |
|
||||
| Fields | Select which field or fields to display in the visualization. Each field name is available on the list, or you can select one of the following options:<ul><li>**Numeric fields** - All fields with numerical values.</li><li>**All fields** - All fields that are not removed by transformations.</li><li>**Time** - All fields with time values.</li></ul> |
|
||||
|
||||
- **Calculate -** Reduces each value to a single value per series.
|
||||
- **All values -** Displays every value from a single series.
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
### Calculation
|
||||
|
||||
Select a calculation to reduce each series when Calculate has been selected. For information about available calculations, refer to [Calculation types](ref:calculation-types).
|
||||
|
||||
### Limit
|
||||
|
||||
When displaying every value from a single series, this limits the number of values displayed.
|
||||
|
||||
### Fields
|
||||
|
||||
Select which field or fields to display in the visualization. Each field name is available on the list, or you can select one of the following options:
|
||||
|
||||
- **Numeric fields -** All fields with numerical values.
|
||||
- **All fields -** All fields that are not removed by transformations.
|
||||
- **Time -** All fields with time values.
|
||||
|
||||
## Pie chart options
|
||||
### Pie chart options
|
||||
|
||||
Use these options to refine how your visualization looks.
|
||||
|
||||
### Pie chart type
|
||||
#### Pie chart type
|
||||
|
||||
Select the pie chart display style.
|
||||
Select the pie chart display style. Choose from **Pie** or **Donut**.
|
||||
|
||||
### Pie
|
||||

|
||||
|
||||

|
||||
|
||||
### Donut
|
||||
|
||||

|
||||
|
||||
### Labels
|
||||
#### Labels
|
||||
|
||||
Select labels to display on the pie chart. You can select more than one.
|
||||
|
||||
- **Name -** The series or field name.
|
||||
- **Percent -** The percentage of the whole.
|
||||
- **Value -** The raw numerical value.
|
||||
- **Name** - The series or field name.
|
||||
- **Percent** - The percentage of the whole.
|
||||
- **Value** - The raw numerical value.
|
||||
|
||||
Labels are displayed in white over the body of the chart. You might need to select darker chart colors to make them more visible. Long names or numbers might be clipped.
|
||||
|
||||
The following example shows a pie chart with **Name** and **Percent** labels displayed.
|
||||
The following example shows a pie chart with **Name** and **Percent** labels displayed:
|
||||
|
||||

|
||||
{{< figure src="/static/img/docs/pie-chart-panel/pie-chart-labels-7-5.png" alt="Pie chart labels" max-width="350px" >}}
|
||||
|
||||
## Tooltip options
|
||||
### Tooltip options
|
||||
|
||||
{{< docs/shared lookup="visualizations/tooltip-options-1.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
{{< docs/shared lookup="visualizations/tooltip-options-1.md" source="grafana" version="<GRAFANA_VERSION>" leveloffset="+1" >}}
|
||||
|
||||
## Legend options
|
||||
### Legend options
|
||||
|
||||
Use these settings to define how the legend appears in your visualization. For more information about the legend, refer to [Configure a legend]({{< relref "../../configure-legend" >}}).
|
||||
Use these settings to define how the legend appears in your visualization. For more information about the legend, refer to [Configure a legend](ref:configure-legends).
|
||||
|
||||
### Visibility
|
||||
<!-- prettier-ignore-start -->
|
||||
|
||||
Toggle the switch to turn the legend on or off.
|
||||
| Option | Description |
|
||||
| ------ | ----------- |
|
||||
| Visibility | Toggle the switch to turn the legend on or off. |
|
||||
| Mode | Use these settings to define how the legend appears in your visualization. Choose from:<ul><li>**List** - Displays the legend as a list. This is a default display mode of the legend.</li><li>**Table** - Displays the legend as a table.</li></ul> |
|
||||
| Placement | Select where to display the legend. Choose **Bottom** or **Right**. |
|
||||
| Width | Control how wide the legend is when placed on the right side of the visualization. This option is only displayed if you set the legend placement to **Right**. |
|
||||
| Legend values | Select values to display in the legend. You can select more than one:<ul><li>**Percent** - The percentage of the whole.</li><li>**Value** - The raw numerical value.</li></ul> |
|
||||
|
||||
### Mode
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
Use these settings to define how the legend appears in your visualization.
|
||||
|
||||
- **List -** Displays the legend as a list. This is a default display mode of the legend.
|
||||
- **Table -** Displays the legend as a table.
|
||||
|
||||
### Placement
|
||||
|
||||
Choose where to display the legend.
|
||||
|
||||
- **Bottom -** Below the graph.
|
||||
- **Right -** To the right of the graph.
|
||||
|
||||
#### Width
|
||||
|
||||
Control how wide the legend is when placed on the right side of the visualization. This option is only displayed if you set the legend placement to **Right**.
|
||||
|
||||
### Values
|
||||
|
||||
Select values to display in the legend. You can select more than one.
|
||||
|
||||
- **Percent:** The percentage of the whole.
|
||||
- **Value:** The raw numerical value.
|
||||
|
||||
## Standard options
|
||||
### Standard options
|
||||
|
||||
{{< docs/shared lookup="visualizations/standard-options.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
## Data links
|
||||
### Data links
|
||||
|
||||
{{< docs/shared lookup="visualizations/datalink-options.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
## Value mappings
|
||||
### Value mappings
|
||||
|
||||
{{< docs/shared lookup="visualizations/value-mappings-options.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
## Field overrides
|
||||
### Field overrides
|
||||
|
||||
{{< docs/shared lookup="visualizations/overrides-options.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
@@ -34,7 +34,7 @@ A state timeline visualization displays data in a way that shows state changes o
|
||||
|
||||
For example, if you're monitoring the CPU usage of a server, you can use a state timeline to visualize the different states, such as “LOW,” “NORMAL,” “HIGH,” or “CRITICAL,” over time. Each state is represented by a different color and the lengths represent the duration of time that the server remained in that state:
|
||||
|
||||
{{< figure src="/static/img/docs/state-timeline-panel/state-timeline-panel.png" max-width="1025px" alt="A state timeline visualization showing CPU usage" >}}
|
||||

|
||||
|
||||
The state timeline visualization is useful when you need to monitor and analyze changes in states or statuses of various entities over time. You can use one when you need to:
|
||||
|
||||
@@ -58,11 +58,9 @@ The state timeline visualization works best if you have data capturing the vario
|
||||
|
||||
Each state ends when the next state begins or when there is a `null` value.
|
||||
|
||||
### Examples
|
||||
### Example 1
|
||||
|
||||
The following tables are examples of the type of data you need for a state timeline visualization and how it should be formatted.
|
||||
|
||||
#### Single time column with null values
|
||||
The following example has a single time column and includes null values:
|
||||
|
||||
| Timestamps | Server A | Server B |
|
||||
| ------------------- | -------- | -------- |
|
||||
@@ -76,11 +74,13 @@ The following tables are examples of the type of data you need for a state timel
|
||||
| 2024-02-29 10:00:00 | Down | Down |
|
||||
| 2024-02-29 10:30:00 | Warning | Down |
|
||||
|
||||
The data is converted as follows, with the [null and empty values visualized as gaps](https://grafana.com/docs/grafana/latest/panels-visualizations/visualizations/state-timeline/#connect-null-values) in the state timeline:
|
||||
The data is converted as follows, with the [null and empty values visualized as gaps](#connect-null-values) in the state timeline:
|
||||
|
||||
{{< figure src="/static/img/docs/state-timeline-panel/state-timeline-with-null-values.png" max-width="1025px" alt="A state timeline visualization with null values showing the status of two servers" >}}
|
||||
|
||||
#### Two time columns without null values
|
||||
### Example 2
|
||||
|
||||
The following example has two time columns and doesn't include any null values:
|
||||
|
||||
| Start time | End time | Server A | Server B |
|
||||
| ------------------- | ------------------- | -------- | -------- |
|
||||
@@ -97,80 +97,74 @@ The data is converted as follows:
|
||||
|
||||
If your query results aren't in a table format like the preceding examples, especially for time-series data, you can apply specific [transformations](https://stackoverflow.com/questions/68887416/grafana-state-timeline-panel-with-values-states-supplied-by-label) to achieve this.
|
||||
|
||||
## Panel options
|
||||
### Time series data
|
||||
|
||||
You can also create a state timeline visualization using time series data. To do this, add [thresholds](#thresholds), which turn the time series into discrete colored state regions.
|
||||
|
||||

|
||||
|
||||
## Configuration options
|
||||
|
||||
{{< docs/shared lookup="visualizations/config-options-intro.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
### Panel options
|
||||
|
||||
{{< docs/shared lookup="visualizations/panel-options.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
## State timeline options
|
||||
### State timeline options
|
||||
|
||||
Use these options to refine the visualization.
|
||||
|
||||
### Merge equal consecutive values
|
||||
<!-- prettier-ignore-start -->
|
||||
|
||||
Controls whether Grafana merges identical values if they are next to each other.
|
||||
| Option | Description |
|
||||
| ------ | ----------------------------------------------------------------------------------------------- |
|
||||
| Merge equal consecutive values | Controls whether Grafana merges identical values if they are next to each other. |
|
||||
| Show values | Controls whether values are rendered inside the state regions. Choose from **Auto**, **Always**, and **Never**. **Auto** renders values if there is sufficient space. |
|
||||
| Align values | Controls value alignment inside state regions. Choose from **Left**, **Center**, and **Right**. |
|
||||
| Row height | Controls how much space between rows there are. 1 = no space = 0.5 = 50% space. |
|
||||
| [Page size](#page-size-enable-pagination) | The **Page size** option lets you paginate the state timeline visualization to limit how many series are visible at once. |
|
||||
| Line width | Controls line width of state regions. |
|
||||
| Fill opacity | Controls value alignment inside state regions. |
|
||||
| [Connect null values](#connect-null-values) | Choose how null values, which are gaps in the data, appear on the graph. |
|
||||
| [Disconnect null values](#disconnect-values) | Choose whether to set a threshold above which values in the data should be disconnected. |
|
||||
|
||||
### Show values
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
Controls whether values are rendered inside the state regions. Auto will render values if there is sufficient space.
|
||||
|
||||
### Align values
|
||||
|
||||
Controls value alignment inside state regions.
|
||||
|
||||
### Row height
|
||||
|
||||
Controls how much space between rows there are. 1 = no space = 0.5 = 50% space.
|
||||
|
||||
### Page size (enable pagination)
|
||||
#### Page size (enable pagination)
|
||||
|
||||
The **Page size** option lets you paginate the state timeline visualization to limit how many series are visible at once. This is useful when you have many series. With paginated results, the visualization displays a subset of all series on each page:
|
||||
|
||||
{{< video-embed src="/media/docs/grafana/panels-visualizations/screen-recording-grafana-11-2-state-timeline-pagination-dark.mp4" >}}
|
||||
|
||||
### Line width
|
||||
{{< docs/shared lookup="visualizations/connect-null-values.md" source="grafana" version="<GRAFANA_VERSION>" leveloffset="+1" >}}
|
||||
|
||||
Controls line width of state regions.
|
||||
{{< docs/shared lookup="visualizations/disconnect-values.md" source="grafana" version="<GRAFANA_VERSION>" leveloffset="+1" >}}
|
||||
|
||||
### Fill opacity
|
||||
### Legend options
|
||||
|
||||
Controls the opacity of state regions.
|
||||
{{< docs/shared lookup="visualizations/legend-options-2.md" source="grafana" version="<GRAFANA_VERSION>" leveloffset="+1" >}}
|
||||
|
||||
{{< docs/shared lookup="visualizations/connect-null-values.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
### Tooltip options
|
||||
|
||||
{{< docs/shared lookup="visualizations/disconnect-values.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
{{< docs/shared lookup="visualizations/tooltip-options-1.md" source="grafana" version="<GRAFANA_VERSION>" leveloffset="+1" >}}
|
||||
|
||||
## Time series data with thresholds
|
||||
|
||||
The visualization can be used with time series data as well. In this case, the thresholds are used to turn the time series into discrete colored state regions.
|
||||
|
||||
{{< figure src="/static/img/docs/v8/state_timeline_time_series.png" max-width="1025px" caption="state timeline with time series" >}}
|
||||
|
||||
## Standard options
|
||||
### Standard options
|
||||
|
||||
{{< docs/shared lookup="visualizations/standard-options.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
## Legend options
|
||||
|
||||
{{< docs/shared lookup="visualizations/legend-options-2.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
## Tooltip options
|
||||
|
||||
{{< docs/shared lookup="visualizations/tooltip-options-1.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
## Data links
|
||||
### Data links
|
||||
|
||||
{{< docs/shared lookup="visualizations/datalink-options.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
## Value mappings
|
||||
### Value mappings
|
||||
|
||||
{{< docs/shared lookup="visualizations/value-mappings-options.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
{{< figure src="/static/img/docs/v8/value_mappings_side_editor.png" max-width="300px" caption="Value mappings side editor" >}}
|
||||
|
||||
## Thresholds
|
||||
### Thresholds
|
||||
|
||||
{{< docs/shared lookup="visualizations/thresholds-options-2.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
## Field overrides
|
||||
### Field overrides
|
||||
|
||||
{{< docs/shared lookup="visualizations/overrides-options.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
|
||||
@@ -51,7 +51,7 @@ refs:
|
||||
# Traces
|
||||
|
||||
Traces visualizations let you follow a request as it traverses the services in your infrastructure.
|
||||
The traces visualization displays traces data in a diagram that allows you to easily interpret it.
|
||||
The traces visualization displays traces data in a diagram that allows you to easily interpret it. Traces visualizations currently render one trace traversal based on the traceID used in TraceQL or using a variable.
|
||||
|
||||
For more information about traces and how to use them, refer to the following documentation:
|
||||
|
||||
|
||||
@@ -272,6 +272,10 @@ Path to the certificate file (if `protocol` is set to `https` or `h2`).
|
||||
|
||||
Path to the certificate key file (if `protocol` is set to `https` or `h2`).
|
||||
|
||||
### cert_pass
|
||||
|
||||
Optional. Password to decrypt encrypted certificates.
|
||||
|
||||
### certs_watch_interval
|
||||
|
||||
Controls whether `cert_key` and `cert_file` are periodically watched for changes.
|
||||
@@ -1784,7 +1788,7 @@ Configures the batch size for the annotation clean-up job. This setting is used
|
||||
|
||||
### tags_length
|
||||
|
||||
Enforces the maximum allowed length of the tags for any newly introduced annotations. It can be between 500 and 4096 (inclusive). Default value is 500. Setting it to a higher value would impact performance therefore is not recommended.
|
||||
Enforces the maximum allowed amount of tags for any newly introduced annotations. This value can be between 500 and 4096 (inclusive). The default value is 500. Setting it to a higher value would impact performance and is therefore not recommended.
|
||||
|
||||
## [annotations.dashboard]
|
||||
|
||||
|
||||
@@ -20,8 +20,6 @@ weight: 1000
|
||||
|
||||
Grafana supports automatic rendering of panels as PNG images. This allows Grafana to automatically generate images of your panels to include in alert notifications, [PDF export]({{< relref "../../dashboards/create-reports#export-dashboard-as-pdf" >}}), and [Reporting]({{< relref "../../dashboards/create-reports" >}}). PDF Export and Reporting are available only in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise" >}}) and [Grafana Cloud](/docs/grafana-cloud/).
|
||||
|
||||
> **Note:** Image rendering of dashboards is not supported at this time.
|
||||
|
||||
While an image is being rendered, the PNG image is temporarily written to the file system. When the image is rendered, the PNG image is temporarily written to the `png` folder in the Grafana `data` folder.
|
||||
|
||||
A background job runs every 10 minutes and removes temporary images. You can configure how long an image should be stored before being removed by configuring the [temp_data_lifetime]({{< relref "../configure-grafana#temp_data_lifetime" >}}) setting.
|
||||
|
||||
@@ -46,7 +46,7 @@ Installation of Grafana on other operating systems is possible, but is not recom
|
||||
Grafana requires the minimum system resources:
|
||||
|
||||
- Minimum recommended memory: 512 MB
|
||||
- Minimum recommended CPU: 1
|
||||
- Minimum recommended CPU: 1 core
|
||||
|
||||
Some features might require more memory or CPUs, including:
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@ This topic explains how to install Grafana dependencies, install Grafana on Linu
|
||||
|
||||
There are multiple ways to install Grafana: using the Grafana Labs APT repository, by downloading a `.deb` package, or by downloading a binary `.tar.gz` file. Choose only one of the methods below that best suits your needs.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
{{< admonition type="note" >}}
|
||||
If you install via the `.deb` package or `.tar.gz` file, then you must manually update Grafana for each new version.
|
||||
{{% /admonition %}}
|
||||
{{< /admonition >}}
|
||||
|
||||
The following video demonstrates how to install Grafana on Debian and Ubuntu as outlined in this document:
|
||||
|
||||
@@ -37,9 +37,9 @@ If you install from the APT repository, Grafana automatically updates when you r
|
||||
| Grafana OSS | grafana | `https://apt.grafana.com stable main` |
|
||||
| Grafana OSS (Beta) | grafana | `https://apt.grafana.com beta main` |
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
{{< admonition type="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](/products/enterprise/?utm_source=grafana-install-page), which has support for [Enterprise plugins](/grafana/plugins/?enterprise=1&utcm_source=grafana-install-page).
|
||||
{{% /admonition %}}
|
||||
{{< /admonition >}}
|
||||
|
||||
Complete the following steps to install Grafana from the APT repository:
|
||||
|
||||
@@ -89,11 +89,11 @@ Complete the following steps to install Grafana from the APT repository:
|
||||
sudo apt-get install grafana-enterprise
|
||||
```
|
||||
|
||||
## Install Grafana using a deb package or as a standalone binary
|
||||
## Install Grafana using a deb package
|
||||
|
||||
If you choose not to install Grafana using APT, you can download and install Grafana using the deb package or as a standalone binary.
|
||||
If you install Grafana manually using the deb package, then you must manually update Grafana for each new version.
|
||||
|
||||
Complete the following steps to install Grafana using DEB or the standalone binaries:
|
||||
Complete the following steps to install Grafana using a deb package:
|
||||
|
||||
1. Navigate to the [Grafana download page](/grafana/download).
|
||||
1. Select the Grafana version you want to install.
|
||||
@@ -105,6 +105,80 @@ 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](/grafana/download).
|
||||
1. Copy and paste the code from the [download page](/grafana/download) into your command line and run.
|
||||
|
||||
## Install Grafana as a standalone binary
|
||||
|
||||
Complete the following steps to install Grafana using the standalone binaries:
|
||||
|
||||
1. Navigate to the [Grafana download page](/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](/grafana/download).
|
||||
1. Copy and paste the code from the [download page](/grafana/download) page into your command line and run.
|
||||
1. Create a user account for Grafana on your system:
|
||||
|
||||
```shell
|
||||
sudo useradd -r -s /bin/false grafana
|
||||
```
|
||||
|
||||
1. Move the unpacked binary to `/usr/local/grafana`:
|
||||
|
||||
```shell
|
||||
sudo mv <DOWNLOAD PATH> /usr/local/grafana
|
||||
```
|
||||
|
||||
1. Change the owner of `/usr/local/grafana` to Grafana users:
|
||||
|
||||
```shell
|
||||
sudo chown -R grafana:users /usr/local/grafana
|
||||
```
|
||||
|
||||
1. Create a Grafana server systemd unit file:
|
||||
|
||||
```shell
|
||||
sudo touch /etc/systemd/system/grafana-server.service
|
||||
```
|
||||
|
||||
1. Add the following to the unit file in a text editor of your choice:
|
||||
|
||||
```ini
|
||||
[Unit]
|
||||
Description=Grafana Server
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=grafana
|
||||
Group=users
|
||||
ExecStart=/usr/local/grafana/bin/grafana server --config=/usr/local/grafana/conf/grafana.ini --homepath=/usr/local/grafana
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
1. Use the binary to manually start the Grafana server:
|
||||
|
||||
```shell
|
||||
/usr/local/grafana/bin/grafana-server --homepath /usr/local/grafana
|
||||
```
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
Manually invoking the binary in this step automatically creates the `/usr/local/grafana/data` directory, which needs to be created and configured before the installation can be considered complete.
|
||||
{{< /admonition >}}
|
||||
|
||||
1. Press `CTRL+C` to stop the Grafana server.
|
||||
1. Change the owner of `/usr/local/grafana` to Grafana users again to apply the ownership to the newly created `/usr/local/grafana/data` directory:
|
||||
|
||||
```shell
|
||||
sudo chown -R grafana:users /usr/local/grafana
|
||||
```
|
||||
|
||||
1. [Configure the Grafana server to start at boot time using systemd](https://grafana.com/docs/grafana/latest/setup-grafana/start-restart-grafana/#configure-the-grafana-server-to-start-at-boot-using-systemd).
|
||||
|
||||
## Uninstall on Debian or Ubuntu
|
||||
|
||||
Complete any of the following steps to uninstall Grafana.
|
||||
|
||||
@@ -187,7 +187,7 @@ This section describes the steps you must complete to access Grafana via web bro
|
||||
|
||||
## Customize Grafana default configuration
|
||||
|
||||
Helm is a popular package manager for Kubernetes. It bundles Kubernetes resource manifests to be re-used across different environments. These manifests are written in a templating language, allowing you to provide configuration values via `values.yaml` file, or in-line using Helm, to replace the placeholders in the manifest where these configurations should reside.
|
||||
Helm is a popular package manager for Kubernetes. It bundles Kubernetes resource manifests to be reused across different environments. These manifests are written in a templating language, allowing you to provide configuration values via `values.yaml` file, or in-line using Helm, to replace the placeholders in the manifest where these configurations should reside.
|
||||
|
||||
The `values.yaml` file allows you to customize the chart's configuration by specifying values for various parameters such as image versions, resource limits, service configurations, etc.
|
||||
|
||||
|
||||
@@ -32,15 +32,15 @@ If you install from the RPM repository, then Grafana is automatically updated ev
|
||||
| Grafana OSS | grafana | `https://rpm.grafana.com` |
|
||||
| Grafana OSS (Beta) | grafana | `https://rpm-beta.grafana.com` |
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
{{< admonition type="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](/products/enterprise/?utm_source=grafana-install-page), which has support for [Enterprise plugins](/grafana/plugins/?enterprise=1&utcm_source=grafana-install-page).
|
||||
{{% /admonition %}}
|
||||
{{< /admonition >}}
|
||||
|
||||
To install Grafana from the RPM repository, complete the following steps:
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
{{< admonition type="note" >}}
|
||||
If you wish to install beta versions of Grafana, substitute the repository URL for the beta URL listed above.
|
||||
{{% /admonition %}}
|
||||
{{< /admonition >}}
|
||||
|
||||
1. Import the GPG key:
|
||||
|
||||
@@ -96,6 +96,8 @@ If you install Grafana manually using YUM or RPM, then you must manually update
|
||||
|
||||
## Install Grafana as a standalone binary
|
||||
|
||||
If you install Grafana manually using the standalone binaries, then you must manually update Grafana for each new version.
|
||||
|
||||
Complete the following steps to install Grafana using the standalone binaries:
|
||||
|
||||
1. Navigate to the [Grafana download page](/grafana/download).
|
||||
@@ -103,10 +105,70 @@ Complete the following steps to install Grafana using the standalone binaries:
|
||||
- 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.
|
||||
- **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](/grafana/download).
|
||||
1. Copy and paste the code from the [download page](/grafana/download) page into your command line and run.
|
||||
1. Create a user account for Grafana on your system:
|
||||
|
||||
```shell
|
||||
sudo useradd -r -s /bin/false grafana
|
||||
```
|
||||
|
||||
1. Move the unpacked binary to `/usr/local/grafana`:
|
||||
|
||||
```shell
|
||||
sudo mv <DOWNLOAD PATH> /usr/local/grafana
|
||||
```
|
||||
|
||||
1. Change the owner of `/usr/local/grafana` to Grafana users:
|
||||
|
||||
```shell
|
||||
sudo chown -R grafana:users /usr/local/grafana
|
||||
```
|
||||
|
||||
1. Create a Grafana server systemd unit file:
|
||||
|
||||
```shell
|
||||
sudo touch /etc/systemd/system/grafana-server.service
|
||||
```
|
||||
|
||||
1. Add the following to the unit file in a text editor of your choice:
|
||||
|
||||
```ini
|
||||
[Unit]
|
||||
Description=Grafana Server
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=grafana
|
||||
Group=users
|
||||
ExecStart=/usr/local/grafana/bin/grafana server --config=/usr/local/grafana/conf/grafana.ini --homepath=/usr/local/grafana
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
1. Use the binary to manually start the Grafana server:
|
||||
|
||||
```shell
|
||||
/usr/local/grafana/bin/grafana-server --homepath /usr/local/grafana
|
||||
```
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
Manually invoking the binary in this step automatically creates the `/usr/local/grafana/data` directory, which needs to be created and configured before the installation can be considered complete.
|
||||
{{< /admonition >}}
|
||||
|
||||
1. Press `CTRL+C` to stop the Grafana server.
|
||||
1. Change the owner of `/usr/local/grafana` to Grafana users again to apply the ownership to the newly created `/usr/local/grafana/data` directory:
|
||||
|
||||
```shell
|
||||
sudo chown -R grafana:users /usr/local/grafana
|
||||
```
|
||||
|
||||
1. [Configure the Grafana server to start at boot time using systemd]({{< relref "../../start-restart-grafana#configure-the-grafana-server-to-start-at-boot-using-systemd" >}}).
|
||||
|
||||
## Uninstall on RHEL or Fedora
|
||||
|
||||
|
||||
@@ -30,9 +30,9 @@ If you install from the RPM repository, then Grafana is automatically updated ev
|
||||
| Grafana Enterprise | grafana-enterprise | `https://rpm.grafana.com` |
|
||||
| Grafana OSS | grafana | `https://rpm.grafana.com` |
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
{{< admonition type="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](/products/enterprise/?utm_source=grafana-install-page), which has support for [Enterprise plugins](/grafana/plugins/?enterprise=1&utcm_source=grafana-install-page).
|
||||
{{% /admonition %}}
|
||||
{{< /admonition >}}
|
||||
|
||||
To install Grafana using the RPM repository, complete the following steps:
|
||||
|
||||
@@ -84,6 +84,8 @@ If you install Grafana manually using RPM, then you must manually update Grafana
|
||||
|
||||
## Install Grafana as a standalone binary
|
||||
|
||||
If you install Grafana manually using the standalone binaries, then you must manually update Grafana for each new version.
|
||||
|
||||
Complete the following steps to install Grafana using the standalone binaries:
|
||||
|
||||
1. Navigate to the [Grafana download page](/grafana/download).
|
||||
@@ -91,10 +93,70 @@ Complete the following steps to install Grafana using the standalone binaries:
|
||||
- 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.
|
||||
- **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](/grafana/download).
|
||||
1. Copy and paste the code from the [download page](/grafana/download) into your command line and run.
|
||||
1. Create a user account for Grafana on your system:
|
||||
|
||||
```shell
|
||||
sudo useradd -r -s /bin/false grafana
|
||||
```
|
||||
|
||||
1. Move the unpacked binary to `/usr/local/grafana`:
|
||||
|
||||
```shell
|
||||
sudo mv <DOWNLOAD PATH> /usr/local/grafana
|
||||
```
|
||||
|
||||
1. Change the owner of `/usr/local/grafana` to Grafana users:
|
||||
|
||||
```shell
|
||||
sudo chown -R grafana:users /usr/local/grafana
|
||||
```
|
||||
|
||||
1. Create a Grafana server systemd unit file:
|
||||
|
||||
```shell
|
||||
sudo touch /etc/systemd/system/grafana-server.service
|
||||
```
|
||||
|
||||
1. Add the following to the unit file in a text editor of your choice:
|
||||
|
||||
```ini
|
||||
[Unit]
|
||||
Description=Grafana Server
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=grafana
|
||||
Group=users
|
||||
ExecStart=/usr/local/grafana/bin/grafana server --config=/usr/local/grafana/conf/grafana.ini --homepath=/usr/local/grafana
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
1. Use the binary to manually start the Grafana server:
|
||||
|
||||
```shell
|
||||
/usr/local/grafana/bin/grafana-server --homepath /usr/local/grafana
|
||||
```
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
Manually invoking the binary in this step automatically creates the `/usr/local/grafana/data` directory, which needs to be created and configured before the installation can be considered complete.
|
||||
{{< /admonition >}}
|
||||
|
||||
1. Press `CTRL+C` to stop the Grafana server.
|
||||
1. Change the owner of `/usr/local/grafana` to Grafana users again to apply the ownership to the newly created `/usr/local/grafana/data` directory:
|
||||
|
||||
```shell
|
||||
sudo chown -R grafana:users /usr/local/grafana
|
||||
```
|
||||
|
||||
1. [Configure the Grafana server to start at boot time using systemd](https://grafana.com/docs/grafana/latest/setup-grafana/start-restart-grafana/#configure-the-grafana-server-to-start-at-boot-using-systemd).
|
||||
|
||||
## Uninstall on SUSE or openSUSE
|
||||
|
||||
|
||||
@@ -244,6 +244,8 @@ To configure Grafana HTTPS and restart Grafana, complete the following steps.
|
||||
|
||||
> **Note**: The standard port for SSL traffic is 443, which you can use instead of Grafana's default port 3000. This change might require additional operating system privileges or configuration to bind to lower-numbered privileged ports.
|
||||
|
||||
1. Optional. From Grafana v11.2, edit the `cert_pass` configuration option with the decryption password if you are using encrypted certificates.
|
||||
|
||||
1. [Restart the Grafana server]({{< relref "./start-restart-grafana#linux" >}}) using `systemd`, `init.d`, or the binary as appropriate for your environment.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
26
docs/sources/shared/alerts/add-alertmanager-ds.md
Normal file
26
docs/sources/shared/alerts/add-alertmanager-ds.md
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: 'Add an 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**.
|
||||
|
||||
The **Settings** tab of the data source is displayed.
|
||||
|
||||
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 can receive Grafana-managed alerts. **Important:** This works only if receiving alerts is enabled for the Alertmanager in the Grafana Alerting Settings page |
|
||||
| **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 |
|
||||
@@ -384,7 +384,7 @@ To reset the notification policy tree to the default and unlock it for editing i
|
||||
|
||||
| Code | Status | Description | Has headers | Schema |
|
||||
| --------------------------------- | ---------- | -------------------------------------- | :---------: | ------------------------------------------- |
|
||||
| [204](#route-delete-template-204) | No Content | The template was deleted successfully. | | [schema](#route-delete-template-204-schema) |
|
||||
| [204](#route-delete-template-204) | No Content | The template was deleted successfully. | | [schema](#route-delete-template-204-schema) |
|
||||
| [409](#route-delete-template-409) | Conflict | GenericPublicError | | [schema](#route-delete-template-409-schema) |
|
||||
|
||||
#### Responses
|
||||
|
||||
13
docs/sources/shared/alerts/configure-alert-rule-name.md
Normal file
13
docs/sources/shared/alerts/configure-alert-rule-name.md
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
labels:
|
||||
products:
|
||||
- oss
|
||||
title: 'Set alert rule name'
|
||||
---
|
||||
|
||||
## Set alert rule name
|
||||
|
||||
1. Click **Alerts & IRM** -> **Alert rules** -> **+ New alert rule**.
|
||||
1. Enter a name to identify your alert rule.
|
||||
|
||||
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.
|
||||
36
docs/sources/shared/alerts/configure-notification-message.md
Normal file
36
docs/sources/shared/alerts/configure-notification-message.md
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
labels:
|
||||
products:
|
||||
- oss
|
||||
title: 'Configure notification message'
|
||||
---
|
||||
|
||||
## Configure notification message
|
||||
|
||||
Use [annotations](ref:shared-annotations) to add information to alert messages that can help respond to the alert.
|
||||
|
||||
Annotations are included by default in notification messages, and can use text or [templates](ref:shared-alert-rule-template) to display dynamic data from queries.
|
||||
|
||||
Grafana provides several optional annotations.
|
||||
|
||||
1. Optional: Add a summary.
|
||||
|
||||
Short summary of what happened and why.
|
||||
|
||||
1. Optional: Add a description.
|
||||
|
||||
Description of what the alert rule does.
|
||||
|
||||
1. Optional: Add a Runbook URL.
|
||||
|
||||
Webpage where you keep your runbook for the alert
|
||||
|
||||
1. Optional: Add a custom annotation.
|
||||
|
||||
Add any additional information that could help address the alert.
|
||||
|
||||
1. Optional: **Link dashboard and panel**.
|
||||
|
||||
[Link the alert rule to a panel](ref:shared-link-alert-rules-to-panels) to facilitate alert investigation.
|
||||
|
||||
1. Click **Save rule**.
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
labels:
|
||||
products:
|
||||
- oss
|
||||
title: 'Provisioning'
|
||||
---
|
||||
|
||||
### Provisioning
|
||||
|
||||
Note that if you delete an alert resource created in the UI, you can no longer retrieve it.
|
||||
|
||||
To backup and manage alert rules, you can [provision alerting resources](ref:shared-provision-alerting-resources) using options such as configuration files, Terraform, or the Alerting API.
|
||||
@@ -8,7 +8,7 @@ title: 'How label matching works'
|
||||
|
||||
{{< collapse title="How label matching works" >}}
|
||||
|
||||
Use [labels](ref:alert-labels) and label matchers to link alert rules to [notification policies](ref:notification-policies) and [silences](ref:silences). This allows for a flexible way to manage your alert instances, specify which policy should handle them, and which alerts to silence.
|
||||
Use [labels](ref:shared-alert-labels) and label matchers to link alert rules to [notification policies](ref:shared-notification-policies) and [silences](ref:shared-silences). This allows for a flexible way to manage your alert instances, specify which policy should handle them, and which alerts to silence.
|
||||
|
||||
A label matchers consists of 3 distinct parts, the **label**, the **value** and the **operator**.
|
||||
|
||||
|
||||
17
docs/sources/shared/alerts/mute-timings-vs-silences.md
Normal file
17
docs/sources/shared/alerts/mute-timings-vs-silences.md
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
labels:
|
||||
products:
|
||||
- oss
|
||||
title: 'Mute timings vs silences'
|
||||
---
|
||||
|
||||
## Mute timings vs silences
|
||||
|
||||
[Mute timings](ref:shared-mute-timings) and [silences](ref:shared-silences) are distinct methods to suppress notifications. They do not prevent alert rules from being evaluated or stop alert instances from appearing in the user interface; they only prevent notifications from being created.
|
||||
|
||||
The following table highlights the key differences between mute timings and silences.
|
||||
|
||||
| | Mute timing | Silence |
|
||||
| ---------- | ----------------------------------------------------------- | ---------------------------------------------------------------- |
|
||||
| **Setup** | Created and then added to notification policies | Matches alerts using labels to determine whether to silence them |
|
||||
| **Period** | Uses time interval definitions that can repeat periodically | Has a fixed start and end time |
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user