Compare commits
198 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
50f6940ae6 | ||
|
|
15179419c3 | ||
|
|
7b82b8a469 | ||
|
|
00cafdc02a | ||
|
|
42dad26bef | ||
|
|
6582de0628 | ||
|
|
1564c68f31 | ||
|
|
8078429367 | ||
|
|
c1c0ba553c | ||
|
|
abf58507a7 | ||
|
|
550de7f2b4 | ||
|
|
1d6a7053f9 | ||
|
|
bee9517d96 | ||
|
|
d1bbd4a5e7 | ||
|
|
b552750f2b | ||
|
|
f13c3a42c5 | ||
|
|
1229d8137c | ||
|
|
f3cf25c49a | ||
|
|
74e7808c73 | ||
|
|
6db0d7c9fa | ||
|
|
4422f8ade6 | ||
|
|
3a0d6a5966 | ||
|
|
e311b0f7a9 | ||
|
|
e01e9047ef | ||
|
|
8d7374499a | ||
|
|
3fc75522d0 | ||
|
|
a1408862dc | ||
|
|
8f3cddbf65 | ||
|
|
e102b640c9 | ||
|
|
5bed94f873 | ||
|
|
7a0ee7044b | ||
|
|
64822982ac | ||
|
|
53a6f07b6f | ||
|
|
b5000606d4 | ||
|
|
d695537e14 | ||
|
|
9b014729cc | ||
|
|
4611f0c325 | ||
|
|
d80f114eda | ||
|
|
a95807c24c | ||
|
|
137e19087d | ||
|
|
eed5ff5d74 | ||
|
|
f15c79be65 | ||
|
|
95836864ff | ||
|
|
320bf2b799 | ||
|
|
770af668a3 | ||
|
|
fd9a2d3cc1 | ||
|
|
fa92b1e2dd | ||
|
|
c19c4b9e2c | ||
|
|
e7ee10b2dc | ||
|
|
0311c2a3c6 | ||
|
|
6f797c4b88 | ||
|
|
1f3654b666 | ||
|
|
46a42f2b03 | ||
|
|
69daafd37b | ||
|
|
be04fa6a9d | ||
|
|
5663de31a0 | ||
|
|
03ecb1db39 | ||
|
|
8757cb124b | ||
|
|
2358ab0a85 | ||
|
|
9835ffafb1 | ||
|
|
7f0afc4707 | ||
|
|
6ca249f58e | ||
|
|
af6a07efa1 | ||
|
|
b13c584b02 | ||
|
|
215fbafaba | ||
|
|
2d37539fc9 | ||
|
|
20bab22935 | ||
|
|
b723a0aa81 | ||
|
|
4287686420 | ||
|
|
aa99c458f7 | ||
|
|
9fc209c98a | ||
|
|
2595039be2 | ||
|
|
a21f8fdcb8 | ||
|
|
fc03b5c5f9 | ||
|
|
ffc594d12e | ||
|
|
ae001d75ce | ||
|
|
19ceb927b1 | ||
|
|
d6c3bffe88 | ||
|
|
96407c0779 | ||
|
|
42e673a34c | ||
|
|
7f75ea6bb3 | ||
|
|
3badf96c13 | ||
|
|
7b8e09c90b | ||
|
|
c629e3b09c | ||
|
|
98b6810acf | ||
|
|
4cb6e5fbc3 | ||
|
|
6d0ec34e6e | ||
|
|
db63486961 | ||
|
|
493161fa21 | ||
|
|
21833d2526 | ||
|
|
452c3979b8 | ||
|
|
28d2423050 | ||
|
|
6445e1f907 | ||
|
|
8476f5acdc | ||
|
|
fe2ea4df84 | ||
|
|
22983a86f2 | ||
|
|
f59ce8baed | ||
|
|
dfd5e25d87 | ||
|
|
e0e5721215 | ||
|
|
8f92988d0e | ||
|
|
d6d9dfd084 | ||
|
|
2acf4e46d7 | ||
|
|
476ee0015f | ||
|
|
ab5939c64c | ||
|
|
a68c3cf9f4 | ||
|
|
91f1162a77 | ||
|
|
f12cbfaf15 | ||
|
|
f9fa201dbe | ||
|
|
174152c66c | ||
|
|
76e66b3f08 | ||
|
|
11d5cf4214 | ||
|
|
ca190aabfd | ||
|
|
d326a0ed1a | ||
|
|
ae581286bb | ||
|
|
48aa4b66fc | ||
|
|
354c6a4971 | ||
|
|
1bb4a7299b | ||
|
|
8c5cc1a7cc | ||
|
|
56d08f66d5 | ||
|
|
f339e19d05 | ||
|
|
7e7d320489 | ||
|
|
0b367182a3 | ||
|
|
821b0f3e34 | ||
|
|
697db3f596 | ||
|
|
c1a7144aa9 | ||
|
|
f79ea44a3b | ||
|
|
b3a24ef55a | ||
|
|
1ac834c74f | ||
|
|
af684c4992 | ||
|
|
bb55c4c590 | ||
|
|
d826160908 | ||
|
|
476771b6e4 | ||
|
|
36704b22ff | ||
|
|
bbbf9c12fd | ||
|
|
07661d77fe | ||
|
|
95ba33fde8 | ||
|
|
6f29103386 | ||
|
|
3dee8c4c85 | ||
|
|
522400c01e | ||
|
|
1b18713691 | ||
|
|
8972a1bd5b | ||
|
|
22cd5b2ae1 | ||
|
|
632c0a2f7f | ||
|
|
14123eb3a6 | ||
|
|
f3331f8442 | ||
|
|
abe720d48f | ||
|
|
ff8e88f8c9 | ||
|
|
5d66c2acf1 | ||
|
|
9e22607231 | ||
|
|
831193f8e1 | ||
|
|
68e9926213 | ||
|
|
5791fc4710 | ||
|
|
13b01c3d88 | ||
|
|
4d12b32659 | ||
|
|
eb3392fd36 | ||
|
|
b2966b4086 | ||
|
|
205fb9d0e2 | ||
|
|
c8bcc96d90 | ||
|
|
e41a47260c | ||
|
|
95650aff08 | ||
|
|
0ec838213f | ||
|
|
269fe354ca | ||
|
|
246b414c58 | ||
|
|
65e1e9d67f | ||
|
|
48bcaf669e | ||
|
|
f2917477d6 | ||
|
|
6671063638 | ||
|
|
86b5cf1ccc | ||
|
|
d15106b023 | ||
|
|
cffd4bcb80 | ||
|
|
ba089cb438 | ||
|
|
69038b2ab0 | ||
|
|
1756bf01d7 | ||
|
|
bd02d16a44 | ||
|
|
44fa2302dd | ||
|
|
2bd40a50f6 | ||
|
|
39b30c5397 | ||
|
|
279d7ea994 | ||
|
|
a587af2c92 | ||
|
|
01d039b9aa | ||
|
|
1aff3dcfa7 | ||
|
|
9be1e52ad7 | ||
|
|
61e5e997c3 | ||
|
|
47e2c5444a | ||
|
|
b79cdf1859 | ||
|
|
635396a03b | ||
|
|
1ded9c6e61 | ||
|
|
7d418c0894 | ||
|
|
58c1693b27 | ||
|
|
140db359b7 | ||
|
|
513adc5bf6 | ||
|
|
054b308a5c | ||
|
|
5b92695cb7 | ||
|
|
c051961b73 | ||
|
|
ddf3b8fbd5 | ||
|
|
ece82b3306 | ||
|
|
96653b4390 | ||
|
|
c686910083 |
@@ -4173,7 +4173,9 @@ exports[`better eslint`] = {
|
||||
],
|
||||
"public/app/plugins/datasource/influxdb/specs/mocks.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"]
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "2"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "3"]
|
||||
],
|
||||
"public/app/plugins/datasource/jaeger/datasource.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
|
||||
@@ -1294,7 +1294,7 @@ This option to group query variable values into groups by tags has been an exper
|
||||
**Deprecation warnings**
|
||||
|
||||
- Scripted dashboards is now deprecated. The feature is not removed but will be in a future release. We hope to address the underlying requirement of dynamic dashboards in a different way. [#24059](https://github.com/grafana/grafana/issues/24059)
|
||||
- The unofficial first version of backend plugins together with usage of [grafana/grafana-plugin-model](https://github.com/grafana/grafana-plugin-model) is now deprecated and support for that will be removed in a future release. Please refer to [backend plugins documentation](https://grafana.com/docs/grafana/latest/developers/plugins/backend/) for information about the new officially supported backend plugins.
|
||||
- The unofficial first version of backend plugins together with usage of [grafana/grafana-plugin-model](https://github.com/grafana/grafana-plugin-model) is now deprecated and support for that will be removed in a future release. Please refer to [backend plugins documentation](/developers/plugin-tools/introduction/backend-plugins) for information about the new officially supported backend plugins.
|
||||
|
||||
## 7.0 Feature highlights
|
||||
|
||||
|
||||
@@ -2204,7 +2204,7 @@ In the Loki data source, the dataframe format used to represent Loki logs-data h
|
||||
|
||||
### Deprecations
|
||||
|
||||
`setExploreQueryField`, `setExploreMetricsQueryField` and `setExploreLogsQueryField` are now deprecated and will be removed in a future release. If you need to set a different query editor for Explore, conditionally render based on `props.app` in your regular query editor. Please refer to https://grafana.com/docs/grafana/latest/developers/plugins/add-support-for-explore-queries/ for more information.
|
||||
`setExploreQueryField`, `setExploreMetricsQueryField` and `setExploreLogsQueryField` are now deprecated and will be removed in a future release. If you need to set a different query editor for Explore, conditionally render based on `props.app` in your regular query editor. Please refer to https://grafana.com/developers/plugin-tools/create-a-plugin/extend-a-plugin/add-support-for-explore-queries for more information.
|
||||
Issue [#48701](https://github.com/grafana/grafana/issues/48701)
|
||||
|
||||
### Plugin development fixes & changes
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
aks
|
||||
eror
|
||||
iam
|
||||
wan
|
||||
wan
|
||||
operato
|
||||
|
||||
20
.drone.star
20
.drone.star
@@ -7,8 +7,9 @@
|
||||
This module returns a Drone configuration including pipelines and secrets.
|
||||
"""
|
||||
|
||||
load("scripts/drone/events/pr.star", "pr_pipelines")
|
||||
load("scripts/drone/events/cron.star", "cronjobs")
|
||||
load("scripts/drone/events/main.star", "main_pipelines")
|
||||
load("scripts/drone/events/pr.star", "pr_pipelines")
|
||||
load(
|
||||
"scripts/drone/events/release.star",
|
||||
"integration_test_pipelines",
|
||||
@@ -17,24 +18,21 @@ load(
|
||||
"publish_packages_pipeline",
|
||||
)
|
||||
load(
|
||||
"scripts/drone/rgm.star",
|
||||
"rgm",
|
||||
"scripts/drone/pipelines/ci_images.star",
|
||||
"publish_ci_windows_test_image_pipeline",
|
||||
)
|
||||
load(
|
||||
"scripts/drone/pipelines/publish_images.star",
|
||||
"publish_image_pipelines_public",
|
||||
)
|
||||
load(
|
||||
"scripts/drone/pipelines/ci_images.star",
|
||||
"publish_ci_build_container_image_pipeline",
|
||||
"publish_ci_windows_test_image_pipeline",
|
||||
)
|
||||
load(
|
||||
"scripts/drone/pipelines/windows.star",
|
||||
"windows_test_backend",
|
||||
)
|
||||
load("scripts/drone/version.star", "version_branch_pipelines")
|
||||
load("scripts/drone/events/cron.star", "cronjobs")
|
||||
load(
|
||||
"scripts/drone/rgm.star",
|
||||
"rgm",
|
||||
)
|
||||
load("scripts/drone/vault.star", "secrets")
|
||||
|
||||
def main(_ctx):
|
||||
@@ -50,10 +48,8 @@ def main(_ctx):
|
||||
"event": ["promote"],
|
||||
"target": ["test-windows"],
|
||||
}, "oss", "testing")] +
|
||||
version_branch_pipelines() +
|
||||
integration_test_pipelines() +
|
||||
publish_ci_windows_test_image_pipeline() +
|
||||
publish_ci_build_container_image_pipeline() +
|
||||
cronjobs() +
|
||||
secrets()
|
||||
)
|
||||
|
||||
2751
.drone.yml
2751
.drone.yml
File diff suppressed because it is too large
Load Diff
4
.github/CODEOWNERS
vendored
4
.github/CODEOWNERS
vendored
@@ -38,7 +38,7 @@
|
||||
# Documentation sources might have different owners.
|
||||
/docs/ @grafana/docs-tooling
|
||||
/docs/sources/ @Eve832
|
||||
/docs/sources/administration/ @Eve832 @GrafanaWriter
|
||||
/docs/sources/administration/ @jdbaldry
|
||||
/docs/sources/alerting/ @brendamuir
|
||||
/docs/sources/dashboards/ @imatwawana
|
||||
/docs/sources/datasources/ @lwandz13
|
||||
@@ -53,7 +53,6 @@
|
||||
/docs/sources/upgrade-guide/ @chri2547 @imatwawana
|
||||
/docs/sources/whatsnew/ @chri2547 @imatwawana
|
||||
/docs/sources/developers/plugins/ @Eve832 @josmperez @grafana/plugins-platform-frontend @grafana/plugins-platform-backend
|
||||
/docs/sources/developers/plugins/introduction-to-plugin-development/backend/ @Eve832 @grafana/plugins-platform-backend
|
||||
|
||||
# Backend code
|
||||
/go.mod @grafana/backend-platform
|
||||
@@ -637,6 +636,7 @@ embed.go @grafana/grafana-as-code
|
||||
/.github/workflows/dashboards-issue-add-label.yml @grafana/dashboards-squad
|
||||
/.github/workflows/ephemeral-instances-pr-comment.yml @grafana/grafana-operator-experience-squad
|
||||
/.github/workflows/ephemeral-instances-pr-opened-closed.yml @grafana/grafana-operator-experience-squad
|
||||
/.github/workflows/create-security-patch-from-security-mirror.yml @grafana/grafana-delivery
|
||||
|
||||
|
||||
# Generated files not requiring owner approval
|
||||
|
||||
2
.github/workflows/alerting-swagger-gen.yml
vendored
2
.github/workflows/alerting-swagger-gen.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
- name: Set go version
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.20.6'
|
||||
go-version: '1.21.5'
|
||||
- name: Build swagger
|
||||
run: |
|
||||
make -C pkg/services/ngalert/api/tooling post.json api.json
|
||||
|
||||
2
.github/workflows/auto-milestone.yml
vendored
2
.github/workflows/auto-milestone.yml
vendored
@@ -2,6 +2,8 @@ name: Auto-milestone
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
- closed
|
||||
|
||||
jobs:
|
||||
|
||||
2
.github/workflows/codeql-analysis.yml
vendored
2
.github/workflows/codeql-analysis.yml
vendored
@@ -44,7 +44,7 @@ jobs:
|
||||
name: Set go version
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.20.6'
|
||||
go-version: '1.21.5'
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
|
||||
28
.github/workflows/create-security-patch-from-security-mirror.yml
vendored
Normal file
28
.github/workflows/create-security-patch-from-security-mirror.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
# Owned by grafana-delivery-squad
|
||||
# Intended to be dropped into the base repo (Ex: grafana/grafana) for use in the security mirror.
|
||||
name: Create security patch
|
||||
run-name: create-security-patch
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
- synchronize
|
||||
branches:
|
||||
- "main"
|
||||
- "v*.*.*"
|
||||
|
||||
# This is run before the pull request has been merged, so we'll run against the src branch
|
||||
jobs:
|
||||
trigger_downstream_create_security_patch:
|
||||
concurrency: create-patch-${{ github.ref_name }}
|
||||
uses: grafana/security-patch-actions/.github/workflows/create-patch.yml@main
|
||||
if: github.repository == 'grafana/grafana-security-mirror'
|
||||
with:
|
||||
repo: "${{ github.repository }}"
|
||||
src_ref: "${{ github.head_ref }}" # this is the source branch name, Ex: "feature/newthing"
|
||||
patch_ref: "${{ github.base_ref }}" # this is the target branch name, Ex: "main"
|
||||
patch_repo: "grafana/grafana-security-patches"
|
||||
patch_prefix: "${{ github.event.pull_request.number }}"
|
||||
secrets: inherit
|
||||
|
||||
2
.github/workflows/doc-validator.yml
vendored
2
.github/workflows/doc-validator.yml
vendored
@@ -7,7 +7,7 @@ jobs:
|
||||
doc-validator:
|
||||
runs-on: "ubuntu-latest"
|
||||
container:
|
||||
image: "grafana/doc-validator:v3.2.1"
|
||||
image: "grafana/doc-validator:v4.0.0"
|
||||
steps:
|
||||
- name: "Checkout code"
|
||||
uses: "actions/checkout@v3"
|
||||
|
||||
@@ -2,11 +2,33 @@ name: 'Ephemeral instances: PR opened/closed'
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, reopened, closed]
|
||||
jobs:
|
||||
jobs:
|
||||
config:
|
||||
runs-on: "ubuntu-latest"
|
||||
outputs:
|
||||
has-secrets: ${{ steps.check.outputs.has-secrets }}
|
||||
steps:
|
||||
- name: "Check for secrets"
|
||||
id: check
|
||||
shell: bash
|
||||
run: |
|
||||
if [ -n "${{ (secrets.EI_APP_ID != '' &&
|
||||
secrets.EI_APP_PRIVATE_KEY != '' &&
|
||||
secrets.EI_GCOM_HOST != '' &&
|
||||
secrets.EI_GCOM_TOKEN != '' &&
|
||||
secrets.EI_EPHEMERAL_INSTANCES_REGISTRY != '' &&
|
||||
secrets.EI_GCP_SERVICE_ACCOUNT_KEY_BASE64 != '' &&
|
||||
secrets.EI_EPHEMERAL_ORG_ID != ''
|
||||
) || '' }}" ]; then
|
||||
echo "has-secrets=1" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
handle-pull-request-event:
|
||||
needs: config
|
||||
if: needs.config.outputs.has-secrets
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: true
|
||||
steps:
|
||||
steps:
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
@@ -20,13 +42,13 @@ jobs:
|
||||
private_key: ${{ secrets.EI_APP_PRIVATE_KEY }}
|
||||
|
||||
- name: Checkout ephemeral instances repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: grafana/ephemeral-grafana-instances-github-action
|
||||
token: ${{ steps.generate_token.outputs.token }}
|
||||
ref: main
|
||||
path: ephemeral
|
||||
|
||||
|
||||
- name: Run action
|
||||
env:
|
||||
GITHUB_EVENT: ${{ toJson(github.event)}}
|
||||
@@ -44,4 +66,4 @@ jobs:
|
||||
-REGISTRY="${{ secrets.EI_EPHEMERAL_INSTANCES_REGISTRY }}" \
|
||||
-GRAFANA_VERSION="$GRAFANA_VERSION" \
|
||||
-GCP_SERVICE_ACCOUNT_KEY_BASE64="${{ secrets.EI_GCP_SERVICE_ACCOUNT_KEY_BASE64 }}" \
|
||||
-EPHEMERAL_ORG_ID="${{ secrets.EI_EPHEMERAL_ORG_ID }}" || true
|
||||
-EPHEMERAL_ORG_ID="${{ secrets.EI_EPHEMERAL_ORG_ID }}" || true
|
||||
|
||||
2
.github/workflows/pr-codeql-analysis-go.yml
vendored
2
.github/workflows/pr-codeql-analysis-go.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
- name: Set go version
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.20.6'
|
||||
go-version: '1.21.5'
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
|
||||
20
.github/workflows/pr-commands.yml
vendored
20
.github/workflows/pr-commands.yml
vendored
@@ -8,11 +8,29 @@ on:
|
||||
concurrency:
|
||||
group: pr-commands-${{ github.event.number }}
|
||||
jobs:
|
||||
config:
|
||||
runs-on: "ubuntu-latest"
|
||||
outputs:
|
||||
has-secrets: ${{ steps.check.outputs.has-secrets }}
|
||||
steps:
|
||||
- name: "Check for secrets"
|
||||
id: check
|
||||
shell: bash
|
||||
run: |
|
||||
if [ -n "${{ (secrets.GRAFANA_PR_AUTOMATION_APP_ID != '' &&
|
||||
secrets.GRAFANA_PR_AUTOMATION_APP_PEM != '' &&
|
||||
secrets.GRAFANA_MISC_STATS_API_KEY != ''
|
||||
) || '' }}" ]; then
|
||||
echo "has-secrets=1" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
main:
|
||||
needs: config
|
||||
if: needs.config.outputs.has-secrets
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: "grafana/grafana-github-actions"
|
||||
path: ./actions
|
||||
|
||||
4
.github/workflows/pr-patch-check.yml
vendored
4
.github/workflows/pr-patch-check.yml
vendored
@@ -3,9 +3,11 @@
|
||||
name: Check for patch conflicts
|
||||
run-name: check-patch-conflicts-${{ github.base_ref }}-${{ github.head_ref }}
|
||||
on:
|
||||
pull_request_target:
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
- synchronize
|
||||
branches:
|
||||
- "main"
|
||||
- "v*.*.*"
|
||||
|
||||
3
.github/workflows/publish-kinds-next.yml
vendored
3
.github/workflows/publish-kinds-next.yml
vendored
@@ -10,6 +10,7 @@ on:
|
||||
|
||||
jobs:
|
||||
main:
|
||||
if: github.repository == 'grafana/grafana'
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- name: "Checkout Grafana repo"
|
||||
@@ -20,7 +21,7 @@ jobs:
|
||||
- name: "Setup Go"
|
||||
uses: "actions/setup-go@v4"
|
||||
with:
|
||||
go-version: '1.20.6'
|
||||
go-version: '1.21.5'
|
||||
|
||||
- name: "Verify kinds"
|
||||
run: go run .github/workflows/scripts/kinds/verify-kinds.go
|
||||
|
||||
3
.github/workflows/publish-kinds-release.yml
vendored
3
.github/workflows/publish-kinds-release.yml
vendored
@@ -12,6 +12,7 @@ on:
|
||||
|
||||
jobs:
|
||||
main:
|
||||
if: github.repository == 'grafana/grafana'
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- name: "Checkout Grafana repo"
|
||||
@@ -23,7 +24,7 @@ jobs:
|
||||
- name: "Setup Go"
|
||||
uses: "actions/setup-go@v4"
|
||||
with:
|
||||
go-version: '1.20.6'
|
||||
go-version: '1.21.5'
|
||||
|
||||
- name: "Verify kinds"
|
||||
run: go run .github/workflows/scripts/kinds/verify-kinds.go
|
||||
|
||||
2
.github/workflows/verify-kinds.yml
vendored
2
.github/workflows/verify-kinds.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
||||
- name: "Setup Go"
|
||||
uses: "actions/setup-go@v4"
|
||||
with:
|
||||
go-version: '1.20.6'
|
||||
go-version: '1.21.5'
|
||||
|
||||
- name: "Verify kinds"
|
||||
run: go run .github/workflows/scripts/kinds/verify-kinds.go
|
||||
|
||||
112
CHANGELOG.md
112
CHANGELOG.md
@@ -1,3 +1,115 @@
|
||||
<!-- 10.1.6 START -->
|
||||
|
||||
# 10.1.6 (2023-12-18)
|
||||
|
||||
### Features and enhancements
|
||||
|
||||
- **Alerting:** Attempt to retry retryable errors. [#79211](https://github.com/grafana/grafana/issues/79211), [@gotjosh](https://github.com/gotjosh)
|
||||
- **Unified Alerting:** Set `max_attempts` to 1 by default. [#79102](https://github.com/grafana/grafana/issues/79102), [@gotjosh](https://github.com/gotjosh)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- **Alerting:** Fix deleting rules in a folder with matching UID in another organization. [#79007](https://github.com/grafana/grafana/issues/79007), [@papagian](https://github.com/papagian)
|
||||
- **Chore:** Fix timeout issues when gathering prometheus datasource stats. [#78858](https://github.com/grafana/grafana/issues/78858), [@DanCech](https://github.com/DanCech)
|
||||
- **Provisioning:** Ensure that enterprise provisioning runs [10.1.x]. [#76686](https://github.com/grafana/grafana/issues/76686), [@IevaVasiljeva](https://github.com/IevaVasiljeva)
|
||||
- **Alerting:** Make shareable alert rule link work if rule name contains forward slashes. [#75950](https://github.com/grafana/grafana/issues/75950), [@domasx2](https://github.com/domasx2)
|
||||
- **Loki:** Cache extracted labels. [#75905](https://github.com/grafana/grafana/issues/75905), [@gtk-grafana](https://github.com/gtk-grafana)
|
||||
- **DataSourcePicker:** Disable autocomplete for the search input . [#75900](https://github.com/grafana/grafana/issues/75900), [@ivanortegaalba](https://github.com/ivanortegaalba)
|
||||
- **Plugins:** Refresh plugin info after installation. [#75225](https://github.com/grafana/grafana/issues/75225), [@oshirohugo](https://github.com/oshirohugo)
|
||||
- **LDAP:** FIX Enable users on successfull login . [#75176](https://github.com/grafana/grafana/issues/75176), [@gamab](https://github.com/gamab)
|
||||
- **Loki:** Fix filters not being added with multiple expressions and parsers. [#75172](https://github.com/grafana/grafana/issues/75172), [@svennergr](https://github.com/svennergr)
|
||||
- **Recorded Queries:** Add org isolation (remote write target per org), and fix cross org Delete/List. (Enterprise)
|
||||
- **Auditing and UsageInsights:** FIX Loki configuration to use proxy env variables. (Enterprise)
|
||||
|
||||
<!-- 10.1.6 END -->
|
||||
<!-- 10.1.5 START -->
|
||||
|
||||
# 10.1.5 (2023-10-11)
|
||||
|
||||
### Features and enhancements
|
||||
|
||||
- **Chore:** Upgrade Go to 1.20.10. [#76355](https://github.com/grafana/grafana/issues/76355), [@zerok](https://github.com/zerok)
|
||||
- **Cloudwatch:** Backport 73524 Bring Back Legacy Log Group Picker. [#75031](https://github.com/grafana/grafana/issues/75031), [@sarahzinger](https://github.com/sarahzinger)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- **Cloudwatch:** Prevent log group requests with ARNs if feature flag is off. [#75691](https://github.com/grafana/grafana/issues/75691), [@sarahzinger](https://github.com/sarahzinger)
|
||||
- **Alerting:** Add support for `keep_firing_for` field from external rulers. [#75257](https://github.com/grafana/grafana/issues/75257), [@rwwiv](https://github.com/rwwiv)
|
||||
- **Canvas:** Avoid conflicting stylesheets when loading SVG icons. [#75032](https://github.com/grafana/grafana/issues/75032), [@adela-almasan](https://github.com/adela-almasan)
|
||||
- **Alerting:** Prevent showing "Permissions denied" alert when not accurate. [#74925](https://github.com/grafana/grafana/issues/74925), [@VikaCep](https://github.com/VikaCep)
|
||||
- **BrowseDashboards:** Only remember the most recent expanded folder. [#74809](https://github.com/grafana/grafana/issues/74809), [@joshhunt](https://github.com/joshhunt)
|
||||
- **Tempo Service Map:** Fix context menu links in service map when namespace is present. [#74796](https://github.com/grafana/grafana/issues/74796), [@javiruiz01](https://github.com/javiruiz01)
|
||||
- **Logs Panel:** Performance issue while scrolling within panel in safari. [#74747](https://github.com/grafana/grafana/issues/74747), [@gtk-grafana](https://github.com/gtk-grafana)
|
||||
- **Bug:** Allow to uninstall a deprecated plugin. [#74704](https://github.com/grafana/grafana/issues/74704), [@andresmgot](https://github.com/andresmgot)
|
||||
- **Licensing:** Pass func to update env variables when starting plugin. [#74678](https://github.com/grafana/grafana/issues/74678), [@leandro-deveikis](https://github.com/leandro-deveikis)
|
||||
- **Nested folders:** Fix folder hierarchy in folder responses. [#74580](https://github.com/grafana/grafana/issues/74580), [@papagian](https://github.com/papagian)
|
||||
- **Share link:** Use panel relative time for direct link rendered image. [#74518](https://github.com/grafana/grafana/issues/74518), [@Clarity-89](https://github.com/Clarity-89)
|
||||
- **Alerting:** Do not exit if Redis ping fails when using redis-based Alertmanager clustering. [#74399](https://github.com/grafana/grafana/issues/74399), [@alexweav](https://github.com/alexweav)
|
||||
- **Alerting:** Refactor AlertRuleForm and fix annotations step description for cloud rules. [#74193](https://github.com/grafana/grafana/issues/74193), [@soniaAguilarPeiron](https://github.com/soniaAguilarPeiron)
|
||||
- **RBAC:** Chore fix hasPermissionInOrg. (Enterprise)
|
||||
- **Licensing:** Updated grpc plugin factory newPlugin signature. (Enterprise)
|
||||
- **Reporting:** Add support for old dashboard schema. (Enterprise)
|
||||
|
||||
<!-- 10.1.5 END -->
|
||||
<!-- 10.1.4 START -->
|
||||
|
||||
# 10.1.4 (2023-09-29)
|
||||
|
||||
### Features and enhancements
|
||||
|
||||
- **Azure:** Add support for Workload Identity authentication. [#75733](https://github.com/grafana/grafana/issues/75733), [@aangelisc](https://github.com/aangelisc)
|
||||
|
||||
<!-- 10.1.4 END -->
|
||||
<!-- 10.1.2 START -->
|
||||
|
||||
# 10.1.2 (2023-09-18)
|
||||
|
||||
### Features and enhancements
|
||||
|
||||
- **Chore:** Upgrade Alpine base image to 3.18.3. [#74993](https://github.com/grafana/grafana/issues/74993), [@zerok](https://github.com/zerok)
|
||||
- **Chore:** Upgrade Go to 1.20.8. [#74980](https://github.com/grafana/grafana/issues/74980), [@zerok](https://github.com/zerok)
|
||||
|
||||
<!-- 10.1.2 END -->
|
||||
<!-- 10.1.1 START -->
|
||||
|
||||
# 10.1.1 (2023-08-29)
|
||||
|
||||
### Features and enhancements
|
||||
|
||||
- **Loki:** Remove `distinct` operation. [#74003](https://github.com/grafana/grafana/issues/74003), [@svennergr](https://github.com/svennergr)
|
||||
- **Whitelabeling:** Add a config option to hide the Grafana edition from the footer. [#73491](https://github.com/grafana/grafana/issues/73491), [@JoaoSilvaGrafana](https://github.com/JoaoSilvaGrafana)
|
||||
- **Alerting:** Optimize rule details page data fetching. [#73139](https://github.com/grafana/grafana/issues/73139), [@konrad147](https://github.com/konrad147)
|
||||
- **Alerting:** Optimize external Loki queries. [#73050](https://github.com/grafana/grafana/issues/73050), [@JohnnyQQQQ](https://github.com/JohnnyQQQQ)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- **Alerting:** Limit redis pool size to 5 and make configurable. [#74059](https://github.com/grafana/grafana/issues/74059), [@alexweav](https://github.com/alexweav)
|
||||
- **Elasticsearch:** Fix respecting of precision in geo hash grid. [#73933](https://github.com/grafana/grafana/issues/73933), [@ivanahuckova](https://github.com/ivanahuckova)
|
||||
- **Dashboard:** Fix Variable Dropdown to Enforce Minimum One Selection when 'All' Option is Configured. [#73927](https://github.com/grafana/grafana/issues/73927), [@axelavargas](https://github.com/axelavargas)
|
||||
- **Chore:** Fix Random Walk scenario for Grafana DS. [#73894](https://github.com/grafana/grafana/issues/73894), [@andresmgot](https://github.com/andresmgot)
|
||||
- **AuthProxy:** Fix user retrieval through cache. [#73824](https://github.com/grafana/grafana/issues/73824), [@kalleep](https://github.com/kalleep)
|
||||
- **Alerting:** Fix auto-completion snippets for KV properties. [#73741](https://github.com/grafana/grafana/issues/73741), [@jvmdc](https://github.com/jvmdc)
|
||||
- **Alerting:** Fix incorrect timing meta information for policy. [#73695](https://github.com/grafana/grafana/issues/73695), [@gillesdemey](https://github.com/gillesdemey)
|
||||
- **Alerting:** Add new Recording Rule button when the list is empty. [#73638](https://github.com/grafana/grafana/issues/73638), [@VikaCep](https://github.com/VikaCep)
|
||||
- **Drawer:** Clicking a `Select` arrow within a `Drawer` no longer causes it to close. [#73634](https://github.com/grafana/grafana/issues/73634), [@ashharrison90](https://github.com/ashharrison90)
|
||||
- **Logs:** Fix log samples not present with empty first frame. [#73622](https://github.com/grafana/grafana/issues/73622), [@svennergr](https://github.com/svennergr)
|
||||
- **Alerting:** Fix Recording Rule QueryEditor builder view. [#73621](https://github.com/grafana/grafana/issues/73621), [@VikaCep](https://github.com/VikaCep)
|
||||
- **Transforms:** Catch errors while running transforms. [#73527](https://github.com/grafana/grafana/issues/73527), [@ryantxu](https://github.com/ryantxu)
|
||||
- **Dashboard:** Fix version restore. [#73482](https://github.com/grafana/grafana/issues/73482), [@Clarity-89](https://github.com/Clarity-89)
|
||||
- **Logs:** Fix permalinks not scrolling into view. [#73477](https://github.com/grafana/grafana/issues/73477), [@svennergr](https://github.com/svennergr)
|
||||
- **SqlDataSources:** Update metricFindQuery to pass on scopedVars to templateSrv. [#73398](https://github.com/grafana/grafana/issues/73398), [@torkelo](https://github.com/torkelo)
|
||||
- **Rendering:** Fix dashboard screenshot. [#73361](https://github.com/grafana/grafana/issues/73361), [@AgnesToulet](https://github.com/AgnesToulet)
|
||||
- **Loki:** Fix validation of `step` values to also allow e.g. `ms` values. [#73335](https://github.com/grafana/grafana/issues/73335), [@svennergr](https://github.com/svennergr)
|
||||
- **Dashboard:** Fix repeated row panel placement with larger number of rows. [#73279](https://github.com/grafana/grafana/issues/73279), [@kaydelaney](https://github.com/kaydelaney)
|
||||
- **CodeEditor:** Correctly fires onChange handler. [#73261](https://github.com/grafana/grafana/issues/73261), [@ashharrison90](https://github.com/ashharrison90)
|
||||
- **Drawer:** Fix scrolling drawer content on Safari. [#73229](https://github.com/grafana/grafana/issues/73229), [@asimonok](https://github.com/asimonok)
|
||||
- **Alerting:** Remove dump wrapper for yaml config. [#73215](https://github.com/grafana/grafana/issues/73215), [@VikaCep](https://github.com/VikaCep)
|
||||
- **Alerting:** Always invalidate the AM config after mutation. [#73189](https://github.com/grafana/grafana/issues/73189), [@gillesdemey](https://github.com/gillesdemey)
|
||||
- **Slug:** Combine various slugify fixes for special character handling. [#73173](https://github.com/grafana/grafana/issues/73173), [@DanCech](https://github.com/DanCech)
|
||||
- **Logs:** Fix displaying the wrong field as body. [#73037](https://github.com/grafana/grafana/issues/73037), [@svennergr](https://github.com/svennergr)
|
||||
- **Alerting:** Fix "see graph button" for cloud rules. [#73029](https://github.com/grafana/grafana/issues/73029), [@gillesdemey](https://github.com/gillesdemey)
|
||||
|
||||
<!-- 10.1.1 END -->
|
||||
<!-- 10.1.0 START -->
|
||||
|
||||
# 10.1.0 (2023-08-01)
|
||||
|
||||
@@ -82,6 +82,6 @@ Before we can accept your pull request, you need to [sign our CLA](https://grafa
|
||||
## Where do I go from here?
|
||||
|
||||
- Set up your [development environment](contribute/developer-guide.md).
|
||||
- Learn how to [contribute documentation](contribute/README.md).
|
||||
- Get started [developing plugins](https://grafana.com/docs/grafana/latest/developers/plugins/) for Grafana.
|
||||
- Learn how to [contribute to our documentation](contribute/documentation/README.md).
|
||||
- Get started [developing plugins](https://grafana.com/developers/plugin-tools) for Grafana.
|
||||
- Look through the resources in the [contribute](contribute) folder.
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
ARG BASE_IMAGE=alpine:3.17
|
||||
ARG JS_IMAGE=node:18-alpine3.17
|
||||
ARG BASE_IMAGE=alpine:3.18.3
|
||||
ARG JS_IMAGE=node:18-alpine3.18
|
||||
ARG JS_PLATFORM=linux/amd64
|
||||
ARG GO_IMAGE=golang:1.20.6-alpine3.17
|
||||
ARG GO_IMAGE=golang:1.21.5-alpine3.18
|
||||
|
||||
ARG GO_SRC=go-builder
|
||||
ARG JS_SRC=js-builder
|
||||
|
||||
72
Makefile
72
Makefile
@@ -36,36 +36,68 @@ node_modules: package.json yarn.lock ## Install node modules.
|
||||
|
||||
##@ Swagger
|
||||
SPEC_TARGET = public/api-spec.json
|
||||
MERGED_SPEC_TARGET := public/api-merged.json
|
||||
ENTERPRISE_SPEC_TARGET = public/api-enterprise-spec.json
|
||||
MERGED_SPEC_TARGET = public/api-merged.json
|
||||
NGALERT_SPEC_TARGET = pkg/services/ngalert/api/tooling/api.json
|
||||
|
||||
$(NGALERT_SPEC_TARGET):
|
||||
+$(MAKE) -C pkg/services/ngalert/api/tooling api.json
|
||||
|
||||
$(MERGED_SPEC_TARGET): $(SPEC_TARGET) $(NGALERT_SPEC_TARGET) $(SWAGGER) ## Merge generated and ngalert API specs
|
||||
$(MERGED_SPEC_TARGET): swagger-oss-gen swagger-enterprise-gen $(NGALERT_SPEC_TARGET) $(SWAGGER) ## Merge generated and ngalert API specs
|
||||
# known conflicts DsPermissionType, AddApiKeyCommand, Json, Duration (identical models referenced by both specs)
|
||||
$(SWAGGER) mixin $(SPEC_TARGET) $(NGALERT_SPEC_TARGET) --ignore-conflicts -o $(MERGED_SPEC_TARGET)
|
||||
$(SWAGGER) mixin $(SPEC_TARGET) $(ENTERPRISE_SPEC_TARGET) $(NGALERT_SPEC_TARGET) --ignore-conflicts -o $(MERGED_SPEC_TARGET)
|
||||
|
||||
$(SPEC_TARGET): $(SWAGGER) ## Generate API Swagger specification
|
||||
swagger-oss-gen: $(SWAGGER) ## Generate API Swagger specification
|
||||
@echo "re-generating swagger for OSS"
|
||||
rm -f $(SPEC_TARGET)
|
||||
SWAGGER_GENERATE_EXTENSION=false $(SWAGGER) generate spec -m -w pkg/server -o $(SPEC_TARGET) \
|
||||
-x "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" \
|
||||
-x "github.com/prometheus/alertmanager" \
|
||||
-i pkg/api/swagger_tags.json \
|
||||
--exclude-tag=alpha
|
||||
go run pkg/services/ngalert/api/tooling/cmd/clean-swagger/main.go -if $@ -of $@
|
||||
--exclude-tag=alpha \
|
||||
--exclude-tag=enterprise
|
||||
|
||||
swagger-api-spec: gen-go $(SPEC_TARGET) $(MERGED_SPEC_TARGET) validate-api-spec
|
||||
# this file only exists if enterprise is enabled
|
||||
ENTERPRISE_EXT_FILE = pkg/extensions/ext.go
|
||||
ifeq ("$(wildcard $(ENTERPRISE_EXT_FILE))","") ## if enterprise is not enabled
|
||||
swagger-enterprise-gen:
|
||||
@echo "skipping re-generating swagger for enterprise: not enabled"
|
||||
else
|
||||
swagger-enterprise-gen: $(SWAGGER) ## Generate API Swagger specification
|
||||
@echo "re-generating swagger for enterprise"
|
||||
rm -f $(ENTERPRISE_SPEC_TARGET)
|
||||
SWAGGER_GENERATE_EXTENSION=false $(SWAGGER) generate spec -m -w pkg/server -o $(ENTERPRISE_SPEC_TARGET) \
|
||||
-x "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" \
|
||||
-x "github.com/prometheus/alertmanager" \
|
||||
-i pkg/api/swagger_tags.json \
|
||||
--exclude-tag=alpha \
|
||||
--include-tag=enterprise
|
||||
endif
|
||||
|
||||
validate-api-spec: $(MERGED_SPEC_TARGET) $(SWAGGER) ## Validate API spec
|
||||
swagger-gen: gen-go $(MERGED_SPEC_TARGET) swagger-validate
|
||||
|
||||
swagger-validate: $(MERGED_SPEC_TARGET) $(SWAGGER) ## Validate API spec
|
||||
$(SWAGGER) validate $(<)
|
||||
|
||||
clean-api-spec:
|
||||
swagger-clean:
|
||||
rm -f $(SPEC_TARGET) $(MERGED_SPEC_TARGET) $(OAPI_SPEC_TARGET)
|
||||
|
||||
.PHONY: cleanup-old-git-hooks
|
||||
cleanup-old-git-hooks:
|
||||
./scripts/cleanup-husky.sh
|
||||
|
||||
.PHONY: lefthook-install
|
||||
lefthook-install: cleanup-old-git-hooks $(LEFTHOOK) # install lefthook for pre-commit hooks
|
||||
$(LEFTHOOK) install -f
|
||||
|
||||
.PHONY: lefthook-uninstall
|
||||
lefthook-uninstall: $(LEFTHOOK)
|
||||
$(LEFTHOOK) uninstall
|
||||
|
||||
##@ OpenAPI 3
|
||||
OAPI_SPEC_TARGET = public/openapi3.json
|
||||
|
||||
openapi3-gen: swagger-api-spec ## Generates OpenApi 3 specs from the Swagger 2 already generated
|
||||
openapi3-gen: swagger-gen ## Generates OpenApi 3 specs from the Swagger 2 already generated
|
||||
$(GO) run scripts/openapi3/openapi3conv.go $(MERGED_SPEC_TARGET) $(OAPI_SPEC_TARGET)
|
||||
|
||||
##@ Building
|
||||
@@ -132,6 +164,13 @@ test-go-integration: ## Run integration tests for backend with flags.
|
||||
@echo "test backend integration tests"
|
||||
$(GO) test -count=1 -run "^TestIntegration" -covermode=atomic -timeout=5m $(GO_INTEGRATION_TESTS)
|
||||
|
||||
.PHONY: test-go-integration-alertmanager
|
||||
test-go-integration-alertmanager: ## Run integration tests for the remote alertmanager (config taken from the mimir_backend block).
|
||||
@echo "test remote alertmanager integration tests"
|
||||
$(GO) clean -testcache
|
||||
AM_URL=http://localhost:8080 AM_TENANT_ID=test AM_PASSWORD=test \
|
||||
$(GO) test -count=1 -run "^TestIntegrationRemoteAlertmanager" -covermode=atomic -timeout=5m ./pkg/services/ngalert/notifier/...
|
||||
|
||||
.PHONY: test-go-integration-postgres
|
||||
test-go-integration-postgres: devenv-postgres ## Run integration tests for postgres backend with flags.
|
||||
@echo "test backend integration postgres tests"
|
||||
@@ -190,7 +229,7 @@ build-docker-full: ## Build Docker image for development.
|
||||
--build-arg BINGO=false \
|
||||
--build-arg GO_BUILD_TAGS=$(GO_BUILD_TAGS) \
|
||||
--build-arg WIRE_TAGS=$(WIRE_TAGS) \
|
||||
--build-arg COMMIT_SHA=$$(git rev-parse --short HEAD) \
|
||||
--build-arg COMMIT_SHA=$$(git rev-parse HEAD) \
|
||||
--build-arg BUILD_BRANCH=$$(git rev-parse --abbrev-ref HEAD) \
|
||||
--tag grafana/grafana$(TAG_SUFFIX):dev \
|
||||
$(DOCKER_BUILD_ARGS)
|
||||
@@ -203,10 +242,10 @@ build-docker-full-ubuntu: ## Build Docker image based on Ubuntu for development.
|
||||
--build-arg BINGO=false \
|
||||
--build-arg GO_BUILD_TAGS=$(GO_BUILD_TAGS) \
|
||||
--build-arg WIRE_TAGS=$(WIRE_TAGS) \
|
||||
--build-arg COMMIT_SHA=$$(git rev-parse --short HEAD) \
|
||||
--build-arg COMMIT_SHA=$$(git rev-parse HEAD) \
|
||||
--build-arg BUILD_BRANCH=$$(git rev-parse --abbrev-ref HEAD) \
|
||||
--build-arg BASE_IMAGE=ubuntu:20.04 \
|
||||
--build-arg GO_IMAGE=golang:1.20.6 \
|
||||
--build-arg BASE_IMAGE=ubuntu:22.04 \
|
||||
--build-arg GO_IMAGE=golang:1.21.5 \
|
||||
--tag grafana/grafana$(TAG_SUFFIX):dev-ubuntu \
|
||||
$(DOCKER_BUILD_ARGS)
|
||||
|
||||
@@ -251,6 +290,9 @@ devenv-mysql:
|
||||
protobuf: ## Compile protobuf definitions
|
||||
bash scripts/protobuf-check.sh
|
||||
bash pkg/plugins/backendplugin/pluginextensionv2/generate.sh
|
||||
bash pkg/plugins/backendplugin/secretsmanagerplugin/generate.sh
|
||||
bash pkg/services/store/entity/generate.sh
|
||||
bash pkg/infra/grn/generate.sh
|
||||
|
||||
clean: ## Clean up intermediate build artifacts.
|
||||
@echo "cleaning"
|
||||
@@ -276,7 +318,7 @@ scripts/drone/TAGS: $(shell find scripts/drone -name '*.star')
|
||||
etags --lang none --regex="/def \(\w+\)[^:]+:/\1/" --regex="/\s*\(\w+\) =/\1/" $^ -o $@
|
||||
|
||||
format-drone:
|
||||
buildifier -r scripts/drone
|
||||
buildifier --lint=fix -r scripts/drone
|
||||
|
||||
help: ## Display this help.
|
||||
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
|
||||
|
||||
@@ -245,7 +245,7 @@ reporting_distributor = grafana-labs
|
||||
# for new versions of grafana. The check is used
|
||||
# in some UI views to notify that a grafana update exists.
|
||||
# This option does not cause any auto updates, nor send any information
|
||||
# only a GET request to https://raw.githubusercontent.com/grafana/grafana/main/latest.json to get the latest version.
|
||||
# only a GET request to https://grafana.com/api/grafana/versions/stable to get the latest version.
|
||||
check_for_updates = true
|
||||
|
||||
# Set to false to disable all checks to https://grafana.com
|
||||
@@ -562,6 +562,17 @@ azure_auth_enabled = false
|
||||
# Use email lookup in addition to the unique ID provided by the IdP
|
||||
oauth_allow_insecure_email_lookup = false
|
||||
|
||||
# Set to true to include id of identity as a response header
|
||||
id_response_header_enabled = false
|
||||
|
||||
# Prefix used for the id response header, X-Grafana-Identity-Id
|
||||
id_response_header_prefix = X-Grafana
|
||||
|
||||
# List of identity namespaces to add id response headers for, separated by space.
|
||||
# Available namespaces are user, api-key and service-account.
|
||||
# The header value will encode the namespace ("user:<id>", "api-key:<id>", "service-account:<id>")
|
||||
id_response_header_namespaces = user api-key service-account
|
||||
|
||||
#################################### Anonymous Auth ######################
|
||||
[auth.anonymous]
|
||||
# enable anonymous access
|
||||
@@ -845,6 +856,24 @@ managed_identity_enabled = false
|
||||
# Should be set for user-assigned identity and should be empty for system-assigned identity
|
||||
managed_identity_client_id =
|
||||
|
||||
# Specifies whether Azure AD Workload Identity authentication should be enabled in datasources that support it
|
||||
# For more documentation on Azure AD Workload Identity, review this documentation:
|
||||
# https://azure.github.io/azure-workload-identity/docs/
|
||||
# Disabled by default, needs to be explicitly enabled
|
||||
workload_identity_enabled = false
|
||||
|
||||
# Tenant ID of the Azure AD Workload Identity
|
||||
# Allows to override default tenant ID of the Azure AD identity associated with the Kubernetes service account
|
||||
workload_identity_tenant_id =
|
||||
|
||||
# Client ID of the Azure AD Workload Identity
|
||||
# Allows to override default client ID of the Azure AD identity associated with the Kubernetes service account
|
||||
workload_identity_client_id =
|
||||
|
||||
# Custom path to token file for the Azure AD Workload Identity
|
||||
# Allows to set a custom path to the projected service account token file
|
||||
workload_identity_token_file =
|
||||
|
||||
# Specifies whether user identity authentication (on behalf of currently signed-in user) should be enabled in datasources
|
||||
# that support it (requires AAD authentication)
|
||||
# Disabled by default, needs to be explicitly enabled
|
||||
@@ -1099,8 +1128,8 @@ execute_alerts = true
|
||||
# The timeout string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
|
||||
evaluation_timeout = 30s
|
||||
|
||||
# Number of times we'll attempt to evaluate an alert rule before giving up on that evaluation. This option has a legacy version in the `[alerting]` section that takes precedence.
|
||||
max_attempts = 3
|
||||
# Number of times we'll attempt to evaluate an alert rule before giving up on that evaluation. The default value is 1.
|
||||
max_attempts = 1
|
||||
|
||||
# Minimum interval to enforce between rule evaluations. Rules will be adjusted if they are less than this value or if they are not multiple of the scheduler interval (10s). Higher values can help with resource management as we'll schedule fewer evaluations over time. This option has a legacy version in the `[alerting]` section that takes precedence.
|
||||
# The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
|
||||
|
||||
@@ -252,7 +252,7 @@
|
||||
# for new versions of grafana. The check is used
|
||||
# in some UI views to notify that a grafana update exists.
|
||||
# This option does not cause any auto updates, nor send any information
|
||||
# only a GET request to https://raw.githubusercontent.com/grafana/grafana/main/latest.json to get the latest version.
|
||||
# only a GET request to https://grafana.com/api/grafana/versions/stable to get the latest version.
|
||||
;check_for_updates = true
|
||||
|
||||
# Set to false to disable all checks to https://grafana.com
|
||||
@@ -551,6 +551,17 @@
|
||||
# Use email lookup in addition to the unique ID provided by the IdP
|
||||
;oauth_allow_insecure_email_lookup = false
|
||||
|
||||
# Set to true to include id of identity as a response header
|
||||
;id_response_header_enabled = false
|
||||
|
||||
# Prefix used for the id response header, X-Grafana-Identity-Id
|
||||
;id_response_header_prefix = X-Grafana
|
||||
|
||||
# List of identity namespaces to add id response headers for, separated by space.
|
||||
# Available namespaces are user, api-key and service-account.
|
||||
# The header value will encode the namespace ("user:<id>", "api-key:<id>", "service-account:<id>")
|
||||
;id_response_header_namespaces = user api-key service-account
|
||||
|
||||
#################################### Anonymous Auth ######################
|
||||
[auth.anonymous]
|
||||
# enable anonymous access
|
||||
@@ -797,6 +808,24 @@
|
||||
# Should be set for user-assigned identity and should be empty for system-assigned identity
|
||||
;managed_identity_client_id =
|
||||
|
||||
# Specifies whether Azure AD Workload Identity authentication should be enabled in datasources that support it
|
||||
# For more documentation on Azure AD Workload Identity, review this documentation:
|
||||
# https://azure.github.io/azure-workload-identity/docs/
|
||||
# Disabled by default, needs to be explicitly enabled
|
||||
;workload_identity_enabled = false
|
||||
|
||||
# Tenant ID of the Azure AD Workload Identity
|
||||
# Allows to override default tenant ID of the Azure AD identity associated with the Kubernetes service account
|
||||
;workload_identity_tenant_id =
|
||||
|
||||
# Client ID of the Azure AD Workload Identity
|
||||
# Allows to override default client ID of the Azure AD identity associated with the Kubernetes service account
|
||||
;workload_identity_client_id =
|
||||
|
||||
# Custom path to token file for the Azure AD Workload Identity
|
||||
# Allows to set a custom path to the projected service account token file
|
||||
;workload_identity_token_file =
|
||||
|
||||
# Specifies whether user identity authentication (on behalf of currently signed-in user) should be enabled in datasources
|
||||
# that support it (requires AAD authentication)
|
||||
# Disabled by default, needs to be explicitly enabled
|
||||
@@ -1046,8 +1075,8 @@
|
||||
# The timeout string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
|
||||
;evaluation_timeout = 30s
|
||||
|
||||
# Number of times we'll attempt to evaluate an alert rule before giving up on that evaluation. This option has a legacy version in the `[alerting]` section that takes precedence.
|
||||
;max_attempts = 3
|
||||
# Number of times we'll attempt to evaluate an alert rule before giving up on that evaluation. The default value is 1.
|
||||
;max_attempts = 1
|
||||
|
||||
# Minimum interval to enforce between rule evaluations. Rules will be adjusted if they are less than this value or if they are not multiple of the scheduler interval (10s). Higher values can help with resource management as we'll schedule fewer evaluations over time. This option has a legacy version in the `[alerting]` section that takes precedence.
|
||||
# The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
|
||||
|
||||
22
contribute/backend/upgrading-go-version.md
Normal file
22
contribute/backend/upgrading-go-version.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# Upgrading Go Version
|
||||
|
||||
Notes on upgrading Go version.
|
||||
|
||||
Example PR: https://github.com/grafana/grafana/pull/79329
|
||||
|
||||
## The main areas that need to change during the upgrade are:
|
||||
|
||||
- https://github.com/grafana/grafana/blob/d8ecea4ed93efb2e4d64a5ee24bc08f3805f413d/scripts/drone/variables.star#L6
|
||||
- https://github.com/grafana/grafana/blob/d8ecea4ed93efb2e4d64a5ee24bc08f3805f413d/Makefile#L264
|
||||
- https://github.com/grafana/grafana/blob/d8ecea4ed93efb2e4d64a5ee24bc08f3805f413d/Dockerfile#L6
|
||||
|
||||
Make sure to run `make drone` so that changes to `.star` files are reflected and `drone.yml` is generated.
|
||||
|
||||
### Additional files to change
|
||||
|
||||
- Take a look in `.github/workflows` folder for what `go` version is being used there in various workflows.
|
||||
- Make sure to create a PR with the corresponding changes in `grafana/grafana-enterprise` repository.
|
||||
|
||||
## Updating the go.mod file
|
||||
|
||||
Please avoid updating the `go.mod` to the newest version unless really necessary. This ensures backwards compatibility and introduces less breaking changes. Always upgrade Go version in the runtime files above first, let them run for a couple of weeks and only then consider updating the `go.mod` file if necessary.
|
||||
@@ -104,7 +104,7 @@ myOldFunction(name: string) {
|
||||
2. Add info in the comment about **when it is going to be removed**
|
||||
3. Add info in the comment about **what should be used instead**
|
||||
4. In case it's a function or a method, use `deprecationWarning(<file name>, <old name>, <new name>)` to raise attention during runtime as well
|
||||
5. Update the [migration guide](../docs/sources/developers/plugins/migration-guide.md) with your instructions
|
||||
5. Update the [migration guidance](/developers/plugin-tools/migration-guides/) for plugin developers with your instructions
|
||||
|
||||
### Communicate
|
||||
|
||||
|
||||
12
docs/docs.mk
12
docs/docs.mk
@@ -80,7 +80,7 @@ docs-pull: ## Pull documentation base image.
|
||||
|
||||
make-docs: ## Fetch the latest make-docs script.
|
||||
make-docs:
|
||||
if [[ ! -f "$(PWD)/make-docs" ]]; then
|
||||
if [[ ! -f "$(CURDIR)/make-docs" ]]; then
|
||||
echo 'WARN: No make-docs script found in the working directory. Run `make update` to download it.' >&2
|
||||
exit 1
|
||||
fi
|
||||
@@ -88,27 +88,27 @@ make-docs:
|
||||
.PHONY: docs
|
||||
docs: ## Serve documentation locally, which includes pulling the latest `DOCS_IMAGE` (default: `grafana/docs-base:latest`) container image. See also `docs-no-pull`.
|
||||
docs: docs-pull make-docs
|
||||
$(PWD)/make-docs $(PROJECTS)
|
||||
$(CURDIR)/make-docs $(PROJECTS)
|
||||
|
||||
.PHONY: docs-no-pull
|
||||
docs-no-pull: ## Serve documentation locally without pulling the `DOCS_IMAGE` (default: `grafana/docs-base:latest`) container image.
|
||||
docs-no-pull: make-docs
|
||||
$(PWD)/make-docs $(PROJECTS)
|
||||
$(CURDIR)/make-docs $(PROJECTS)
|
||||
|
||||
.PHONY: docs-debug
|
||||
docs-debug: ## Run Hugo web server with debugging enabled. TODO: support all SERVER_FLAGS defined in website Makefile.
|
||||
docs-debug: make-docs
|
||||
WEBSITE_EXEC='hugo server --bind 0.0.0.0 --port 3002 --debug' $(PWD)/make-docs $(PROJECTS)
|
||||
WEBSITE_EXEC='hugo server --bind 0.0.0.0 --port 3002 --debug' $(CURDIR)/make-docs $(PROJECTS)
|
||||
|
||||
.PHONY: doc-validator
|
||||
doc-validator: ## Run doc-validator on the entire docs folder.
|
||||
doc-validator: make-docs
|
||||
DOCS_IMAGE=$(DOC_VALIDATOR_IMAGE) $(PWD)/make-docs $(PROJECTS)
|
||||
DOCS_IMAGE=$(DOC_VALIDATOR_IMAGE) $(CURDIR)/make-docs $(PROJECTS)
|
||||
|
||||
.PHONY: vale
|
||||
vale: ## Run vale on the entire docs folder.
|
||||
vale: make-docs
|
||||
DOCS_IMAGE=$(VALE_IMAGE) $(PWD)/make-docs $(PROJECTS)
|
||||
DOCS_IMAGE=$(VALE_IMAGE) $(CURDIR)/make-docs $(PROJECTS)
|
||||
|
||||
.PHONY: update
|
||||
update: ## Fetch the latest version of this Makefile and the `make-docs` script from Writers' Toolkit.
|
||||
|
||||
@@ -6,6 +6,19 @@
|
||||
# [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.
|
||||
|
||||
# ## 4.2.1 (2023-09-13)
|
||||
|
||||
# ## Fixed
|
||||
|
||||
# - Improved consistency of the webserver request loop by polling the Hugo port rather than the proxy port.
|
||||
|
||||
# ## 4.2.0 (2023-09-01)
|
||||
|
||||
# ### Added
|
||||
|
||||
# - Retry the initial webserver request up to ten times to allow for the process to start.
|
||||
# If it is still failing after ten seconds, an error message is logged.
|
||||
|
||||
# ## 4.1.1 (2023-07-20)
|
||||
|
||||
# ### Fixed
|
||||
@@ -189,7 +202,6 @@ EOF
|
||||
fi
|
||||
|
||||
SOURCES_as_code='as-code-docs'
|
||||
SOURCES_beyla='ebpf-autoinstrument'
|
||||
SOURCES_enterprise_metrics='backend-enterprise'
|
||||
SOURCES_enterprise_metrics_='backend-enterprise'
|
||||
SOURCES_grafana_cloud='website'
|
||||
@@ -440,30 +452,41 @@ await_build() {
|
||||
url="$1"
|
||||
req="$(if command -v curl >/dev/null 2>&1; then echo 'curl -s -o /dev/null'; else echo 'wget -q'; fi)"
|
||||
|
||||
sleep 2
|
||||
i=1
|
||||
max=10
|
||||
while [ "${i}" -ne "${max}" ]
|
||||
do
|
||||
sleep 1
|
||||
debg "Retrying request to webserver assuming the process is still starting up."
|
||||
i=$((i + 1))
|
||||
|
||||
if ${req} "${url}"; then
|
||||
echo
|
||||
echo "View documentation locally:"
|
||||
for x in ${url_src_dst_vers}; do
|
||||
IFS='^' read -r url _ _ <<POSIX_HERESTRING
|
||||
if ${req} "${url}"; then
|
||||
echo
|
||||
echo "View documentation locally:"
|
||||
for x in ${url_src_dst_vers}; do
|
||||
IFS='^' read -r url _ _ <<POSIX_HERESTRING
|
||||
$x
|
||||
POSIX_HERESTRING
|
||||
|
||||
if [ -n "${url}" ]; then
|
||||
if [ "${_url}" != "arbitrary" ]; then
|
||||
echo " ${url}"
|
||||
if [ -n "${url}" ]; then
|
||||
if [ "${_url}" != "arbitrary" ]; then
|
||||
echo " ${url}"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
echo
|
||||
echo 'Press Ctrl+C to stop the server'
|
||||
else
|
||||
echo
|
||||
errr 'The build was interrupted or a build error occurred, check the previous logs for possible causes.'
|
||||
fi
|
||||
done
|
||||
echo
|
||||
echo 'Press Ctrl+c to stop the server'
|
||||
|
||||
unset url req
|
||||
unset i max req url
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
echo
|
||||
errr 'The build was interrupted or a build error occurred, check the previous logs for possible causes.'
|
||||
note 'You might need to use Ctrl+c to end the process.'
|
||||
|
||||
unset i max req url
|
||||
}
|
||||
|
||||
debg() {
|
||||
@@ -611,7 +634,7 @@ ${PODMAN} run \
|
||||
${DOCS_IMAGE} \
|
||||
/entrypoint
|
||||
EOF
|
||||
await_build http://localhost:3002 &
|
||||
await_build http://localhost:3003 &
|
||||
|
||||
if [ -n "${DEBUG}" ]; then
|
||||
${cmd}
|
||||
|
||||
@@ -39,12 +39,16 @@ title: Grafana documentation
|
||||
<img src="/static/img/logos/logo-docker.svg">
|
||||
<h5>Run Docker image</h5>
|
||||
</a>
|
||||
<a href="{{< relref "setup-grafana/installation/kubernetes/" >}}" class="nav-cards__item nav-cards__item--install">
|
||||
<img src="/static/img/logos/logo-kubernetes.svg">
|
||||
<h5>Run on Kubernetes</h5>
|
||||
</a>
|
||||
<a href="https://grafana.com/docs/grafana-cloud/" class="nav-cards__item nav-cards__item--install">
|
||||
<div class="nav-cards__icon fa fa-cloud">
|
||||
</div>
|
||||
<h5>Grafana Cloud</h5>
|
||||
</a>
|
||||
<a href="https://grafana.com/grafana/nightly?edition=oss" class="nav-cards__item nav-cards__item--install">
|
||||
<a href="https://grafana.com/grafana/download/nightly?edition=oss" class="nav-cards__item nav-cards__item--install">
|
||||
<div class="nav-cards__icon fa fa-moon-o">
|
||||
</div>
|
||||
<h5>Nightly builds</h5>
|
||||
|
||||
@@ -135,7 +135,7 @@ Complete the following steps to migrate from API keys to service accounts for AP
|
||||
This action generates a service account token.
|
||||
|
||||
1. Store the ID and secret that the system returns to you.
|
||||
1. Pass the token in the `Authrorization` header, prefixed with `Bearer`.
|
||||
1. Pass the token in the `Authorization` header, prefixed with `Bearer`.
|
||||
|
||||
This action authenticates API requests.
|
||||
|
||||
|
||||
15
docs/sources/administration/back-up-grafana/index.md
Normal file
15
docs/sources/administration/back-up-grafana/index.md
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
description: Describes how to back up a locally provisioned Grafana instance.
|
||||
keywords:
|
||||
- grafana
|
||||
- backup
|
||||
labels:
|
||||
products:
|
||||
- enterprise
|
||||
- oss
|
||||
title: Back up Grafana
|
||||
weight: 80
|
||||
menuTitle: Back up Grafana
|
||||
---
|
||||
|
||||
{{< docs/shared lookup="back-up/back-up-grafana.md" source="grafana" version="<GRAFANA VERSION>" >}}
|
||||
@@ -14,25 +14,30 @@ weight: 900
|
||||
|
||||
You can create interactive links for Explore visualizations to run queries related to presented data by setting up Correlations.
|
||||
|
||||
A correlation defines how data in one [data source]({{< relref "/docs/grafana/latest/datasources/" >}}) is used to query data in another data source. Some examples:
|
||||
A correlation defines how data in one [data source]({{< relref "../../datasources" >}}) is used to query data in another data source.
|
||||
Some examples:
|
||||
|
||||
- an application name returned in a logs data source can be used to query metrics related to that application in a metrics data source, or
|
||||
- a user name returned by an SQL data source can be used to query logs related to that particular user in a logs data source
|
||||
|
||||
[Explore]({{< relref "/docs/grafana/latest/explore/" >}}) takes user-defined correlations to display links inside the visualizations. You can click on a link to run the related query and see results in [Explore Split View]({{< relref "/docs/grafana/latest/explore/#split-and-compare" >}}).
|
||||
[Explore]({{< relref "../../explore" >}}) takes user-defined correlations to display links inside the visualizations.
|
||||
You can click on a link to run the related query and see results in [Explore Split View]({{< relref "../../explore#split-and-compare" >}}).
|
||||
|
||||
Explore visualizations that currently support showing links based on correlations:
|
||||
|
||||
- [Logs Panel]({{< relref "./use-correlations-in-visualizations#correlations-in-logs-panel">}})
|
||||
- [Table]({{< relref "./use-correlations-in-visualizations#correlations-in-table">}})
|
||||
|
||||
You can configure correlations using [Administration > Correlation page]({{< relref "/docs/grafana/latest/administration/" >}}) or with [provisioning]({{< relref "/docs/grafana/latest/administration/provisioning" >}}).
|
||||
You can configure correlations using the **Administration > Correlation** page in Grafana or with [provisioning]({{< relref "../provisioning" >}}).
|
||||
|
||||
> **Note:** Correlations are available in Grafana 10.0+ as an opt-in beta feature. Modify Grafana [configuration file]({{< relref "/docs/grafana/latest/setup-grafana/configure-grafana/#configuration-file-location" >}}) to enable the `correlations` [feature toggle]({{< relref "/docs/grafana/latest/setup-grafana/configure-grafana/#feature_toggles" >}}) to use it.
|
||||
{{% admonition type="note" %}}
|
||||
Correlations are available in Grafana 10.0+ as an opt-in beta feature.
|
||||
Modify the Grafana [configuration file]({{< relref "../../setup-grafana/configure-grafana#configuration-file-location" >}}) to enable the `correlations` [feature toggle]({{< relref "../../setup-grafana/configure-grafana#feature_toggles" >}}) to use it.
|
||||
{{% /admonition %}}
|
||||
|
||||
## Example of how links work in Explore once set up
|
||||
|
||||
{{< figure src="/static/img/docs/correlations/correlations-in-explore-10-0.gif" caption="Correlations links in Explore" >}}
|
||||
{{< figure src="/static/img/docs/correlations/correlations-in-explore-10-0.gif" alt="Demonstration of following a correlation link in Grafana Explore" caption="Correlations links in Explore" >}}
|
||||
|
||||
See also:
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ weight: 30
|
||||
|
||||
## Before you begin
|
||||
|
||||
Adding access to create correlations for [Viewers and Editors]({{< relref "/docs/grafana/latest/administration/roles-and-permissions/" >}}) is available with [Role-based access control]({{< relref "/docs/grafana/latest/administration/roles-and-permissions/access-control/" >}}).
|
||||
Adding access to create correlations for [Viewers and Editors]({{< relref "../../../administration/roles-and-permissions" >}}) is available with [Role-based access control]({{< relref "../../../administration/roles-and-permissions/access-control" >}}).
|
||||
|
||||
## Add permissions to create correlations
|
||||
|
||||
|
||||
@@ -33,7 +33,9 @@ Learn how to create correlations using the [Administration page]({{< relref "./c
|
||||
|
||||
## Source data source and result field
|
||||
|
||||
Links are shown in Explore visualizations for the results from the correlation’s source data source. A link is assigned to one of the fields from the result provided in the correlation configuration (the results field). Each visualization displays fields with links in a different way ([Correlations in Logs Panel]({{< relref "./use-correlations-in-visualizations#correlations-in-logs-panel">}}) and see [Correlations in Table]({{< relref "./use-correlations-in-visualizations#correlations-in-table">}}))
|
||||
Links are shown in Explore visualizations for the results from the correlation’s source data source.
|
||||
A link is assigned to one of the fields from the result provided in the correlation configuration (the results field).
|
||||
Each visualization displays fields with links in a different way ([Correlations in Logs Panel]({{< relref "./use-correlations-in-visualizations#correlations-in-logs-panel">}}) and see [Correlations in Table]({{< relref "./use-correlations-in-visualizations#correlations-in-table">}})).
|
||||
|
||||
## Target query
|
||||
|
||||
@@ -41,9 +43,11 @@ The target query is run when a link is clicked in the visualization. You can use
|
||||
|
||||
### Correlation Variables
|
||||
|
||||
You can use variables inside the target query to access the source data related to the query. Correlations use [Grafana variable syntax]({{< relref "/docs/grafana/latest/dashboards/variables/variable-syntax" >}}). Variables are filled with values from the source results when the link is clicked. There are two types of variables you can use:
|
||||
You can use variables inside the target query to access the source data related to the query.
|
||||
Correlations use [Grafana variable syntax]({{< relref "../../../dashboards/variables/variable-syntax" >}}).
|
||||
Variables are filled with values from the source results when the link is clicked. There are two types of variables you can use:
|
||||
|
||||
- [field variables]({{< relref "/docs/grafana/latest/panels-visualizations/configure-data-links#field-variables" >}}) (allows to access field values and labels)
|
||||
- [field variables]({{< relref "../../../panels-visualizations/configure-data-links#field-variables" >}}) (allows to access field values and labels)
|
||||
- correlation variables (allows to access field values and transformations)
|
||||
|
||||
Example: If source results contain a field called “employee”, the value of the field can be accessed with:
|
||||
|
||||
@@ -9,11 +9,11 @@ weight: 20
|
||||
|
||||
# Permissions
|
||||
|
||||
Users with [Viewer base role]({{< relref "/docs/grafana/latest/administration/roles-and-permissions/" >}}) or with [datasources:query RBAC role]({{< relref "/docs/grafana/latest/administration/roles-and-permissions/access-control/" >}}) can:
|
||||
Users with [Viewer base role]({{< relref "../../../administration/roles-and-permissions" >}}) or with [datasources:query RBAC role]({{< relref "../../../administration/roles-and-permissions/access-control" >}}) can:
|
||||
|
||||
- Use correlations in Explore’s visualizations
|
||||
- List all available correlations in read-only mode
|
||||
- Use correlations in Explore’s visualizations.
|
||||
- List all available correlations in read-only mode.
|
||||
|
||||
Users with [Admin base role]({{< relref "/docs/grafana/latest/administration/roles-and-permissions/" >}}) or with [datasources:write RBAC role]({{< relref "/docs/grafana/latest/administration/roles-and-permissions/access-control/" >}}) can:
|
||||
Users with [Admin base role]({{< relref "../../../administration/roles-and-permissions" >}}) or with [datasources:write RBAC role]({{< relref "../../../administration/roles-and-permissions/access-control" >}}) can:
|
||||
|
||||
- Add, edit and delete correlations
|
||||
- Add, edit and delete correlations.
|
||||
|
||||
@@ -80,7 +80,7 @@ Description of provisioning properties:
|
||||
: Correlation type. “query” is the only supported type at the moment
|
||||
|
||||
**config.target**
|
||||
: [Target query model]({{< relref "#determine-target-query-model-structure" >}})
|
||||
: [Target query model](#determine-target-query-model-structure)
|
||||
|
||||
**config.field**
|
||||
: Name of the field where link is shown
|
||||
|
||||
@@ -27,7 +27,7 @@ weight: 70
|
||||
1. Open Explore.
|
||||
1. Select a data source that you chose as the source data source of the correlation.
|
||||
1. Run a query that results in data containing fields required to build variables in the target query.
|
||||
1. Links are added to cell rows in the column representing the field with the assigned link ([the results field]({{< relref "/docs/grafana/latest/administration/correlations/correlation-configuration#source-data-source-and-result-field" >}}).
|
||||
1. Links are added to cell rows in the column representing the field with the assigned link ([the results field]({{< relref "../correlation-configuration#source-data-source-and-result-field" >}}).
|
||||
1. Cells containing multiple links accessible with a context menu.
|
||||
|
||||
{{< figure src="/static/img/docs/correlations/correlations-in-table-10-0.png" max-width="600px" caption="Correlations links in table" >}}
|
||||
|
||||
@@ -73,7 +73,7 @@ Instructions below show how to set up a link that can run metrics query for the
|
||||
- Required correlation type (query)
|
||||
- Target query matching test data source model
|
||||
- “App metrics” correlation contains the following configuration:
|
||||
- Alias is set to ${application} variable (note that in provisioning files $ is used to access environment variables so it has to be [escaped]({{< relref "/docs/grafana/latest/administration/provisioning#using-environment-variables" >}})).
|
||||
- Alias is set to ${application} variable (note that in provisioning files $ is used to access environment variables so it has to be [escaped]({{< relref "../../../administration/provisioning#using-environment-variables" >}})).
|
||||
- Regular expression transformation is created to extract values from “msg” field
|
||||
- Regular expression transformation is used to capture the application name from the full name of the service stored in the log line.
|
||||
- The output of the transformation is mapped to a variable called “application”.
|
||||
|
||||
@@ -43,7 +43,7 @@ For links to data source-specific documentation, see [Data sources]({{< relref "
|
||||
You can configure data source permissions to allow or deny certain users the ability to query or edit a data source. Each data source’s configuration includes a Permissions tab where you can restrict data source permissions to specific users, teams, or roles.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) and [Grafana Cloud Pro and Advanced](/docs/grafana-cloud).
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) and [Grafana Cloud](/docs/grafana-cloud).
|
||||
{{% /admonition %}}
|
||||
|
||||
By default, data sources in an organization can be queried by any user in that organization. For example, a user with the `Viewer` role can issue any possible query to a data source, not just queries that exist on dashboards to which they have access. Additionally, by default, data sources can be edited by the user who created the data source, as well as users with the `Admin` role.
|
||||
@@ -89,12 +89,12 @@ You can assign data source permissions to users, teams, and roles which will all
|
||||
|
||||
When you enable query and resource caching, Grafana temporarily stores the results of data source queries and resource requests. When you or another user submit the same query or resource request again, the results will come back from the cache instead of from the data source.
|
||||
|
||||
When using Grafana, a query pertains to a request for data frames to be modified or displayed. A resource relates to any HTTP requests made by a plugin, such as the Amazon Timestream plugin requesting a list of available databases from AWS. For more information on data source queries and resources, please see the developers page on [backend plugins]({{< relref "../../developers/plugins/introduction-to-plugin-development/backend/" >}}).
|
||||
When using Grafana, a query pertains to a request for data frames to be modified or displayed. A resource relates to any HTTP requests made by a plugin, such as the Amazon Timestream plugin requesting a list of available databases from AWS. For more information on data source queries and resources, please see the developers page on [backend plugins](/developers/plugin-tools/introduction/backend-plugins).
|
||||
|
||||
The caching feature works for **all** backend data sources. You can enable the cache globally in Grafana's [configuration]({{< relref "../../setup-grafana/configure-grafana/enterprise-configuration/#caching" >}}), and configure a cache duration (also called Time to Live, or TTL) for each data source individually.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) and [Grafana Cloud Pro and Advanced](/docs/grafana-cloud/).
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) and [Grafana Cloud](/docs/grafana-cloud/).
|
||||
{{% /admonition %}}
|
||||
|
||||
The following cache backend options are available: in-memory, Redis, and Memcached.
|
||||
@@ -124,7 +124,7 @@ Query caching works for Grafana's [built-in data sources]({{< relref "../../data
|
||||
To verify that a data source works with query caching, follow the [instructions below](#enable-and-configure-query-caching) to **Enable and Configure query caching**. If caching is enabled in Grafana but the Caching tab is not visible for the given data source, then query caching is not available for that data source.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Some data sources, such as Elasticsearch, Prometheus, and Loki, cache queries themselves, so Grafana _query_ caching does not significantly improve performance. However, _resource_ caching may help. See the developers page on [plugin resources]({{< relref "../../developers/plugins/introduction-to-plugin-development/backend/#resources" >}}) for details.
|
||||
Some data sources, such as Elasticsearch, Prometheus, and Loki, cache queries themselves, so Grafana _query_ caching does not significantly improve performance. However, _resource_ caching may help. See the developers page on [plugin resources](/developers/plugin-tools/introduction/backend-plugins#resources) for details.
|
||||
{{% /admonition %}}
|
||||
|
||||
### Enable and configure query caching
|
||||
@@ -195,4 +195,4 @@ For more documentation on a specific data source plugin's features, including it
|
||||
|
||||
### Create a data source plugin
|
||||
|
||||
To build your own data source plugin, refer to the ["Build a data source plugin"](/tutorials/build-a-data-source-plugin/) tutorial and our documentation about [building a plugin](/developers/plugins/).
|
||||
To build your own data source plugin, refer to the ["Build a data source plugin"](/developers/plugin-tools/tutorials/build-a-data-source-plugin) tutorial and our documentation about [building a plugin](/developers/plugin-tools).
|
||||
|
||||
@@ -17,7 +17,7 @@ weight: 600
|
||||
|
||||
Besides the wide range of visualizations and data sources that are available immediately after you install Grafana, you can extend your Grafana experience with _plugins_.
|
||||
|
||||
You can [install]({{< relref "#install-a-plugin" >}}) one of the plugins built by the Grafana community, or [build one yourself]({{< relref "../../developers/plugins/" >}}).
|
||||
You can [install](#install-a-plugin) one of the plugins built by the Grafana community, or [build one yourself](/developers/plugin-tools).
|
||||
|
||||
Grafana supports three types of plugins: [panels](/grafana/plugins?type=panel), [data sources](/plugins?type=datasource), and [apps](/grafana/plugins?type=app).
|
||||
|
||||
@@ -100,6 +100,7 @@ To browse for available plugins:
|
||||
To install a plugin:
|
||||
|
||||
1. In Grafana, click **Administration > Plugins** in the side navigation menu to view installed plugins.
|
||||
1. Click the **All** filter to browse all available plugins.
|
||||
1. Browse and find a plugin.
|
||||
1. Click on the plugin logo.
|
||||
1. Click **Install**.
|
||||
@@ -171,7 +172,7 @@ Grafana also writes an error message to the server log:
|
||||
WARN[05-26|12:00:00] Some plugin scanning errors were found errors="plugin '<plugin id>' is unsigned, plugin '<plugin id>' has an invalid signature"
|
||||
```
|
||||
|
||||
If you are a plugin developer and want to know how to sign your plugin, refer to [Sign a plugin]({{< relref "../../developers/plugins/publish-a-plugin/sign-a-plugin.md" >}}).
|
||||
If you are a plugin developer and want to know how to sign your plugin, refer to [Sign a plugin](/developers/plugin-tools/publish-a-plugin/sign-a-plugin).
|
||||
|
||||
| Signature status | Description |
|
||||
| ------------------ | ------------------------------------------------------------------------------- |
|
||||
|
||||
@@ -62,7 +62,7 @@ Currently we do not provide any scripts/manifests for configuring Grafana. Rathe
|
||||
| Tool | Project |
|
||||
| --------- | -------------------------------------------------------------------------------------------------------------- |
|
||||
| Puppet | [https://forge.puppet.com/puppet/grafana](https://forge.puppet.com/puppet/grafana) |
|
||||
| Ansible | [https://github.com/cloudalchemy/ansible-grafana](https://github.com/cloudalchemy/ansible-grafana) |
|
||||
| Ansible | [https://github.com/grafana/grafana-ansible-collection](https://github.com/grafana/grafana-ansible-collection) |
|
||||
| Chef | [https://github.com/sous-chefs/chef-grafana](https://github.com/sous-chefs/chef-grafana) |
|
||||
| Saltstack | [https://github.com/salt-formulas/salt-formula-grafana](https://github.com/salt-formulas/salt-formula-grafana) |
|
||||
| Jsonnet | [https://github.com/grafana/grafonnet-lib/](https://github.com/grafana/grafonnet-lib/) |
|
||||
@@ -371,8 +371,8 @@ By default, Grafana deletes dashboards in the database if the file is removed. Y
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Provisioning allows you to overwrite existing dashboards
|
||||
which leads to problems if you re-use settings that are supposed to be unique.
|
||||
Be careful not to re-use the same `title` multiple times within a folder
|
||||
which leads to problems if you reuse settings that are supposed to be unique.
|
||||
Be careful not to reuse the same `title` multiple times within a folder
|
||||
or `uid` within the same installation as this will cause weird behaviors.
|
||||
{{% /admonition %}}
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ The following tables list permissions associated with basic and fixed roles.
|
||||
|
||||
### Alerting roles
|
||||
|
||||
If alerting is [enabled]({{< relref "../../../../alerting/set-up/migrating-alerts/opt-out/" >}}), you can use predefined roles to manage user access to alert rules, alert instances, and alert notification settings and create custom roles to limit user access to alert rules in a folder.
|
||||
If alerting is [enabled]({{< relref "../../../../alerting/set-up/migrating-alerts" >}}), you can use predefined roles to manage user access to alert rules, alert instances, and alert notification settings and create custom roles to limit user access to alert rules in a folder.
|
||||
|
||||
Access to Grafana alert rules is an intersection of many permissions:
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ filters = accesscontrol:debug accesscontrol.evaluator:debug dashboard.permission
|
||||
## Enable audit logging
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) version 7.3 and later, and [Grafana Cloud](/docs/grafana-cloud).
|
||||
Available in [Grafana Enterprise]({{< relref "../../../../introduction/grafana-enterprise/" >}}) version 7.3 and later, and [Grafana Cloud](/docs/grafana-cloud).
|
||||
{{% /admonition %}}
|
||||
|
||||
You can enable auditing in the Grafana configuration file.
|
||||
|
||||
@@ -47,9 +47,6 @@ For information on how to configure notification policies, see [Configure notifi
|
||||
[create-mimir-loki-managed-recording-rule]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/alerting/alerting-rules/create-mimir-loki-managed-recording-rule"
|
||||
[create-mimir-loki-managed-recording-rule]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/create-mimir-loki-managed-recording-rule"
|
||||
|
||||
[edit-mimir-loki-namespace-group]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/alerting/alerting-rules/edit-mimir-loki-namespace-group"
|
||||
[edit-mimir-loki-namespace-group]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/edit-mimir-loki-namespace-group"
|
||||
|
||||
[create-grafana-managed-rule]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/alerting/alerting-rules/create-grafana-managed-rule"
|
||||
[create-grafana-managed-rule]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/create-grafana-managed-rule"
|
||||
|
||||
|
||||
@@ -30,6 +30,9 @@ Multiple alert instances can be created as a result of one alert rule (also know
|
||||
|
||||
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 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.
|
||||
|
||||
Watch this video to learn more about creating alert rules: {{< vimeo 720001934 >}}
|
||||
|
||||
In the following sections, we’ll guide you through the process of creating your Grafana-managed alert rules.
|
||||
@@ -65,7 +68,10 @@ Define a query to get the data you want to measure and a condition that needs to
|
||||
1. Add one or more [expressions][expression-queries].
|
||||
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.
|
||||
|
||||
For details on these options, see [Single and multi dimensional rule]
|
||||
{{% 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.
|
||||
|
||||
1. Click **Set as alert condition** on the query or expression you want to set as your alert condition.
|
||||
@@ -197,8 +203,8 @@ Stale alert instances that are in the **Alerting**/**NoData**/**Error** states a
|
||||
[add-a-query]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/panels-visualizations/query-transform-data#add-a-query"
|
||||
[add-a-query]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/panels-visualizations/query-transform-data#add-a-query"
|
||||
|
||||
[alerting-on-numeric-data]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/alerting/fundamentals/evaluate-grafana-alerts#alerting-on-numeric-data-1")
|
||||
[alerting-on-numeric-data]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/evaluate-grafana-alerts#alerting-on-numeric-data-1")
|
||||
[alerting-on-numeric-data]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/alerting/fundamentals/evaluate-grafana-alerts#alerting-on-numeric-data-1"
|
||||
[alerting-on-numeric-data]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/evaluate-grafana-alerts#alerting-on-numeric-data-1"
|
||||
|
||||
[annotation-label]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/alerting/fundamentals/annotation-label"
|
||||
[annotation-label]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/annotation-label"
|
||||
|
||||
@@ -58,7 +58,7 @@ To create recording rules, follow these steps.
|
||||
- Select your Loki or Prometheus data source.
|
||||
- Enter a query.
|
||||
1. Add namespace and group.
|
||||
- From the **Namespace** dropdown, select an existing rule namespace or add a new one. Namespaces can contain one or more rule groups and only have an organizational purpose. For more information, see [Grafana Mimir or Loki rule groups and namespaces][edit-mimir-loki-namespace-group].
|
||||
- From the **Namespace** dropdown, select an existing rule namespace or add a new one. Namespaces can contain one or more rule groups and only have an organizational purpose.
|
||||
- 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.
|
||||
1. Add labels.
|
||||
- Add custom labels selecting existing key-value pairs from the drop down, or add new labels by entering the new key or value .
|
||||
@@ -70,7 +70,4 @@ To create recording rules, follow these steps.
|
||||
|
||||
[configure-grafana]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/setup-grafana/configure-grafana"
|
||||
[configure-grafana]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/setup-grafana/configure-grafana"
|
||||
|
||||
[edit-mimir-loki-namespace-group]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/alerting/alerting-rules/edit-mimir-loki-namespace-group"
|
||||
[edit-mimir-loki-namespace-group]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/edit-mimir-loki-namespace-group"
|
||||
{{% /docs/reference %}}
|
||||
|
||||
@@ -28,6 +28,9 @@ Create alert rules for an external Grafana Mimir or Loki instance that has ruler
|
||||
|
||||
Alert rules for an external 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 Prometheus or Loki data source. Otherwise, you will not be able to create or update Grafana Mimir managed alert rules.
|
||||
@@ -89,7 +92,7 @@ Use alert rule evaluation to determine how frequently an alert rule should be ev
|
||||
|
||||
## Add annotations
|
||||
|
||||
Add [annotations][annotation-label]. to provide more context on the alert in your alert notifications.
|
||||
Add [annotations][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.
|
||||
|
||||
@@ -123,15 +126,6 @@ All alert rules and instances, irrespective of their labels, match the default n
|
||||
1. Click **Save rule**.
|
||||
|
||||
{{% docs/reference %}}
|
||||
[alerting]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/alerting"
|
||||
[alerting]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/alerting-and-irm/alerting"
|
||||
|
||||
[annotation-label]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/alerting/fundamentals/annotation-label"
|
||||
[annotation-label]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/annotation-label"
|
||||
|
||||
[edit-mimir-loki-namespace-group]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/alerting/alerting-rules/edit-mimir-loki-namespace-group"
|
||||
[edit-mimir-loki-namespace-group]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/edit-mimir-loki-namespace-group"
|
||||
|
||||
[fundamentals]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/alerting/fundamentals"
|
||||
[fundamentals]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals"
|
||||
{{% /docs/reference %}}
|
||||
|
||||
@@ -54,10 +54,12 @@ Before Grafana v8.2, the configuration of the embedded Alertmanager was shared a
|
||||
|
||||
## Add new nested policy
|
||||
|
||||
To create a new notification policy, you need to follow its tree structure. New policies created on the trunk of the tree (default policy), are the tree branches. And, subsequently, each branch can bear their own child policies. This is why you will always be adding a new **nested** policy under either the default policy, or under a already nested policy.
|
||||
|
||||
1. In the left-side menu, click **Alerts & IRM** and then **Alerting**.
|
||||
1. Click **Notification policies**.
|
||||
1. From the **Choose Alertmanager** dropdown, select an Alertmanager. By default, the **Grafana Alertmanager** is selected.
|
||||
1. To add a top level specific policy, go to the Specific routing section and click **+New specific policy**.
|
||||
1. To add a top level specific policy, go to the Specific routing section (either to the default policy, or to another existing policy in which you would like to add a new nested policy) and click **+New nested policy**.
|
||||
1. In the Matching labels section, add one or more rules for matching alert labels.
|
||||
1. 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 nested policies.
|
||||
1. 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.
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
---
|
||||
aliases:
|
||||
- ../../contact-points/create-contact-point/
|
||||
- ../../contact-points/delete-contact-point/
|
||||
- ../../contact-points/edit-contact-point/
|
||||
- ../../contact-points/test-contact-point/
|
||||
- ../create-contact-point/
|
||||
- alerting/manage-notifications/manage-contact-points/
|
||||
- ../contact-points/ # /docs/grafana/<GRAFANA_VERSION>/alerting/contact-points/
|
||||
- ../contact-points/create-contact-point/ # /docs/grafana/<GRAFANA_VERSION>/alerting/contact-points/create-contact-point/
|
||||
- ../contact-points/delete-contact-point/ # /docs/grafana/<GRAFANA_VERSION>/alerting/contact-points/delete-contact-point/
|
||||
- ../contact-points/edit-contact-point/ # /docs/grafana/<GRAFANA_VERSION>/alerting/contact-points/edit-contact-point/
|
||||
- ../contact-points/test-contact-point/ # /docs/grafana/<GRAFANA_VERSION>/alerting/contact-points/test-contact-point/
|
||||
- ../manage-notifications/manage-contact-points/ # /docs/grafana/<GRAFANA_VERSION>/alerting/manage-notifications/manage-contact-points/
|
||||
- create-contact-point/ # /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/create-contact-point/
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/alerting-rules/manage-contact-points/
|
||||
description: How to manage your contact points
|
||||
keywords:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
_build:
|
||||
list: false
|
||||
aliases:
|
||||
- unified-alerting/difference-old-new/
|
||||
- ./unified-alerting/difference-old-new/ # /docs/grafana/<GRAFANA VERSION>/alerting/unified-alerting/difference-old-new/
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/difference-old-new/
|
||||
description: Compare new unified alerting compared to legacy dashboard alerting
|
||||
keywords:
|
||||
|
||||
@@ -59,11 +59,11 @@ Alert summary:
|
||||
|
||||
You can use any of the following built-in template options to embed custom templates.
|
||||
|
||||
| Name | Notes |
|
||||
| ----------------------- | ------------------------------------------------------------- |
|
||||
| `default.title` | Displays high-level status information. |
|
||||
| `default.message` | Provides a formatted summary of firing and resolved alerts. |
|
||||
| `teams.default.message` | Similar to `default.messsage`, formatted for Microsoft Teams. |
|
||||
| Name | Notes |
|
||||
| ----------------------- | ------------------------------------------------------------ |
|
||||
| `default.title` | Displays high-level status information. |
|
||||
| `default.message` | Provides a formatted summary of firing and resolved alerts. |
|
||||
| `teams.default.message` | Similar to `default.message`, formatted for Microsoft Teams. |
|
||||
|
||||
### HTML in notification templates
|
||||
|
||||
|
||||
@@ -97,6 +97,27 @@ Checks if any time series data matches the alert condition.
|
||||
Classic condition expression queries always produce one alert instance only, no matter how many time series meet the condition.
|
||||
Classic conditions exist mainly for compatibility reasons and should be avoided if possible.
|
||||
|
||||
## Aggregations
|
||||
|
||||
Grafana Alerting provides the following aggregation functions to enable you to further refine your query.
|
||||
|
||||
These functions are available for **Reduce** and **Classic condition** expressions only.
|
||||
|
||||
| Function | Expression | What it does |
|
||||
| ---------------- | ---------------- | ------------------------------------------------------------------------------- |
|
||||
| avg | Reduce / Classic | Displays the average of the values |
|
||||
| min | Reduce / Classic | Displays the lowest value |
|
||||
| max | Reduce / Classic | Displays the highest value |
|
||||
| sum | Reduce / Classic | Displays the sum of all values |
|
||||
| count | Reduce / Classic | Counts the number of values in the result |
|
||||
| last | Reduce / Classic | Displays the last value |
|
||||
| median | Reduce / Classic | Displays the median value |
|
||||
| diff | Classic | Displays the difference between the newest and oldest value |
|
||||
| diff_abs | Classic | Displays the absolute value of diff |
|
||||
| percent_diff | Classic | Displays the percentage value of the difference between newest and oldest value |
|
||||
| percent_diff_abs | Classic | Displays the absolute value of percent_diff |
|
||||
| count_non_null | Classic | Displays a count of values in the result set that aren't `null` |
|
||||
|
||||
## Alert condition
|
||||
|
||||
An alert condition is the query or expression that determines whether the alert will fire or not depending on the value it yields. There can be only one condition which will determine the triggering of the alert.
|
||||
|
||||
@@ -22,9 +22,11 @@ To do this, you need to make sure that your alert rule is in the right evaluatio
|
||||
|
||||
## Evaluation group
|
||||
|
||||
Every alert rule is part of an evaluation group. Each evaluation group contains an evaluation interval that determines how frequently the alert rule is checked. Alert rules within the same group are evaluated one after the other, while alert rules in different groups can be evaluated simultaneously.
|
||||
Every alert rule is part of an evaluation group. Each evaluation group contains an evaluation interval that determines how frequently the alert rule is checked.
|
||||
|
||||
This feature is especially useful for Prometheus/Mimir rules when you want to ensure that recording rules are evaluated before any alert rules.
|
||||
**Data-source managed** alert rules within the same group are evaluated one after the other, while alert rules in different groups can be evaluated simultaneously. This feature is especially useful when you want to ensure that recording rules are evaluated before any alert rules.
|
||||
|
||||
**Grafana-managed** alert rules are evaluated at the same time, regardless of alert rule group. The default evaluation interval is set at 10 seconds, which means that Grafana-managed alert rules are evaluated every 10 seconds to the closest 10-second window on the clock, for example, 10:00:00, 10:00:10, 10:00:20, and so on. You can also configure your own evaluation interval, if required.
|
||||
|
||||
**Note:**
|
||||
|
||||
@@ -45,7 +47,7 @@ Evaluation will occur as follows:
|
||||
[00:30] First evaluation - condition not met.
|
||||
|
||||
[01:00] Second evaluation - condition breached.
|
||||
Pending counter starts. **Alert stars pending.**
|
||||
Pending counter starts. **Alert starts pending.**
|
||||
|
||||
[01:30] Third evaluation - condition breached. Pending counter = 30s. **Pending state.**
|
||||
|
||||
|
||||
@@ -50,3 +50,15 @@ then:
|
||||
- A label matcher defined as `id=~[0-9]+` matches this alert rule.
|
||||
- A label matcher defined as `baz!~[0-9]+` matches this alert rule.
|
||||
- Two label matchers defined as `foo=bar` and `id=~[0-9]+` match this alert rule.
|
||||
|
||||
## Exclude labels
|
||||
|
||||
You can also write label matchers to exclude labels.
|
||||
|
||||
Here is an example that shows how to exclude the label `Team`. You can choose between any of the values below to exclude labels.
|
||||
|
||||
| Label | Operator | Value |
|
||||
| ------ | -------- | ----- |
|
||||
| `team` | `=` | `""` |
|
||||
| `team` | `!~` | `.+` |
|
||||
| `team` | `=~` | `^$` |
|
||||
|
||||
@@ -103,15 +103,35 @@ If you were to print the value of the expression with RefID `B` in the summary o
|
||||
The summary will contain just the value:
|
||||
|
||||
```
|
||||
api has an over 5% of responses with 5xx errors: 6.789%
|
||||
api has over 5% of responses with 5xx errors: 6.78912%
|
||||
```
|
||||
|
||||
However, while `{{ $values.B }}` prints the number 6.789, it is actually a string as you are printing the object that contains both the labels and value for RefID B, not the floating point value of B. To use the floating point value of RefID B you must use the `Value` field from `$values.B`. If you were to humanize the floating point value in the summary of an alert:
|
||||
However, while `{{ $values.B }}` prints the number 6.78912, it is actually a string as you are printing the object that contains both the labels and value for RefID B, not the floating point value of B. To use the floating point value of RefID B you must use the `Value` field from `$values.B`.
|
||||
|
||||
If you were to print the humanized floating point value in the summary of an alert:
|
||||
|
||||
```
|
||||
{{ $labels.service }} has over 5% of responses with 5xx errors: {{ humanize $values.B.Value }}%
|
||||
```
|
||||
|
||||
The summary will contain the humanized value:
|
||||
|
||||
```
|
||||
api has over 5% of responses with 5xx errors: 6.789%
|
||||
```
|
||||
|
||||
You can also compare the floating point value using the `eq`, `ne`, `lt`, `le`, `gt` and `ge` comparison operators:
|
||||
|
||||
```
|
||||
{{ if gt $values.B.Value 50.0 -}}
|
||||
Critical 5xx error rate
|
||||
{{ else -}}
|
||||
Elevated 5xx error rate
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
When using comparison operators with `$values` make sure to compare it to a floating point number such as `50.0` and not an integer such as `50`. Go templates do not support implicit type coercion, and comparing a floating point number to an integer will break your template.
|
||||
|
||||
### No data, execution errors and timeouts
|
||||
|
||||
If the query in your alert rule returns no data, or fails because of a datasource error or timeout, then any Threshold, Reduce or Math expressions that use that query will also return no data or an error. When this happens these expression will be absent from `$values`. It is good practice to check that a RefID is present before using it as otherwise your template will break should your query return no data or an error. You can do this using an if statement:
|
||||
|
||||
@@ -20,75 +20,76 @@ Specifying `{ "alerting": true, “backend”: true }` in the plugin.json file i
|
||||
|
||||
These are the data sources that are compatible with and supported by Grafana Alerting.
|
||||
|
||||
- [AWS CloudWatch][aws-cloudwatch]
|
||||
- [Azure Monitor][azure-monitor]
|
||||
- [Elasticsearch][elasticsearch]
|
||||
- [Google Cloud Monitoring][google-cloud-monitoring]
|
||||
- [Graphite][graphite]
|
||||
- [InfluxDB][influxdb]
|
||||
- [Loki][loki]
|
||||
- [Microsoft SQL Server MSSQL][mssql]
|
||||
- [MySQL][mysql]
|
||||
- [Open TSDB][opentsdb]
|
||||
- [PostgreSQL][postgres]
|
||||
- [Prometheus][prometheus]
|
||||
- [Jaeger][jaeger]
|
||||
- [Zipkin][zipkin]
|
||||
- [Tempo][tempo]
|
||||
- [Testdata][testdata]
|
||||
- [AWS CloudWatch][]
|
||||
- [Azure Monitor][]
|
||||
- [Elasticsearch][]
|
||||
- [Google Cloud Monitoring][]
|
||||
- [Graphite][]
|
||||
- [InfluxDB][]
|
||||
- [Loki][]
|
||||
- [Microsoft SQL Server (MSSQL)][]
|
||||
- [MySQL][]
|
||||
- [Open TSDB][]
|
||||
- [PostgreSQL][]
|
||||
- [Prometheus][]
|
||||
- [Jaeger][]
|
||||
- [Zipkin][]
|
||||
- [Tempo][]
|
||||
- [Testdata][]
|
||||
|
||||
## Useful links
|
||||
|
||||
- [Grafana data sources][datasources]
|
||||
- [Grafana data sources][]
|
||||
|
||||
{{% docs/reference %}}
|
||||
[datasources]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources"
|
||||
[Grafana data sources]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources"
|
||||
[Grafana data sources]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources"
|
||||
|
||||
[aws-cloudwatch]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/aws-cloudwatch"
|
||||
[aws-cloudwatch]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/aws-cloudwatch"
|
||||
[AWS CloudWatch]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/aws-cloudwatch"
|
||||
[AWS CloudWatch]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/aws-cloudwatch"
|
||||
|
||||
[azure-monitor]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/azure-monitor"
|
||||
[azure-monitor]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/azure-monitor"
|
||||
[Azure Monitor]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/azure-monitor"
|
||||
[Azure Monitor]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/azure-monitor"
|
||||
|
||||
[elasticsearch]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/elasticsearch"
|
||||
[elasticsearch]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/elasticsearch"
|
||||
[Elasticsearch]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/elasticsearch"
|
||||
[Elasticsearch]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/elasticsearch"
|
||||
|
||||
[google-cloud-monitoring]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/google-cloud-monitoring"
|
||||
[google-cloud-monitoring]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/google-cloud-monitoring"
|
||||
[Google Cloud Monitoring]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/google-cloud-monitoring"
|
||||
[Google Cloud Monitoring]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/google-cloud-monitoring"
|
||||
|
||||
[graphite]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/graphite"
|
||||
[graphite]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/graphite"
|
||||
[Graphite]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/graphite"
|
||||
[Graphite]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/graphite"
|
||||
|
||||
[influxdb]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/influxdb"
|
||||
[influxdb]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/influxdb"
|
||||
[InfluxDB]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/influxdb"
|
||||
[InfluxDB]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/influxdb"
|
||||
|
||||
[loki]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/loki"
|
||||
[loki]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/loki"
|
||||
[Loki]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/loki"
|
||||
[Loki]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/loki"
|
||||
|
||||
[mssql]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/mssql"
|
||||
[mssql]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/mssql"
|
||||
[Microsoft SQL Server (MSSQL)]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/mssql"
|
||||
[Microsoft SQL Server (MSSQL)]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/mssql"
|
||||
|
||||
[mysql]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/mysql"
|
||||
[mysql]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/mysql"
|
||||
[MySQL]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/mysql"
|
||||
[MySQL]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/mysql"
|
||||
|
||||
[opentsdb]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/opentsdb"
|
||||
[opentsdb]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/opentsdb"
|
||||
[Open TSDB]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/opentsdb"
|
||||
[Open TSDB]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/opentsdb"
|
||||
|
||||
[postgres]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/postgres"
|
||||
[postgres]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/postgres"
|
||||
[PostgreSQL]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/postgres"
|
||||
[PostgreSQL]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/postgres"
|
||||
|
||||
[prometheus]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/prometheus"
|
||||
[prometheus]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/prometheus"
|
||||
[Prometheus]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/prometheus"
|
||||
[Prometheus]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/prometheus"
|
||||
|
||||
[jaeger]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/jaeger"
|
||||
[jaeger]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/jaeger"
|
||||
[Jaeger]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/jaeger"
|
||||
[Jaeger]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/jaeger"
|
||||
|
||||
[zipkin]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/zipkin"
|
||||
[zipkin]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/zipkin"
|
||||
[Zipkin]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/zipkin"
|
||||
[Zipkin]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/zipkin"
|
||||
|
||||
[tempo]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/tempo"
|
||||
[tempo]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/tempo"
|
||||
[Tempo]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/tempo"
|
||||
[Tempo]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/tempo"
|
||||
|
||||
[testdata]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/testdata"
|
||||
[testdata]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/testdata"
|
||||
[Testdata]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/datasources/testdata"
|
||||
[Testdata]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/datasources/testdata"
|
||||
{{% /docs/reference %}}
|
||||
|
||||
@@ -30,7 +30,7 @@ Grafana managed alerts query the following backend data sources that have alerti
|
||||
|
||||
- built-in data sources or those developed and maintained by Grafana: `Graphite`, `Prometheus`, `Loki`, `InfluxDB`, `Elasticsearch`,
|
||||
`Google Cloud Monitoring`, `Cloudwatch`, `Azure Monitor`, `MySQL`, `PostgreSQL`, `MSSQL`, `OpenTSDB`, `Oracle`, and `Azure Monitor`
|
||||
- community developed backend data sources with alerting enabled (`backend` and `alerting` properties are set in the [plugin.json][metadata])
|
||||
- community developed backend data sources with alerting enabled (`backend` and `alerting` properties are set in the [plugin.json](/developers/plugin-tools/reference-plugin-json))
|
||||
|
||||
### Metrics from the alerting engine
|
||||
|
||||
@@ -108,9 +108,6 @@ When this query is used as the **condition** in an alert rule, then the non-zero
|
||||
| {Host=web3,disk=/var} | Normal |
|
||||
|
||||
{{% docs/reference %}}
|
||||
[metadata]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/developers/plugins/metadata"
|
||||
[metadata]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/developers/plugins/metadata"
|
||||
|
||||
[set-up-grafana-monitoring]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/setup-grafana/set-up-grafana-monitoring"
|
||||
[set-up-grafana-monitoring]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/setup-grafana/set-up-grafana-monitoring"
|
||||
{{% /docs/reference %}}
|
||||
|
||||
@@ -71,4 +71,4 @@ To remove a silence, complete the following steps.
|
||||
|
||||
## Useful links
|
||||
|
||||
[Aggregation operators](/docs/prometheus/latest/querying/operators/#aggregation-operators)
|
||||
[Aggregation operators](https://prometheus.io/docs/prometheus/latest/querying/operators/#aggregation-operators)
|
||||
|
||||
@@ -69,9 +69,7 @@ If screenshots should be uploaded to cloud storage then `upload_external_image_s
|
||||
# will be persisted to disk for up to temp_data_lifetime.
|
||||
upload_external_image_storage = false
|
||||
|
||||
Please see [`[external_image_storage]`]({{< relref "../../setup-grafana/configure-grafana#external_image_storage" >}}) for instructions on how to configure cloud storage. Grafana will not start if `upload_external_image_storage` is `true` and `[external_image_storage]` contains missing or invalid configuration.
|
||||
|
||||
If Grafana is acting as its own cloud storage then `[upload_external_image_storage]` should be set to `true` and the `local` provider should be set in [`[external_image_storage]`]({{< relref "../../setup-grafana/configure-grafana#external_image_storage" >}}).
|
||||
For more information on image rendering, refer to [image rendering][image-rendering].
|
||||
|
||||
Restart Grafana for the changes to take effect.
|
||||
|
||||
|
||||
@@ -57,18 +57,19 @@ The following table highlights the key differences between mute timings and sile
|
||||
|
||||
## Time intervals
|
||||
|
||||
A time interval is a definition for a moment in time. If an alert fires during this interval it will be suppressed. All fields are lists, and at least one list element must be satisfied to match the field. Fields also support ranges using `:` (ex: `monday:thursday`). The fields available for a time interval are: mute timing can contain multiple time intervals. A time interval is a specific duration when alerts are suppressed from firing. The duration typically consists of a specific time range along with days of a week, month, or year.
|
||||
|
||||
All properties for the time interval are lists, and at least one list element must be satisfied to match the field. The fields support ranges using `:` (ex: `monday:thursday`). If you leave a field blank, it will match with any moment of time.
|
||||
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.
|
||||
|
||||
Supported time interval options are:
|
||||
|
||||
- Time range: The time inclusive of the starting time and exclusive of the end time in UTC.
|
||||
- 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).
|
||||
- Location: Depending on the location you select, the time range is displayed in local time.
|
||||
- Days of the week: The day or range of days of the week. Example: `monday:thursday`.
|
||||
- Days of the month: The date 1-31 of a month. Negative values can also be used to represent days that begin at the end of the month. For example: `-1` for the last day of the month.
|
||||
- Months: The months of the year in either numerical or the full calendar month. For example: `1, may:august`.
|
||||
- Years: The year or years for the interval. For example: `2021:2024`.
|
||||
|
||||
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 will match 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 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:
|
||||
|
||||
@@ -25,15 +25,17 @@ Notification templates are not tied to specific contact point integrations, such
|
||||
|
||||
You can use notification templates to:
|
||||
|
||||
- Add, remove, or re-order information in the notification including the summary, description, labels and annotations, values, and links
|
||||
- Format text in bold and italic, and add or remove line breaks
|
||||
- Customize the subject of an email or the title of a message.
|
||||
- Add, change or remove text in notifications. For example, to select or omit certain labels, annotations and links.
|
||||
- Format text in bold and italic, and add or remove line breaks.
|
||||
|
||||
You cannot use notification templates to:
|
||||
|
||||
- Change how images are included in notifications, such as the number of images in each notification or where in the notification inline images are shown
|
||||
- Change the design of notifications in instant messaging services such as Slack and Microsoft Teams
|
||||
- Change the data in webhook notifications, including the structure of the JSON request or sending data in other formats such as XML
|
||||
- Add or remove HTTP headers in webhook notifications other than those in the contact point configuration
|
||||
- Add HTML and CSS to email notifications to change their visual appearance.
|
||||
- Change the design of notifications in instant messaging services such as Slack and Microsoft Teams. For example, to add or remove custom blocks with Slack Block Kit or adaptive cards with Microsoft Teams.
|
||||
- Choose the number and size of images, or where in the notification images are shown.
|
||||
- Customize the data in webhooks, including the fields or structure of the JSON data or send the data in other formats such as XML.
|
||||
- Add or remove HTTP headers in webhooks other than those in the contact point configuration.
|
||||
|
||||
[Using Go's templating language][using-go-templating-language]
|
||||
|
||||
@@ -41,7 +43,7 @@ Learn how to write the content of your notification templates in Go’s templati
|
||||
|
||||
Create reusable notification templates for your contact points.
|
||||
|
||||
[Use notification templates][use-notication-templates]
|
||||
[Use notification templates][use-notification-templates]
|
||||
|
||||
Use notification templates to send notifications to your contact points.
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ weight: 400
|
||||
| GeneratorURL | `string` | A link to Grafana, or the Alertmanager if using an external Alertmanager | `{{ .GeneratorURL }}` |
|
||||
| SilenceURL | `string` | A link to silence the alert | `{{ .SilenceURL }}` |
|
||||
| DashboardURL | `string` | A link to the Grafana Dashboard if the alert has a Dashboard UID annotation | `{{ .DashboardURL }}` |
|
||||
| PanelURL | `string` | A link to the panel if the alert has a Panel ID annotation | `{{ .PanelID }}` |
|
||||
| PanelURL | `string` | A link to the panel if the alert has a Panel ID annotation | `{{ .PanelURL }}` |
|
||||
| Fingerprint | `string` | A unique string that identifies the alert | `{{ .Fingerprint }}` |
|
||||
| ValueString | `string` | A string that contains the labels and value of each reduced expression in the alert. | `{{ .ValueString }}` |
|
||||
|
||||
|
||||
@@ -83,9 +83,9 @@ You can handle these alerts the same way as regular alerts by adding a silence,
|
||||
|
||||
Use the State history view to get insight into how your alert instances behave over time. View information on when a state change occurred, what the previous state was, the current state, any other alert instances that changed their state at the same time as well as what the query value was that triggered the change.
|
||||
|
||||
### Configure the state history view
|
||||
|
||||
To enable the state history view, see [Configuring alert state history]({{< relref "../set-up/configure-alert-state-history/index.md" >}}).
|
||||
{{% admonition type="note" %}}
|
||||
Open source users must configure alert state history in order to be able to access the view.
|
||||
{{% /admonition %}}
|
||||
|
||||
### View state history
|
||||
|
||||
|
||||
@@ -19,8 +19,6 @@ Set up or upgrade your implementation of Grafana Alerting.
|
||||
|
||||
These are set-up instructions for Grafana Alerting Open Source.
|
||||
|
||||
To set up Grafana Alerting for Cloud, see [Set up Alerting for Cloud][set-up-cloud].
|
||||
|
||||
## Before you begin
|
||||
|
||||
- Configure your [data sources][data-source-management]
|
||||
@@ -77,9 +75,6 @@ The following topics provide you with advanced configuration options for Grafana
|
||||
[file-provisioning]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/alerting/set-up/provision-alerting-resources/file-provisioning"
|
||||
[file-provisioning]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/alerting-and-irm/alerting/set-up/provision-alerting-resources/file-provisioning"
|
||||
|
||||
[set-up-cloud]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/alerting/set-up/set-up-cloud"
|
||||
[set-up-cloud]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/alerting-and-irm/alerting/set-up/set-up-cloud"
|
||||
|
||||
[terraform-provisioning]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/alerting/set-up/provision-alerting-resources/terraform-provisioning"
|
||||
[terraform-provisioning]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/alerting-and-irm/alerting/set-up/provision-alerting-resources/terraform-provisioning"
|
||||
{{% /docs/reference %}}
|
||||
|
||||
@@ -9,17 +9,13 @@ keywords:
|
||||
- alert state history
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- oss
|
||||
title: Configure Alert State History
|
||||
weight: 600
|
||||
---
|
||||
|
||||
# Configure Alert State History
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
This applies to Open Source only. There is no configuration required if you are using Grafana Cloud.
|
||||
{{% /admonition %}}
|
||||
|
||||
Starting with Grafana 10, Alerting can record all alert rule state changes for your Grafana managed alert rules in a Loki instance.
|
||||
|
||||
This allows you to explore the behavior of your alert rules in the Grafana explore view and levels up the existing state history modal with a powerful new visualisation.
|
||||
|
||||
@@ -33,7 +33,7 @@ Since gossiping of notifications and silences uses both TCP and UDP port `9094`,
|
||||
|
||||
1. In your custom configuration file ($WORKING_DIR/conf/custom.ini), go to the `[unified_alerting]` section.
|
||||
2. Set `[ha_peers]` to the number of hosts for each Grafana instance in the cluster (using a format of host:port), for example, `ha_peers=10.0.0.5:9094,10.0.0.6:9094,10.0.0.7:9094`.
|
||||
You must have at least one (1) Grafana instance added to the [`[ha_peer]` section.
|
||||
You must have at least one (1) Grafana instance added to the `ha_peers` section.
|
||||
3. Set `[ha_listen_address]` to the instance IP address using a format of `host:port` (or the [Pod's](https://kubernetes.io/docs/concepts/workloads/pods/) IP in the case of using Kubernetes).
|
||||
By default, it is set to listen to all interfaces (`0.0.0.0`).
|
||||
4. Set `[ha_peer_timeout]` in the `[unified_alerting]` section of the custom.ini to specify the time to wait for an instance to send a notification via the Alertmanager. The default value is 15s, but it may increase if Grafana servers are located in different geographic regions or if the network latency between them is high
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
---
|
||||
aliases:
|
||||
- difference-old-new/
|
||||
- unified-alerting/
|
||||
- unified-alerting/difference-old-new/
|
||||
- alerting/migrating-alerts/
|
||||
- ../migrating-alerts/ # /docs/grafana/<GRAFANA VERSION>/alerting/migrating-alerts/
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/set-up/migrating-alerts/
|
||||
description: Upgrade Grafana alerts
|
||||
labels:
|
||||
|
||||
@@ -28,9 +28,11 @@ There are three options to choose from:
|
||||
|
||||
1. Provision your alerting resources using the Alerting Provisioning HTTP API.
|
||||
|
||||
For more information on the Alerting Provisioning HTTP API, refer to [Alerting provisioning API]({{< relref "../../../developers/http_api/alerting_provisioning" >}}).
|
||||
For more information on the Alerting Provisioning HTTP API, refer to [Alerting provisioning HTTP API][alerting_provisioning].
|
||||
|
||||
1. Provision your alerting resources using [Terraform](https://www.terraform.io/).
|
||||
1. {{% admonition type="note" %}}
|
||||
If you are using Open Source, you can provision your alerting resources using [Terraform](https://www.terraform.io/).
|
||||
{{% /admonition %}}
|
||||
|
||||
**Note:**
|
||||
|
||||
@@ -40,8 +42,6 @@ Currently, provisioning for Grafana Alerting supports alert rules, contact point
|
||||
|
||||
[Grafana provisioning][provisioning]
|
||||
|
||||
[Terraform provisioning](/docs/grafana-cloud/infrastructure-as-code/terraform/)
|
||||
|
||||
[Grafana Alerting provisioning API][alerting_provisioning]
|
||||
|
||||
{{% docs/reference %}}
|
||||
|
||||
@@ -138,7 +138,7 @@ deleteRules:
|
||||
Create or delete contact points in your Grafana instance(s).
|
||||
|
||||
1. Create a contact point in Grafana.
|
||||
1. Use the [Alerting provisioning API]({{< relref "../../../../developers/http_api/alerting_provisioning" >}}) export endpoints to download a provisioning file for your contact point.
|
||||
1. Use the [Alerting provisioning API][alerting_provisioning] export endpoints to download a provisioning file for your contact point.
|
||||
1. Copy the contents into a YAML or JSON configuration file in the default provisioning directory or in your configured directory.
|
||||
|
||||
Example configuration files can be found below.
|
||||
@@ -497,12 +497,12 @@ settings:
|
||||
Create or reset the notification policy tree in your Grafana instance(s).
|
||||
|
||||
1. Create a notification policy in Grafana.
|
||||
2. Use the [Alerting provisioning API]({{< relref "../../../../developers/http_api/alerting_provisioning" >}}) export endpoints to download a provisioning file for your notification policy.
|
||||
3. Copy the contents into a YAML or JSON configuration file in the default provisioning directory or in your configured directory.
|
||||
1. Use the [Alerting provisioning API][alerting_provisioning] export endpoints to download a provisioning file for your notification policy.
|
||||
1. Copy the contents into a YAML or JSON configuration file in the default provisioning directory or in your configured directory.
|
||||
|
||||
Example configuration files can be found below.
|
||||
|
||||
4. Ensure that your files are in the right directory on the node running the Grafana server, so that they deploy alongside your Grafana instance(s).
|
||||
1. Ensure that your files are in the right directory on the node running the Grafana server, so that they deploy alongside your Grafana instance(s).
|
||||
|
||||
Here is an example of a configuration file for creating notification policies.
|
||||
|
||||
@@ -603,7 +603,7 @@ apiVersion: 1
|
||||
# List of templates to import or update
|
||||
templates:
|
||||
# <int> organization ID, default = 1
|
||||
- orgID: 1
|
||||
- orgId: 1
|
||||
# <string, required> name of the template, must be unique
|
||||
name: my_first_template
|
||||
# <string, required> content of the the template
|
||||
@@ -652,7 +652,7 @@ muteTimes:
|
||||
- times:
|
||||
- start_time: '06:00'
|
||||
end_time: '23:59'
|
||||
location: 'UTC'
|
||||
location: 'UTC'
|
||||
weekdays: ['monday:wednesday', 'saturday', 'sunday']
|
||||
months: ['1:3', 'may:august', 'december']
|
||||
years: ['2020:2022', '2030']
|
||||
|
||||
@@ -138,7 +138,7 @@ By default, you cannot edit resources provisioned via Terraform from the UI. Thi
|
||||
|
||||
**Note:**
|
||||
|
||||
You can re-use the same templates across many contact points. In the example above, a shared template ie embedded using the statement `{{ template “Alert Instance Template” . }}`
|
||||
You can reuse the same templates across many contact points. In the example above, a shared template ie embedded using the statement `{{ template “Alert Instance Template” . }}`
|
||||
|
||||
This fragment can then be managed separately in Terraform:
|
||||
|
||||
|
||||
@@ -1,260 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /docs/grafana-cloud/alerts/alerts-rules/
|
||||
- /docs/grafana-cloud/how-do-i/alerts/alerts-rules/
|
||||
- /docs/grafana-cloud/legacy-alerting/alerts-rules/
|
||||
- /docs/grafana-cloud/metrics/prometheus/alerts_rules/
|
||||
- /docs/hosted-metrics/prometheus/alerts_rules/
|
||||
- /docs/grafana-cloud/alerts/grafana-cloud-alerting/
|
||||
- /docs/grafana-cloud/how-do-i/grafana-cloud-alerting/
|
||||
- /docs/grafana-cloud/legacy-alerting/grafana-cloud-alerting/
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/set-up/set-up-cloud/
|
||||
description: How to configure Alerting for Cloud
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
title: Set up Alerting for Cloud
|
||||
weight: 100
|
||||
---
|
||||
|
||||
# Set up Alerting for Cloud
|
||||
|
||||
Set up your implementation of Grafana Alerting for Cloud.
|
||||
|
||||
Grafana Cloud alerts are directly tied to metrics and log data.
|
||||
|
||||
They can be configured either using the UI or by uploading files containing Prometheus and Loki alert rules with mimirtool.
|
||||
|
||||
Grafana Cloud Alerting's Prometheus-style alerts are built by querying directly from the data source itself.
|
||||
|
||||
**Note:**
|
||||
|
||||
These are set up instructions for Grafana Alerting Cloud.
|
||||
|
||||
To set up Grafana Alerting for Open Source, see [Set up][set-up].
|
||||
|
||||
To set up Alerting, you need to:
|
||||
|
||||
1. Configure alert rules
|
||||
|
||||
- Create Mimir/Loki-managed alert rules and recording rules
|
||||
|
||||
2. Configure contact points
|
||||
- Check the default contact point and update the email address
|
||||
- [Optional] Add new contact points and integrations
|
||||
3. Configure notification policies
|
||||
|
||||
- Check the default notification policy
|
||||
- [Optional] Add additional nested policies
|
||||
- [Optional] Add labels and label matchers to control alert routing
|
||||
|
||||
4. [Optional] Integrate with [Grafana OnCall](/docs/oncall/latest/integrations/grafana-alerting) and [Grafana Incident](/docs/grafana-cloud/incident/set-up)
|
||||
|
||||
## Advanced set up options
|
||||
|
||||
Grafana Alerting supports many additional configuration options, from configuring external Alertmanagers to routing Grafana-managed alerts outside of Grafana, to defining your alerting setup as code.
|
||||
|
||||
The following topics provide you with advanced configuration options for Grafana Alerting for Cloud.
|
||||
|
||||
### Provision alert rules using mimirtool
|
||||
|
||||
Use `mimirtool` to create and upload alert and recording rules to your Grafana Cloud instance.
|
||||
|
||||
Once created, you can view these alert and recordiing rules from within the Grafana Cloud Alerting page in the UI.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
`mimirtool` does _not_ support Loki.
|
||||
{{% /admonition %}}
|
||||
|
||||
Prometheus-style alerting is driven by your Grafana Cloud Metrics, Grafana Cloud Logs, and Grafana Cloud Alerts instances. The Metrics and Logs instance holds the rules definition, while the Alerts instance is in charge of routing and managing the alerts that fire from the Metrics and Logs instance. These are separate systems that must be individually configured in order for alerting to work correctly.
|
||||
|
||||
The following sections cover all of these concepts:
|
||||
|
||||
- How to upload alerting and recording rules definition to your Grafana Cloud Metrics instance
|
||||
- How to upload alerting rules definition to your Grafana Cloud Logs instance
|
||||
- How to configure an Alertmanager for your Grafana Cloud Alerts instance, giving you access to the Alertmanager UI.
|
||||
|
||||
**Note:** You need an API key with proper permissions. You can use the same API key for your Metric, Log, and Alerting instances.
|
||||
|
||||
#### Download and install mimirtool
|
||||
|
||||
`mimirtool` is a powerful command-line tool for interacting with Grafana Mimir, which powers Grafana Cloud Metrics and Alerts. Use `mimirtool` to upload your metric and log rules definition and the Alertmanager configuration using YAML files.
|
||||
|
||||
For more information, including installation instructions, see [Grafana Mimirtool](/docs/mimir/latest/operators-guide/tools/mimirtool).
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
For `mimirtool` to interact with Grafana Cloud, you must set the correct configuration variables. Set them using either environment variables or a command line flags.
|
||||
{{% /admonition %}}
|
||||
|
||||
#### Upload rules definition to your Grafana Cloud Metrics and Logs instance
|
||||
|
||||
First, you'll need to upload your alerting and recording rules to your Metrics and Logs instance. You'll need the instance ID and the URL. These should be part of /orgs/`<yourOrgName>`/.
|
||||
|
||||
**Metrics instance**
|
||||
|
||||
Your Metrics instance is likely to be in the `us-central1` region. Its address would be in the form of [https://prometheus-us-central1.grafana.net](https://prometheus-us-central1.grafana.net).
|
||||
|
||||
**Logs instance**
|
||||
|
||||
Your Logs instance is likely to be in the `us-central1` region. Its address would be in the form of [https://logs-prod-us-central1.grafana.net](https://logs-prod-us-central1.grafana.net).
|
||||
|
||||
#### Use mimirtool
|
||||
|
||||
With your instance ID, URL, and API key you're now ready to upload your rules to your metrics instance. Use the following commands and files as a reference.
|
||||
|
||||
Below is an example alert and rule definition YAML file. Take note of the namespace key which replaces the concept of "files" in this context given each instance only supports 1 configuration file.
|
||||
|
||||
```yaml
|
||||
# first_rules.yml
|
||||
namespace: 'first_rules'
|
||||
groups:
|
||||
- name: 'shopping_service_rules_and_alerts'
|
||||
rules:
|
||||
- alert: 'PromScrapeFailed'
|
||||
annotations:
|
||||
message: 'Prometheus failed to scrape a target {{ $labels.job }} / {{ $labels.instance }}'
|
||||
expr: 'up != 1'
|
||||
for: '1m'
|
||||
labels:
|
||||
'severity': 'critical'
|
||||
- record: 'job:up:sum'
|
||||
expr: 'sum by(job) (up)'
|
||||
```
|
||||
|
||||
Although both recording and alerting rules are defined under the key `rules` the difference between a rule and and alert is _generally_ (as there are others) whenever the key `record` or `alert` is defined.
|
||||
|
||||
With this file, you can run the following commands to upload your rules file in your Metrics or Logs instance. Keep in mind that these are example commands for your Metrics instance, and they use placeholders and command line flags. Follow a similar pattern for your Logs instances by switching the address to the correct one. The examples also assume that files are located in the same directory.
|
||||
|
||||
```bash
|
||||
$ mimirtool rules load first_rules.yml \
|
||||
--address=https://prometheus-us-central1.grafana.net \
|
||||
--id=<yourID> \
|
||||
--key=<yourKey>
|
||||
```
|
||||
|
||||
Next, confirm that the rules were uploaded correctly by running:
|
||||
|
||||
```bash
|
||||
$ mimirtool rules list \
|
||||
--address=https://prometheus-us-central1.grafana.net \
|
||||
--id=<yourID> \
|
||||
--key=<yourKey>
|
||||
```
|
||||
|
||||
Output is a list that shows you all the namespaces and rule groups for your instance ID:
|
||||
|
||||
```bash
|
||||
Namespace | Rule Group
|
||||
first_rules | shopping_service_rules_and_alerts
|
||||
```
|
||||
|
||||
You can also print the rules:
|
||||
|
||||
```bash
|
||||
$ mimirtool rules print \
|
||||
--address=https://prometheus-us-central1.grafana.net \
|
||||
--id=<yourID> \
|
||||
--key=<yourKey>
|
||||
```
|
||||
|
||||
Output from the print command should look like this:
|
||||
|
||||
```yaml
|
||||
first_rules:
|
||||
- name: shopping_service_rules_and_alerts
|
||||
interval: 0s
|
||||
rules:
|
||||
- alert: PromScrapeFailed
|
||||
expr: up != 1
|
||||
for: 1m
|
||||
labels:
|
||||
severity: critical
|
||||
annotations:
|
||||
message: Prometheus failed to scrape a target {{ $labels.job }} / {{ $labels.instance }}
|
||||
- record: job:up:sum
|
||||
expr: sum by(job) (up)
|
||||
```
|
||||
|
||||
### Add an external Alertmanager using mimirtool
|
||||
|
||||
To receive alerts you need to upload your Alertmanager configuration to your Grafana Cloud Alerts instance. Similar to the previous step, you need the corresponding instance ID, URL and API key. These should be part of /orgs/`<yourOrgName>`/.
|
||||
|
||||
Your Alerts instance is likely to be in the `us-central1` region. Its address would be in the form of [https://alertmanager-us-central1.grafana.net](https://alertmanager-us-central1.grafana.net).
|
||||
|
||||
#### Use mimirtool
|
||||
|
||||
With your instance ID, URL, and API key you're now ready to upload your Alertmanager configuration to your Alerts instance. Use the following commands and files as a reference.
|
||||
|
||||
Ultimately, you'll need to [write your own](https://prometheus.io/docs/alerting/latest/configuration/) or adapt an [example config file](https://github.com/prometheus/alertmanager/blob/master/doc/examples/simple.yml) for alerts to be delivered.
|
||||
|
||||
Below is an example Alertmanager configuration. Please take that this not a working configuration, your alerts won't be delivered with the following configuration but your Alertmanager UI will be accessible.
|
||||
|
||||
```yaml
|
||||
# alertmanager.yml
|
||||
global:
|
||||
smtp_smarthost: 'localhost:25'
|
||||
smtp_from: 'youraddress@example.org'
|
||||
route:
|
||||
receiver: example-email
|
||||
receivers:
|
||||
- name: example-email
|
||||
email_configs:
|
||||
- to: 'youraddress@example.org'
|
||||
```
|
||||
|
||||
With this file, you can run the following commands to upload your Alertmanager configuration in your Alerts instance.
|
||||
|
||||
```bash
|
||||
$ mimirtool alertmanager load alertmanager.yml \
|
||||
--address=https://alertmanager-us-central1.grafana.net \
|
||||
--id=<yourID> \
|
||||
--key=<yourKey>
|
||||
```
|
||||
|
||||
Then, confirm that the rules were uploaded correctly by running:
|
||||
|
||||
```bash
|
||||
$ mimirtool alertmanager get \
|
||||
--address=https://alertmanager-us-central1.grafana.net \
|
||||
--id=<yourID> \
|
||||
--key=<yourKey>
|
||||
```
|
||||
|
||||
You should see output similar to the following:
|
||||
|
||||
```bash
|
||||
global:
|
||||
smtp_smarthost: 'localhost:25'
|
||||
smtp_from: 'youraddress@example.org'
|
||||
route:
|
||||
receiver: example-email
|
||||
receivers:
|
||||
- name: example-email
|
||||
email_configs:
|
||||
- to: 'youraddress@example.org'
|
||||
```
|
||||
|
||||
Finally, you can delete the configuration with:
|
||||
|
||||
```bash
|
||||
$ mimirtool alertmanager delete \
|
||||
--address=https://alertmanager-us-central1.grafana.net \
|
||||
--id=<yourID> \
|
||||
--key=<yourKey>
|
||||
```
|
||||
|
||||
#### UI access
|
||||
|
||||
After you upload a working Alertmanager configuration file, you can access the Alertmanager UI at: https://alertmanager-us-central1.grafana.net/alertmanager.
|
||||
|
||||
### Provision alert rules using Terraform
|
||||
|
||||
For information on how to provision alert rule using Terraform, see [Provision alert rules using Terraform][terraform-provisioning].
|
||||
|
||||
{{% docs/reference %}}
|
||||
[set-up]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/alerting/set-up"
|
||||
[set-up]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/alerting-and-irm/alerting/set-up"
|
||||
|
||||
[terraform-provisioning]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/alerting/set-up/provision-alerting-resources/terraform-provisioning"
|
||||
[terraform-provisioning]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/alerting-and-irm/alerting/set-up/provision-alerting-resources/terraform-provisioning"
|
||||
{{% /docs/reference %}}
|
||||
@@ -25,7 +25,7 @@ weight: 200
|
||||
Usage insights enables you to have a better understanding of how your Grafana instance is used.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) and [Grafana Cloud Pro and Advanced](/docs/grafana-cloud/). Grafana Cloud insights logs include additional fields with their own dashboards. Read more in the [Grafana Cloud documentation](/docs/grafana-cloud/usage-insights/).
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) and [Grafana Cloud](/docs/grafana-cloud/). Grafana Cloud insights logs include additional fields with their own dashboards. Read more in the [Grafana Cloud documentation](/docs/grafana-cloud/usage-insights/).
|
||||
{{% /admonition %}}
|
||||
|
||||
The usage insights feature collects a number of aggregated data and stores them in the database:
|
||||
@@ -95,10 +95,23 @@ To change _recent_ to something other than the past 10 minutes, edit the [config
|
||||
|
||||
```ini
|
||||
[analytics.views]
|
||||
# Set age for recent active users
|
||||
|
||||
# Set age for recent active users to 10 minutes
|
||||
recent_users_age = 10m
|
||||
```
|
||||
|
||||
To disable the presence indicator, edit the [configuration][] file as follows:
|
||||
|
||||
```ini
|
||||
[analytics.views]
|
||||
|
||||
|
||||
# Disables the presence indicator
|
||||
recent_users_age = 0
|
||||
```
|
||||
|
||||
The dashboard won't show any avatars and thus no recent user activity.
|
||||
|
||||
## Sort dashboards by using insights data
|
||||
|
||||
In the search view, you can use insights data to help you find most-used, broken, and unused dashboards.
|
||||
|
||||
@@ -43,7 +43,10 @@ Annotations are supported for the following visualization types:
|
||||
|
||||
Grafana comes with the ability to add annotation events directly from a panel using the [built-in annotation query](#built-in-query) that exists on all dashboards. Annotations that you create this way are stored in Grafana.
|
||||
|
||||
To add annotations directly in the panel, the built-in query must be enabled. Learn more in [Built-in query](#built-in-query)
|
||||
To add annotations directly in the panel:
|
||||
|
||||
- The dashboard must already be saved.
|
||||
- The built-in query must be enabled. Learn more in [Built-in query](#built-in-query).
|
||||
|
||||
### Add an annotation
|
||||
|
||||
@@ -119,6 +122,8 @@ To add a new annotation query to a dashboard, take the following steps:
|
||||
|
||||
After you add an annotation, they will still be visible. This is due to the built-in annotation query that exists on all dashboards. This annotation query will fetch all annotation events that originate from the current dashboard, which are stored in Grafana, and show them on the panel where they were created. This includes alert state history annotations.
|
||||
|
||||
By default, the built-in annotation query uses the `-- Grafana --` special data source, and manual annotations are only supported using this data source. You can use another data source in the built-in annotation query, but you'll only be able to create automated annotations using the query editor for that data source.
|
||||
|
||||
To add annotations directly to the dashboard, this query must be enabled.
|
||||
|
||||
To confirm if the built-in query is enabled, take the following steps:
|
||||
@@ -136,7 +141,7 @@ You can stop annotations from being fetched and drawn by taking the following st
|
||||
1. Find and click the **Annotations & Alerts (Built-in)** query to open it.
|
||||
1. Click the **Enabled** toggle to turn it off.
|
||||
|
||||
When you copy a dashboard using the **Save As** feature it will get a new dashboard id, so annotations created on source dashboard will no longer be visible on the copy. You can still show them if you add a new **Annotation Query** and filter by tags. However, this only works if the annotations on the source dashboard had tags to filter by.
|
||||
When you copy a dashboard using the **Save As** feature it will get a new dashboard id, so annotations created on the source dashboard will no longer be visible on the copy. You can still show them if you add a new **Annotation Query** and filter by tags. However, this only works if the annotations on the source dashboard had tags to filter by.
|
||||
|
||||
Following are some query options specific to the built-in annotation query.
|
||||
|
||||
|
||||
@@ -243,6 +243,6 @@ Usage of the above mentioned fields in the templating section is explained below
|
||||
| **name** | name of variable |
|
||||
| **options** | array of variable text/value pairs available for selection on dashboard |
|
||||
| **query** | data source query used to fetch values for a variable |
|
||||
| **refresh** | |
|
||||
| **regex** | |
|
||||
| **refresh** | configures when to refresh a variable |
|
||||
| **regex** | extracts part of a series name or metric node segment |
|
||||
| **type** | type of variable, i.e. `custom`, `query` or `interval` |
|
||||
|
||||
@@ -21,7 +21,7 @@ weight: 85
|
||||
|
||||
# Create and manage reports
|
||||
|
||||
Reporting enables you to automatically generate PDFs from any of your dashboards and have Grafana email them to interested parties on a schedule. This is available in Grafana Cloud Pro and Advanced and in Grafana Enterprise.
|
||||
Reporting enables you to automatically generate PDFs from any of your dashboards and have Grafana email them to interested parties on a schedule. This is available in Grafana Cloud and in Grafana Enterprise.
|
||||
|
||||
> If you have [Role-based access control]({{< relref "../../administration/roles-and-permissions/access-control/" >}}) enabled, for some actions you would need to have relevant permissions.
|
||||
> Refer to specific guides to understand what permissions are required.
|
||||
@@ -76,7 +76,7 @@ Only organization administrators can create reports by default. You can customiz
|
||||
### Save as draft
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) version 9.1.0 and later and [Grafana Cloud Pro and Advanced](/docs/grafana-cloud/).
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) version 9.1.0 and later and [Grafana Cloud](/docs/grafana-cloud/).
|
||||
{{% /admonition %}}
|
||||
|
||||
You can save a report as a draft at any point during the report creation or update process. You can save a report as a draft even if it's missing required fields. Also, the report won't be sent according to its schedule while it's a draft.
|
||||
@@ -84,7 +84,7 @@ You can save a report as a draft at any point during the report creation or upda
|
||||
### Choose template variables
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) version 7.5 and later behind the `reportVariables` feature flag, Grafana Enterprise version 8.0 and later without a feature flag, and [Grafana Cloud Pro and Advanced](/docs/grafana-cloud/).
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) version 7.5 and later behind the `reportVariables` feature flag, Grafana Enterprise version 8.0 and later without a feature flag, and [Grafana Cloud](/docs/grafana-cloud/).
|
||||
{{% /admonition %}}
|
||||
|
||||
You can configure report-specific template variables for the dashboard on the report page. The variables that you select will override the variables from the dashboard, and they are used when rendering a PDF file of the report. For detailed information about using template variables, refer to the [Templates and variables]({{< relref "../variables/" >}}) section.
|
||||
@@ -96,7 +96,7 @@ The query variables saved with a report might become of date if the results of t
|
||||
### Render a report with panels or rows set to repeat by a variable
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) version 8.0 and later, and [Grafana Cloud Pro and Advanced](/docs/grafana-cloud/).
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) version 8.0 and later, and [Grafana Cloud](/docs/grafana-cloud/).
|
||||
{{% /admonition %}}
|
||||
|
||||
You can include dynamic dashboards with panels or rows, set to repeat by a variable, into reports. For detailed information about setting up repeating panels or rows in dashboards, refer to [Repeat panels or rows]({{< relref "../../panels-visualizations/configure-panel-options/#configure-repeating-rows-or-panels" >}}).
|
||||
@@ -113,15 +113,21 @@ You can include dynamic dashboards with panels or rows, set to repeat by a varia
|
||||
### Report time range
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
You can set custom report time ranges in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) 7.2+ and [Grafana Cloud Pro and Advanced](/docs/grafana-cloud/).
|
||||
You can set custom report time ranges in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) 7.2+ and [Grafana Cloud](/docs/grafana-cloud/).
|
||||
{{% /admonition %}}
|
||||
|
||||
By default, reports use the saved time range of the dashboard. You can change the time range of the report by:
|
||||
|
||||
- Saving a modified time range to the dashboard.
|
||||
- Saving a modified time range to the dashboard. Changing the dashboard time range without saving it doesn't change the time zone of the report.
|
||||
- Setting a time range via the **Time range** field in the report form. If specified, the custom time range overrides the time range from the report's dashboard.
|
||||
|
||||
The page header of the report displays the time range for the dashboard's data queries. Dashboards set to use the browser's time zone use the time zone on the Grafana server.
|
||||
The page header of the report displays the time range for the dashboard's data queries.
|
||||
|
||||
#### Report time zones
|
||||
|
||||
Reports use the time zone of the dashboard from which they’re generated. You can control the time zone for your reports by setting the dashboard to a specific time zone. Note that this affects the display of the dashboard for all users.
|
||||
|
||||
If a dashboard has the **Browser Time** setting, the reports generated from that dashboard use the time zone of the Grafana server. As a result, this time zone might not match the time zone of users creating or receiving the report.
|
||||
|
||||
If the time zone is set differently between your Grafana server and its remote image renderer, then the time ranges in the report might be different between the page header and the time axes in the panels. To avoid this, set the time zone to UTC for dashboards when using a remote renderer. Each dashboard's time zone setting is visible in the [time range controls]({{< relref "./manage-dashboards/#dashboard-time-settings" >}}).
|
||||
|
||||
@@ -139,7 +145,7 @@ If the time zone is set differently between your Grafana server and its remote i
|
||||
### CSV export
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) 8+ with the [Grafana image renderer plugin](/grafana/plugins/grafana-image-renderer) v3.0+, and [Grafana Cloud Pro and Advanced](/docs/grafana-cloud/).
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) 8+ with the [Grafana image renderer plugin](/grafana/plugins/grafana-image-renderer) v3.0+, and [Grafana Cloud](/docs/grafana-cloud/).
|
||||
{{% /admonition %}}
|
||||
|
||||
You can attach a CSV file to the report email for each table panel on the selected dashboard, along with the PDF report. By default, CSVs larger than 10Mb are not sent which keeps email servers from rejecting the email. You can increase or decrease this limit in the [reporting configuration]({{< relref "#rendering-configuration" >}}).
|
||||
@@ -153,7 +159,7 @@ A background job runs every 10 minutes and removes temporary CSV files. You can
|
||||
### Scheduling
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) version 8.0 and later, and [Grafana Cloud Pro and Advanced](/docs/grafana-cloud/).
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) version 8.0 and later, and [Grafana Cloud](/docs/grafana-cloud/).
|
||||
The scheduler was significantly changed in Grafana Enterprise version 8.1.
|
||||
{{% /admonition %}}
|
||||
|
||||
@@ -176,7 +182,7 @@ When you schedule a report with a monthly frequency, and set the start date betw
|
||||
#### Send a test email
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) version 7.0 and later, and [Grafana Cloud Pro and Advanced](/docs/grafana-cloud/).
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) version 7.0 and later, and [Grafana Cloud](/docs/grafana-cloud/).
|
||||
{{% /admonition %}}
|
||||
|
||||
1. In the report, click **Send test email**.
|
||||
@@ -189,7 +195,7 @@ The last saved version of the report will be sent to selected emails. You can us
|
||||
### Pause a report
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) version 8.0 and later, and [Grafana Cloud Pro and Advanced](/docs/grafana-cloud/).
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) version 8.0 and later, and [Grafana Cloud](/docs/grafana-cloud/).
|
||||
{{% /admonition %}}
|
||||
|
||||
You can pause sending reports from the report list view by clicking the pause icon. The report will not be sent according to its schedule until it is resumed by clicking the resume button on the report row.
|
||||
@@ -197,7 +203,7 @@ You can pause sending reports from the report list view by clicking the pause ic
|
||||
### Add multiple dashboards to a report
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) version 9.0 and later, and [Grafana Cloud Pro and Advanced](/docs/grafana-cloud/).
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) version 9.0 and later, and [Grafana Cloud](/docs/grafana-cloud/).
|
||||
{{% /admonition %}}
|
||||
|
||||
You can add more than one dashboard to a report. Additional dashboards will be rendered as new pages in the same PDF file, or additional images if you chose to embed images in your report email. You cannot add the same dashboard to a report multiple times.
|
||||
@@ -205,7 +211,7 @@ You can add more than one dashboard to a report. Additional dashboards will be r
|
||||
### Embed a dashboard as an image into a report
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) version 9.0 and later, and [Grafana Cloud Pro and Advanced](/docs/grafana-cloud/).
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) version 9.0 and later, and [Grafana Cloud](/docs/grafana-cloud/).
|
||||
{{% /admonition %}}
|
||||
|
||||
You can send a report email with an image of the dashboard embedded in the email instead of attached as a PDF. In this case, the email recipients can see the dashboard at a glance instead of having to open the PDF.
|
||||
@@ -215,7 +221,7 @@ You can send a report email with an image of the dashboard embedded in the email
|
||||
You can generate and save PDF files of any dashboard.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) version 6.7 and later, and [Grafana Cloud Pro and Advanced](/docs/grafana-cloud/).
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) version 6.7 and later, and [Grafana Cloud](/docs/grafana-cloud/).
|
||||
{{% /admonition %}}
|
||||
|
||||
1. In the dashboard that you want to export as PDF, click the **Share dashboard** icon.
|
||||
@@ -263,7 +269,7 @@ font_italic = DejaVuSansCondensed-Oblique.ttf
|
||||
|
||||
## Report settings
|
||||
|
||||
> **Note:** Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) version 7.2 and later, and [Grafana Cloud Pro and Advanced](/docs/grafana-cloud/).
|
||||
> **Note:** Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) version 7.2 and later, and [Grafana Cloud](/docs/grafana-cloud/).
|
||||
|
||||
You can configure organization-wide report settings in the **Settings** under **Dashboards > Reporting**. Settings are applied to all the reports for current organization.
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ If you are using Docker, use an environment variable to enable public dashboards
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
|
||||
For Grafana Cloud (Pro and Advanced only), contact support to have the feature enabled.
|
||||
For Grafana Cloud, contact support to have the feature enabled.
|
||||
|
||||
{{% /admonition %}}
|
||||
|
||||
@@ -88,7 +88,7 @@ The link no longer works. You must create a new public URL, as in [Make a dashbo
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
|
||||
Available in [private preview](/docs/release-life-cycle/) in [Grafana Cloud Pro and Advanced](/docs/grafana-cloud). This feature will have a cost by active users after being promoted into general availability.
|
||||
Available in [private preview](/docs/release-life-cycle/) in [Grafana Cloud](/docs/grafana-cloud). This feature will have a cost by active users after being promoted into general availability.
|
||||
|
||||
Please contact support to have the feature enabled.
|
||||
|
||||
@@ -150,7 +150,7 @@ If a Grafana user has read access to the parent dashboard, they can view the pub
|
||||
## Assess public dashboard usage
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) and [Grafana Cloud Pro and Advanced](/docs/grafana-cloud).
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) and [Grafana Cloud](/docs/grafana-cloud).
|
||||
{{% /admonition %}}
|
||||
|
||||
You can check usage analytics about your public dashboard by clicking the insights icon in the dashboard header:
|
||||
|
||||
@@ -58,6 +58,8 @@ Folders help you organize and group dashboards, which is useful when you have ma
|
||||
1. On the Dashboards page, click **New** and select **New folder** in the dropdown.
|
||||
1. Enter a unique name and click **Create**.
|
||||
|
||||
Do not use the name of a folder that has already been provisioned (such as "General") and avoid special characters (except underscores and hyphens).
|
||||
|
||||
When you save a dashboard, you can either select a folder for the dashboard to be saved in or create a new folder.
|
||||
|
||||
## Manage dashboards
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
---
|
||||
aliases:
|
||||
- ../variables/
|
||||
- ../variables/variable-examples/
|
||||
- ./
|
||||
- ../variables/ # /docs/grafana/<GRAFANA VERSION>/variables/
|
||||
- ../variables/templates-and-variables/ # /docs/grafana/<GRAFANA VERSION>/variables/templates-and-variables/
|
||||
- ../variables/variable-examples/ # /docs/grafana/<GRAFANA VERSION>/variables/variable-examples/
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
|
||||
@@ -66,7 +66,7 @@ The following table lists the types of variables shipped with Grafana.
|
||||
You must enter general options for any type of variable that you create.
|
||||
|
||||
1. Navigate to the dashboard you want to make a variable for and click the **Dashboard settings** (gear) icon at the top of the page.
|
||||
1. On the **Variables** tab, click **New**.
|
||||
1. On the **Variables** tab, click **New variable**.
|
||||
1. Enter a **Name** for the variable.
|
||||
1. In the **Type** list, select **Query**.
|
||||
1. (Optional) In **Label**, enter the display name of the variable dropdown.
|
||||
@@ -94,9 +94,10 @@ Query expressions are different for each data source. For more information, refe
|
||||
1. In the **Data source** list, select the target data source for the query. For more information about data sources, refer to [Add a data source]({{< relref "../../../administration/data-source-management#add-a-data-source" >}}).
|
||||
1. In the **Refresh** list, select when the variable should update options.
|
||||
- **On Dashboard Load:** Queries the data source every time the dashboard loads. This slows down dashboard loading, because the variable query needs to be completed before dashboard can be initialized.
|
||||
- **On Time Range Change:** Queries the data source when the dashboard time range changes. Only use this option if your variable options query contains a time range filter or is dependent on the dashboard time range.
|
||||
- **On Time Range Change:** Queries the data source every time the dashboard loads and when the dashboard time range changes. Use this option if your variable options query contains a time range filter or is dependent on the dashboard time range.
|
||||
1. In the **Query** field, enter a query.
|
||||
- The query field varies according to your data source. Some data sources have custom query editors.
|
||||
- Make sure that the query returns values named `__text` and `__value` as appropriate in your query syntax. For example, in SQL, you can use a query such as `SELECT hostname AS __text, id AS __value FROM MyTable`. Queries for other languages will vary depending on syntax.
|
||||
- If you need more room in a single input field query editor, then hover your cursor over the lines in the lower right corner of the field and drag downward to expand.
|
||||
1. (Optional) In the **Regex** field, type a regex expression to filter or capture specific parts of the names returned by your data source query. To see examples, refer to [Filter variables with regex]({{< relref "#filter-variables-with-regex" >}}).
|
||||
1. In the **Sort** list, select the sort order for values to be displayed in the dropdown list. The default option, **Disabled**, means that the order of options returned by your data source query will be used.
|
||||
@@ -355,7 +356,7 @@ Extremely complex linked templated dashboards are possible, 5 or 10 levels deep.
|
||||
The following Grafana Play dashboards contain fairly simple chained variables, only two layers deep. To view the variables and their settings, click **Dashboard settings** (gear icon) and then click **Variables**. Both examples are expanded in the following section.
|
||||
|
||||
- [Graphite Templated Nested](https://play.grafana.org/d/000000056/graphite-templated-nested?orgId=1&var-app=country&var-server=All&var-interval=1h)
|
||||
- [InfluxDB Templated](https://play.grafana.org/d/000000002/influxdb-templated?orgId=1)
|
||||
- [InfluxDB Templated](https://play.grafana.org/d/e7bad3ef-db0c-4bbd-8245-b85c0b2ca2b9/influx-2-73a-hourly-electric-grid-monitor-for-us?orgId=1&refresh=1m)
|
||||
|
||||
### Examples explained
|
||||
|
||||
@@ -429,7 +430,7 @@ apps.fakesite.web_server_01.cpu.*
|
||||
|
||||
#### InfluxDB example
|
||||
|
||||
In this example, you have several data centers. Each data center has a different subset of hosts. It is based on the [InfluxDB Templated](https://play.grafana.org/d/000000002/influxdb-templated?orgId=1) dashboard.
|
||||
In this example, you have several data centers. Each data center has a different subset of hosts. It is based on the [InfluxDB Templated](https://play.grafana.org/d/e7bad3ef-db0c-4bbd-8245-b85c0b2ca2b9/influx-2-73a-hourly-electric-grid-monitor-for-us?orgId=1&refresh=1m) dashboard.
|
||||
|
||||
In this example, when the user changes the value of the `datacenter` variable, it changes the dropdown options returned by the `host` variable. The `host` variable uses the **Multi-value** option and **Include all option**, allowing users to select some or all options presented at any time. The `datacenter` does not use either option, so you can only select one data center at a time.
|
||||
|
||||
|
||||
@@ -29,7 +29,8 @@ After you add and configure a data source, you can use it as an input for many o
|
||||
This documentation describes how to manage data sources in general,
|
||||
and how to configure or query the built-in data sources.
|
||||
For other data sources, refer to the list of [datasource plugins](/grafana/plugins/).
|
||||
To develop a custom plugin, refer to [Build a plugin][build-a-plugin].
|
||||
|
||||
To develop a custom plugin, refer to [Build a plugin](/developers/plugin-tools).
|
||||
|
||||
## Manage data sources
|
||||
|
||||
@@ -52,7 +53,7 @@ For example, this video demonstrates the visual Prometheus query builder:
|
||||
|
||||
{{< vimeo 720004179 >}}
|
||||
|
||||
For general information about querying in Grafana, and common options and user interface elements across all query editors, refer to [Query and transform data]({{< relref "../panels-visualizations/query-transform-data/" >}}).
|
||||
For general information about querying in Grafana, and common options and user interface elements across all query editors, refer to [Query and transform data][query-transform-data] .
|
||||
|
||||
## Special data sources
|
||||
|
||||
@@ -92,9 +93,6 @@ These built-in core data sources are also included in the Grafana documentation:
|
||||
[alerts]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/alerting"
|
||||
[alerts]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/alerting"
|
||||
|
||||
[build-a-plugin]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/developers/plugins"
|
||||
[build-a-plugin]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/developers/plugins"
|
||||
|
||||
[data-source-management]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/administration/data-source-management"
|
||||
[data-source-management]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/administration/data-source-management"
|
||||
|
||||
|
||||
@@ -63,6 +63,9 @@ For more information, refer to [Azure documentation for role assignments](https:
|
||||
If you host Grafana in Azure, such as in App Service or Azure Virtual Machines, you can configure the Azure Monitor data source to use Managed Identity for secure authentication without entering credentials into Grafana.
|
||||
For details, refer to [Configuring using Managed Identity](#configuring-using-managed-identity).
|
||||
|
||||
You can configure the Azure Monitor data source to use Workload Identity for secure authentication without entering credentials into Grafana if you host Grafana in a Kubernetes environment, such as AKS, and require access to Azure resources.
|
||||
For details, refer to [Configuring using Workload Identity](#configuring-using-workload-identity).
|
||||
|
||||
| Name | Description |
|
||||
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **Authentication** | Enables Managed Identity. Selecting Managed Identity hides many of the other fields. For details, see [Configuring using Managed Identity](#configuring-using-managed-identity). |
|
||||
@@ -114,6 +117,21 @@ datasources:
|
||||
version: 1
|
||||
```
|
||||
|
||||
**Workload Identity:**
|
||||
|
||||
```yaml
|
||||
apiVersion: 1 # config file version
|
||||
|
||||
datasources:
|
||||
- name: Azure Monitor
|
||||
type: grafana-azure-monitor-datasource
|
||||
access: proxy
|
||||
jsonData:
|
||||
azureAuthType: workloadidentity
|
||||
subscriptionId: <subscription-id> # Optional, default subscription
|
||||
version: 1
|
||||
```
|
||||
|
||||
#### Supported cloud names
|
||||
|
||||
| Azure Cloud | `cloudName` Value |
|
||||
@@ -124,8 +142,8 @@ datasources:
|
||||
|
||||
### Configure Managed Identity
|
||||
|
||||
If you host Grafana in Azure, such as an App Service or with Azure Virtual Machines, and have managed identity enabled on your VM, you can use managed identity to configure Azure Monitor in Grafana.
|
||||
This lets you securely authenticate data sources without manually configuring credentials via Azure AD App Registrations for each.
|
||||
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).
|
||||
|
||||
**To enable managed identity for Grafana:**
|
||||
@@ -141,7 +159,46 @@ For details on Azure managed identities, refer to the [Azure documentation](http
|
||||
|
||||
This hides the directory ID, application ID, and client secret fields, and the data source uses managed identity to authenticate to Azure Monitor Metrics and Logs, and Azure Resource Graph.
|
||||
|
||||
{{< figure src="/media/docs/grafana/data-sources/screenshot-managed-identity.png" max-width="800px" class="docs-image--no-shadow" caption="Azure Monitor Metrics screenshot showing Dimensions" >}}
|
||||
{{< figure src="/media/docs/grafana/data-sources/screenshot-managed-identity-2.png" max-width="800px" class="docs-image--no-shadow" caption="Azure Monitor screenshot showing Managed Identity authentication" >}}
|
||||
|
||||
3. You can set the `managed_identity_client_id` field in the `[azure]` section of the [Grafana server configuration][configure-grafana-azure] to allow a user-assigned managed identity to be used instead of the default system-assigned identity.
|
||||
|
||||
```ini
|
||||
[azure]
|
||||
managed_identity_enabled = true
|
||||
managed_identity_client_id = USER_ASSIGNED_IDENTITY_CLIENT_ID
|
||||
```
|
||||
|
||||
### Configure Workload Identity
|
||||
|
||||
You can use workload identity to configure Azure Monitor in Grafana if you host Grafana in a Kubernetes environment, such as AKS, in conjunction with managed identities.
|
||||
This lets you securely authenticate data sources without manually configuring credentials via Azure AD App Registrations.
|
||||
For details on workload identity, refer to the [Azure workload identity documentation](https://azure.github.io/azure-workload-identity/docs/).
|
||||
|
||||
**To enable workload identity for Grafana:**
|
||||
|
||||
1. Set the `workload_identity_enabled` flag in the `[azure]` section of the [Grafana server configuration][configure-grafana-azure].
|
||||
|
||||
```ini
|
||||
[azure]
|
||||
workload_identity_enabled = true
|
||||
```
|
||||
|
||||
2. In the Azure Monitor data source configuration, set **Authentication** to **Workload Identity**.
|
||||
|
||||
This hides the directory ID, application ID, and client secret fields, and the data source uses workload identity to authenticate to Azure Monitor Metrics and Logs, and Azure Resource Graph.
|
||||
|
||||
{{< figure src="/media/docs/grafana/data-sources/screenshot-workload-identity.png" max-width="800px" class="docs-image--no-shadow" caption="Azure Monitor screenshot showing Workload Identity authentication" >}}
|
||||
|
||||
3. There are additional configuration variables that can control the authentication method.`workload_identity_tenant_id` represents the Azure AD tenant that contains the managed identity, `workload_identity_client_id` represents the client ID of the managed identity if it differs from the default client ID, `workload_identity_token_file` represents the path to the token file. Refer to the [documentation](https://azure.github.io/azure-workload-identity/docs/) for more information on what values these variables should use, if any.
|
||||
|
||||
```ini
|
||||
[azure]
|
||||
workload_identity_enabled = true
|
||||
workload_identity_tenant_id = IDENTITY_TENANT_ID
|
||||
workload_identity_client_id = IDENTITY_CLIENT_ID
|
||||
workload_identity_token_file = TOKEN_FILE_PATH
|
||||
```
|
||||
|
||||
## Query the data source
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ keywords:
|
||||
- grafana
|
||||
- elasticsearch
|
||||
- guide
|
||||
- data source
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
@@ -19,17 +20,15 @@ weight: 325
|
||||
|
||||
# Elasticsearch data source
|
||||
|
||||
Grafana ships with built-in support for Elasticsearch.
|
||||
You can make many types of queries to visualize logs or metrics stored in Elasticsearch, and annotate graphs with log events stored in Elasticsearch.
|
||||
Elasticsearch is a search and analytics engine used for a variety of use cases.
|
||||
You can create many types of queries to visualize logs or metrics stored in Elasticsearch, and annotate graphs with log events stored in Elasticsearch.
|
||||
|
||||
This topic explains configuring and querying specific to the Elasticsearch data source.
|
||||
For general documentation on querying data sources in Grafana, see [Query and transform data][query-transform-data].
|
||||
The following will help you get started working with Elasticsearch and Grafana:
|
||||
|
||||
For instructions on how to add a data source to Grafana, refer to the [administration documentation][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.
|
||||
|
||||
Once you've added the Elasticsearch data source, you can [configure it](#configure-the-data-source) so that your Grafana instance's users can create queries in its [query editor]({{< relref "./query-editor" >}}) when they [build dashboards][build-dashboards] and use [Explore][explore].
|
||||
- [What is Elasticsearch?](https://www.elastic.co/guide/en/elasticsearch/reference/current/elasticsearch-intro.html)
|
||||
- [Configure the Elasticsearch data source](/docs/grafana/latest/datasources/elasticsearch/configure-elasticsearch-data-source/)
|
||||
- [Elasticsearch query editor]({{< relref "./query-editor/" >}})
|
||||
- [Elasticsearch template variables]({{< relref "./template-variables/" >}})
|
||||
|
||||
## Supported Elasticsearch versions
|
||||
|
||||
@@ -40,113 +39,7 @@ This data source supports these versions of Elasticsearch:
|
||||
|
||||
Our maintenance policy for Elasticsearch data source is aligned with the [Elastic Product End of Life Dates](https://www.elastic.co/support/eol) and we ensure proper functionality for supported versions. If you are using an Elasticsearch with version that is past its end-of-life (EOL), you can still execute queries, but you will receive a notification in the query builder indicating that the version of Elasticsearch you are using is no longer supported. It's important to note that in such cases, we do not guarantee the correctness of the functionality, and we will not be addressing any related issues.
|
||||
|
||||
## 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 `Elasticsearch` in the search bar.
|
||||
1. Click **Elasticsearch**.
|
||||
|
||||
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 in panels and queries. |
|
||||
| **Default** | Sets the data source that's pre-selected for new panels. |
|
||||
| **Url** | Sets the HTTP protocol, IP, and port of your Elasticsearch server. |
|
||||
| **Access** | Don't modify Access. Use `Server (default)` or the data source won't work. |
|
||||
|
||||
You must also configure settings specific to the Elasticsearch data source. These options are described in the sections below.
|
||||
|
||||
### Index settings
|
||||
|
||||
{{< figure src="/static/img/docs/elasticsearch/elasticsearch-ds-details-7-4.png" max-width="500px" class="docs-image--right" caption="Elasticsearch data source details" >}}
|
||||
|
||||
Use the index settings to specify a default for the `time field` and your Elasticsearch index's name.
|
||||
You can use a time pattern, such as `YYYY.MM.DD`, or a wildcard for the index name.
|
||||
|
||||
### Configure Min time interval
|
||||
|
||||
The **Min time interval** setting defines a lower limit for the auto group-by time interval.
|
||||
|
||||
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 Elasticsearch write frequency.
|
||||
For example, set this to `1m` if Elasticsearch writes data every minute.
|
||||
|
||||
You can also override this setting in a dashboard panel under its data source options.
|
||||
|
||||
### X-Pack enabled
|
||||
|
||||
Toggle this to enable `X-Pack`-specific features and options, which provide the [query editor]({{< relref "./query-editor" >}}) with additional aggregations, such as `Rate` and `Top Metrics`.
|
||||
|
||||
#### Include frozen indices
|
||||
|
||||
When the "X-Pack enabled" setting is active and the configured Elasticsearch version is higher than `6.6.0`, you can configure Grafana to not ignore [frozen indices](https://www.elastic.co/guide/en/elasticsearch/reference/7.13/frozen-indices.html) when performing search requests.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Frozen indices are [deprecated in Elasticsearch](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/frozen-indices.html) since v7.14.
|
||||
{{% /admonition %}}
|
||||
|
||||
### Logs
|
||||
|
||||
You can optionally configure the two Logs parameters **Message field name** and **Level field name** to determine which fields the data source uses for log messages and log levels when visualizing logs in [Explore][explore].
|
||||
|
||||
For example, if you're using a default setup of Filebeat for shipping logs to Elasticsearch, set:
|
||||
|
||||
- **Message field name:** `message`
|
||||
- **Level field name:** `fields.level`
|
||||
|
||||
### Data links
|
||||
|
||||
Data links create a link from a specified field that can be accessed in Explore's logs view.
|
||||
|
||||
Each data link configuration consists of:
|
||||
|
||||
| Parameter | Description |
|
||||
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **Field** | Sets the name of the field used by the data link. |
|
||||
| **URL/query** | Sets the full link URL if the link is external. If the link is internal, this input serves as a query for the target data source.<br/>In both cases, you can interpolate the value from the field with the `${__value.raw }` macro. |
|
||||
| **URL Label** | (Optional) Sets a custom display label for the link. The link label defaults to the full external URL or name of the linked internal data source and is overridden by this setting. |
|
||||
| **Internal link** | Sets whether the link is internal or external. For an internal link, you can select the target data source with a data source selector. This supports only tracing data sources. |
|
||||
|
||||
### Configure Amazon Elasticsearch Service
|
||||
|
||||
If you use Amazon Elasticsearch Service, you can use Grafana's Elasticsearch data source to visualize data from it.
|
||||
|
||||
If you use an AWS Identity and Access Management (IAM) policy to control access to your Amazon Elasticsearch Service domain, you must use AWS Signature Version 4 (AWS SigV4) to sign all requests to that domain.
|
||||
|
||||
For details on AWS SigV4, refer to the [AWS documentation](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html).
|
||||
|
||||
#### AWS Signature Version 4 authentication
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Available in Grafana v7.3 and higher.
|
||||
{{% /admonition %}}
|
||||
|
||||
To sign requests to your Amazon Elasticsearch Service domain, you can enable SigV4 in Grafana's [configuration][configure-grafana-sigv4-auth-enabled].
|
||||
|
||||
Once AWS SigV4 is enabled, you can configure it on the Elasticsearch data source configuration page.
|
||||
For more information about AWS authentication options, refer to [AWS authentication]({{< relref "../aws-cloudwatch/aws-authentication" >}}).
|
||||
|
||||
{{< figure src="/static/img/docs/v73/elasticsearch-sigv4-config-editor.png" max-width="500px" class="docs-image--no-shadow" caption="SigV4 configuration for AWS Elasticsearch Service" >}}
|
||||
|
||||
### Provision the data source
|
||||
## 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][provisioning-data-sources].
|
||||
@@ -157,9 +50,9 @@ You should now use the `index` field in `jsonData` to store the index name.
|
||||
Please see the examples below.
|
||||
{{% /admonition %}}
|
||||
|
||||
#### Provisioning examples
|
||||
### Provisioning examples
|
||||
|
||||
**Basic provisioning:**
|
||||
**Basic provisioning**
|
||||
|
||||
```yaml
|
||||
apiVersion: 1
|
||||
@@ -175,7 +68,7 @@ datasources:
|
||||
timeField: '@timestamp'
|
||||
```
|
||||
|
||||
**Provision for logs:**
|
||||
**Provision for logs**
|
||||
|
||||
```yaml
|
||||
apiVersion: 1
|
||||
@@ -197,6 +90,27 @@ datasources:
|
||||
url: '$${__value.raw}' # Careful about the double "$$" because of env var expansion
|
||||
```
|
||||
|
||||
## Configure Amazon Elasticsearch Service
|
||||
|
||||
If you use Amazon Elasticsearch Service, you can use Grafana's Elasticsearch data source to visualize data from it.
|
||||
|
||||
If you use an AWS Identity and Access Management (IAM) policy to control access to your Amazon Elasticsearch Service domain, you must use AWS Signature Version 4 (AWS SigV4) to sign all requests to that domain.
|
||||
|
||||
For details on AWS SigV4, refer to the [AWS documentation](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html).
|
||||
|
||||
### AWS Signature Version 4 authentication
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Available in Grafana v7.3 and higher.
|
||||
{{% /admonition %}}
|
||||
|
||||
To sign requests to your Amazon Elasticsearch Service domain, you can enable SigV4 in Grafana's [configuration]({{< relref "../../setup-grafana/configure-grafana/#sigv4_auth_enabled" >}}).
|
||||
|
||||
Once AWS SigV4 is enabled, you can configure it on the Elasticsearch data source configuration page.
|
||||
For more information about AWS authentication options, refer to [AWS authentication]({{< relref "../aws-cloudwatch/aws-authentication/" >}}).
|
||||
|
||||
{{< figure src="/static/img/docs/v73/elasticsearch-sigv4-config-editor.png" max-width="500px" class="docs-image--no-shadow" caption="SigV4 configuration for AWS Elasticsearch Service" >}}
|
||||
|
||||
## Query the data source
|
||||
|
||||
You can select multiple metrics and group by multiple terms or filters when using the Elasticsearch query editor.
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
---
|
||||
aliases:
|
||||
- ../data-sources/elasticsearch/
|
||||
- ../features/datasources/elasticsearch/
|
||||
description: Guide for configuring the Elasticsearch data source in Grafana
|
||||
keywords:
|
||||
- grafana
|
||||
- elasticsearch
|
||||
- guide
|
||||
- data source
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
menuTitle: Configure Elasticsearch
|
||||
title: Configure the Elasticsearch data source
|
||||
weight: 200
|
||||
---
|
||||
|
||||
# Configure the Elasticsearch data source
|
||||
|
||||
Grafana ships with built-in support for Elasticsearch.
|
||||
You can make many types of queries to visualize logs or metrics stored in Elasticsearch, and annotate graphs with log events stored in Elasticsearch.
|
||||
|
||||
For general documentation on querying data sources in Grafana, see [Query and transform data]({{< relref "../../panels-visualizations/query-transform-data" >}}).
|
||||
|
||||
For instructions on how to add a data source to Grafana, refer to the [administration documentation]({{< relref "../../administration/data-source-management/" >}}).
|
||||
Only users with the organization administrator role can add data sources.
|
||||
Administrators can also [configure the data source via YAML]({{< relref "#provision-the-data-source" >}}) with Grafana's provisioning system.
|
||||
|
||||
## Configure the data source
|
||||
|
||||
To add the Elasticsearch data source, complete the following steps:
|
||||
|
||||
1. Click **Connections** in the left-side menu.
|
||||
1. Under **Connections**, click **Add new connection**.
|
||||
1. Enter `Elasticsearch` in the search bar.
|
||||
1. Select **Elasticsearch data source**.
|
||||
1. Click **Create a Elasticsearch data source** in the upper right.
|
||||
|
||||
You will be taken to the **Settings** tab where you will set up your Elasticsearch configuration.
|
||||
|
||||
## Configuration options
|
||||
|
||||
The following is a list of configuration options for Elasticsearch.
|
||||
|
||||
The first option to configure is the name of your connection:
|
||||
|
||||
- **Name** - The data source name. This is how you refer to the data source in panels and queries. Examples: elastic-1, elasticsearch_metrics.
|
||||
|
||||
- **Default** - Toggle to select as the default data source option. When you go to a dashboard panel or Explore, this will be the default selected data source.
|
||||
|
||||
### HTTP section
|
||||
|
||||
- **URL** - The URL of your Elasticsearch server. If your Elasticsearch server is local, use `<http://localhost:9200>`. If it is on a server within a network, this is the URL with port where you are running Elasticsearch. Example: `<http://elasticsearch.example.orgname:9200>`.
|
||||
|
||||
- **Allowed cookies** - Specify cookies by name that should be forwarded to the data source. The Grafana proxy deletes all forwarded cookies by default.
|
||||
|
||||
- **Timeout** - The HTTP request timeout. This must be in seconds. There is no default, so this setting is up to you.
|
||||
|
||||
### Auth section
|
||||
|
||||
There are several authentication methods you can choose in the Authentication section.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Use TLS (Transport Layer Security) for an additional layer of security when working with Elasticsearch. For information on setting up TLS encryption with Elasticsearch see [Configure TLS](https://www.elastic.co/guide/en/elasticsearch/reference/8.8/configuring-tls.html#configuring-tls). You must add TLS settings to your Elasticsearch configuration file **prior** to setting these options in Grafana.
|
||||
{{% /admonition %}}
|
||||
|
||||
- **Basic authentication** - The most common authentication method. Use your `data source` user name and `data source` password to connect.
|
||||
|
||||
- **With credentials** - Toggle to enable credentials such as cookies or auth headers to be sent with cross-site requests.
|
||||
|
||||
- **TLS client authentication** - Toggle to use client authentication. When enabled, add the `Server name`, `Client cert` and `Client key`. The client provides a certificate that is validated by the server to establish the client's trusted identity. The client key encrypts the data between client and server.
|
||||
|
||||
- **With CA cert** - Toggle to authenticate with a CA certificate. Follow the instructions of the CA (Certificate Authority) to download the certificate file.
|
||||
|
||||
- **Skip TLS verify** - Toggle on to bypass TLS certificate validation.
|
||||
|
||||
- **Forward OAuth identity** - Forward the OAuth access token (and the OIDC ID token if available) of the user querying the data source.
|
||||
|
||||
### Custom HTTP headers
|
||||
|
||||
- **Header** - Add a custom header. This allows custom headers to be passed based on the needs of your Elasticsearch instance.
|
||||
|
||||
- **Value** - The value of the header.
|
||||
|
||||
### Elasticsearch details
|
||||
|
||||
The following settings are specific to the Elasticsearch data source.
|
||||
|
||||
- **Index name** - Use the index settings to specify a default for the `time field` and your Elasticsearch index's name. You can use a time pattern, such as `YYYY.MM.DD`, or a wildcard for the index name.
|
||||
|
||||
- **Pattern** - Select the matching pattern if using one in your index name. Options include:
|
||||
|
||||
- no pattern
|
||||
- hourly
|
||||
- daily
|
||||
- weekly
|
||||
- monthly
|
||||
- yearly
|
||||
|
||||
- **Time field name** - Name of the time field. The default value is @timestamp. You can enter a different name.
|
||||
|
||||
- **Max concurrent shard requests** - Sets the number of shards being queried at the same time. The default is `5`. For more information on shards see [Elasticsearch's documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.9/scalability.html#scalability).
|
||||
|
||||
- **Min time interval** - Defines a lower limit for the auto group-by time interval. 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 Elasticsearch write frequency.
|
||||
For example, set this to `1m` if Elasticsearch writes data every minute.
|
||||
|
||||
You can also override this setting in a dashboard panel under its data source options. The default is `10s`.
|
||||
|
||||
- **X-Pack enabled** - Toggle to enable `X-Pack`-specific features and options, which provide the [query editor]({{< relref "./query-editor/" >}}) with additional aggregations, such as `Rate` and `Top Metrics`.
|
||||
|
||||
- **Include frozen indices** - Toggle on when the `X-Pack enabled` setting is active. You can configure Grafana to include [frozen indices](https://www.elastic.co/guide/en/elasticsearch/reference/7.13/frozen-indices.html) when performing search requests.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Frozen indices are [deprecated in Elasticsearch](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/frozen-indices.html) since v7.14.
|
||||
{{% /admonition %}}
|
||||
|
||||
### Logs
|
||||
|
||||
In this section you can configure which fields the data source uses for log messages and log levels.
|
||||
|
||||
- **Message field name:** - Grabs the actual log message from the default source.
|
||||
|
||||
- **Level field name:** - Name of the field with log level/severity information. When a level label is specified, the value of this label is used to determine the log level and update the color of each log line accordingly. If the log doesn’t have a specified level label, we try to determine if its content matches any of the [supported expressions](/docs/grafana/latest/explore/logs-integration/#log-level). The first match always determines the log level. If Grafana cannot infer a log-level field, it will be visualized with an unknown log level.
|
||||
|
||||
### Data links
|
||||
|
||||
Data links create a link from a specified field that can be accessed in Explore's logs view. You can add multiple data links
|
||||
|
||||
Each data link configuration consists of:
|
||||
|
||||
- **Field** - Sets the name of the field used by the data link.
|
||||
|
||||
- **URL/query** - Sets the full link URL if the link is external. If the link is internal, this input serves as a query for the target data source.<br/>In both cases, you can interpolate the value from the field with the `${__value.raw }` macro.
|
||||
|
||||
- **URL Label** (Optional) - Sets a custom display label for the link. The link label defaults to the full external URL or name of the linked internal data source and is overridden by this setting.
|
||||
|
||||
- **Internal link** - Toggle on to set an internal link. For an internal link, you can select the target data source with a data source selector. This supports only tracing data sources.
|
||||
@@ -15,6 +15,7 @@ labels:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
- data source
|
||||
menuTitle: Query editor
|
||||
title: Elasticsearch query editor
|
||||
weight: 300
|
||||
@@ -22,52 +23,128 @@ weight: 300
|
||||
|
||||
# Elasticsearch query editor
|
||||
|
||||
{{< figure src="/static/img/docs/elasticsearch/query-editor-7-4.png" max-width="500px" class="docs-image--no-shadow" caption="Elasticsearch Query Editor" >}}
|
||||
Grafana provides a query editor for Elasticsearch. Elasticsearch queries are in Lucene format. See [Query string syntax](https://www.elastic.co/guide/en/elasticsearch/reference/8.9/query-dsl-query-string-query.html#query-string-syntax) if you are new to working with Elasticsearch.
|
||||
|
||||
This topic explains querying specific to the Elasticsearch data source.
|
||||
For general documentation on querying data sources in Grafana, see [Query and transform data][query-transform-data].
|
||||
{{< figure src="/static/img/docs/elasticsearch/elastic-query-editor-10.1.png" max-width="800px" class="docs-image--no-shadow" caption="Elasticsearch query editor" >}}
|
||||
|
||||
## Select and edit metrics
|
||||
For general documentation on querying data sources in Grafana, including options and functions common to all query editors, see [Query and transform data]({{< relref "../../../panels-visualizations/query-transform-data" >}}).
|
||||
|
||||
## Aggregation types
|
||||
|
||||
Elasticsearch groups aggregations into three categories:
|
||||
|
||||
- **Bucket** - Bucket aggregations don't calculate metrics, they create buckets of documents based on field values, ranges and a variety of other criteria. See [Bucket aggregations](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket.html) for additional information. Use bucket aggregations under `Group by` when creating a metrics query in the query builder.
|
||||
|
||||
- **Metrics** - Metrics aggregations perform calculations such as sum, average, min, etc. They can be single-value or multi-value. See [Metrics aggregations](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics.html) for additional information. Use metrics aggregations in the metrics query type in the query builder.
|
||||
|
||||
- **Pipeline** - Elasticsearch pipeline aggregations work with inputs or metrics created from other aggregations (not documents or fields). There are parent and sibling and sibling pipeline aggregations. See [Pipeline aggregations](https://www.elastic.co/guide/en/elasticsearch/reference/8.9/search-aggregations-pipeline.html) for additional information.
|
||||
|
||||
## Common options
|
||||
|
||||
There are several different types of queries you can create using the Elasticsearch query editor. The following options are available for all query types.
|
||||
|
||||
### Add query
|
||||
|
||||
Regardless of query type, you can create multiple queries by clicking **+ Add query**.
|
||||
|
||||
### Query inspector
|
||||
|
||||
Click **Query inspector** to get detailed statistics regarding your query. Query inspector functions as a kind of debugging tool that "inspects" your query. It provides query statistics under **Stats**, request response time under **Query**, data frame details under **{} JSON**, and the shape of your data under **Data**.
|
||||
|
||||
## Select a query type
|
||||
|
||||
There are three types of queries you can create with the Elasticsearch query builder. Each type is explained in detail below.
|
||||
|
||||
### Metrics query type
|
||||
|
||||
Metrics queries aggregate data and produce a variety of calculations such as count, min, max, etc. Click on the metric box to view a list of options in the dropdown menu. The default is `count`.
|
||||
|
||||
- **Alias** - Aliasing only applies to **time series queries**, where the last group is `date histogram`. This is ignored for any other type of query.
|
||||
|
||||
- **Metric** - Metrics aggregations include:
|
||||
|
||||
- count - see [Value count aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/8.9/search-aggregations-metrics-valuecount-aggregation.html)
|
||||
- average - see [Avg aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/8.9/search-aggregations-metrics-rate-aggregation.html)
|
||||
- sum - see [Sum aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-sum-aggregation.html)
|
||||
- max - see [Max aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/8.9/search-aggregations-metrics-max-aggregation.html)
|
||||
- min - see [Min aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/8.9/search-aggregations-metrics-min-aggregation.html)
|
||||
- extended stats - see [Extended stats aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-extendedstats-aggregation.html)
|
||||
- percentiles - see [Percentiles aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/8.9/search-aggregations-metrics-percentile-aggregation.html)
|
||||
- unique count - see [Cardinlaity aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/8.9/search-aggregations-metrics-cardinality-aggregation.html)
|
||||
- top metrics - see [Top metrics aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/8.9/search-aggregations-metrics-top-metrics.html)
|
||||
- rate - see [Rate aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/8.9/search-aggregations-metrics-rate-aggregation.html)
|
||||
|
||||
You can select multiple metrics and group by multiple terms or filters when using the Elasticsearch query editor.
|
||||
|
||||
Use the plus and minus icons to the right to add and remove metrics or group by clauses.
|
||||
To expand the row to view and edit any available metric or group-by options, click the option text.
|
||||
Use the **plus icon** to the right to add multiple metrics to your query. Click on the **eye icon** next to "Metric" to hide metrics, and the **garbage can icon** to remove metrics.
|
||||
|
||||
- **Group by options** - Create multiple group by options when constructing your Elasticsearch query. Date histogram is the default option. Below is a list of options in the dropdown menu.
|
||||
|
||||
- terms - see [Terms aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html).
|
||||
- filter - see [Filter aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-filter-aggregation.html).
|
||||
- geo hash grid - see [Geohash grid aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-geohashgrid-aggregation.html).
|
||||
- date histogram - for time series queries. See [Date histogram aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-datehistogram-aggregation.html).
|
||||
- histogram - Depicts frequency distributions. See [Histogram aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-histogram-aggregation.html).
|
||||
- nested (experimental) - See [Nested aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-nested-aggregation.html).
|
||||
|
||||
Each group by option will have a different subset of options to further narrow your query.
|
||||
|
||||
The following options are specific to the **date histogram** bucket aggregation option.
|
||||
|
||||
- **Time field** - Depicts date data options. The default option can be specified when configuring the Elasticsearch data source in the **Time field name** under the [**Elasticsearch details**](/docs/grafana/latest/datasources/elasticsearch/configure-elasticsearch-data-source/#elasticsearch-details) section. Otherwise **@timestamp** field will be used as a default option.
|
||||
- **Interval** - Group by a type of interval. There are option to choose from the dropdown menu to select seconds, minutes, hours or day. You can also add a custom interval such as `30d` (30 days). `Auto` is the default option.
|
||||
- **Min doc count** - The minimum amount of data to include in your query. The default is `0`.
|
||||
- **Thin edges** - Select to trim edges on the time series data points. The default is `0`.
|
||||
- **Offset** - Changes the start value of each bucket by the specified positive(+) or negative (-) offset duration. Examples include `1h` for 1 hour, `5s` for 5 seconds or `1d` for 1 day.
|
||||
- **Timezone** - Select a timezone from the dropdown menu. The default is `Coordinated universal time`.
|
||||
|
||||
Configure the following options for the **terms** bucket aggregation option:
|
||||
|
||||
- **Order** - Sets the order of data. Options are `top` or `bottom.`
|
||||
- **Size** - Limits the number of documents, or size of the data set. You can set a custom number or `no limit`.
|
||||
- **Min doc count** - The minimum amount of data to include in your query. The default is `0`.
|
||||
- **Order by** - Order terms by `term value`, `doc count` or `count`.
|
||||
- **Missing** - Defines how documents missing a value should be treated. Missing values are ignored by default, but they can be treated as if they had a value. See [Missing value](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#_missing_value_5) in Elasticsearch's documentation for more information.
|
||||
|
||||
Configure the following options for the **filters** bucket aggregation option:
|
||||
|
||||
- **Query** - Specify the query to create a bucket of documents (data). Examples are `hostname:"hostname1"`, `product:"widget5"`. Use the \* wildcard to match any number of characters.
|
||||
- **Label** - Add a label or name to the bucket.
|
||||
|
||||
Configure the following options for the **geo hash grid** bucket aggregation option:
|
||||
|
||||
- **Precision** - Specifies the number of characters of the geo hash.
|
||||
|
||||
Configure the following options for the **histogram** bucket aggregation option:
|
||||
|
||||
- **Interval** - Group by a type of interval. There are option to choose from the dropdown menu to select seconds, minutes, hours or day. You can also add a custom interval such as `30d` (30 days). `Auto` is the default option.
|
||||
- **Min doc count** - The minimum amount of data to include in your query. The default is `0`
|
||||
|
||||
The **nested** group by option is currently experimental, you can select a field and then settings specific to that field.
|
||||
|
||||
Click the **+ sign** to add multiple group by options. The data will grouped in order (first by, then by).
|
||||
|
||||
{{< figure src="/static/img/docs/elasticsearch/group-by-then-by-10.2.png" max-width="850px" class="docs-image--no-shadow" caption="Group by options" >}}
|
||||
|
||||
### Logs query type
|
||||
|
||||
Logs queries analyze Elasticsearch log data. You can configure the following options:
|
||||
|
||||
- **Logs Options/Limit** - Limits the number of logs to analyze. The default is `500`.
|
||||
|
||||
### Raw data query type
|
||||
|
||||
Run a raw data query to retrieve a table of all fields that are associated with each log line.
|
||||
|
||||
- **Raw data size** - Number of raw data documents. You can specify a different amount. The default is `500`.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
The option to run a **raw document query** is deprecated as of Grafana v10.1.
|
||||
{{% /admonition %}}
|
||||
|
||||
## Use template variables
|
||||
|
||||
You can also augment queries by using [template variables]({{< relref "./template-variables" >}}).
|
||||
|
||||
## Name a time series
|
||||
|
||||
You can control the name for time series via the `Alias` input field.
|
||||
|
||||
| Pattern | Replacement value |
|
||||
| -------------------- | -------------------------------------- |
|
||||
| `{{term fieldname}}` | Value of a term group-by |
|
||||
| `{{metric}}` | Metric name, such as Average, Min, Max |
|
||||
| `{{field}}` | Metric field name |
|
||||
|
||||
## Control pipeline metrics visibility
|
||||
|
||||
Some metric aggregations, such as _Moving Average_ and _Derivative_, are called **Pipeline** aggregations.
|
||||
Elasticsearch pipeline metrics must be based on another metric.
|
||||
Use the eye icon next to the metric to prevent metrics from appearing in the graph.
|
||||
This is useful for metrics you only have in the query for use in a pipeline metric.
|
||||
|
||||
{{< figure src="/static/img/docs/elasticsearch/pipeline-aggregation-editor-7-4.png" max-width="500px" class="docs-image--no-shadow" caption="Pipeline aggregation editor" >}}
|
||||
|
||||
## Create a query
|
||||
|
||||
Write the query using a custom JSON string, with the field mapped as a [keyword](https://www.elastic.co/guide/en/elasticsearch/reference/current/keyword.html#keyword) in the Elasticsearch index mapping.
|
||||
|
||||
If the query is [multi-field](https://www.elastic.co/guide/en/elasticsearch/reference/current/multi-fields.html) with both a `text` and `keyword` type, use `"field":"fieldname.keyword"` (sometimes `fieldname.raw`) to specify the keyword field in your query.
|
||||
|
||||
| Query | Description |
|
||||
| ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `{"find": "fields", "type": "keyword"}` | Returns a list of field names with the index type `keyword`. |
|
||||
| `{"find": "terms", "field": "hostname.keyword", "size": 1000}` | Returns a list of values for a keyword using term aggregation. Query will use current dashboard time range as time range query. |
|
||||
| `{"find": "terms", "field": "hostname", "query": '<Lucene query>'}` | Returns a list of values for a keyword field using term aggregation and a specified Lucene query filter. Query will use current dashboard time range as time range for query. |
|
||||
You can also augment queries by using [template variables]({{< relref "./template-variables/" >}}).
|
||||
|
||||
Queries of `terms` have a 500-result limit by default.
|
||||
To set a custom limit, set the `size` property in your query.
|
||||
|
||||
@@ -72,6 +72,21 @@ The example also uses a variable in the _Terms_ group by field input box, which
|
||||
|
||||
To view an example dashboard on Grafana Play, see the [Elasticsearch Templated Dashboard](https://play.grafana.org/d/z8OZC66nk/elasticsearch-8-2-0-sample-flight-data?orgId=1).
|
||||
|
||||
## Create a query
|
||||
|
||||
Write the query using a custom JSON string, with the field mapped as a [keyword](https://www.elastic.co/guide/en/elasticsearch/reference/current/keyword.html#keyword) in the Elasticsearch index mapping.
|
||||
|
||||
If the query is [multi-field](https://www.elastic.co/guide/en/elasticsearch/reference/current/multi-fields.html) with both a `text` and `keyword` type, use `"field":"fieldname.keyword"` (sometimes `fieldname.raw`) to specify the keyword field in your query.
|
||||
|
||||
| Query | Description |
|
||||
| ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `{"find": "fields", "type": "keyword"}` | Returns a list of field names with the index type `keyword`. |
|
||||
| `{"find": "terms", "field": "hostname.keyword", "size": 1000}` | Returns a list of values for a keyword using term aggregation. Query will use current dashboard time range as time range query. |
|
||||
| `{"find": "terms", "field": "hostname", "query": '<Lucene query>'}` | Returns a list of values for a keyword field using term aggregation and a specified Lucene query filter. Query will use current dashboard time range as time range for query. |
|
||||
|
||||
Queries of `terms` have a 500-result limit by default.
|
||||
To set a custom limit, set the `size` property in your query.
|
||||
|
||||
{{% docs/reference %}}
|
||||
[add-template-variables-multi-value-variables]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/variables/add-template-variables#multi-value-variables"
|
||||
[add-template-variables-multi-value-variables]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/variables/add-template-variables#multi-value-variables"
|
||||
|
||||
@@ -139,7 +139,7 @@ The default values for "cloud monitoring auto" are:
|
||||
|
||||
The other automatic option is "grafana auto", which automatically sets the Group By time depending on the time range chosen and width of the time series panel.
|
||||
|
||||
For more information about "grafana auto", refer to [Interval variable]({{< relref "../../../dashboards/variables/add-template-variables/#add-an-interval-variable" >}}).
|
||||
For more information about "grafana auto", refer to [Interval variable][add-template-variables-add-interval-variable].
|
||||
|
||||
You can also choose fixed time intervals to group by, like `1h` or `1d`.
|
||||
|
||||
@@ -305,6 +305,9 @@ Example result: `monitoring.googleapis.com/uptime_check/http_status has this val
|
||||
| `{{resource.label.xxx}}` | Returns the resource label value. | `{{resource.label.zone}}` | `us-east1-b` |
|
||||
|
||||
{{% docs/reference %}}
|
||||
[add-template-variables-add-interval-variable]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/variables/add-template-variables#add-an-interval-variable"
|
||||
[add-template-variables-add-interval-variable]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/variables/add-template-variables#add-an-interval-variable"
|
||||
|
||||
[annotate-visualizations]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/build-dashboards/annotate-visualizations"
|
||||
[annotate-visualizations]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/build-dashboards/annotate-visualizations"
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ weight: 700
|
||||
|
||||
# InfluxDB data source
|
||||
|
||||
{{< docs/shared "influxdb/intro.md" >}}
|
||||
{{< docs/shared lookup="influxdb/intro.md" source="grafana" version="<GRAFANA VERSION>" >}}
|
||||
|
||||
Grafana includes built-in support for InfluxDB.
|
||||
This topic explains options, variables, querying, and other features specific to the InfluxDB data source, which include its [feature-rich code editor for queries and visual query builder]({{< relref "./query-editor" >}}).
|
||||
|
||||
@@ -43,7 +43,7 @@ SHOW TAG VALUES WITH KEY = "hostname"
|
||||
|
||||
### Chain or nest variables
|
||||
|
||||
You can also create nested variables, sometimes called [chained variables]({{< relref "../../../dashboards/variables/add-template-variables#chained-variables" >}}).
|
||||
You can also create nested variables, sometimes called [chained variables][add-template-variables-chained-variables].
|
||||
|
||||
For example, if you had a variable called `region`, you could have the `hosts` variable show only hosts from the selected region with a query like:
|
||||
|
||||
@@ -90,6 +90,9 @@ When you enable the **Multi-value** or **Include all value** options, Grafana co
|
||||
To view an example templated dashboard, refer to [InfluxDB Templated Dashboard](https://play.grafana.org/dashboard/db/influxdb-templated).
|
||||
|
||||
{{% docs/reference %}}
|
||||
[add-template-variables-chained-variables]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/variables/add-template-variables#chained-variables"
|
||||
[add-template-variables-chained-variables]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/variables/add-template-variables#chained-variables"
|
||||
|
||||
[add-template-variables-add-ad-hoc-filters]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/variables/add-template-variables#add-ad-hoc-filters"
|
||||
[add-template-variables-add-ad-hoc-filters]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/variables/add-template-variables#add-ad-hoc-filters"
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ The resulting table panel:
|
||||
If you set the **Format** setting in the query editor 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.
|
||||
Result sets of time series queries must also be sorted by time for panels to properly visualize the result.
|
||||
|
||||
A time series query result is returned in a [wide data frame format][data-frames-wide-format].
|
||||
A time series query result is returned in a [wide data frame format](/developers/plugin-tools/introduction/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.
|
||||
|
||||
@@ -552,9 +552,6 @@ EXEC dbo.sp_test_datetime @from, @to
|
||||
[configure-standard-options-display-name]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/panels-visualizations/configure-standard-options#display-name"
|
||||
[configure-standard-options-display-name]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/panels-visualizations/configure-standard-options#display-name"
|
||||
|
||||
[data-frames-wide-format]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/developers/plugins/introduction-to-plugin-development/data-frames#wide-format"
|
||||
[data-frames-wide-format]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/developers/plugins/introduction-to-plugin-development/data-frames#wide-format"
|
||||
|
||||
[query-transform-data]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/panels-visualizations/query-transform-data"
|
||||
[query-transform-data]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/panels-visualizations/query-transform-data"
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ datasources:
|
||||
password: ${GRAFANA_MYSQL_PASSWORD}
|
||||
```
|
||||
|
||||
##### Using TLS Verificaiton
|
||||
##### Using TLS verification
|
||||
|
||||
```yaml
|
||||
apiVersion: 1
|
||||
@@ -297,7 +297,7 @@ The examples in this section query the following table:
|
||||
|
||||
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][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.
|
||||
A time series query result is returned in a [wide data frame format](https://grafana.com/developers/plugin-tools/introduction/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.
|
||||
|
||||
@@ -567,9 +567,6 @@ Time series queries should work in alerting conditions. Table formatted queries
|
||||
[configure-standard-options-display-name]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/panels-visualizations/configure-standard-options#display-name"
|
||||
[configure-standard-options-display-name]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/panels-visualizations/configure-standard-options#display-name"
|
||||
|
||||
[data-frames-wide-format]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/developers/plugins/introduction-to-plugin-development/data-frames#wide-format"
|
||||
[data-frames-wide-format]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/developers/plugins/introduction-to-plugin-development/data-frames#wide-format"
|
||||
|
||||
[data-source-management]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/administration/data-source-management"
|
||||
[data-source-management]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/administration/data-source-management"
|
||||
|
||||
|
||||
@@ -232,7 +232,7 @@ The resulting table panel:
|
||||
|
||||
If you set Format as 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][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.
|
||||
A time series query result is returned in a [wide data frame format](https://grafana.com/developers/plugin-tools/introduction/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.
|
||||
|
||||
@@ -492,9 +492,6 @@ conditions.
|
||||
[configure-standard-options-display-name]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/panels-visualizations/configure-standard-options#display-name"
|
||||
[configure-standard-options-display-name]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/panels-visualizations/configure-standard-options#display-name"
|
||||
|
||||
[data-frames-wide-format]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/developers/plugins/introduction-to-plugin-development/data-frames#wide-format"
|
||||
[data-frames-wide-format]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/developers/plugins/introduction-to-plugin-development/data-frames#wide-format"
|
||||
|
||||
[data-source-management]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/administration/data-source-management"
|
||||
[data-source-management]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/administration/data-source-management"
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ For instructions on how to add a data source to Grafana, refer to the [administr
|
||||
Only users with the organization `administrator` role can add data sources and edit existing data sources.
|
||||
Administrators can also [configure the data source via YAML](#provision-the-data-source) with Grafana's provisioning system.
|
||||
|
||||
Once you've added the Prometheus data source, you can [configure it][configure-prometheus-data-source] so that your Grafana instance's users can create queries in its [query editor]({{< relref "./query-editor" >}}) when they [build dashboards][build-dashboards], use [Explore][explore], and [annotate visualizations]({{< relref "./query-editor#apply-annotations" >}}).
|
||||
Once you've added the Prometheus data source, you can [configure it][configure-prometheus-data-source] so that your Grafana instance's users can create queries in its [query editor]({{< relref "./query-editor" >}}) when they [build dashboards][build-dashboards], use [Explore][explore], and [annotate visualizations][annotate visualizations].
|
||||
|
||||
The following guides will help you get started with the Prometheus data source:
|
||||
|
||||
@@ -193,4 +193,8 @@ The Prometheus data source can be configured to disable recording rules under th
|
||||
|
||||
[set-up-grafana-monitoring]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/setup-grafana/set-up-grafana-monitoring"
|
||||
[set-up-grafana-monitoring]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/setup-grafana/set-up-grafana-monitoring"
|
||||
|
||||
[annotate visualizations]: "/docs/grafana/ -> /docs/grafana/<GRAFANA_VERSION>/dashboards/build-dashboards/annotate-visualizations"
|
||||
[annotate visualizations]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/visualizations/dashboards/build-dashboards/annotate-visualizations"
|
||||
|
||||
{{% /docs/reference %}}
|
||||
|
||||
@@ -80,7 +80,7 @@ This setting supports the `$__interval` and `$__rate_interval` macros.
|
||||
|
||||
Switch between the following format options:
|
||||
|
||||
- **Time series** - The default time series format. See [Time series kind formats](https://grafana.com/developers/dataplane/timeseries/) for information on time series data frames and how time and value fields are structured.
|
||||
- **Time series** - The default time series format. See [Time series kind formats](/developers/dataplane/timeseries/) for information on time series data frames and how time and value fields are structured.
|
||||
- **Table** - This works only in a [Table panel][table].
|
||||
- **Heatmap** - Displays metrics of the Histogram type on a [Heatmap panel][heatmap] by converting cumulative histograms to regular ones and sorting the series by the bucket bound.
|
||||
|
||||
|
||||
@@ -26,383 +26,9 @@ For instructions on how to add a data source to Grafana, refer to the [administr
|
||||
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.
|
||||
|
||||
Once you've added the data source, you can [configure it](#configure-the-data-source) so that your Grafana instance's users can create queries in its [query editor]({{< relref "./query-editor/" >}}) when they [build dashboards][build-dashboards] and use [Explore][explore].
|
||||
Once you've added the data source, you can [configure it]({{< relref "./configure-tempo-data-source/" >}}) so that your Grafana instance's users can create queries in its [query editor]({{< relref "./query-editor/" >}}) when they [build dashboards][build-dashboards] and use [Explore][explore].
|
||||
|
||||
You can also [use the Service Graph](#use-the-service-graph) to view service relationships, [track RED metrics](#open-the-service-graph-view), [upload a JSON trace file](#upload-a-json-trace-file), [link to a trace ID from logs](#link-to-a-trace-id-from-logs), and [link to a trace ID from metrics](#link-to-a-trace-id-from-metrics).
|
||||
|
||||
## 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 `Tempo` in the search bar.
|
||||
1. Select **Tempo**.
|
||||
|
||||
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 in panels and queries. |
|
||||
| **Default** | Sets the data source that's pre-selected for new panels. |
|
||||
| **URL** | Sets the URL of the Tempo instance, such as `http://tempo`. |
|
||||
| **Basic Auth** | Enables basic authentication to the Tempo data source. |
|
||||
| **User** | Sets the user name for basic authentication. |
|
||||
| **Password** | Sets the password for basic authentication. |
|
||||
|
||||
You can also configure settings specific to the Tempo data source. These options are described in the sections below.
|
||||
|
||||
### Trace to logs
|
||||
|
||||

|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Available in Grafana v7.4 and higher.
|
||||
If you use Grafana Cloud, open a [support ticket in the Cloud Portal](/profile/org#support) to access this feature.
|
||||
{{% /admonition %}}
|
||||
|
||||
The **Trace to logs** setting configures the [trace to logs feature][explore-trace-integration] that is available when you integrate Grafana with Tempo.
|
||||
|
||||
There are two ways to configure the trace to logs feature:
|
||||
|
||||
- Use a simplified configuration with default query, or
|
||||
- Configure a custom query where you can use a [template language][variable-syntax] to interpolate variables from the trace or span.
|
||||
|
||||
#### Use a simple configuration
|
||||
|
||||
1. Select the target 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.
|
||||
|
||||
1. Set start and end time shift. As the logs timestamps may not exactly match the timestamps of the spans in trace it may be necessary to search in larger or shifted time range to find the desired logs.
|
||||
1. Select which tags to use in the logs query. The tags you configure must be present in the spans attributes or resources for a trace to logs span link to appear. You can optionally configure a new name for the tag. This is useful for example if the tag has dots in the name and the target data source does not allow using dots in labels. In that case you can for example remap `http.status` to `http_status`.
|
||||
1. Optionally switch on the **Filter by trace ID** and/or **Filter by span ID** setting to further filter the logs if your logs consistently contain trace or span IDs.
|
||||
|
||||
#### Configure a custom query
|
||||
|
||||
1. Select the target 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.
|
||||
|
||||
1. Set start and end time shift. As the logs timestamps may not exactly match the timestamps of the spans in the trace it may be necessary to widen or shift the time range to find the desired logs.
|
||||
1. Optionally select tags to map. These tags can be used in the custom query with `${__tags}` variable. This variable will interpolate the mapped tags as list in an appropriate syntax for the data source and will only include the tags that were present in the span omitting those that weren't present. You can optionally configure a new name for the tag. This is useful in cases where the tag has dots in the name and the target data source does not allow using dots in labels. For example, you can remap `http.status` to `http_status` in such a case. If you don't map any tags here, you can still use any tag in the query like this `method="${__span.tags.method}"`.
|
||||
1. Skip **Filter by trace ID** and **Filter by span ID** settings as these cannot be used with a custom query.
|
||||
1. Switch on **Use custom query**.
|
||||
1. Specify a custom query to be used to query the logs. You can use various variables to make that query relevant for current span. The link will only be shown only if all the variables are interpolated with non-empty values to prevent creating an invalid query.
|
||||
|
||||
#### Variables that can be used in a custom query
|
||||
|
||||
To use a variable you need to wrap it in `${}`. For example `${__span.name}`.
|
||||
|
||||
| Variable name | Description |
|
||||
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **\_\_tags** | This variable uses the tag mapping from the UI to create a label matcher string in the specific data source syntax. The variable only uses tags that are present in the span. The link is still created even if only one of those tags is present in the span. You can use this if all tags are not required for the query to be useful. |
|
||||
| **\_\_span.spanId** | The ID of the span. |
|
||||
| **\_\_span.traceId** | The ID of the trace. |
|
||||
| **\_\_span.duration** | The duration of the span. |
|
||||
| **\_\_span.name** | Name of the span. |
|
||||
| **\_\_span.tags** | Namespace for the tags in the span. To access a specific tag named `version`, you would use `${__span.tags.version}`. In case the tag contains dot, you have to access it as `${__span.tags["http.status"]}`. |
|
||||
| **\_\_trace.traceId** | The ID of the trace. |
|
||||
| **\_\_trace.duration** | The duration of the trace. |
|
||||
| **\_\_trace.name** | The name of the trace. |
|
||||
|
||||
The following table describes the ways in which you can configure your trace to logs settings:
|
||||
|
||||
| Setting name | Description |
|
||||
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **Data source** | Defines the target data source. You can select only Loki or Splunk \[logs\] data sources. |
|
||||
| **Span start time shift** | Shifts the start time for the logs query, based on the span's start time. You can use time units, such as `5s`, `1m`, `3h`. To extend the time to the past, use a negative value. Default: `0`. |
|
||||
| **Span end time shift** | Shifts the end time for the logs query, based on the span's end time. You can use time units. Default: `0`. |
|
||||
| **Tags** | Defines the tags to use in the logs query. Default: `cluster`, `hostname`, `namespace`, `pod`. You can change the tag name for example to remove dots from the name if they are not allowed in the target data source. For example, map `http.status` to `http_status`. |
|
||||
| **Filter by trace ID** | Toggles whether to append the trace ID to the logs query. |
|
||||
| **Filter by span ID** | Toggles whether to append the span ID to the logs query. |
|
||||
| **Use custom query** | Toggles use of custom query with interpolation. |
|
||||
| **Query** | Input to write custom query. Use variable interpolation to customize it with variables from span. |
|
||||
|
||||
### Trace to metrics
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
This feature is behind the `traceToMetrics` [feature toggle][configure-grafana-feature-toggles].
|
||||
If you use Grafana Cloud, open a [support ticket in the Cloud Portal](/profile/org#support) to access this feature.
|
||||
{{% /admonition %}}
|
||||
|
||||
The **Trace to metrics** setting configures the [trace to metrics feature](/blog/2022/08/18/new-in-grafana-9.1-trace-to-metrics-allows-users-to-navigate-from-a-trace-span-to-a-selected-data-source/) available when integrating Grafana with Tempo.
|
||||
|
||||
To configure trace to metrics:
|
||||
|
||||
1. Select the target 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.
|
||||
|
||||
1. Create any desired linked queries.
|
||||
|
||||
| Setting name | Description |
|
||||
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **Data source** | Defines the target data source. |
|
||||
| **Tags** | Defines the tags used in linked queries. The key sets the span attribute name, and the optional value sets the corresponding metric label name. For example, you can map `k8s.pod` to `pod`. To interpolate these tags into queries, use the `$__tags` keyword. |
|
||||
|
||||
Each linked query consists of:
|
||||
|
||||
- **Link Label:** _(Optional)_ Descriptive label for the linked query.
|
||||
- **Query:** The query ran when navigating from a trace to the metrics data source.
|
||||
Interpolate tags using the `$__tags` keyword.
|
||||
For example, when you configure the query `requests_total{$__tags}`with the tags `k8s.pod=pod` and `cluster`, the result looks like `requests_total{pod="nginx-554b9", cluster="us-east-1"}`.
|
||||
|
||||
### Service Graph
|
||||
|
||||
The **Service Graph** setting configures the [Service Graph](/docs/tempo/latest/grafana-agent/service-graphs/) feature.
|
||||
|
||||
Configure the **Data source** setting to define in which Prometheus instance the Service Graph data is stored.
|
||||
|
||||
To use the Service Graph, refer to the [Service Graph documentation](#use-the-service-graph).
|
||||
|
||||
### Node Graph
|
||||
|
||||
The **Node Graph** setting enables the [node graph visualization][node-graph], which is disabled by default.
|
||||
|
||||
Once enabled, Grafana displays the node graph above the trace view.
|
||||
|
||||
### Tempo search
|
||||
|
||||
The **Search** setting configures [Tempo search](/docs/tempo/latest/configuration/#search).
|
||||
|
||||
You can configure the **Hide search** setting to hide the search query option in **Explore** if search is not configured in the Tempo instance.
|
||||
|
||||
### Loki search
|
||||
|
||||
The **Loki search** setting configures the Loki search query type.
|
||||
|
||||
Configure the **Data source** setting to define which Loki instance you want to use to search traces.
|
||||
You must configure [derived fields]({{< relref "../loki#configure-derived-fields" >}}) in the Loki instance.
|
||||
|
||||
### TraceID query
|
||||
|
||||
The **TraceID query** setting modifies how TraceID queries are run. The time range can be used when there are performance issues or timeouts since it will narrow down the search to the defined range. This setting is disabled by default.
|
||||
|
||||
You can configure this setting as follows:
|
||||
|
||||
| Name | Description |
|
||||
| --------------------- | ----------------------------------------------------------- |
|
||||
| **Enable time range** | Use a time range in the TraceID query. Default: `disabled`. |
|
||||
| **Time shift start** | Time shift for start of search. Default: `30m`. |
|
||||
| **Time shift end** | Time shift for end of search. Default: `30m`. |
|
||||
|
||||
### Span bar
|
||||
|
||||
The **Span bar** setting helps you display additional information in the span bar row.
|
||||
|
||||
You can choose one of three options:
|
||||
|
||||
| Name | Description |
|
||||
| ------------ | -------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **None** | Adds nothing to the span bar row. |
|
||||
| **Duration** | _(Default)_ Displays the span duration on the span bar row. |
|
||||
| **Tag** | Displays the span tag on the span bar row. You must also specify which tag key to use to get the tag value, such as `component`. |
|
||||
|
||||
### Provision the data source
|
||||
|
||||
You can define and configure the Tempo data source in YAML files as part of Grafana's provisioning system.
|
||||
For more information about provisioning and available configuration options, refer to [Provisioning Grafana][provisioning-data-sources].
|
||||
|
||||
#### Provisioning example
|
||||
|
||||
```yaml
|
||||
apiVersion: 1
|
||||
|
||||
datasources:
|
||||
- name: Tempo
|
||||
type: tempo
|
||||
uid: EbPG8fYoz
|
||||
url: http://localhost:3200
|
||||
access: proxy
|
||||
basicAuth: false
|
||||
jsonData:
|
||||
tracesToLogsV2:
|
||||
# Field with an internal link pointing to a logs data source in Grafana.
|
||||
# datasourceUid value must match the uid value of the logs data source.
|
||||
datasourceUid: 'loki'
|
||||
spanStartTimeShift: '1h'
|
||||
spanEndTimeShift: '-1h'
|
||||
tags: ['job', 'instance', 'pod', 'namespace']
|
||||
filterByTraceID: false
|
||||
filterBySpanID: false
|
||||
customQuery: true
|
||||
query: 'method="${__span.tags.method}"'
|
||||
tracesToMetrics:
|
||||
datasourceUid: 'prom'
|
||||
spanStartTimeShift: '1h'
|
||||
spanEndTimeShift: '-1h'
|
||||
tags: [{ key: 'service.name', value: 'service' }, { key: 'job' }]
|
||||
queries:
|
||||
- name: 'Sample query'
|
||||
query: 'sum(rate(traces_spanmetrics_latency_bucket{$$__tags}[5m]))'
|
||||
serviceMap:
|
||||
datasourceUid: 'prometheus'
|
||||
nodeGraph:
|
||||
enabled: true
|
||||
search:
|
||||
hide: false
|
||||
lokiSearch:
|
||||
datasourceUid: 'loki'
|
||||
traceQuery:
|
||||
timeShiftEnabled: true
|
||||
spanStartTimeShift: '1h'
|
||||
spanEndTimeShift: '-1h'
|
||||
spanBar:
|
||||
type: 'Tag'
|
||||
tag: 'http.path'
|
||||
```
|
||||
|
||||
## Query the data source
|
||||
|
||||
The Tempo data source's query editor helps you query and display traces from Tempo in [Explore][explore].
|
||||
|
||||
For details, refer to the [query editor documentation]({{< relref "./query-editor" >}}).
|
||||
|
||||
## Upload a JSON trace file
|
||||
|
||||
You can upload a JSON file that contains a single trace and visualize it.
|
||||
If the file has multiple traces, Grafana visualizes its first trace.
|
||||
|
||||
**To download a trace or Service Graph through the inspector:**
|
||||
|
||||
1. Open the inspector.
|
||||
1. Navigate to the **Data** tab.
|
||||
1. Click **Download traces** or **Download Service Graph**.
|
||||
|
||||
### Trace JSON example
|
||||
|
||||
```json
|
||||
{
|
||||
"batches": [
|
||||
{
|
||||
"resource": {
|
||||
"attributes": [
|
||||
{ "key": "service.name", "value": { "stringValue": "db" } },
|
||||
{ "key": "job", "value": { "stringValue": "tns/db" } },
|
||||
{ "key": "opencensus.exporterversion", "value": { "stringValue": "Jaeger-Go-2.22.1" } },
|
||||
{ "key": "host.name", "value": { "stringValue": "63d16772b4a2" } },
|
||||
{ "key": "ip", "value": { "stringValue": "0.0.0.0" } },
|
||||
{ "key": "client-uuid", "value": { "stringValue": "39fb01637a579639" } }
|
||||
]
|
||||
},
|
||||
"instrumentationLibrarySpans": [
|
||||
{
|
||||
"instrumentationLibrary": {},
|
||||
"spans": [
|
||||
{
|
||||
"traceId": "AAAAAAAAAABguiq7RPE+rg==",
|
||||
"spanId": "cmteMBAvwNA=",
|
||||
"parentSpanId": "OY8PIaPbma4=",
|
||||
"name": "HTTP GET - root",
|
||||
"kind": "SPAN_KIND_SERVER",
|
||||
"startTimeUnixNano": "1627471657255809000",
|
||||
"endTimeUnixNano": "1627471657256268000",
|
||||
"attributes": [
|
||||
{ "key": "http.status_code", "value": { "intValue": "200" } },
|
||||
{ "key": "http.method", "value": { "stringValue": "GET" } },
|
||||
{ "key": "http.url", "value": { "stringValue": "/" } },
|
||||
{ "key": "component", "value": { "stringValue": "net/http" } }
|
||||
],
|
||||
"status": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Use the Service Graph
|
||||
|
||||
The Service Graph is a visual representation of the relationships between services.
|
||||
Each node on the graph represents a service such as an API or database.
|
||||
|
||||
You use the Service Graph to detect performance issues; track increases in error, fault, or throttle rates in services; and investigate root causes by viewing corresponding traces.
|
||||
|
||||
{{< figure src="/static/img/docs/node-graph/node-graph-8-0.png" class="docs-image--no-shadow" max-width="500px" caption="Screenshot of a Node Graph" >}}
|
||||
|
||||
**To display the Service Graph:**
|
||||
|
||||
1. [Configure Grafana Agent](/docs/tempo/latest/grafana-agent/service-graphs/#quickstart) or [Tempo or GET](/docs/tempo/latest/metrics-generator/service_graphs/#tempo) to generate Service Graph data.
|
||||
1. Link a Prometheus data source in the Tempo data source's [Service Graph](#configure-service-graph) settings.
|
||||
1. Navigate to [Explore][explore].
|
||||
1. Select the Tempo data source.
|
||||
1. Select the **Service Graph** query type.
|
||||
1. Run the query.
|
||||
1. _(Optional)_ Filter by service name.
|
||||
|
||||
For details, refer to [Node Graph panel][node-graph].
|
||||
|
||||
Each circle in the graph represents a service.
|
||||
To open a context menu with additional links for quick navigation to other relevant information, click a service.
|
||||
|
||||
Numbers inside the circles indicate the average time per request and requests per second.
|
||||
|
||||
Each circle's color represents the percentage of requests in each state:
|
||||
|
||||
| Color | State |
|
||||
| ---------- | ------------------- |
|
||||
| **Green** | Success |
|
||||
| **Red** | Fault |
|
||||
| **Yellow** | Errors |
|
||||
| **Purple** | Throttled responses |
|
||||
|
||||
## Open the Service Graph view
|
||||
|
||||
Service graph view displays a table of request rate, error rate, and duration metrics (RED) calculated from your incoming spans. It also includes a node graph view built from your spans.
|
||||
|
||||
{{< figure src="/static/img/docs/tempo/apm-table.png" class="docs-image--no-shadow" max-width="500px" caption="Screenshot of the Service Graph view" >}}
|
||||
|
||||
For details, refer to the [Service Graph view documentation](/docs/tempo/latest/metrics-generator/service-graph-view/).
|
||||
|
||||
To open the Service Graph view:
|
||||
|
||||
1. Link a Prometheus data source in the Tempo data source settings.
|
||||
1. Navigate to [Explore][explore].
|
||||
1. Select the Tempo data source.
|
||||
1. Select the **Service Graph** query type.
|
||||
1. Run the query.
|
||||
1. _(Optional)_ Filter your results.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Grafana uses the `traces_spanmetrics_calls_total` metric to display the name, rate, and error rate columns, and `traces_spanmetrics_latency_bucket` to display the duration column.
|
||||
These metrics must exist in your Prometheus data source.
|
||||
{{% /admonition %}}
|
||||
|
||||
To open a query in Prometheus with the span name of that row automatically set in the query, click a row in the **rate**, **error rate**, or **duration** columns.
|
||||
|
||||
To open a query in Tempo with the span name of that row automatically set in the query, click a row in the **links** column.
|
||||
|
||||
## Span Filters
|
||||
|
||||

|
||||
|
||||
Using span filters, you can filter your spans in the trace timeline viewer. The more filters you add, the more specific are the filtered spans.
|
||||
|
||||
You can add one or more of the following filters:
|
||||
|
||||
- Service name
|
||||
- Span name
|
||||
- Duration
|
||||
- Tags (which include tags, process tags, and log fields)
|
||||
|
||||
To only show the spans you have matched, you can press the `Show matches only` toggle.
|
||||
|
||||
## Link to a trace ID from logs
|
||||
|
||||
You can link to Tempo traces from logs in Loki, Elasticsearch, Splunk, and other logs data sources by configuring an internal link.
|
||||
|
||||
To configure this feature, see the [Derived fields]({{< relref "../loki#configure-derived-fields" >}}) section of the Loki data source docs or the [Data links]({{< relref "../elasticsearch#data-links" >}}) section of the Elasticsearch or Splunk data source docs.
|
||||
|
||||
## Link to a trace ID from metrics
|
||||
|
||||
You can link to Tempo traces from metrics in Prometheus data sources by configuring an exemplar.
|
||||
|
||||
To configure this feature, see the [introduction to exemplars][exemplars] documentation.
|
||||
{{< section withDescriptions="true">}}
|
||||
|
||||
{{% docs/reference %}}
|
||||
[build-dashboards]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/build-dashboards"
|
||||
|
||||
268
docs/sources/datasources/tempo/configure-tempo-data-source.md
Normal file
268
docs/sources/datasources/tempo/configure-tempo-data-source.md
Normal file
@@ -0,0 +1,268 @@
|
||||
---
|
||||
description: Guide for configuring Tempo in Grafana
|
||||
keywords:
|
||||
- grafana
|
||||
- tempo
|
||||
- guide
|
||||
- tracing
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
menuTitle: Configure Tempo
|
||||
title: Configure the Tempo data source
|
||||
weight: 200
|
||||
---
|
||||
|
||||
# Configure the Tempo data source
|
||||
|
||||
To configure basic settings for the Tempo data source, complete the following steps:
|
||||
|
||||
1. Click **Connections** in the left-side menu.
|
||||
1. Under Your connections, click **Data sources**.
|
||||
1. Enter `Tempo` in the search bar.
|
||||
1. Select **Tempo**.
|
||||
|
||||
1. On the **Settings** tab, set the data source's basic configuration options:
|
||||
|
||||
| Name | Description |
|
||||
| -------------- | ------------------------------------------------------------------------ |
|
||||
| **Name** | Sets the name you use to refer to the data source in panels and queries. |
|
||||
| **Default** | Sets the data source that's pre-selected for new panels. |
|
||||
| **URL** | Sets the URL of the Tempo instance, such as `http://tempo`. |
|
||||
| **Basic Auth** | Enables basic authentication to the Tempo data source. |
|
||||
| **User** | Sets the user name for basic authentication. |
|
||||
| **Password** | Sets the password for basic authentication. |
|
||||
|
||||
You can also configure settings specific to the Tempo data source. These options are described in the sections below.
|
||||
|
||||
## Trace to logs
|
||||
|
||||

|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Available in Grafana v7.4 and higher.
|
||||
If you use Grafana Cloud, open a [support ticket in the Cloud Portal](/profile/org#support) to access this feature.
|
||||
{{% /admonition %}}
|
||||
|
||||
The **Trace to logs** setting configures the [trace to logs feature][explore-trace-integration] that is available when you integrate Grafana with Tempo.
|
||||
|
||||
There are two ways to configure the trace to logs feature:
|
||||
|
||||
- Use a simplified configuration with default query, or
|
||||
- Configure a custom query where you can use a [template language][variable-syntax] to interpolate variables from the trace or span.
|
||||
|
||||
### Use a simple configuration
|
||||
|
||||
1. Select the target 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.
|
||||
|
||||
1. Set start and end time shift. As the logs timestamps may not exactly match the timestamps of the spans in trace it may be necessary to search in larger or shifted time range to find the desired logs.
|
||||
1. Select which tags to use in the logs query. The tags you configure must be present in the spans attributes or resources for a trace to logs span link to appear. You can optionally configure a new name for the tag. This is useful for example if the tag has dots in the name and the target data source does not allow using dots in labels. In that case you can for example remap `http.status` to `http_status`.
|
||||
1. Optionally switch on the **Filter by trace ID** and/or **Filter by span ID** setting to further filter the logs if your logs consistently contain trace or span IDs.
|
||||
|
||||
### Configure a custom query
|
||||
|
||||
1. Select the target 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.
|
||||
|
||||
1. Set start and end time shift. As the logs timestamps may not exactly match the timestamps of the spans in the trace it may be necessary to widen or shift the time range to find the desired logs.
|
||||
1. Optionally select tags to map. These tags can be used in the custom query with `${__tags}` variable. This variable will interpolate the mapped tags as list in an appropriate syntax for the data source and will only include the tags that were present in the span omitting those that weren't present. You can optionally configure a new name for the tag. This is useful in cases where the tag has dots in the name and the target data source does not allow using dots in labels. For example, you can remap `http.status` to `http_status` in such a case. If you don't map any tags here, you can still use any tag in the query like this `method="${__span.tags.method}"`.
|
||||
1. Skip **Filter by trace ID** and **Filter by span ID** settings as these cannot be used with a custom query.
|
||||
1. Switch on **Use custom query**.
|
||||
1. Specify a custom query to be used to query the logs. You can use various variables to make that query relevant for current span. The link will only be shown only if all the variables are interpolated with non-empty values to prevent creating an invalid query.
|
||||
|
||||
### Variables that can be used in a custom query
|
||||
|
||||
To use a variable you need to wrap it in `${}`. For example `${__span.name}`.
|
||||
|
||||
| Variable name | Description |
|
||||
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **\_\_tags** | This variable uses the tag mapping from the UI to create a label matcher string in the specific data source syntax. The variable only uses tags that are present in the span. The link is still created even if only one of those tags is present in the span. You can use this if all tags are not required for the query to be useful. |
|
||||
| **\_\_span.spanId** | The ID of the span. |
|
||||
| **\_\_span.traceId** | The ID of the trace. |
|
||||
| **\_\_span.duration** | The duration of the span. |
|
||||
| **\_\_span.name** | Name of the span. |
|
||||
| **\_\_span.tags** | Namespace for the tags in the span. To access a specific tag named `version`, you would use `${__span.tags.version}`. In case the tag contains dot, you have to access it as `${__span.tags["http.status"]}`. |
|
||||
| **\_\_trace.traceId** | The ID of the trace. |
|
||||
| **\_\_trace.duration** | The duration of the trace. |
|
||||
| **\_\_trace.name** | The name of the trace. |
|
||||
|
||||
The following table describes the ways in which you can configure your trace to logs settings:
|
||||
|
||||
| Setting name | Description |
|
||||
| ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **Data source** | Defines the target data source. You can select only Loki or Splunk \[logs\] data sources. |
|
||||
| **Span start time shift** | Shifts the start time for the logs query, based on the span's start time. You can use time units, such as `5s`, `1m`, `3h`. To extend the time to the past, use a negative value. Default: `0`. |
|
||||
| **Span end time shift** | Shifts the end time for the logs query, based on the span's end time. You can use time units. Default: `0`. |
|
||||
| **Tags** | Defines the tags to use in the logs query. Default: `cluster`, `hostname`, `namespace`, `pod`, `service.name`, `service.namespace`, `deployment.environment`. You can change the tag name for example to remove dots from the name if they are not allowed in the target data source. For example, map `http.status` to `http_status`. |
|
||||
| **Filter by trace ID** | Toggles whether to append the trace ID to the logs query. |
|
||||
| **Filter by span ID** | Toggles whether to append the span ID to the logs query. |
|
||||
| **Use custom query** | Toggles use of custom query with interpolation. |
|
||||
| **Query** | Input to write custom query. Use variable interpolation to customize it with variables from span. |
|
||||
|
||||
## Trace to metrics
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
This feature is behind the `traceToMetrics` [feature toggle][configure-grafana-feature-toggles].
|
||||
If you use Grafana Cloud, open a [support ticket in the Cloud Portal](/profile/org#support) to access this feature.
|
||||
{{% /admonition %}}
|
||||
|
||||
The **Trace to metrics** setting configures the [trace to metrics feature](/blog/2022/08/18/new-in-grafana-9.1-trace-to-metrics-allows-users-to-navigate-from-a-trace-span-to-a-selected-data-source/) available when integrating Grafana with Tempo.
|
||||
|
||||
To configure trace to metrics:
|
||||
|
||||
1. Select the target 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.
|
||||
|
||||
1. Create any desired linked queries.
|
||||
|
||||
| Setting name | Description |
|
||||
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **Data source** | Defines the target data source. |
|
||||
| **Tags** | Defines the tags used in linked queries. The key sets the span attribute name, and the optional value sets the corresponding metric label name. For example, you can map `k8s.pod` to `pod`. To interpolate these tags into queries, use the `$__tags` keyword. |
|
||||
|
||||
Each linked query consists of:
|
||||
|
||||
- **Link Label:** _(Optional)_ Descriptive label for the linked query.
|
||||
- **Query:** The query ran when navigating from a trace to the metrics data source.
|
||||
Interpolate tags using the `$__tags` keyword.
|
||||
For example, when you configure the query `requests_total{$__tags}`with the tags `k8s.pod=pod` and `cluster`, the result looks like `requests_total{pod="nginx-554b9", cluster="us-east-1"}`.
|
||||
|
||||
## Service Graph
|
||||
|
||||
The **Service Graph** setting configures the [Service Graph](/docs/tempo/latest/metrics-generator/service_graphs/enable-service-graphs/) feature.
|
||||
|
||||
Configure the **Data source** setting to define in which Prometheus instance the Service Graph data is stored.
|
||||
|
||||
To use the Service Graph, refer to the [Service Graph documentation](#use-the-service-graph).
|
||||
|
||||
## Node Graph
|
||||
|
||||
The **Node Graph** setting enables the [node graph visualization][node-graph], which is disabled by default.
|
||||
|
||||
Once enabled, Grafana displays the node graph above the trace view.
|
||||
|
||||
## Tempo search
|
||||
|
||||
The **Search** setting configures [Tempo search](/docs/tempo/latest/configuration/#search).
|
||||
|
||||
You can configure the **Hide search** setting to hide the search query option in **Explore** if search is not configured in the Tempo instance.
|
||||
|
||||
## Loki search
|
||||
|
||||
The **Loki search** setting configures the Loki search query type.
|
||||
|
||||
Configure the **Data source** setting to define which Loki instance you want to use to search traces.
|
||||
You must configure [derived fields]({{< relref "../loki#configure-derived-fields" >}}) in the Loki instance.
|
||||
|
||||
## TraceID query
|
||||
|
||||
The **TraceID query** setting modifies how TraceID queries are run. The time range can be used when there are performance issues or timeouts since it will narrow down the search to the defined range. This setting is disabled by default.
|
||||
|
||||
You can configure this setting as follows:
|
||||
|
||||
| Name | Description |
|
||||
| --------------------- | ----------------------------------------------------------- |
|
||||
| **Enable time range** | Use a time range in the TraceID query. Default: `disabled`. |
|
||||
| **Time shift start** | Time shift for start of search. Default: `30m`. |
|
||||
| **Time shift end** | Time shift for end of search. Default: `30m`. |
|
||||
|
||||
## Span bar
|
||||
|
||||
The **Span bar** setting helps you display additional information in the span bar row.
|
||||
|
||||
You can choose one of three options:
|
||||
|
||||
| Name | Description |
|
||||
| ------------ | -------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **None** | Adds nothing to the span bar row. |
|
||||
| **Duration** | _(Default)_ Displays the span duration on the span bar row. |
|
||||
| **Tag** | Displays the span tag on the span bar row. You must also specify which tag key to use to get the tag value, such as `component`. |
|
||||
|
||||
## Provision the data source
|
||||
|
||||
You can define and configure the Tempo data source in YAML files as part of Grafana's provisioning system.
|
||||
For more information about provisioning and available configuration options, refer to [Provisioning Grafana][provisioning-data-sources].
|
||||
|
||||
Example provision YAML file:
|
||||
|
||||
```yaml
|
||||
apiVersion: 1
|
||||
|
||||
datasources:
|
||||
- name: Tempo
|
||||
type: tempo
|
||||
uid: EbPG8fYoz
|
||||
url: http://localhost:3200
|
||||
access: proxy
|
||||
basicAuth: false
|
||||
jsonData:
|
||||
tracesToLogsV2:
|
||||
# Field with an internal link pointing to a logs data source in Grafana.
|
||||
# datasourceUid value must match the uid value of the logs data source.
|
||||
datasourceUid: 'loki'
|
||||
spanStartTimeShift: '1h'
|
||||
spanEndTimeShift: '-1h'
|
||||
tags: ['job', 'instance', 'pod', 'namespace']
|
||||
filterByTraceID: false
|
||||
filterBySpanID: false
|
||||
customQuery: true
|
||||
query: 'method="${__span.tags.method}"'
|
||||
tracesToMetrics:
|
||||
datasourceUid: 'prom'
|
||||
spanStartTimeShift: '1h'
|
||||
spanEndTimeShift: '-1h'
|
||||
tags: [{ key: 'service.name', value: 'service' }, { key: 'job' }]
|
||||
queries:
|
||||
- name: 'Sample query'
|
||||
query: 'sum(rate(traces_spanmetrics_latency_bucket{$$__tags}[5m]))'
|
||||
serviceMap:
|
||||
datasourceUid: 'prometheus'
|
||||
nodeGraph:
|
||||
enabled: true
|
||||
search:
|
||||
hide: false
|
||||
lokiSearch:
|
||||
datasourceUid: 'loki'
|
||||
traceQuery:
|
||||
timeShiftEnabled: true
|
||||
spanStartTimeShift: '1h'
|
||||
spanEndTimeShift: '-1h'
|
||||
spanBar:
|
||||
type: 'Tag'
|
||||
tag: 'http.path'
|
||||
```
|
||||
|
||||
{{% docs/reference %}}
|
||||
[build-dashboards]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/build-dashboards"
|
||||
[build-dashboards]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/build-dashboards"
|
||||
|
||||
[configure-grafana-feature-toggles]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/setup-grafana/configure-grafana#feature_toggles"
|
||||
[configure-grafana-feature-toggles]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/setup-grafana/configure-grafana#feature_toggles"
|
||||
|
||||
[data-source-management]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/administration/data-source-management"
|
||||
[data-source-management]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/administration/data-source-management"
|
||||
|
||||
[exemplars]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/fundamentals/exemplars"
|
||||
[exemplars]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/fundamentals/exemplars"
|
||||
|
||||
[explore-trace-integration]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/explore/trace-integration"
|
||||
[explore-trace-integration]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/explore/trace-integration"
|
||||
|
||||
[explore]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/explore"
|
||||
[explore]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/explore"
|
||||
|
||||
[node-graph]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/panels-visualizations/visualizations/node-graph"
|
||||
[node-graph]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/panels-visualizations/visualizations/node-graph"
|
||||
|
||||
[provisioning-data-sources]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/administration/provisioning#data-sources"
|
||||
[provisioning-data-sources]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/administration/provisioning#data-sources"
|
||||
|
||||
[variable-syntax]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/variables/variable-syntax"
|
||||
[variable-syntax]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/variables/variable-syntax"
|
||||
{{% /docs/reference %}}
|
||||
71
docs/sources/datasources/tempo/json-trace-file.md
Normal file
71
docs/sources/datasources/tempo/json-trace-file.md
Normal file
@@ -0,0 +1,71 @@
|
||||
---
|
||||
description: Upload a JSON trace file to the Tempo data source
|
||||
keywords:
|
||||
- grafana
|
||||
- tempo
|
||||
- guide
|
||||
- tracing
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
menuTitle: Upload JSON trace file
|
||||
title: Upload a JSON trace file
|
||||
weight: 400
|
||||
---
|
||||
|
||||
# Upload a JSON trace file
|
||||
|
||||
You can upload a JSON file that contains a single trace and visualize it.
|
||||
If the file has multiple traces, Grafana visualizes the first trace.
|
||||
|
||||
**To download a trace or Service Graph through the inspector:**
|
||||
|
||||
1. Open the inspector.
|
||||
1. Navigate to the **Data** tab.
|
||||
1. Click **Download traces** or **Download Service Graph**.
|
||||
|
||||
## Trace JSON example
|
||||
|
||||
```json
|
||||
{
|
||||
"batches": [
|
||||
{
|
||||
"resource": {
|
||||
"attributes": [
|
||||
{ "key": "service.name", "value": { "stringValue": "db" } },
|
||||
{ "key": "job", "value": { "stringValue": "tns/db" } },
|
||||
{ "key": "opencensus.exporterversion", "value": { "stringValue": "Jaeger-Go-2.22.1" } },
|
||||
{ "key": "host.name", "value": { "stringValue": "63d16772b4a2" } },
|
||||
{ "key": "ip", "value": { "stringValue": "0.0.0.0" } },
|
||||
{ "key": "client-uuid", "value": { "stringValue": "39fb01637a579639" } }
|
||||
]
|
||||
},
|
||||
"instrumentationLibrarySpans": [
|
||||
{
|
||||
"instrumentationLibrary": {},
|
||||
"spans": [
|
||||
{
|
||||
"traceId": "AAAAAAAAAABguiq7RPE+rg==",
|
||||
"spanId": "cmteMBAvwNA=",
|
||||
"parentSpanId": "OY8PIaPbma4=",
|
||||
"name": "HTTP GET - root",
|
||||
"kind": "SPAN_KIND_SERVER",
|
||||
"startTimeUnixNano": "1627471657255809000",
|
||||
"endTimeUnixNano": "1627471657256268000",
|
||||
"attributes": [
|
||||
{ "key": "http.status_code", "value": { "intValue": "200" } },
|
||||
{ "key": "http.method", "value": { "stringValue": "GET" } },
|
||||
{ "key": "http.url", "value": { "stringValue": "/" } },
|
||||
{ "key": "component", "value": { "stringValue": "net/http" } }
|
||||
],
|
||||
"status": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
61
docs/sources/datasources/tempo/link-trace-id.md
Normal file
61
docs/sources/datasources/tempo/link-trace-id.md
Normal file
@@ -0,0 +1,61 @@
|
||||
---
|
||||
description: Link to trace IDs from logs and metrics
|
||||
keywords:
|
||||
- grafana
|
||||
- tempo
|
||||
- guide
|
||||
- tracing
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
menuTitle: Link to a trace ID
|
||||
title: Link to a trace ID
|
||||
weight: 700
|
||||
---
|
||||
|
||||
# Link to a trace ID
|
||||
|
||||
You can link to Tempo traces from logs or metrics.
|
||||
|
||||
## Link to a trace ID from logs
|
||||
|
||||
You can link to Tempo traces from logs in Loki, Elasticsearch, Splunk, and other logs data sources by configuring an internal link.
|
||||
|
||||
To configure this feature, see the [Derived fields]({{< relref "../loki#configure-derived-fields" >}}) section of the Loki data source docs or the [Data links]({{< relref "../elasticsearch#data-links" >}}) section of the Elasticsearch or Splunk data source docs.
|
||||
|
||||
## Link to a trace ID from metrics
|
||||
|
||||
You can link to Tempo traces from metrics in Prometheus data sources by configuring an exemplar.
|
||||
|
||||
To configure this feature, see the [introduction to exemplars][exemplars] documentation.
|
||||
|
||||
{{% docs/reference %}}
|
||||
[build-dashboards]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/build-dashboards"
|
||||
[build-dashboards]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/build-dashboards"
|
||||
|
||||
[configure-grafana-feature-toggles]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/setup-grafana/configure-grafana#feature_toggles"
|
||||
[configure-grafana-feature-toggles]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/setup-grafana/configure-grafana#feature_toggles"
|
||||
|
||||
[data-source-management]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/administration/data-source-management"
|
||||
[data-source-management]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/administration/data-source-management"
|
||||
|
||||
[exemplars]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/fundamentals/exemplars"
|
||||
[exemplars]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/fundamentals/exemplars"
|
||||
|
||||
[explore-trace-integration]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/explore/trace-integration"
|
||||
[explore-trace-integration]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/explore/trace-integration"
|
||||
|
||||
[explore]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/explore"
|
||||
[explore]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/explore"
|
||||
|
||||
[node-graph]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/panels-visualizations/visualizations/node-graph"
|
||||
[node-graph]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/panels-visualizations/visualizations/node-graph"
|
||||
|
||||
[provisioning-data-sources]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/administration/provisioning#data-sources"
|
||||
[provisioning-data-sources]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/administration/provisioning#data-sources"
|
||||
|
||||
[variable-syntax]: "/docs/grafana/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/variables/variable-syntax"
|
||||
[variable-syntax]: "/docs/grafana-cloud/ -> /docs/grafana/<GRAFANA VERSION>/dashboards/variables/variable-syntax"
|
||||
{{% /docs/reference %}}
|
||||
@@ -24,7 +24,38 @@ The Tempo data source's query editor helps you query and display traces from Tem
|
||||
This topic explains configuration and queries specific to the Tempo data source.
|
||||
For general documentation on querying data sources in Grafana, see [Query and transform data][query-transform-data].
|
||||
|
||||
## Query by search
|
||||
To add TraceQL panels to your dashboard, refer to the [Traces panel documentation](/docs/grafana/latest/panels-visualizations/visualizations/traces/).
|
||||
|
||||
To learn more about Grafana dashboards, refer to the [Use dashboards documentation](/docs/grafana/latest/dashboards/use-dashboards/).
|
||||
|
||||
## Write TraceQL queries in Grafana
|
||||
|
||||
You can compose TraceQL queries in Grafana and Grafana Cloud using **Explore** and a Tempo data source. You can use either the **Query type** > **Search** (the TraceQL query builder) or the **TraceQL** tab (the TraceQL query editor).
|
||||
Both of these methods let you build queries and drill-down into result sets.
|
||||
|
||||
To learn more about how to query by TraceQL, refer to the [TraceQL documentation](/docs/tempo/latest/traceql).
|
||||
|
||||
### TraceQL query builder
|
||||
|
||||
The TraceQL query builder, located on the **Explore** > **Query type** > **Search** in Grafana, provides drop-downs and text fields to help you write a query.
|
||||
|
||||
Refer to the [Search using the TraceQL query builder documentation]({{< relref "./traceql-search" >}}) to learn more about creating queries using convenient drop-down menus.
|
||||
|
||||

|
||||
|
||||
### TraceQL query editor
|
||||
|
||||
The TraceQL query editor, located on the **Explore** > **TraceQL** tab in Grafana, lets you search by trace ID and write TraceQL queries using autocomplete.
|
||||
|
||||
Refer to the [TraceQL query editor documentation]({{< relref "./traceql-editor" >}}) to learn more about constructing queries using a code-editor-like experience.
|
||||
|
||||

|
||||
|
||||
## Query by search (deprecated)
|
||||
|
||||
{{% admonition type="caution" %}}
|
||||
Starting with Grafana v10.2, this query type has been deprecated. It will be removed in Grafana v10.3.
|
||||
{{% /admonition %}}
|
||||
|
||||
Use this to search for traces by service name, span name, duration range, or process-level attributes that are included in your application's instrumentation, such as HTTP status code and customer ID.
|
||||
|
||||
@@ -68,21 +99,6 @@ To query a particular trace:
|
||||
|
||||
{{< figure src="/static/img/docs/tempo/query-editor-traceid.png" class="docs-image--no-shadow" max-width="750px" caption="Screenshot of the Tempo TraceID query type" >}}
|
||||
|
||||
## Query by TraceQL
|
||||
|
||||
Inspired by PromQL and LogQL, TraceQL is a query language designed for selecting traces.
|
||||
The default traces search reviews the whole trace.
|
||||
TraceQL provides a method for formulating precise queries so you can zoom in to the data you need.
|
||||
Query results are returned faster because the queries limit what is searched.
|
||||
|
||||
To learn more about how to query by TraceQL, refer to the [TraceQL documentation](/docs/tempo/latest/traceql).
|
||||
|
||||
You can create TraceQL queries using the Query editor or using **Search** query type.
|
||||
|
||||
[//]: # 'Include content for preview of Search tab featuring TraceQL query builder'
|
||||
|
||||
{{< docs/shared source="grafana" lookup="datasources/tempo-search-traceql.md" leveloffset="+1" >}}
|
||||
|
||||
## Query Loki for traces
|
||||
|
||||
To find traces to visualize, you can use the [Loki query editor]({{< relref "../../loki#loki-query-editor" >}}).
|
||||
@@ -0,0 +1,23 @@
|
||||
---
|
||||
description: Learn how to create TraceQL queries in Grafana using the query editor.
|
||||
keywords:
|
||||
- grafana
|
||||
- tempo
|
||||
- traces
|
||||
- queries
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
menuTitle: Write TraceQL queries
|
||||
title: Write TraceQL queries with the editor
|
||||
weight: 300
|
||||
---
|
||||
|
||||
# Write TraceQL queries with the editor
|
||||
|
||||
[//]: # 'Shared content for the TraceQL query editor'
|
||||
[//]: # 'This content is located in /docs/sources/shared/datasources/tempo-editor-traceql.md'
|
||||
|
||||
{{< docs/shared source="grafana" lookup="datasources/tempo-editor-traceql.md" version="<GRAFANA VERSION>" >}}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user