Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82e32447b4 |
@@ -1780,7 +1780,8 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "20"]
|
||||
],
|
||||
"packages/grafana-ui/src/components/Sparkline/Sparkline.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"]
|
||||
],
|
||||
"packages/grafana-ui/src/components/StatsPicker/StatsPicker.story.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
@@ -1825,8 +1826,7 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "3"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "4"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "5"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "6"]
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "5"]
|
||||
],
|
||||
"packages/grafana-ui/src/components/Table/TableCell.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
@@ -3089,10 +3089,14 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/core/navigation/__mocks__/routeProps.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"]
|
||||
[0, 0, 0, "Do not use any type assertions.", "2"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "4"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "5"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "6"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "7"]
|
||||
],
|
||||
"public/app/core/navigation/hooks.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
@@ -3169,6 +3173,11 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
],
|
||||
"public/app/core/services/__mocks__/backend_srv.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.", "2"]
|
||||
],
|
||||
"public/app/core/services/__mocks__/search_srv.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
@@ -5231,8 +5240,19 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/features/plugins/__mocks__/pluginMocks.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "3"]
|
||||
],
|
||||
"public/app/features/plugins/admin/__mocks__/catalogPlugin.mock.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/features/plugins/admin/__mocks__/localPlugin.mock.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/features/plugins/admin/__mocks__/remotePlugin.mock.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/features/plugins/admin/components/AppConfigWrapper.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
@@ -5829,6 +5849,11 @@ exports[`better eslint`] = {
|
||||
"public/app/features/transformers/utils.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/features/users/__mocks__/userMocks.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.", "2"]
|
||||
],
|
||||
"public/app/features/users/state/reducers.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
@@ -6256,6 +6281,11 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Do not use any type assertions.", "2"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"]
|
||||
],
|
||||
"public/app/plugins/datasource/cloud-monitoring/__mocks__/cloudMonitoringDatasource.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.", "2"]
|
||||
],
|
||||
"public/app/plugins/datasource/cloud-monitoring/annotationSupport.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"]
|
||||
@@ -6365,13 +6395,58 @@ exports[`better eslint`] = {
|
||||
"public/app/plugins/datasource/cloudwatch/__mocks__/CloudWatchDataSource.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "2"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "4"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "5"]
|
||||
[0, 0, 0, "Do not use any type assertions.", "4"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "5"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "6"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "7"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "8"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "9"]
|
||||
],
|
||||
"public/app/plugins/datasource/cloudwatch/__mocks__/cloudwatch-sql-test-data/multiLineFullQuery.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/plugins/datasource/cloudwatch/__mocks__/cloudwatch-sql-test-data/multiLineIncompleteQueryWithoutNamespace.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/plugins/datasource/cloudwatch/__mocks__/cloudwatch-sql-test-data/singleLineEmptyQuery.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/plugins/datasource/cloudwatch/__mocks__/cloudwatch-sql-test-data/singleLineFullQuery.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/plugins/datasource/cloudwatch/__mocks__/cloudwatch-sql-test-data/singleLineTwoQueries.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/plugins/datasource/cloudwatch/__mocks__/dynamic-label-test-data/afterLabelValue.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/plugins/datasource/cloudwatch/__mocks__/dynamic-label-test-data/insideLabelValue.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/plugins/datasource/cloudwatch/__mocks__/metric-math-test-data/afterFunctionQuery.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/plugins/datasource/cloudwatch/__mocks__/metric-math-test-data/secondArgAfterSearchQuery.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/plugins/datasource/cloudwatch/__mocks__/metric-math-test-data/secondArgQuery.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/plugins/datasource/cloudwatch/__mocks__/metric-math-test-data/singleLineEmptyQuery.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/plugins/datasource/cloudwatch/__mocks__/metric-math-test-data/thirdArgAfterSearchQuery.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/plugins/datasource/cloudwatch/__mocks__/metric-math-test-data/withinStringQuery.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/plugins/datasource/cloudwatch/__mocks__/monarch/Monaco.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"]
|
||||
],
|
||||
"public/app/plugins/datasource/cloudwatch/components/ConfigEditor.test.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
@@ -6750,6 +6825,17 @@ exports[`better eslint`] = {
|
||||
"public/app/plugins/datasource/elasticsearch/test-helpers/render.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/plugins/datasource/grafana-azure-monitor-datasource/__mocks__/datasource.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/plugins/datasource/grafana-azure-monitor-datasource/__mocks__/instanceSettings.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/plugins/datasource/grafana-azure-monitor-datasource/__mocks__/panelData.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.", "2"]
|
||||
],
|
||||
"public/app/plugins/datasource/grafana-azure-monitor-datasource/__mocks__/query_ctrl.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||
@@ -6757,6 +6843,10 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "4"]
|
||||
],
|
||||
"public/app/plugins/datasource/grafana-azure-monitor-datasource/__mocks__/utils.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"]
|
||||
],
|
||||
"public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/__mocks__/schema.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
@@ -8563,8 +8653,10 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/plugins/panel/barchart/BarChartPanel.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"]
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "2"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "3"]
|
||||
],
|
||||
"public/app/plugins/panel/barchart/TickSpacingEditor.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
|
||||
@@ -35,10 +35,7 @@ function countEslintErrors() {
|
||||
'@typescript-eslint/no-explicit-any': 'error',
|
||||
};
|
||||
|
||||
const isTestFile =
|
||||
filePath.endsWith('.test.tsx') || filePath.endsWith('.test.ts') || filePath.includes('__mocks__');
|
||||
|
||||
if (!isTestFile) {
|
||||
if (!filePath.endsWith('.test.tsx') && !filePath.endsWith('.test.ts')) {
|
||||
rules['@typescript-eslint/consistent-type-assertions'] = [
|
||||
'error',
|
||||
{
|
||||
|
||||
@@ -3432,7 +3432,6 @@ steps:
|
||||
from_secret: gcp_key
|
||||
PRERELEASE_BUCKET:
|
||||
from_secret: prerelease_bucket
|
||||
failure: ignore
|
||||
image: grafana/grafana-ci-deploy:1.3.3
|
||||
name: retrieve-npm-packages
|
||||
- commands:
|
||||
@@ -3442,7 +3441,6 @@ steps:
|
||||
environment:
|
||||
NPM_TOKEN:
|
||||
from_secret: npm_token
|
||||
failure: ignore
|
||||
image: grafana/build-container:1.5.9
|
||||
name: release-npm-packages
|
||||
trigger:
|
||||
@@ -5018,6 +5016,6 @@ kind: secret
|
||||
name: gcp_upload_artifacts_key
|
||||
---
|
||||
kind: signature
|
||||
hmac: 1ca37da2d5a2ca7290349339aaa494e24e51e27699dca658813d99abc55ee63c
|
||||
hmac: 710e3af4e83d49bce6403c31135075bbd2fbc302b985e0dea201157950805924
|
||||
|
||||
...
|
||||
|
||||
4
.github/workflows/publish.yml
vendored
4
.github/workflows/publish.yml
vendored
@@ -3,7 +3,7 @@ name: publish_docs
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- v9.1.x
|
||||
- main
|
||||
paths:
|
||||
- 'docs/sources/**'
|
||||
- 'packages/grafana-*/**'
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
host: github.com
|
||||
github_pat: '${{ secrets.GH_BOT_ACCESS_TOKEN }}'
|
||||
source_folder: docs/sources
|
||||
target_folder: content/docs/grafana/latest
|
||||
target_folder: content/docs/grafana/next
|
||||
allow_no_changes: 'true'
|
||||
- shell: bash
|
||||
run: |
|
||||
|
||||
59
CHANGELOG.md
59
CHANGELOG.md
@@ -1,62 +1,3 @@
|
||||
<!-- 9.1.0 START -->
|
||||
|
||||
# 9.1.0 (2022-08-16)
|
||||
|
||||
### Features and enhancements
|
||||
|
||||
- **API:** Allow creating teams with a user defined identifier. [#48710](https://github.com/grafana/grafana/pull/48710), [@papagian](https://github.com/papagian)
|
||||
- **Alerting:** Adds interval and For to alert rule details. [#53211](https://github.com/grafana/grafana/pull/53211), [@gillesdemey](https://github.com/gillesdemey)
|
||||
- **Alerting:** Extend PUT rule-group route to write the entire rule group rather than top-level fields only. [#53078](https://github.com/grafana/grafana/pull/53078), [@alexweav](https://github.com/alexweav)
|
||||
- **Alerting:** Use Adaptive Cards in Teams notifications. [#53532](https://github.com/grafana/grafana/pull/53532), [@grobinson-grafana](https://github.com/grobinson-grafana)
|
||||
- **Azure Monitor:** Add Network Insights Dashboard. [#50362](https://github.com/grafana/grafana/pull/50362), [@Teddy-Lin](https://github.com/Teddy-Lin)
|
||||
- **Chore:** Improve logging of unrecoverable errors. [#53664](https://github.com/grafana/grafana/pull/53664), [@sakjur](https://github.com/sakjur)
|
||||
- **Correlations:** Add UpdateCorrelation HTTP API. [#52444](https://github.com/grafana/grafana/pull/52444), [@Elfo404](https://github.com/Elfo404)
|
||||
- **Dashboard:** Reverted the changes of hiding multi-select and all variable in the datasource picker. [#53521](https://github.com/grafana/grafana/pull/53521), [@lpskdl](https://github.com/lpskdl)
|
||||
- **Geomap:** Add alpha day/night layer. [#50201](https://github.com/grafana/grafana/pull/50201), [@ryantxu](https://github.com/ryantxu)
|
||||
- **Geomap:** Add measuring tools. [#51608](https://github.com/grafana/grafana/pull/51608), [@drew08t](https://github.com/drew08t)
|
||||
- **GrafanaUI:** Add success state to ClipboardButton. [#52069](https://github.com/grafana/grafana/pull/52069), [@evictorero](https://github.com/evictorero)
|
||||
- **Heatmap:** Replace the heatmap panel with new implementation. [#50229](https://github.com/grafana/grafana/pull/50229), [@ryantxu](https://github.com/ryantxu)
|
||||
- **KVStore:** Allow empty value in kv_store. [#53416](https://github.com/grafana/grafana/pull/53416), [@spinillos](https://github.com/spinillos)
|
||||
- **Prometheus:** Promote Azure auth flag to configuration. [#53447](https://github.com/grafana/grafana/pull/53447), [@andresmgot](https://github.com/andresmgot)
|
||||
- **Reports:** Save and update in reports should be transactional. (Enterprise)
|
||||
- **Reports:** Set uid when we don't receive it in the query. (Enterprise)
|
||||
- **Search:** Display only dashboards in General folder of Search Folder View. [#53607](https://github.com/grafana/grafana/pull/53607), [@lpskdl](https://github.com/lpskdl)
|
||||
- **Status history/State timeline:** Support datalinks. [#50226](https://github.com/grafana/grafana/pull/50226), [@jloupdef](https://github.com/jloupdef)
|
||||
- **Transform:** Add a limit transform. [#49291](https://github.com/grafana/grafana/pull/49291), [@josiahg](https://github.com/josiahg)
|
||||
- **Transformations:** Add standard deviation and variance reducers. [#49753](https://github.com/grafana/grafana/pull/49753), [@selvavm](https://github.com/selvavm)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- **API:** Fix snapshot responses. [#52998](https://github.com/grafana/grafana/pull/52998), [@papagian](https://github.com/papagian)
|
||||
- **Access Control:** Fix permission error during dashboard creation flow. [#53214](https://github.com/grafana/grafana/pull/53214), [@IevaVasiljeva](https://github.com/IevaVasiljeva)
|
||||
- **Access Control:** Set permissions for Grafana's test data source. [#53247](https://github.com/grafana/grafana/pull/53247), [@IevaVasiljeva](https://github.com/IevaVasiljeva)
|
||||
- **Alerting:** Fix migration failure. [#53253](https://github.com/grafana/grafana/pull/53253), [@papagian](https://github.com/papagian)
|
||||
- **BarGauge:** Show empty bar when value, minValue and maxValue are all equal. [#53314](https://github.com/grafana/grafana/pull/53314), [@ashharrison90](https://github.com/ashharrison90)
|
||||
- **Dashboard:** Fix color of bold and italics text in panel description tooltip. [#53380](https://github.com/grafana/grafana/pull/53380), [@joshhunt](https://github.com/joshhunt)
|
||||
- **Loki:** Fix passing of query with defaults to code mode. [#53646](https://github.com/grafana/grafana/pull/53646), [@ivanahuckova](https://github.com/ivanahuckova)
|
||||
- **Loki:** Fix producing correct log volume query for query with comments. [#53254](https://github.com/grafana/grafana/pull/53254), [@ivanahuckova](https://github.com/ivanahuckova)
|
||||
- **Loki:** Fix showing of unusable labels field in detected fields. [#53319](https://github.com/grafana/grafana/pull/53319), [@ivanahuckova](https://github.com/ivanahuckova)
|
||||
- **Reports:** Fix inconsistency reports. (Enterprise)
|
||||
- **Tracing:** Fix OpenTelemetry Jaeger context propagation. [#53269](https://github.com/grafana/grafana/pull/53269), [@zhichli](https://github.com/zhichli)
|
||||
- **Tracing:** Fix OpenTelemetry Jaeger context propagation (#53269). [#53724](https://github.com/grafana/grafana/pull/53724), [@idafurjes](https://github.com/idafurjes)
|
||||
- **[9.1.x] Alerting:** AlertingProxy to elevate permissions for request forwarded to data proxy when RBAC enabled. [#53679](https://github.com/grafana/grafana/pull/53679), [@yuri-tceretian](https://github.com/yuri-tceretian)
|
||||
|
||||
### Breaking changes
|
||||
|
||||
Alert notifications to Microsoft Teams now use Adaptive Cards instead of Office 365 Connector Cards. Issue [#53532](https://github.com/grafana/grafana/issues/53532)
|
||||
|
||||
Starting at 9.1.0, existing heatmap panels will start using a new implementation. This can be disabled by setting the `useLegacyHeatmapPanel` feature flag to true. It can be tested on a single dashbobard by adding `?__feature.useLegacyHeatmapPanel=true` to any dashboard URL. Please report any [heatmap migration issues.](https://github.com/grafana/grafana/issues/new/choose). The most notable changes are:
|
||||
|
||||
- Significantly improved rendering performance
|
||||
- When calculating heatmaps, the buckets are now placed on reasonable borders (1m, 5m, 30s etc)
|
||||
- Round cells are no longer supported
|
||||
Issue [#50229](https://github.com/grafana/grafana/issues/50229)
|
||||
|
||||
### Plugin development fixes & changes
|
||||
|
||||
- **Plugins:** Only pass `rootUrls` field in request when not empty. [#53135](https://github.com/grafana/grafana/pull/53135), [@wbrowne](https://github.com/wbrowne)
|
||||
|
||||
<!-- 9.1.0 END -->
|
||||
<!-- 9.1.0-beta1 START -->
|
||||
|
||||
# 9.1.0-beta1 (unreleased)
|
||||
|
||||
@@ -1,186 +0,0 @@
|
||||
# # config file version
|
||||
apiVersion: 1
|
||||
|
||||
# # List of rule groups to import or update
|
||||
# groups:
|
||||
# # <int> organization ID, default = 1
|
||||
# - orgId: 1
|
||||
# # <string, required> name of the rule group
|
||||
# name: my_rule_group
|
||||
# # <string, required> name of the folder the rule group will be stored in
|
||||
# folder: my_first_folder
|
||||
# # <duration, required> interval of the rule group evaluation
|
||||
# interval: 60s
|
||||
# # <list, required> list of rules that are part of the rule group
|
||||
# rules:
|
||||
# # <string, required> unique identifier for the rule
|
||||
# - uid: my_id_1
|
||||
# # <string, required> title of the rule, will be displayed in the UI
|
||||
# title: my_first_rule
|
||||
# # <string, required> query used for the condition
|
||||
# condition: A
|
||||
# # <list, required> list of query objects that should be executed on each
|
||||
# # evaluation - should be obtained via the API
|
||||
# data:
|
||||
# - refId: A
|
||||
# datasourceUid: "-100"
|
||||
# model:
|
||||
# conditions:
|
||||
# - evaluator:
|
||||
# params:
|
||||
# - 3
|
||||
# type: gt
|
||||
# operator:
|
||||
# type: and
|
||||
# query:
|
||||
# params:
|
||||
# - A
|
||||
# reducer:
|
||||
# type: last
|
||||
# type: query
|
||||
# datasource:
|
||||
# type: __expr__
|
||||
# uid: "-100"
|
||||
# expression: 1==0
|
||||
# intervalMs: 1000
|
||||
# maxDataPoints: 43200
|
||||
# refId: A
|
||||
# type: math
|
||||
# # <string> UID of a dashboard that the alert rule should be linked to
|
||||
# dashboardUid: my_dashboard
|
||||
# # <int> ID of the panel that the alert rule should be linked to
|
||||
# panelId: 123
|
||||
# # <string> state of the alert rule when no data is returned
|
||||
# # possible values: "NoData", "Alerting", "OK", default = NoData
|
||||
# noDataState: Alerting
|
||||
# # <string> state of the alert rule when the query execution
|
||||
# # fails - possible values: "Error", "Alerting", "OK"
|
||||
# # default = Alerting
|
||||
# # <duration, required> how long the alert condition should be breached before Firing. Before this time has elapsed, the alert is considered to be Pending
|
||||
# for: 60s
|
||||
# # <map<string, string>> map of strings to attach arbitrary custom data
|
||||
# annotations:
|
||||
# some_key: some_value
|
||||
# # <map<string, string> map of strings to filter and
|
||||
# # route alerts
|
||||
# labels:
|
||||
# team: sre_team_1
|
||||
|
||||
# # List of alert rule UIDs that should be deleted
|
||||
# deleteRules:
|
||||
# # <int> organization ID, default = 1
|
||||
# - orgId: 1
|
||||
# # <string, required> unique identifier for the rule
|
||||
# uid: my_id_1
|
||||
|
||||
# # List of contact points to import or update
|
||||
# contactPoints:
|
||||
# # <int> organization ID, default = 1
|
||||
# - orgId: 1
|
||||
# # <string, required> name of the contact point
|
||||
# name: cp_1
|
||||
# receivers:
|
||||
# # <string, required> unique identifier for the receiver
|
||||
# - uid: first_uid
|
||||
# # <string, required> type of the receiver
|
||||
# type: prometheus-alertmanager
|
||||
# # <object, required> settings for the specific receiver type
|
||||
# settings:
|
||||
# url: http://test:9000
|
||||
|
||||
# # List of receivers that should be deleted
|
||||
# deleteContactPoints:
|
||||
# - orgId: 1
|
||||
# uid: first_uid
|
||||
|
||||
# # List of notification policies to import or update
|
||||
# policies:
|
||||
# # <int> organization ID, default = 1
|
||||
# - orgId: 1
|
||||
# # <string> name of the receiver that should be used for this route
|
||||
# receiver: grafana-default-email
|
||||
# # <list<string>> The labels by which incoming alerts are grouped together. For example,
|
||||
# # multiple alerts coming in for cluster=A and alertname=LatencyHigh would
|
||||
# # be batched into a single group.
|
||||
# #
|
||||
# # To aggregate by all possible labels, use the special value '...' as
|
||||
# # the sole label name, for example:
|
||||
# # group_by: ['...']
|
||||
# # This effectively disables aggregation entirely, passing through all
|
||||
# # alerts as-is. This is unlikely to be what you want, unless you have
|
||||
# # a very low alert volume or your upstream notification system performs
|
||||
# # its own grouping.
|
||||
# group_by:
|
||||
# - grafana_folder
|
||||
# - alertname
|
||||
# # <list> a list of matchers that an alert has to fulfill to match the node
|
||||
# matchers:
|
||||
# - alertname = Watchdog
|
||||
# - severity =~ "warning|critical"
|
||||
# # <list> Times when the route should be muted. These must match the name of a
|
||||
# # mute time interval.
|
||||
# # Additionally, the root node cannot have any mute times.
|
||||
# # When a route is muted it will not send any notifications, but
|
||||
# # otherwise acts normally (including ending the route-matching process
|
||||
# # if the `continue` option is not set)
|
||||
# mute_time_intervals:
|
||||
# - abc
|
||||
# # <duration> How long to initially wait to send a notification for a group
|
||||
# # of alerts. Allows to collect more initial alerts for the same group.
|
||||
# # (Usually ~0s to few minutes), default = 30s
|
||||
# group_wait: 30s
|
||||
# # <duration> How long to wait before sending a notification about new alerts that
|
||||
# # are added to a group of alerts for which an initial notification has
|
||||
# # already been sent. (Usually ~5m or more), default = 5m
|
||||
# group_internval: 5m
|
||||
# # <duration> How long to wait before sending a notification again if it has already
|
||||
# # been sent successfully for an alert. (Usually ~3h or more), default = 4h
|
||||
# repeat_interval: 4h
|
||||
# # <list> Zero or more child routes
|
||||
# routes:
|
||||
# ...
|
||||
|
||||
# # List of orgIds that should be reset to the default policy
|
||||
# resetPolicies:
|
||||
# - 1
|
||||
|
||||
# # List of templates to import or update
|
||||
# templates:
|
||||
# # <int> organization ID, default = 1
|
||||
# - orgID: 1
|
||||
# # <string, required> name of the template, must be unique
|
||||
# name: my_first_template
|
||||
# # <string, required> content of the the template
|
||||
# template: Alerting with a custome text template
|
||||
|
||||
# # List of templates that should be deleted
|
||||
# deleteTemplates:
|
||||
# # <int> organization ID, default = 1
|
||||
# - orgId: 1
|
||||
# # <string, required> name of the template, must be unique
|
||||
# name: my_first_template
|
||||
|
||||
|
||||
# # List of mute time intervals to import or update
|
||||
# muteTimes:
|
||||
# # <int> organization ID, default = 1
|
||||
# - orgId: 1
|
||||
# # <string, required> name of the mute time interval, must be unique
|
||||
# name: mti_1
|
||||
# # <list> time intervals that should trigger the muting
|
||||
# refer to https://prometheus.io/docs/alerting/latest/configuration/#time_interval-0
|
||||
# time_intervals:
|
||||
# - times:
|
||||
# - start_time: '06:00'
|
||||
# end_time: '23:59'
|
||||
# weekdays: ['monday:wednesday','saturday', 'sunday']
|
||||
# months: ['1:3', 'may:august', 'december']
|
||||
# years: ['2020:2022', '2030']
|
||||
# days_of_month: ['1:5', '-3:-1']
|
||||
|
||||
# # List of mute time intervals that should be deleted
|
||||
# deleteMuteTimes:
|
||||
# # <int> organization ID, default = 1
|
||||
# - orgId: 1
|
||||
# # <string, required> name of the mute time interval, must be unique
|
||||
# name: mti_1
|
||||
@@ -71,8 +71,8 @@ title: Grafana documentation
|
||||
<h4>Provisioning</h4>
|
||||
<p>Learn how to automate your Grafana configuration.</p>
|
||||
</a>
|
||||
<a href="{{< relref "whatsnew/whats-new-in-v9-1/" >}}" class="nav-cards__item nav-cards__item--guide">
|
||||
<h4>What's new in v9.1</h4>
|
||||
<a href="{{< relref "whatsnew/whats-new-in-v8-0/" >}}" class="nav-cards__item nav-cards__item--guide">
|
||||
<h4>What's new in v8.0</h4>
|
||||
<p>Explore the features and enhancements in the latest release.</p>
|
||||
</a>
|
||||
|
||||
|
||||
@@ -364,590 +364,8 @@ providers:
|
||||
|
||||
> **Note:** To provision dashboards to the General folder, store them in the root of your `path`.
|
||||
|
||||
## Alerting
|
||||
|
||||
You can manage alert objects in Grafana by adding one or more YAML or JSON
|
||||
configuration files in the [`provisioning/alerting`]({{< relref "../../setup-grafana/configure-grafana/" >}})
|
||||
directory. Those files will be applied when starting Grafana. When Grafana
|
||||
is running, it's possible to do a hot reload using the
|
||||
[Admin API]({{< relref "../../developers/http_api/admin/#reload-provisioning-configurations" >}}).
|
||||
|
||||
### Rules
|
||||
|
||||
Creation
|
||||
|
||||
```yaml
|
||||
# config file version
|
||||
apiVersion: 1
|
||||
|
||||
# List of rule groups to import or update
|
||||
groups:
|
||||
# <int> organization ID, default = 1
|
||||
- orgId: 1
|
||||
# <string, required> name of the rule group
|
||||
name: my_rule_group
|
||||
# <string, required> name of the folder the rule group will be stored in
|
||||
folder: my_first_folder
|
||||
# <duration, required> interval that the rule group should evaluated at
|
||||
interval: 60s
|
||||
# <list, required> list of rules that are part of the rule group
|
||||
rules:
|
||||
# <string, required> unique identifier for the rule
|
||||
- uid: my_id_1
|
||||
# <string, required> title of the rule that will be displayed in the UI
|
||||
title: my_first_rule
|
||||
# <string, required> which query should be used for the condition
|
||||
condition: A
|
||||
# <list, required> list of query objects that should be executed on each
|
||||
# evaluation - should be obtained trough the API
|
||||
data:
|
||||
- refId: A
|
||||
datasourceUid: '-100'
|
||||
model:
|
||||
conditions:
|
||||
- evaluator:
|
||||
params:
|
||||
- 3
|
||||
type: gt
|
||||
operator:
|
||||
type: and
|
||||
query:
|
||||
params:
|
||||
- A
|
||||
reducer:
|
||||
type: last
|
||||
type: query
|
||||
datasource:
|
||||
type: __expr__
|
||||
uid: '-100'
|
||||
expression: 1==0
|
||||
intervalMs: 1000
|
||||
maxDataPoints: 43200
|
||||
refId: A
|
||||
type: math
|
||||
# <string> UID of a dashboard that the alert rule should be linked to
|
||||
dashboardUid: my_dashboard
|
||||
# <int> ID of the panel that the alert rule should be linked to
|
||||
panelId: 123
|
||||
# <string> the state the alert rule will have when no data is returned
|
||||
# possible values: "NoData", "Alerting", "OK", default = NoData
|
||||
noDataState: Alerting
|
||||
# <string> the state the alert rule will have when the query execution
|
||||
# failed - possible values: "Error", "Alerting", "OK"
|
||||
# default = Alerting
|
||||
# <duration, required> for how long should the alert fire before alerting
|
||||
for: 60s
|
||||
# <map<string, string>> a map of strings to pass around any data
|
||||
annotations:
|
||||
some_key: some_value
|
||||
# <map<string, string> a map of strings that can be used to filter and
|
||||
# route alerts
|
||||
labels:
|
||||
team: sre_team_1
|
||||
```
|
||||
|
||||
Deletion
|
||||
|
||||
```yaml
|
||||
# config file version
|
||||
apiVersion: 1
|
||||
|
||||
# List of alert rule UIDs that should be deleted
|
||||
deleteRules:
|
||||
# <int> organization ID, default = 1
|
||||
- orgId: 1
|
||||
# <string, required> unique identifier for the rule
|
||||
uid: my_id_1
|
||||
```
|
||||
|
||||
### Contact points
|
||||
|
||||
Creation
|
||||
|
||||
```yaml
|
||||
# config file version
|
||||
apiVersion: 1
|
||||
|
||||
# List of contact points to import or update
|
||||
contactPoints:
|
||||
# <int> organization ID, default = 1
|
||||
- orgId: 1
|
||||
# <string, required> name of the contact point
|
||||
name: cp_1
|
||||
receivers:
|
||||
# <string, required> unique identifier for the receiver
|
||||
- uid: first_uid
|
||||
# <string, required> type of the receiver
|
||||
type: prometheus-alertmanager
|
||||
# <object, required> settings for the specific receiver type
|
||||
settings:
|
||||
url: http://test:9000
|
||||
```
|
||||
|
||||
Deletion
|
||||
|
||||
```yaml
|
||||
# config file version
|
||||
apiVersion: 1
|
||||
|
||||
# List of receivers that should be deleted
|
||||
deleteContactPoints:
|
||||
# <int> organization ID, default = 1
|
||||
- orgId: 1
|
||||
# <string, required> unique identifier for the receiver
|
||||
uid: first_uid
|
||||
```
|
||||
|
||||
#### Settings
|
||||
|
||||
Here we showcase what kind of settings you can have for the different
|
||||
contact point types.
|
||||
|
||||
##### Alertmanager
|
||||
|
||||
```yaml
|
||||
type: prometheus-alertmanager
|
||||
settings:
|
||||
# <string, required>
|
||||
url: http://localhost:9093
|
||||
# <string>
|
||||
basicAuthUser: abc
|
||||
# <string>
|
||||
basicAuthPassword: abc123
|
||||
```
|
||||
|
||||
##### DingDing
|
||||
|
||||
```yaml
|
||||
type: dingding
|
||||
settings:
|
||||
# <string, required>
|
||||
url: https://oapi.dingtalk.com/robot/send?access_token=xxxxxxxxx
|
||||
# <string> options: link, actionCard
|
||||
msgType: link
|
||||
# <string>
|
||||
message: |
|
||||
{{ template "default.message" . }}
|
||||
```
|
||||
|
||||
##### Discord
|
||||
|
||||
```yaml
|
||||
type: discord
|
||||
settings:
|
||||
# <string, required>
|
||||
url: https://discord/webhook
|
||||
# <string>
|
||||
avatar_url: https://my_avatar
|
||||
# <string>
|
||||
use_discord_username: Grafana
|
||||
# <string>
|
||||
message: |
|
||||
{{ template "default.message" . }}
|
||||
```
|
||||
|
||||
##### E-Mail
|
||||
|
||||
```yaml
|
||||
type: email
|
||||
settings:
|
||||
# <string, required>
|
||||
addresses: me@example.com;you@example.com
|
||||
# <bool>
|
||||
singleEmail: false
|
||||
# <string>
|
||||
message: my optional message to include
|
||||
# <string>
|
||||
subject: |
|
||||
{{ template "default.title" . }}
|
||||
```
|
||||
|
||||
##### Google Hangouts Chat
|
||||
|
||||
```yaml
|
||||
type: googlechat
|
||||
settings:
|
||||
# <string, required>
|
||||
url: https://google/webhook
|
||||
# <string>
|
||||
message: |
|
||||
{{ template "default.message" . }}
|
||||
```
|
||||
|
||||
##### Kafka
|
||||
|
||||
```yaml
|
||||
type: kafka
|
||||
settings:
|
||||
# <string, required>
|
||||
kafkaRestProxy: http://localhost:8082
|
||||
# <string, required>
|
||||
kafkaTopic: topic1
|
||||
```
|
||||
|
||||
##### LINE
|
||||
|
||||
```yaml
|
||||
type: line
|
||||
settings:
|
||||
# <string, required>
|
||||
token: xxx
|
||||
```
|
||||
|
||||
##### Microsoft Teams
|
||||
|
||||
```yaml
|
||||
type: teams
|
||||
settings:
|
||||
# <string, required>
|
||||
url: https://ms_teams_url
|
||||
# <string>
|
||||
title: |
|
||||
{{ template "default.title" . }}
|
||||
# <string>
|
||||
sectiontitle: ''
|
||||
# <string>
|
||||
message: |
|
||||
{{ template "default.message" . }}
|
||||
```
|
||||
|
||||
##### OpsGenie
|
||||
|
||||
```yaml
|
||||
type: opsgenie
|
||||
settings:
|
||||
# <string, required>
|
||||
apiKey: xxx
|
||||
# <string, required>
|
||||
apiUrl: https://api.opsgenie.com/v2/alerts
|
||||
# <string>
|
||||
message: |
|
||||
{{ template "default.title" . }}
|
||||
# <string>
|
||||
description: some descriptive description
|
||||
# <bool>
|
||||
autoClose: false
|
||||
# <bool>
|
||||
overridePriority: false
|
||||
# <string> options: tags, details, both
|
||||
sendTagsAs: both
|
||||
```
|
||||
|
||||
##### PagerDuty
|
||||
|
||||
```yaml
|
||||
type: pagerduty
|
||||
settings:
|
||||
# <string, required>
|
||||
integrationKey: XXX
|
||||
# <string> options: critical, error, warning, info
|
||||
severity: critical
|
||||
# <string>
|
||||
class: ping failure
|
||||
# <string>
|
||||
component: Grafana
|
||||
# <string>
|
||||
group: app-stack
|
||||
# <string>
|
||||
summary: |
|
||||
{{ template "default.message" . }}
|
||||
```
|
||||
|
||||
##### Pushover
|
||||
|
||||
```yaml
|
||||
type: pushover
|
||||
settings:
|
||||
# <string, required>
|
||||
apiToken: XXX
|
||||
# <string, required>
|
||||
userKey: user1,user2
|
||||
# <string>
|
||||
device: device1,device2
|
||||
# <string> options (high to low): 2,1,0,-1,-2
|
||||
priority: '2'
|
||||
# <string>
|
||||
retry: '30'
|
||||
# <string>
|
||||
expire: '120'
|
||||
# <string>
|
||||
sound: siren
|
||||
# <string>
|
||||
okSound: magic
|
||||
# <string>
|
||||
message: |
|
||||
{{ template "default.message" . }}
|
||||
```
|
||||
|
||||
##### Slack
|
||||
|
||||
```yaml
|
||||
type: slack
|
||||
settings:
|
||||
# <string, required>
|
||||
recipient: alerting-dev
|
||||
# <string, required>
|
||||
token: xxx
|
||||
# <string>
|
||||
username: grafana_bot
|
||||
# <string>
|
||||
icon_emoji: heart
|
||||
# <string>
|
||||
icon_url: https://icon_url
|
||||
# <string>
|
||||
mentionUsers: user_1,user_2
|
||||
# <string>
|
||||
mentionGroups: group_1,group_2
|
||||
# <string> options: here, channel
|
||||
mentionChannel: here
|
||||
# <string> Optionally provide a Slack incoming webhook URL for sending messages, in this case the token isn't necessary
|
||||
url: https://some_webhook_url
|
||||
# <string>
|
||||
endpointUrl: https://custom_url/api/chat.postMessage
|
||||
# <string>
|
||||
title: |
|
||||
{{ template "slack.default.title" . }}
|
||||
text: |
|
||||
{{ template "slack.default.text" . }}
|
||||
```
|
||||
|
||||
##### Sensu Go
|
||||
|
||||
```yaml
|
||||
type: sensugo
|
||||
settings:
|
||||
# <string, required>
|
||||
url: http://sensu-api.local:8080
|
||||
# <string, required>
|
||||
apikey: xxx
|
||||
# <string>
|
||||
entity: default
|
||||
# <string>
|
||||
check: default
|
||||
# <string>
|
||||
handler: some_handler
|
||||
# <string>
|
||||
namespace: default
|
||||
# <string>
|
||||
message: |
|
||||
{{ template "default.message" . }}
|
||||
```
|
||||
|
||||
##### Telegram
|
||||
|
||||
```yaml
|
||||
type: telegram
|
||||
settings:
|
||||
# <string, required>
|
||||
bottoken: xxx
|
||||
# <string, required>
|
||||
chatid: some_chat_id
|
||||
# <string>
|
||||
message: |
|
||||
{{ template "default.message" . }}
|
||||
```
|
||||
|
||||
##### Threema Gateway
|
||||
|
||||
```yaml
|
||||
type: threema
|
||||
settings:
|
||||
# <string, required>
|
||||
api_secret: xxx
|
||||
# <string, required>
|
||||
gateway_id: A5K94S9
|
||||
# <string, required>
|
||||
recipient_id: A9R4KL4S
|
||||
```
|
||||
|
||||
##### VictorOps
|
||||
|
||||
```yaml
|
||||
type: victorops
|
||||
settings:
|
||||
# <string, required>
|
||||
url: XXX
|
||||
# <string> options: CRITICAL, WARNING
|
||||
messageType: CRITICAL
|
||||
```
|
||||
|
||||
##### Webhook
|
||||
|
||||
```yaml
|
||||
type: webhook
|
||||
settings:
|
||||
# <string, required>
|
||||
url: https://endpoint_url
|
||||
# <string> options: POST, PUT
|
||||
httpMethod: POST
|
||||
# <string>
|
||||
username: abc
|
||||
# <string>
|
||||
password: abc123
|
||||
# <string>
|
||||
authorization_scheme: Bearer
|
||||
# <string>
|
||||
authorization_credentials: abc123
|
||||
# <string>
|
||||
maxAlerts: '10'
|
||||
```
|
||||
|
||||
##### WeCom
|
||||
|
||||
```yaml
|
||||
type: wecom
|
||||
settings:
|
||||
# <string, required>
|
||||
url: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxxxxxxx
|
||||
# <string>
|
||||
message: |
|
||||
{{ template "default.message" . }}
|
||||
# <string>
|
||||
title: |
|
||||
{{ template "default.title" . }}
|
||||
```
|
||||
|
||||
### Notification policies
|
||||
|
||||
Create
|
||||
|
||||
```yaml
|
||||
# config file version
|
||||
apiVersion: 1
|
||||
|
||||
# List of notification policies
|
||||
policies:
|
||||
# <int> organization ID, default = 1
|
||||
- orgId: 1
|
||||
# <string> name of the contact point that should be used for this route
|
||||
receiver: grafana-default-email
|
||||
# <list> The labels by which incoming alerts are grouped together. For example,
|
||||
# multiple alerts coming in for cluster=A and alertname=LatencyHigh would
|
||||
# be batched into a single group.
|
||||
#
|
||||
# To aggregate by all possible labels use the special value '...' as
|
||||
# the sole label name, for example:
|
||||
# group_by: ['...']
|
||||
# This effectively disables aggregation entirely, passing through all
|
||||
# alerts as-is. This is unlikely to be what you want, unless you have
|
||||
# a very low alert volume or your upstream notification system performs
|
||||
# its own grouping.
|
||||
group_by: ['...']
|
||||
# <list> a list of matchers that an alert has to fulfill to match the node
|
||||
matchers:
|
||||
- alertname = Watchdog
|
||||
- severity =~ "warning|critical"
|
||||
# <list> Times when the route should be muted. These must match the name of a
|
||||
# mute time interval.
|
||||
# Additionally, the root node cannot have any mute times.
|
||||
# When a route is muted it will not send any notifications, but
|
||||
# otherwise acts normally (including ending the route-matching process
|
||||
# if the `continue` option is not set)
|
||||
mute_time_intervals:
|
||||
- abc
|
||||
# <duration> How long to initially wait to send a notification for a group
|
||||
# of alerts. Allows to collect more initial alerts for the same group.
|
||||
# (Usually ~0s to few minutes), default = 30s
|
||||
group_wait: 30s
|
||||
# <duration> How long to wait before sending a notification about new alerts that
|
||||
# are added to a group of alerts for which an initial notification has
|
||||
# already been sent. (Usually ~5m or more), default = 5m
|
||||
group_internval: 5m
|
||||
# <duration> How long to wait before sending a notification again if it has already
|
||||
# been sent successfully for an alert. (Usually ~3h or more), default = 4h
|
||||
repeat_interval: 4h
|
||||
# <list> Zero or more child routes
|
||||
# routes:
|
||||
# ...
|
||||
```
|
||||
|
||||
Reset
|
||||
|
||||
```yaml
|
||||
# config file version
|
||||
apiVersion: 1
|
||||
|
||||
# List of orgIds that should be reset to the default policy
|
||||
resetPolicies:
|
||||
- 1
|
||||
```
|
||||
|
||||
### Templates
|
||||
|
||||
Creation
|
||||
|
||||
```yaml
|
||||
# config file version
|
||||
apiVersion: 1
|
||||
|
||||
# List of templates to import or update
|
||||
templates:
|
||||
# <int> organization ID, default = 1
|
||||
- orgID: 1
|
||||
# <string, required> name of the template, must be unique
|
||||
name: my_first_template
|
||||
# <string, required> content of the the template
|
||||
template: Alerting with a custom text template
|
||||
```
|
||||
|
||||
Deletion
|
||||
|
||||
```yaml
|
||||
# config file version
|
||||
apiVersion: 1
|
||||
|
||||
# List of alert rule UIDs that should be deleted
|
||||
deleteTemplates:
|
||||
# <int> organization ID, default = 1
|
||||
- orgId: 1
|
||||
# <string, required> name of the template, must be unique
|
||||
name: my_first_template
|
||||
```
|
||||
|
||||
### Mute timings
|
||||
|
||||
Creation
|
||||
|
||||
```yaml
|
||||
# config file version
|
||||
apiVersion: 1
|
||||
|
||||
# List of mute time intervals to import or update
|
||||
muteTimes:
|
||||
# <int> organization ID, default = 1
|
||||
- orgId: 1
|
||||
# <string, required> name of the mute time interval, must be unique
|
||||
name: mti_1
|
||||
# <list> time intervals that should trigger the muting
|
||||
# refer to https://prometheus.io/docs/alerting/latest/configuration/#time_interval-0
|
||||
time_intervals:
|
||||
- times:
|
||||
- start_time: '06:00'
|
||||
end_time: '23:59'
|
||||
weekdays: ['monday:wednesday', 'saturday', 'sunday']
|
||||
months: ['1:3', 'may:august', 'december']
|
||||
years: ['2020:2022', '2030']
|
||||
days_of_month: ['1:5', '-3:-1']
|
||||
```
|
||||
|
||||
Deletion
|
||||
|
||||
```yaml
|
||||
# config file version
|
||||
apiVersion: 1
|
||||
|
||||
# List of mute time intervals that should be deleted
|
||||
deleteMuteTimes:
|
||||
# <int> organization ID, default = 1
|
||||
- orgId: 1
|
||||
# <string, required> name of the mute time interval, must be unique
|
||||
name: mti_1
|
||||
```
|
||||
|
||||
## Alert Notification Channels
|
||||
|
||||
> **Note:** Alert Notification Channels are part of legacy alerting, which is deprecated and will be removed in Grafana 10. Use Contact Points in the alerting section above.
|
||||
|
||||
Alert Notification Channels can be provisioned by adding one or more YAML config files in the [`provisioning/notifiers`](/administration/configuration/#provisioning) directory.
|
||||
|
||||
Each config file can contain the following top-level fields:
|
||||
|
||||
@@ -14,7 +14,7 @@ weight: 120
|
||||
|
||||
# Role-based access control (RBAC)
|
||||
|
||||
> **Note:** Available in [Grafana Enterprise]({{< relref "../../../introduction/grafana-enterprise/" >}}) and [Grafana Cloud Advanced]({{< ref "/docs/grafana-cloud" >}}).
|
||||
> **Note:** Available in [Grafana Enterprise]({{< relref "../../enterprise/" >}}) and [Grafana Cloud Advanced]({{< ref "/docs/grafana-cloud" >}}).
|
||||
|
||||
RBAC provides a standardized way of granting, changing, and revoking access when it comes to viewing and modifying Grafana resources, such as dashboards, reports, and administrative settings.
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ weight: 40
|
||||
|
||||
# Assign RBAC roles
|
||||
|
||||
> **Note:** Available in [Grafana Enterprise]({{< relref "../../../introduction/grafana-enterprise/" >}}) and [Grafana Cloud Advanced]({{< ref "/docs/grafana-cloud" >}}).
|
||||
> **Note:** Available in [Grafana Enterprise]({{< relref "../../enterprise/" >}}) and [Grafana Cloud Advanced]({{< ref "/docs/grafana-cloud" >}}).
|
||||
|
||||
In this topic you'll learn how to use the role picker, provisioning, and the HTTP API to assign fixed and custom roles to users and teams.
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ weight: 30
|
||||
|
||||
# Configure RBAC in Grafana
|
||||
|
||||
> **Note:** Available in [Grafana Enterprise]({{< relref "../../../introduction/grafana-enterprise/" >}}) and [Grafana Cloud Advanced]({{< ref "/docs/grafana-cloud" >}}).
|
||||
> **Note:** Available in [Grafana Enterprise]({{< relref "../../enterprise/" >}}) and [Grafana Cloud Advanced]({{< ref "/docs/grafana-cloud" >}}).
|
||||
|
||||
The table below describes all RBAC configuration options. Like any other Grafana configuration, you can apply these options as [environment variables]({{< relref "../../../setup-grafana/configure-grafana/#configure-with-environment-variables" >}}).
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ weight: 80
|
||||
|
||||
# RBAC permissions, actions, and scopes
|
||||
|
||||
> **Note:** Available in [Grafana Enterprise]({{< relref "../../../introduction/grafana-enterprise/" >}}) and [Grafana Cloud Advanced]({{< ref "/docs/grafana-cloud" >}}).
|
||||
> **Note:** Available in [Grafana Enterprise]({{< relref "../../enterprise/" >}}) and [Grafana Cloud Advanced]({{< ref "/docs/grafana-cloud" >}}).
|
||||
|
||||
A permission is comprised of an action and a scope. When creating a custom role, consider the actions the user can perform and the resource(s) on which they can perform those actions.
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ weight: 50
|
||||
|
||||
# Manage RBAC roles
|
||||
|
||||
> **Note:** Available in [Grafana Enterprise]({{< relref "../../../introduction/grafana-enterprise/" >}}) and [Grafana Cloud Advanced]({{< ref "/docs/grafana-cloud" >}}).
|
||||
> **Note:** Available in [Grafana Enterprise]({{< relref "../../enterprise/" >}}) and [Grafana Cloud Advanced]({{< ref "/docs/grafana-cloud" >}}).
|
||||
|
||||
This section includes instructions for how to view permissions associated with roles, create custom roles, and update and delete roles.
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ weight: 20
|
||||
|
||||
# Plan your RBAC rollout strategy
|
||||
|
||||
> **Note:** Available in [Grafana Enterprise]({{< relref "../../../introduction/grafana-enterprise/" >}}) and [Grafana Cloud Advanced]({{< ref "/docs/grafana-cloud" >}}).
|
||||
> **Note:** Available in [Grafana Enterprise]({{< relref "../../enterprise/" >}}) and [Grafana Cloud Advanced]({{< ref "/docs/grafana-cloud" >}}).
|
||||
|
||||
An RBAC rollout strategy helps you determine _how_ you want to implement RBAC prior to assigning RBAC roles to users and teams.
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ weight: 70
|
||||
|
||||
# RBAC role definitions
|
||||
|
||||
> **Note:** Available in [Grafana Enterprise]({{< relref "../../../introduction/grafana-enterprise/" >}}) and [Grafana Cloud Advanced]({{< ref "/docs/grafana-cloud" >}}).
|
||||
> **Note:** Available in [Grafana Enterprise]({{< relref "../../enterprise/" >}}) and [Grafana Cloud Advanced]({{< ref "/docs/grafana-cloud" >}}).
|
||||
|
||||
The following tables list permissions associated with basic and fixed roles.
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ weight: 60
|
||||
|
||||
# Grafana RBAC provisioning
|
||||
|
||||
> **Note:** Available in [Grafana Enterprise]({{< relref "../../../introduction/grafana-enterprise/" >}}) and [Grafana Cloud Advanced]({{< ref "/docs/grafana-cloud" >}}).
|
||||
> **Note:** Available in [Grafana Enterprise]({{< relref "../../enterprise/" >}}) and [Grafana Cloud Advanced]({{< ref "/docs/grafana-cloud" >}}).
|
||||
|
||||
You can create, change or remove [Custom roles]({{< relref "./manage-rbac-roles/#create-custom-roles-using-provisioning" >}}) and create or remove [basic role assignments]({{< relref "./assign-rbac-roles/#assign-a-fixed-role-to-a-basic-role-using-provisioning" >}}), by adding one or more YAML configuration files in the `provisioning/access-control/` directory.
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ no data, we can use an if statement to check for `$values.B`:
|
||||
|
||||
## Classic conditions
|
||||
|
||||
If the rule uses a classic condition instead of a reduce and math expression, then `$values` contains the combination
|
||||
If the rule uses a classic condition instead of a reduce and math expresison, then `$values` contains the combination
|
||||
of the `refID` and position of the condition. For example, `{{ $values.A0 }}` and `{{ $values.A1 }}`.
|
||||
|
||||
## Variables
|
||||
@@ -97,5 +97,5 @@ The following template variables are available when expanding annotations and la
|
||||
| Name | Description |
|
||||
| ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| $labels | The labels from the query or condition. For example, `{{ $labels.instance }}` and `{{ $labels.job }}`. This is unavailable when the rule uses a [classic condition]({{< relref "../../alerting-rules/create-grafana-managed-rule/#single-and-multi-dimensional-rule" >}}). |
|
||||
| $values | The values of all reduce and math expressions that were evaluated for this alert rule. For example, `{{ $values.A }}`, `{{ $values.A.Labels }}` and `{{ $values.A.Value }}` where `A` is the `refID` of the reduce or math expression. If the rule uses a classic condition instead of a reduce and math expression, then `$values` contains the combination of the `refID` and position of the condition. |
|
||||
| $values | The values of all reduce and math expressions that were evaluated for this alert rule. For example, `{{ $values.A }}`, `{{ $values.A.Labels }}` and `{{ $values.A.Value }}` where `A` is the `refID` of the reduce or math expression. If the rule uses a classic condition instead of a reduce and math expresison, then `$values` contains the combination of the `refID` and position of the condition. |
|
||||
| $value | The value string of the alert instance. For example, `[ var='A' labels={instance=foo} value=10 ]`. |
|
||||
|
||||
@@ -27,11 +27,6 @@ dashboard to the world.
|
||||
|
||||
Add the `publicDashboards` feature toggle to your `custom.ini` file.
|
||||
|
||||
```
|
||||
[feature_toggles]
|
||||
publicDashboards = true
|
||||
```
|
||||
|
||||
> **Note:** For Grafana Cloud, you will need to contact support to have the feature enabled.
|
||||
|
||||
#### Make a dashboard public
|
||||
|
||||
@@ -208,7 +208,6 @@ The friendly names for the time series selectors are shown in Grafana. Here is t
|
||||
| SLI Value | select_slo_health |
|
||||
| SLO Compliance | select_slo_compliance |
|
||||
| SLO Error Budget Remaining | select_slo_budget_fraction |
|
||||
| SLO Burn Rate | select_slo_burn_rate |
|
||||
|
||||
#### Alias patterns for SLO queries
|
||||
|
||||
|
||||
@@ -31,71 +31,85 @@ for the license granted herein to Grafana Labs and recipients of
|
||||
software distributed by Grafana Labs, You reserve all right, title,
|
||||
and interest in and to Your Contributions.
|
||||
|
||||
1. Definitions. "You" (or "Your") shall mean the copyright owner or legal entity
|
||||
authorized by the copyright owner that is making this Agreement
|
||||
with Grafana Labs. For legal entities, the entity making a
|
||||
Contribution and all other entities that control, are controlled by,
|
||||
or are under common control with that entity are considered to be a
|
||||
single Contributor. For the purposes of this definition, "control"
|
||||
means (i) the power, direct or indirect, to cause the direction or
|
||||
management of such entity, whether by contract or otherwise, or
|
||||
(ii) ownership of fifty percent (50%) or more of the outstanding
|
||||
shares, or (iii) beneficial ownership of such entity.
|
||||
"Contribution" shall mean any work, as well as
|
||||
any modifications or additions to an existing work, that is intentionally
|
||||
submitted by You to Grafana Labs for inclusion in, or
|
||||
documentation of, any of the products owned or managed by Grafana Labs (the "Work"). For the purposes of this definition,
|
||||
"submitted" means any form of electronic, verbal, or written
|
||||
communication sent to Grafana Labs or its representatives,
|
||||
including but not limited to communication on electronic mailing
|
||||
lists, source code control systems (such as GitHub), and issue tracking systems
|
||||
that are managed by, or on behalf of, Grafana Labs for the
|
||||
purpose of discussing and improving the Work, but excluding
|
||||
communication that is conspicuously marked or otherwise designated
|
||||
in writing by You as "Not a Contribution."
|
||||
## 1. Definitions.
|
||||
|
||||
1. Grant of Copyright License. Subject to the terms and conditions of this Agreement, You hereby grant to Grafana Labs and to
|
||||
recipients of software distributed by Grafana Labs a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare derivative works of,
|
||||
publicly display, publicly perform, sublicense, and distribute
|
||||
Your Contributions and such derivative works.
|
||||
"You" (or "Your") shall mean the copyright owner or legal entity
|
||||
authorized by the copyright owner that is making this Agreement
|
||||
with Grafana Labs. For legal entities, the entity making a
|
||||
Contribution and all other entities that control, are controlled by,
|
||||
or are under common control with that entity are considered to be a
|
||||
single Contributor. For the purposes of this definition, "control"
|
||||
means (i) the power, direct or indirect, to cause the direction or
|
||||
management of such entity, whether by contract or otherwise, or
|
||||
(ii) ownership of fifty percent (50%) or more of the outstanding
|
||||
shares, or (iii) beneficial ownership of such entity.
|
||||
"Contribution" shall mean any work, as well as
|
||||
any modifications or additions to an existing work, that is intentionally
|
||||
submitted by You to Grafana Labs for inclusion in, or
|
||||
documentation of, any of the products owned or managed by Grafana Labs (the "Work"). For the purposes of this definition,
|
||||
"submitted" means any form of electronic, verbal, or written
|
||||
communication sent to Grafana Labs or its representatives,
|
||||
including but not limited to communication on electronic mailing
|
||||
lists, source code control systems (such as GitHub), and issue tracking systems
|
||||
that are managed by, or on behalf of, Grafana Labs for the
|
||||
purpose of discussing and improving the Work, but excluding
|
||||
communication that is conspicuously marked or otherwise designated
|
||||
in writing by You as "Not a Contribution."
|
||||
|
||||
1. Grant of Patent License. Subject to the terms and conditions of this Agreement, You hereby grant to Grafana Labs and to recipients
|
||||
of software distributed by Grafana Labs a perpetual, worldwide,
|
||||
non-exclusive, no-charge, royalty-free, irrevocable (except as
|
||||
stated in this section) patent license to make, have made, use,
|
||||
offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by You that are necessarily infringed by Your Contribution(s)
|
||||
alone or by combination of Your Contribution(s) with the Work to
|
||||
which such Contribution(s) were submitted. If any entity institutes
|
||||
patent litigation against You or any other entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that your
|
||||
Contribution, or the Work to which you have contributed, constitutes
|
||||
direct or contributory patent infringement, then any patent licenses
|
||||
granted to that entity under this Agreement for that Contribution or
|
||||
Work shall terminate as of the date such litigation is filed.
|
||||
## 2. Grant of Copyright License. Subject to the terms and conditions
|
||||
|
||||
1. You represent that You are legally entitled to grant the above license. If You are an individual, and if Your employer(s) has rights to intellectual property
|
||||
that you create that includes Your Contributions, you represent
|
||||
that You have received permission to make Contributions on behalf
|
||||
of that employer, or that Your employer has waived such rights for
|
||||
your Contributions to Grafana Labs. If You are a Corporation, any individual who makes a contribution from an account associated with You will be considered authorized to Contribute on Your behalf.
|
||||
of this Agreement, You hereby grant to Grafana Labs and to
|
||||
recipients of software distributed by Grafana Labs a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare derivative works of,
|
||||
publicly display, publicly perform, sublicense, and distribute
|
||||
Your Contributions and such derivative works.
|
||||
|
||||
1. You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others).
|
||||
## 3. Grant of Patent License. Subject to the terms and conditions of
|
||||
|
||||
1. You are not expected to provide support for Your Contributions,except to the extent You desire to provide support. You may provide
|
||||
support for free, for a fee, or not at all. Unless required by
|
||||
applicable law or agreed to in writing, You provide Your
|
||||
Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
|
||||
OF ANY KIND, either express or implied, including, without
|
||||
limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,
|
||||
MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
this Agreement, You hereby grant to Grafana Labs and to recipients
|
||||
of software distributed by Grafana Labs a perpetual, worldwide,
|
||||
non-exclusive, no-charge, royalty-free, irrevocable (except as
|
||||
stated in this section) patent license to make, have made, use,
|
||||
offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by You that are necessarily infringed by Your Contribution(s)
|
||||
alone or by combination of Your Contribution(s) with the Work to
|
||||
which such Contribution(s) were submitted. If any entity institutes
|
||||
patent litigation against You or any other entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that your
|
||||
Contribution, or the Work to which you have contributed, constitutes
|
||||
direct or contributory patent infringement, then any patent licenses
|
||||
granted to that entity under this Agreement for that Contribution or
|
||||
Work shall terminate as of the date such litigation is filed.
|
||||
|
||||
1. Should You wish to submit work that is not Your original creation, You may submit it to Grafana Labs separately from any
|
||||
Contribution, identifying the complete details of its source and
|
||||
of any license or other restriction (including, but not limited
|
||||
to, related patents, trademarks, and license agreements) of which
|
||||
you are personally aware, and conspicuously marking the work as
|
||||
"Submitted on behalf of a third-party: [named here]".
|
||||
## 4. You represent that You are legally entitled to grant the above
|
||||
|
||||
license. If You are an individual, and if Your employer(s) has rights to intellectual property
|
||||
that you create that includes Your Contributions, you represent
|
||||
that You have received permission to make Contributions on behalf
|
||||
of that employer, or that Your employer has waived such rights for
|
||||
your Contributions to Grafana Labs. If You are a Corporation, any individual who makes a contribution from an account associated with You will be considered authorized to Contribute on Your behalf.
|
||||
|
||||
## 5. You represent that each of Your Contributions is Your original
|
||||
|
||||
creation (see section 7 for submissions on behalf of others).
|
||||
|
||||
## 6. You are not expected to provide support for Your Contributions,
|
||||
|
||||
except to the extent You desire to provide support. You may provide
|
||||
support for free, for a fee, or not at all. Unless required by
|
||||
applicable law or agreed to in writing, You provide Your
|
||||
Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
|
||||
OF ANY KIND, either express or implied, including, without
|
||||
limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,
|
||||
MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
## 7. Should You wish to submit work that is not Your original creation,
|
||||
|
||||
You may submit it to Grafana Labs separately from any
|
||||
Contribution, identifying the complete details of its source and
|
||||
of any license or other restriction (including, but not limited
|
||||
to, related patents, trademarks, and license agreements) of which
|
||||
you are personally aware, and conspicuously marking the work as
|
||||
"Submitted on behalf of a third-party: [named here]".
|
||||
|
||||
@@ -650,8 +650,6 @@ Content-Type: application/json
|
||||
|
||||
`POST /api/admin/provisioning/access-control/reload`
|
||||
|
||||
`POST /api/admin/provisioning/alerting/reload`
|
||||
|
||||
Reloads the provisioning config files for specified type and provision entities again. It won't return
|
||||
until the new provisioned entities are already stored in the database. In case of dashboards, it will stop
|
||||
polling for changes in dashboard files and then restart it with new configurations after returning.
|
||||
@@ -669,7 +667,6 @@ See note in the [introduction]({{< ref "#admin-api" >}}) for an explanation.
|
||||
| provisioning:reload | provisioners:datasources | datasources |
|
||||
| provisioning:reload | provisioners:plugins | plugins |
|
||||
| provisioning:reload | provisioners:notifications | notifications |
|
||||
| provisioning:reload | provisioners:alerting | alerting |
|
||||
|
||||
**Example Request**:
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ Once the secure configuration has been encrypted, it can no longer be accessed f
|
||||
|
||||
To demonstrate how you can add secrets to a data source plugin, let's add support for configuring an API key.
|
||||
|
||||
Create a new interface in `types.ts` to hold the API key.
|
||||
Create a new interface in `types.go` to hold the API key.
|
||||
|
||||
```ts
|
||||
export interface MySecureJsonData {
|
||||
|
||||
@@ -165,7 +165,7 @@ Dimensions: 5 fields by 2 rows
|
||||
+---------------------+------------------+------------------+------------------+------------------+
|
||||
```
|
||||
|
||||
> **Note:** Not all panels support the wide time series data frame format. To keep full backward compatibility we have introduced a transformation that can be used to convert from the wide to the long format. For usage information, refer to the [Prepare time series-transformation]({{< relref "../../panels/transform-data/#prepare-time-series" >}}).
|
||||
> **Note:** Not all panels support the wide time series data frame format. To keep full backward compatibility we have introduced a transformation that can be used to convert from the wide to the long format. For usage information, refer to the [Prepare time series-transformation]({{< relref "../../panels/transform-data/transformation-functions/#prepare-time-series" >}}).
|
||||
|
||||
## Technical references
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ Thresholds provide one method for you to conditionally style and color your visu
|
||||
You can use thresholds to:
|
||||
|
||||
- Color grid lines or grid ares areas in the [Time-series visualization]({{< relref "../../visualizations/time-series/" >}})
|
||||
- Color lines in the [Time-series visualization]({{< relref "../../visualizations/time-series#from-thresholds" >}})
|
||||
- Color lines in the [Time-series visualization]({{< relref "../../visualizations/time-series/graph-color-scheme/#from-thresholds" >}})
|
||||
- Color the background or value text in the [Stat visualization]({{< relref "../../visualizations/stat-panel/" >}})
|
||||
- Color the gauge and threshold markers in the [Gauge visualization]({{< relref "../../visualizations/gauge-panel/" >}})
|
||||
- Color markers in the [Geomap visualization]({{< relref "../../visualizations/geomap/" >}})
|
||||
|
||||
@@ -1,128 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /docs/grafana/latest/panels/configure-value-mappings/
|
||||
- /docs/grafana/latest/panels/format-data/
|
||||
- /docs/grafana/latest/panels/value-mappings/
|
||||
- /docs/grafana/latest/panels/format-data/about-value-mapping/
|
||||
- /docs/grafana/latest/panels/format-data/edit-value-mapping/
|
||||
- /docs/grafana/latest/panels/format-data/map-a-range/
|
||||
- /docs/grafana/latest/panels/format-data/map-a-regular-expression/
|
||||
- /docs/grafana/latest/panels/format-data/map-a-special-value/
|
||||
- /docs/grafana/latest/panels/format-data/map-a-value/
|
||||
title: Configure value mappings
|
||||
menuTitle: Configure value mappings
|
||||
weight: 600
|
||||
---
|
||||
|
||||
# Configure value mappings
|
||||
|
||||
In addition to field overrides, value mapping is a technique that you can use to change the visual treatment of data that appears in a visualization.
|
||||
|
||||
Values mapped via value mappings bypass the unit formatting. This means that a text value mapped to a numerical value is not formatted using the configured unit.
|
||||
|
||||

|
||||
|
||||
If value mappings are present in a panel, then Grafana displays a summary in the side pane of the panel editor.
|
||||
|
||||
> **Note:** The new value mappings are not compatible with some visualizations, such as Graph (old), Text, and Heatmap.
|
||||
|
||||
## Types of value mappings
|
||||
|
||||
Grafana supports the following value mappings:
|
||||
|
||||
- **Value:** Maps text values to a color or different display text. For example, you can configure a value mapping so that all instances of the value `10` appear as **Perfection!** rather than the number.
|
||||
- **Range:** Maps numerical ranges to a display text and color. For example, if a value is within a certain range, you can configure a range value mapping to display **Low** or **High** rather than the number.
|
||||
- **Regex:** Maps regular expressions to replacement text and a color. For example, if a value is `www.example.com`, you can configure a regex value mapping so that Grafana displays **www** and truncates the domain.
|
||||
- **Special** Maps special values like `Null`, `NaN` (not a number), and boolean values like `true` and `false` to a display text and color. For example, you can configure a special value mapping so that `null` values appear as **N/A**.
|
||||
|
||||
You can also use the dots on the left to drag and reorder value mappings in the list.
|
||||
|
||||
## Examples
|
||||
|
||||
Refer to the following examples to learn more about value mapping.
|
||||
|
||||
### Time series example
|
||||
|
||||
The following image shows a time series visualization with value mappings. Value mapping colors are not applied to this visualization, but the display text is shown on the axis.
|
||||
|
||||

|
||||
|
||||
### Stat example
|
||||
|
||||
The following image shows a Stat visualization with value mappings and text colors applied. You can hide the sparkline so it doesn't interfere with the values.
|
||||
|
||||

|
||||
|
||||
### Bar gauge example
|
||||
|
||||
The following image shows a bar gauge visualization with value mappings. The value mapping colors are applied to the text, but not to the gauges.
|
||||
|
||||

|
||||
|
||||
### Table example
|
||||
|
||||
The following image shows a table visualization with value mappings. If you want value mapping colors displayed on the table, then set the cell display mode to **Color text** or **Color background**.
|
||||
|
||||

|
||||
|
||||
## Map a value
|
||||
|
||||
Map a value when you want to format a single value.
|
||||
|
||||
1. Open a panel for which you want to map a value.
|
||||
1. In panel display options, locate the **Value mappings** section and click **Add value mappings**.
|
||||
1. Click **Add a new mapping** and then select **Value**.
|
||||
1. Enter the value for Grafana to match.
|
||||
1. (Optional) Enter display text.
|
||||
1. (Optional) Set the color.
|
||||
1. Click **Update** to save the value mapping.
|
||||
|
||||

|
||||
|
||||
## Map a range
|
||||
|
||||
Map a range of values when you want to format multiple, continuous values.
|
||||
|
||||
1. Edit the panel for which you want to map a range of values.
|
||||
1. In panel display options, in the **Value mappings** section, click **Add value mappings**.
|
||||
1. Click **Add a new mapping** and then select **Range**.
|
||||
1. Enter the beginning and ending values in the range for Grafana to match.
|
||||
1. (Optional) Enter display text.
|
||||
1. (Optional) Set the color.
|
||||
1. Click **Update** to save the value mapping.
|
||||
|
||||

|
||||
|
||||
## Map a regular expression
|
||||
|
||||
Map a regular expression when you want to format the text and color of a regular expression value.
|
||||
|
||||
1. Edit the panel for which you want to map a regular expression.
|
||||
1. In the **Value mappings** section of the panel display options, click **Add value mappings**.
|
||||
1. Click **Add a new mapping** and then select **Regex**.
|
||||
1. Enter the regular expression pattern for Grafana to match.
|
||||
1. (Optional) Enter display text.
|
||||
1. (Optional) Set the color.
|
||||
1. Click **Update** to save the value mapping.
|
||||
|
||||
## Map a special value
|
||||
|
||||
Map a special value when you want to format uncommon, boolean, or empty values.
|
||||
|
||||
1. Edit the panel for which you want to map a special value.
|
||||
1. In panel display options, locate the **Value mappings** section and click **Add value mappings**.
|
||||
1. Click **Add a new mapping** and then select **Special**.
|
||||
1. Select the special value for Grafana to match.
|
||||
1. (Optional) Enter display text.
|
||||
1. (Optional) Set the color.
|
||||
1. Click **Update** to save the value mapping.
|
||||
|
||||

|
||||
|
||||
## Edit a value mapping
|
||||
|
||||
You can change a value mapping at any time.
|
||||
|
||||
1. Edit the panel that contains the value mapping you want to edit.
|
||||
1. In the panel display options, in the **Value mappings** section, click **Edit value mappings**.
|
||||
1. Make the changes and click **Update**.
|
||||
14
docs/sources/panels/format-data/_index.md
Normal file
14
docs/sources/panels/format-data/_index.md
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
aliases:
|
||||
- /docs/grafana/latest/panels/format-data/
|
||||
- /docs/grafana/latest/panels/value-mappings/
|
||||
- /docs/sources/panels/format-data/
|
||||
title: Format data using value mapping
|
||||
weight: 600
|
||||
---
|
||||
|
||||
# Format data using value mapping
|
||||
|
||||
In addition to field overrides, value mapping is a technique that you can use to change the visual treatment of data that appears in a visualization.
|
||||
|
||||
{{< section >}}
|
||||
54
docs/sources/panels/format-data/about-value-mapping.md
Normal file
54
docs/sources/panels/format-data/about-value-mapping.md
Normal file
@@ -0,0 +1,54 @@
|
||||
---
|
||||
aliases:
|
||||
- /docs/grafana/latest/panels/format-data/about-value-mapping/
|
||||
- /docs/sources/panels/format-data/about-value-mapping/
|
||||
title: About value mapping
|
||||
weight: 10
|
||||
---
|
||||
|
||||
# About value mapping
|
||||
|
||||
Value mapping allows you to replace values or ranges in your visualizations with words or emojis.
|
||||
|
||||
Values mapped via value mappings will skip the unit formatting. This means that a text value mapped to a numerical value will not be formatted using the configured unit.
|
||||
|
||||

|
||||
|
||||
If value mappings are present in a panel, then Grafana displays a summary in the side pane of the panel editor.
|
||||
|
||||
> **Note:** The new value mappings are not compatible with some visualizations, such as Graph (old), Text, and Heatmap.
|
||||
|
||||
## Types of value mappings
|
||||
|
||||
Grafana supports the following value mappings:
|
||||
|
||||
- **Value** maps text values to a color or different display text. For example, if a value is `10`, I want Grafana to display **Perfection!** rather than the number.
|
||||
- **Range** maps numerical ranges to a display text and color. For example, if a value is within a certain range, I want Grafana to display **Low** or **High** rather than the number.
|
||||
- **Regex** maps regular expressions to replacement text and a color. For example, if a value is 'www.example.com', I want Grafana to display just **www**, truncating the domain.
|
||||
- **Special** maps special values like `Null`, `NaN` (not a number), and boolean values like `true` and `false` to a display text and color. For example, if Grafana encounters a `null`, I want Grafana to display **N/A**.
|
||||
|
||||
You can also use the dots on the left as a "handle" to drag and reorder value mappings in the list.
|
||||
|
||||
## Time series example
|
||||
|
||||
Here's an example showing a Time series visualization with value mappings. Value mapping colors are not applied to this visualization, but the display text is shown on the axis.
|
||||
|
||||

|
||||
|
||||
## Stat example
|
||||
|
||||
Here's an example showing a Stat visualization with value mappings. You might want to hide the sparkline so it doesn't interfere with the values. Value mapping text colors are applied.
|
||||
|
||||

|
||||
|
||||
## Bar gauge example
|
||||
|
||||
Here's an example showing a Bar gauge visualization with value mappings. The value mapping colors are applied to the text but not the gauges.
|
||||
|
||||

|
||||
|
||||
## Table example
|
||||
|
||||
Here's an example showing a Table visualization with value mappings. If you want value mapping colors displayed on the table, then set the cell display mode to **Color text** or **Color background**.
|
||||
|
||||

|
||||
21
docs/sources/panels/format-data/edit-value-mapping.md
Normal file
21
docs/sources/panels/format-data/edit-value-mapping.md
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
aliases:
|
||||
- /docs/grafana/latest/panels/format-data/edit-value-mapping/
|
||||
- /docs/sources/panels/format-data/edit-value-mapping/
|
||||
title: Edit a value mapping
|
||||
weight: 60
|
||||
---
|
||||
|
||||
# Edit a value mapping
|
||||
|
||||
You can change a value mapping at any time.
|
||||
|
||||
## Before you begin
|
||||
|
||||
- Ensure you have an existing value mapping to edit.
|
||||
|
||||
**To edit a value mapping**:
|
||||
|
||||
1. Edit the panel that contains the value mapping you want to edit.
|
||||
1. In the panel display options, in the **Value mappings** section, click **Edit value mappings**.
|
||||
1. Make the changes and click **Update**.
|
||||
21
docs/sources/panels/format-data/map-a-range.md
Normal file
21
docs/sources/panels/format-data/map-a-range.md
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
aliases:
|
||||
- /docs/grafana/latest/panels/format-data/map-a-range/
|
||||
- /docs/sources/panels/format-data/map-a-range/
|
||||
title: Map a range
|
||||
weight: 30
|
||||
---
|
||||
|
||||
# Map a range
|
||||
|
||||
Map a range of values when you want to format multiple, continuous values.
|
||||
|
||||
1. Edit the panel for which you want to map a range of values.
|
||||
1. In panel display options, in the **Value mappings** section, click **Add value mappings**.
|
||||
1. Click **Add a new mapping** and then select **Range**.
|
||||
1. Enter the beginning and ending values in the range for Grafana to match.
|
||||
1. (Optional) Enter display text.
|
||||
1. (Optional) Set the color.
|
||||
1. Click **Update** to save the value mapping.
|
||||
|
||||

|
||||
19
docs/sources/panels/format-data/map-a-regular-expression.md
Normal file
19
docs/sources/panels/format-data/map-a-regular-expression.md
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
aliases:
|
||||
- /docs/grafana/latest/panels/format-data/map-a-regular-expression/
|
||||
- /docs/sources/panels/format-data/map-a-regular-expression/
|
||||
title: Map a regular expression
|
||||
weight: 40
|
||||
---
|
||||
|
||||
# Map a regular expression
|
||||
|
||||
Map a regular expression when you want to format the text and color of a regular expression value.
|
||||
|
||||
1. Edit the panel for which you want to map a regular expression.
|
||||
1. In the **Value mappings** section of the panel display options, click **Add value mappings**.
|
||||
1. Click **Add a new mapping** and then select **Regex**.
|
||||
1. Enter the regular expression pattern for Grafana to match.
|
||||
1. (Optional) Enter display text.
|
||||
1. (Optional) Set the color.
|
||||
1. Click **Update** to save the value mapping.
|
||||
27
docs/sources/panels/format-data/map-a-special-value.md
Normal file
27
docs/sources/panels/format-data/map-a-special-value.md
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
aliases:
|
||||
- /docs/grafana/latest/panels/format-data/map-a-special-value/
|
||||
- /docs/sources/panels/format-data/map-a-special-value/
|
||||
title: Map a special value
|
||||
weight: 50
|
||||
---
|
||||
|
||||
# Map a special value
|
||||
|
||||
Map a special value when you want to format uncommon, boolean, or empty values.
|
||||
|
||||
1. Edit the panel for which you want to map a special value.
|
||||
1. In panel display options, locate the **Value mappings** section and click **Add value mappings**.
|
||||
1. Click **Add a new mapping** and then select **Special**.
|
||||
1. Select the special value for Grafana to match. Options include:
|
||||
- Null
|
||||
- NaN (Not a Number)
|
||||
- Null + NaN
|
||||
- True
|
||||
- False
|
||||
- Empty
|
||||
1. (Optional) Enter display text.
|
||||
1. (Optional) Set the color.
|
||||
1. Click **Update** to save the value mapping.
|
||||
|
||||

|
||||
21
docs/sources/panels/format-data/map-a-value.md
Normal file
21
docs/sources/panels/format-data/map-a-value.md
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
aliases:
|
||||
- /docs/grafana/latest/panels/format-data/map-a-value/
|
||||
- /docs/sources/panels/format-data/map-a-value/
|
||||
title: Map a value
|
||||
weight: 20
|
||||
---
|
||||
|
||||
# Map a value
|
||||
|
||||
Map a value when you want to format a single value.
|
||||
|
||||
1. Open a panel for which you want to map a value.
|
||||
1. In panel display options, locate the **Value mappings** section and click **Add value mappings**.
|
||||
1. Click **Add a new mapping** and then select **Value**.
|
||||
1. Enter the value for Grafana to match.
|
||||
1. (Optional) Enter display text.
|
||||
1. (Optional) Set the color.
|
||||
1. Click **Update** to save the value mapping.
|
||||
|
||||

|
||||
26
docs/sources/panels/transform-data/_index.md
Normal file
26
docs/sources/panels/transform-data/_index.md
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
aliases:
|
||||
- /docs/grafana/latest/panels/transform-data/
|
||||
- /docs/grafana/latest/panels/transformations/
|
||||
- /docs/grafana/latest/panels/transformations/apply-transformations/
|
||||
- /docs/grafana/latest/panels/transformations/config-from-query/
|
||||
- /docs/grafana/latest/panels/transformations/rows-to-fields/
|
||||
- /docs/sources/panels/transform-data/
|
||||
title: Transform data
|
||||
weight: 500
|
||||
---
|
||||
|
||||
# Transform data
|
||||
|
||||
Transformations are a powerful way to manipulate data returned by a query before the system applies a visualization.
|
||||
|
||||
With transformations, you can:
|
||||
|
||||
- Rename fields
|
||||
- Join time series data
|
||||
- Perform mathematical operations across queries
|
||||
- Use the output of one transformation as the input to another transformation
|
||||
|
||||
This section includes the following topics:
|
||||
|
||||
{{< section >}}
|
||||
32
docs/sources/panels/transform-data/about-transformation.md
Normal file
32
docs/sources/panels/transform-data/about-transformation.md
Normal file
@@ -0,0 +1,32 @@
|
||||
---
|
||||
aliases:
|
||||
- /docs/grafana/latest/panels/transform-data/about-transformation/
|
||||
- /docs/sources/panels/transform-data/about-transformation/
|
||||
title: About transformations
|
||||
weight: 10
|
||||
---
|
||||
|
||||
# About transformations
|
||||
|
||||
Transformations process the result set of a query before it’s passed on for visualization. Using transformations, you can:
|
||||
|
||||
- Rename fields
|
||||
- Join time series data
|
||||
- Perform mathematical operations across queries
|
||||
- Use the output of one transformation as the input to another transformation
|
||||
|
||||
For users that rely on multiple views of the same dataset, transformations offer an efficient method of creating and maintaining numerous dashboards.
|
||||
|
||||
You can also use the output of one transformation as the input to another transformation, which results in a performance gain.
|
||||
|
||||
> Sometimes the system cannot graph transformed data. When that happens, click the `Table view` toggle above the visualization to switch to a table view of the data. This can help you understand the final result of your transformations.
|
||||
|
||||
## Transformation types
|
||||
|
||||
Grafana provides a number of ways that you can transform data. For a complete list of transformations, refer to [Transformation functions]({{< relref "transformation-functions/" >}}).
|
||||
|
||||
## Order of transformations
|
||||
|
||||
When there are multiple transformations, Grafana applies them in the order they are listed. Each transformation creates a result set that then passes on to the next transformation in the processing pipeline.
|
||||
|
||||
The order in which Grafana applies transformations directly impacts the results. For example, if you use a Reduce transformation to condense all the results of one column into a single value, then you can only apply transformations to that single value.
|
||||
@@ -0,0 +1,34 @@
|
||||
---
|
||||
aliases:
|
||||
- /docs/grafana/latest/panels/transform-data/add-transformation-to-data/
|
||||
- /docs/grafana/latest/panels/transform-data/apply-transformation-to-data/
|
||||
- /docs/sources/panels/transform-data/add-transformation-to-data/
|
||||
- /docs/sources/panels/transform-data/apply-transformation-to-data/
|
||||
title: Add a transformation to data
|
||||
weight: 20
|
||||
---
|
||||
|
||||
# Add a transformation function to data
|
||||
|
||||
The following steps guide you in adding a transformation to data. This documentation does not include steps for each type of transformation. For a complete list of transformations, refer to [Transformation functions]({{< relref "transformation-functions/" >}}).
|
||||
|
||||
## Before you begin
|
||||
|
||||
- [Add a query]({{< relref "../query-a-data-source/add-a-query/" >}}).
|
||||
|
||||
**To apply a transformation function to data**:
|
||||
|
||||
1. Navigate to the panel where you want to add one or more transformations.
|
||||
1. Click the panel title and then click **Edit**.
|
||||
1. Click the **Transform** tab.
|
||||
1. Click a transformation.
|
||||
|
||||
A transformation row appears where you configure the transformation options. For more information about how to configure a transformation, refer to [Transformation functions]({{< relref "transformation-functions/" >}}).
|
||||
|
||||
For information about available calculations, refer to [Calculation types]({{< relref "../calculation-types/" >}}).
|
||||
|
||||
1. To apply another transformation, click **Add transformation**.
|
||||
|
||||
This transformation acts on the result set returned by the previous transformation.
|
||||
|
||||
{{< figure src="/static/img/docs/transformations/transformations-7-0.png" class="docs-image--no-shadow" max-width= "1100px" >}}
|
||||
15
docs/sources/panels/transform-data/debug-transformation.md
Normal file
15
docs/sources/panels/transform-data/debug-transformation.md
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
aliases:
|
||||
- /docs/grafana/latest/panels/transform-data/debug-transformation/
|
||||
- /docs/sources/panels/transform-data/debug-transformation/
|
||||
title: Debug a transformation
|
||||
weight: 30
|
||||
---
|
||||
|
||||
# Debug a transformation
|
||||
|
||||
To see the input and the output result sets of the transformation, click the bug icon on the right side of the transformation row.
|
||||
|
||||
The input and output results sets can help you debug a transformation.
|
||||
|
||||
{{< figure src="/static/img/docs/transformations/debug-transformations-7-0.png" class="docs-image--no-shadow" max-width= "1100px" >}}
|
||||
21
docs/sources/panels/transform-data/delete-transformation.md
Normal file
21
docs/sources/panels/transform-data/delete-transformation.md
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
aliases:
|
||||
- /docs/grafana/latest/panels/transform-data/delete-transformation/
|
||||
- /docs/sources/panels/transform-data/delete-transformation/
|
||||
title: Delete a transformation
|
||||
weight: 40
|
||||
---
|
||||
|
||||
# Delete a transformation
|
||||
|
||||
We recommend that you remove transformations that you don't need. When you delete a transformation, you remove the data from the visualization.
|
||||
|
||||
## Before you begin
|
||||
|
||||
- Identify all dashboards that rely on the transformation and inform impacted dashboard users.
|
||||
|
||||
**To delete a transformation**:
|
||||
|
||||
1. Open a panel for editing.
|
||||
1. Click the **Transform** tab.
|
||||
1. Click the trash icon next to the transformation you want to delete.
|
||||
@@ -1,93 +1,18 @@
|
||||
---
|
||||
aliases:
|
||||
- /docs/grafana/latest/panels/transform-data/
|
||||
- /docs/grafana/latest/panels/transformations/
|
||||
- /docs/grafana/latest/panels/transformations/apply-transformations/
|
||||
- /docs/grafana/latest/panels/transformations/config-from-query/
|
||||
- /docs/grafana/latest/panels/transformations/rows-to-fields/
|
||||
- /docs/grafana/latest/panels/transform-data/about-transformation/
|
||||
- /docs/grafana/latest/panels/transform-data/add-transformation-to-data/
|
||||
- /docs/grafana/latest/panels/transform-data/apply-transformation-to-data/
|
||||
- /docs/grafana/latest/panels/transform-data/debug-transformation/
|
||||
- /docs/grafana/latest/panels/transform-data/delete-transformation/
|
||||
- /docs/grafana/latest/panels/reference-transformation-functions/
|
||||
- /docs/grafana/latest/panels/transform-data/transformation-functions/
|
||||
- /docs/grafana/latest/panels/transformations/types-options/
|
||||
title: Transform data
|
||||
weight: 500
|
||||
- /docs/sources/panels/reference-transformation-functions/
|
||||
title: Transformation functions
|
||||
weight: 1000
|
||||
---
|
||||
|
||||
# Transform data
|
||||
|
||||
Transformations are a powerful way to manipulate data returned by a query before the system applies a visualization. Using transformations, you can:
|
||||
|
||||
- Rename fields
|
||||
- Join time series data
|
||||
- Perform mathematical operations across queries
|
||||
- Use the output of one transformation as the input to another transformation
|
||||
|
||||
For users that rely on multiple views of the same dataset, transformations offer an efficient method of creating and maintaining numerous dashboards.
|
||||
|
||||
You can also use the output of one transformation as the input to another transformation, which results in a performance gain.
|
||||
|
||||
> Sometimes the system cannot graph transformed data. When that happens, click the `Table view` toggle above the visualization to switch to a table view of the data. This can help you understand the final result of your transformations.
|
||||
|
||||
## Transformation types
|
||||
|
||||
Grafana provides a number of ways that you can transform data. For a complete list of transformations, refer to [Transformation functions]({{< relref "#transformation-functions" >}}).
|
||||
|
||||
## Order of transformations
|
||||
|
||||
When there are multiple transformations, Grafana applies them in the order they are listed. Each transformation creates a result set that then passes on to the next transformation in the processing pipeline.
|
||||
|
||||
The order in which Grafana applies transformations directly impacts the results. For example, if you use a Reduce transformation to condense all the results of one column into a single value, then you can only apply transformations to that single value.
|
||||
|
||||
## Add a transformation function to data
|
||||
|
||||
The following steps guide you in adding a transformation to data. This documentation does not include steps for each type of transformation. For a complete list of transformations, refer to [Transformation functions]({{< relref "#transformation-functions" >}}).
|
||||
|
||||
1. Navigate to the panel where you want to add one or more transformations.
|
||||
1. Click the panel title and then click **Edit**.
|
||||
1. Click the **Transform** tab.
|
||||
1. Click a transformation.
|
||||
|
||||
A transformation row appears where you configure the transformation options. For more information about how to configure a transformation, refer to [Transformation functions]({{< relref "#transformation-functions" >}}).
|
||||
|
||||
For information about available calculations, refer to [Calculation types]({{< relref "../calculation-types/" >}}).
|
||||
|
||||
1. To apply another transformation, click **Add transformation**.
|
||||
|
||||
This transformation acts on the result set returned by the previous transformation.
|
||||
|
||||
{{< figure src="/static/img/docs/transformations/transformations-7-0.png" class="docs-image--no-shadow" max-width= "1100px" >}}
|
||||
|
||||
## Debug a transformation
|
||||
|
||||
To see the input and the output result sets of the transformation, click the bug icon on the right side of the transformation row.
|
||||
|
||||
The input and output results sets can help you debug a transformation.
|
||||
|
||||
{{< figure src="/static/img/docs/transformations/debug-transformations-7-0.png" class="docs-image--no-shadow" max-width= "1100px" >}}
|
||||
|
||||
## Delete a transformation
|
||||
|
||||
We recommend that you remove transformations that you don't need. When you delete a transformation, you remove the data from the visualization.
|
||||
|
||||
**Before you begin:**
|
||||
|
||||
- Identify all dashboards that rely on the transformation and inform impacted dashboard users.
|
||||
|
||||
**To delete a transformation**:
|
||||
|
||||
1. Open a panel for editing.
|
||||
1. Click the **Transform** tab.
|
||||
1. Click the trash icon next to the transformation you want to delete.
|
||||
|
||||
## Transformation functions
|
||||
# Reference: Transformation functions
|
||||
|
||||
You can perform the following transformations on your data.
|
||||
|
||||
### Add field from calculation
|
||||
## Add field from calculation
|
||||
|
||||
Use this transformation to add a new field calculated from two other fields. Each transformation allows you to add one new field.
|
||||
|
||||
@@ -104,7 +29,7 @@ In the example below, I added two fields together and named them Sum.
|
||||
|
||||
{{< figure src="/static/img/docs/transformations/add-field-from-calc-stat-example-7-0.png" class="docs-image--no-shadow" max-width= "1100px" >}}
|
||||
|
||||
### Concatenate fields
|
||||
## Concatenate fields
|
||||
|
||||
This transformation combines all fields from all frames into one result. Consider:
|
||||
|
||||
@@ -126,19 +51,19 @@ After you concatenate the fields, the data frame would be:
|
||||
| ---- | ------- | --- | ------ |
|
||||
| 15.4 | 1230233 | 3.2 | 5 |
|
||||
|
||||
### Config from query results
|
||||
## Config from query results
|
||||
|
||||
This transformation allow you to select one query and from it extract standard options like **Min**, **Max**, **Unit** and **Thresholds** and apply it to other query results. This enables dynamic query driven visualization configuration.
|
||||
|
||||
If you want to extract a unique config for every row in the config query result then try the rows to fields transformation.
|
||||
|
||||
#### Options
|
||||
### Options
|
||||
|
||||
- **Config query**: Select the query that returns the data you want to use as configuration.
|
||||
- **Apply to**: Select what fields or series to apply the configuration to.
|
||||
- **Apply to options**: Usually a field type or field name regex depending on what option you selected in **Apply to**.
|
||||
|
||||
### Convert field type
|
||||
## Convert field type
|
||||
|
||||
This transformation changes the field type of the specified field.
|
||||
|
||||
@@ -168,7 +93,7 @@ The result:
|
||||
| 2019-01-01 00:00:00 | below | 29 |
|
||||
| 2020-01-01 00:00:00 | above | 22 |
|
||||
|
||||
### Filter data by name
|
||||
## Filter data by name
|
||||
|
||||
Use this transformation to remove portions of the query results.
|
||||
|
||||
@@ -193,7 +118,7 @@ Here is the same query using a Stat visualization.
|
||||
|
||||
{{< figure src="/static/img/docs/transformations/filter-name-stat-after-7-0.png" class="docs-image--no-shadow" max-width= "1100px" >}}
|
||||
|
||||
### Filter data by query
|
||||
## Filter data by query
|
||||
|
||||
Use this transformation in panels that have multiple queries, if you want to hide one or more of the queries.
|
||||
|
||||
@@ -205,7 +130,7 @@ In the example below, the panel has three queries (A, B, C). I removed the B que
|
||||
|
||||
> **Note:** This transformation is not available for Graphite because this data source does not support correlating returned data with queries.
|
||||
|
||||
### Filter data by value
|
||||
## Filter data by value
|
||||
|
||||
This transformation allows you to filter your data directly in Grafana and remove some data points from your query result. You have the option to include or exclude data that match one or more conditions you define. The conditions are applied on a selected field.
|
||||
|
||||
@@ -266,7 +191,7 @@ In the example above we chose **Match all** because we wanted to include the row
|
||||
|
||||
Conditions that are invalid or incompletely configured are ignored.
|
||||
|
||||
### Group by
|
||||
## Group by
|
||||
|
||||
This transformation groups the data by a specified field (column) value and processes calculations on each group. Click to see a list of calculation choices. For information about available calculations, refer to [Calculation types]({{< relref "../calculation-types/" >}}).
|
||||
|
||||
@@ -324,7 +249,7 @@ We would then get :
|
||||
|
||||
This transformation allows you to extract some key information out of your time series and display them in a convenient way.
|
||||
|
||||
### Join by field (outer join)
|
||||
## Join by field (outer join)
|
||||
|
||||
Use this transformation to join multiple time series from a result set by field.
|
||||
|
||||
@@ -338,7 +263,7 @@ I applied a transformation to join the query results using the time field. Now I
|
||||
|
||||
{{< figure src="/static/img/docs/transformations/join-fields-after-7-0.png" class="docs-image--no-shadow" max-width= "1100px" >}}
|
||||
|
||||
### Labels to fields
|
||||
## Labels to fields
|
||||
|
||||
This transformation changes time series results that include labels or tags into a table where each label keys and values are included in the table result. The labels can be displayed either as columns or as row values.
|
||||
|
||||
@@ -366,7 +291,7 @@ In "Rows" mode, the result has a table for each series and show each label value
|
||||
| Server | Server B |
|
||||
| Datacenter | EU |
|
||||
|
||||
#### Value field name
|
||||
### Value field name
|
||||
|
||||
If you selected Server as the **Value field name**, then you would get one field for every value of the Server label.
|
||||
|
||||
@@ -374,7 +299,7 @@ If you selected Server as the **Value field name**, then you would get one field
|
||||
| ------------------- | ---------- | -------- | -------- |
|
||||
| 2020-07-07 11:34:20 | EU | 1 | 2 |
|
||||
|
||||
#### Merging behavior
|
||||
### Merging behavior
|
||||
|
||||
The labels to fields transformer is internally two separate transformations. The first acts on single series and extracts labels to fields. The second is the [merge](#merge) transformation that joins all the results into a single table. The merge transformation tries to join on all matching fields. This merge step is required and cannot be turned off.
|
||||
|
||||
@@ -400,7 +325,7 @@ After merge:
|
||||
| 2020-07-07 11:34:20 | ServerA | 10 | |
|
||||
| 2020-07-07 11:34:20 | | 20 | EU |
|
||||
|
||||
### Merge
|
||||
## Merge
|
||||
|
||||
Use this transformation to combine the result from multiple queries into one single result. This is helpful when using the table panel visualization. Values that can be merged are combined into the same row. Values are mergeable if the shared fields contain the same data. For information, refer to [Table panel]({{< relref "../../visualizations/table/" >}}).
|
||||
|
||||
@@ -427,7 +352,7 @@ Here is the result after applying the Merge transformation.
|
||||
| 2020-07-07 11:34:20 | node | 15 | 25260122 |
|
||||
| 2020-07-07 11:24:20 | postgre | 5 | 123001233 |
|
||||
|
||||
### Organize fields
|
||||
## Organize fields
|
||||
|
||||
Use this transformation to rename, reorder, or hide fields returned by the query.
|
||||
|
||||
@@ -443,7 +368,7 @@ In the example below, I hid the value field and renamed Max and Min.
|
||||
|
||||
{{< figure src="/static/img/docs/transformations/organize-fields-stat-example-7-0.png" class="docs-image--no-shadow" max-width= "1100px" >}}
|
||||
|
||||
### Reduce
|
||||
## Reduce
|
||||
|
||||
The _Reduce_ transformation applies a calculation to each field in the frame and return a single value. Time fields are removed when applying this transformation.
|
||||
|
||||
@@ -493,7 +418,7 @@ Query B:
|
||||
| --- | ------ |
|
||||
| 3.2 | 5 |
|
||||
|
||||
### Rename by regex
|
||||
## Rename by regex
|
||||
|
||||
Use this transformation to rename parts of the query results using a regular expression and replacement pattern.
|
||||
|
||||
@@ -507,7 +432,7 @@ With the transformation applied, you can see we are left with just the remainder
|
||||
|
||||
{{< figure src="/static/img/docs/transformations/rename-by-regex-after-7-3.png" class="docs-image--no-shadow" max-width= "1100px" >}}
|
||||
|
||||
### Rows to fields
|
||||
## Rows to fields
|
||||
|
||||
The rows to fields transformation converts rows into separate fields. This can be useful as fields can be styled and configured individually. It can also use additional fields as sources for dynamic field configuration or map them to field labels. The additional labels can then be used to define better display names for the resulting fields.
|
||||
|
||||
@@ -529,7 +454,7 @@ Useful when visualizing data in:
|
||||
- Stat
|
||||
- Pie chart
|
||||
|
||||
#### Map extra fields to labels
|
||||
### Map extra fields to labels
|
||||
|
||||
If a field does not map to config property Grafana will automatically use it as source for a label on the output field-
|
||||
|
||||
@@ -550,7 +475,7 @@ The extra labels can now be used in the field display name provide more complete
|
||||
|
||||
If you want to extract config from one query and appply it to another you should use the config from query results transformation.
|
||||
|
||||
#### Example
|
||||
### Example
|
||||
|
||||
Input:
|
||||
|
||||
@@ -568,7 +493,7 @@ Output:
|
||||
|
||||
As you can see each row in the source data becomes a separate field. Each field now also has a max config option set. Options like **Min**, **Max**, **Unit** and **Thresholds** are all part of field configuration and if set like this will be used by the visualization instead of any options manually configured in the panel editor options pane.
|
||||
|
||||
### Prepare time series
|
||||
## Prepare time series
|
||||
|
||||
> **Note:** This transformation is available in Grafana 7.5.10+ and Grafana 8.0.6+.
|
||||
|
||||
@@ -580,7 +505,7 @@ Select the `Multi-frame time series` option to transform the time series data fr
|
||||
|
||||
Select the `Wide time series` option to transform the time series data frame from the long to the wide format.
|
||||
|
||||
### Series to rows
|
||||
## Series to rows
|
||||
|
||||
> **Note:** This transformation is available in Grafana 7.1+.
|
||||
|
||||
@@ -617,11 +542,11 @@ Here is the result after applying the Series to rows transformation.
|
||||
| 2020-07-07 09:30:57 | Humidity | 33 |
|
||||
| 2020-07-07 09:30:05 | Temperature | 19 |
|
||||
|
||||
### Sort by
|
||||
## Sort by
|
||||
|
||||
This transformation will sort each frame by the configured field, When `reverse` is checked, the values will return in the opposite order.
|
||||
|
||||
### Limit
|
||||
## Limit
|
||||
|
||||
Use this transformation to limit the number of rows displayed.
|
||||
|
||||
@@ -10,7 +10,6 @@ weight: 10000
|
||||
Here you can find detailed release notes that list everything that is included in every release as well as notices
|
||||
about deprecations, breaking changes as well as changes that relate to plugin development.
|
||||
|
||||
- [Release notes for 9.1.0]({{< relref "release-notes-9-1-0" >}})
|
||||
- [Release notes for 9.1.0-beta1]({{< relref "release-notes-9-1-0-beta1" >}})
|
||||
- [Release notes for 9.0.6]({{< relref "release-notes-9-0-6" >}})
|
||||
- [Release notes for 9.0.5]({{< relref "release-notes-9-0-5" >}})
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
+++
|
||||
title = "Release notes for Grafana 9.1.0"
|
||||
hide_menu = true
|
||||
+++
|
||||
|
||||
<!-- Auto generated by update changelog github action -->
|
||||
|
||||
# Release notes for Grafana 9.1.0
|
||||
|
||||
### Features and enhancements
|
||||
|
||||
- **API:** Allow creating teams with a user defined identifier. [#48710](https://github.com/grafana/grafana/pull/48710), [@papagian](https://github.com/papagian)
|
||||
- **Alerting:** Adds interval and For to alert rule details. [#53211](https://github.com/grafana/grafana/pull/53211), [@gillesdemey](https://github.com/gillesdemey)
|
||||
- **Alerting:** Extend PUT rule-group route to write the entire rule group rather than top-level fields only. [#53078](https://github.com/grafana/grafana/pull/53078), [@alexweav](https://github.com/alexweav)
|
||||
- **Alerting:** Use Adaptive Cards in Teams notifications. [#53532](https://github.com/grafana/grafana/pull/53532), [@grobinson-grafana](https://github.com/grobinson-grafana)
|
||||
- **Azure Monitor:** Add Network Insights Dashboard. [#50362](https://github.com/grafana/grafana/pull/50362), [@Teddy-Lin](https://github.com/Teddy-Lin)
|
||||
- **Chore:** Improve logging of unrecoverable errors. [#53664](https://github.com/grafana/grafana/pull/53664), [@sakjur](https://github.com/sakjur)
|
||||
- **Correlations:** Add UpdateCorrelation HTTP API. [#52444](https://github.com/grafana/grafana/pull/52444), [@Elfo404](https://github.com/Elfo404)
|
||||
- **Dashboard:** Reverted the changes of hiding multi-select and all variable in the datasource picker. [#53521](https://github.com/grafana/grafana/pull/53521), [@lpskdl](https://github.com/lpskdl)
|
||||
- **Geomap:** Add alpha day/night layer. [#50201](https://github.com/grafana/grafana/pull/50201), [@ryantxu](https://github.com/ryantxu)
|
||||
- **Geomap:** Add measuring tools. [#51608](https://github.com/grafana/grafana/pull/51608), [@drew08t](https://github.com/drew08t)
|
||||
- **GrafanaUI:** Add success state to ClipboardButton. [#52069](https://github.com/grafana/grafana/pull/52069), [@evictorero](https://github.com/evictorero)
|
||||
- **Heatmap:** Replace the heatmap panel with new implementation. [#50229](https://github.com/grafana/grafana/pull/50229), [@ryantxu](https://github.com/ryantxu)
|
||||
- **KVStore:** Allow empty value in kv_store. [#53416](https://github.com/grafana/grafana/pull/53416), [@spinillos](https://github.com/spinillos)
|
||||
- **Prometheus:** Promote Azure auth flag to configuration. [#53447](https://github.com/grafana/grafana/pull/53447), [@andresmgot](https://github.com/andresmgot)
|
||||
- **Reports:** Save and update in reports should be transactional. (Enterprise)
|
||||
- **Reports:** Set uid when we don't receive it in the query. (Enterprise)
|
||||
- **Search:** Display only dashboards in General folder of Search Folder View. [#53607](https://github.com/grafana/grafana/pull/53607), [@lpskdl](https://github.com/lpskdl)
|
||||
- **Status history/State timeline:** Support datalinks. [#50226](https://github.com/grafana/grafana/pull/50226), [@jloupdef](https://github.com/jloupdef)
|
||||
- **Transform:** Add a limit transform. [#49291](https://github.com/grafana/grafana/pull/49291), [@josiahg](https://github.com/josiahg)
|
||||
- **Transformations:** Add standard deviation and variance reducers. [#49753](https://github.com/grafana/grafana/pull/49753), [@selvavm](https://github.com/selvavm)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- **API:** Fix snapshot responses. [#52998](https://github.com/grafana/grafana/pull/52998), [@papagian](https://github.com/papagian)
|
||||
- **Access Control:** Fix permission error during dashboard creation flow. [#53214](https://github.com/grafana/grafana/pull/53214), [@IevaVasiljeva](https://github.com/IevaVasiljeva)
|
||||
- **Access Control:** Set permissions for Grafana's test data source. [#53247](https://github.com/grafana/grafana/pull/53247), [@IevaVasiljeva](https://github.com/IevaVasiljeva)
|
||||
- **Alerting:** Fix migration failure. [#53253](https://github.com/grafana/grafana/pull/53253), [@papagian](https://github.com/papagian)
|
||||
- **BarGauge:** Show empty bar when value, minValue and maxValue are all equal. [#53314](https://github.com/grafana/grafana/pull/53314), [@ashharrison90](https://github.com/ashharrison90)
|
||||
- **Dashboard:** Fix color of bold and italics text in panel description tooltip. [#53380](https://github.com/grafana/grafana/pull/53380), [@joshhunt](https://github.com/joshhunt)
|
||||
- **Loki:** Fix passing of query with defaults to code mode. [#53646](https://github.com/grafana/grafana/pull/53646), [@ivanahuckova](https://github.com/ivanahuckova)
|
||||
- **Loki:** Fix producing correct log volume query for query with comments. [#53254](https://github.com/grafana/grafana/pull/53254), [@ivanahuckova](https://github.com/ivanahuckova)
|
||||
- **Loki:** Fix showing of unusable labels field in detected fields. [#53319](https://github.com/grafana/grafana/pull/53319), [@ivanahuckova](https://github.com/ivanahuckova)
|
||||
- **Reports:** Fix inconsistency reports. (Enterprise)
|
||||
- **Tracing:** Fix OpenTelemetry Jaeger context propagation. [#53269](https://github.com/grafana/grafana/pull/53269), [@zhichli](https://github.com/zhichli)
|
||||
- **Tracing:** Fix OpenTelemetry Jaeger context propagation (#53269). [#53724](https://github.com/grafana/grafana/pull/53724), [@idafurjes](https://github.com/idafurjes)
|
||||
- **[9.1.x] Alerting:** AlertingProxy to elevate permissions for request forwarded to data proxy when RBAC enabled. [#53679](https://github.com/grafana/grafana/pull/53679), [@yuri-tceretian](https://github.com/yuri-tceretian)
|
||||
|
||||
### Breaking changes
|
||||
|
||||
Alert notifications to Microsoft Teams now use Adaptive Cards instead of Office 365 Connector Cards. Issue [#53532](https://github.com/grafana/grafana/issues/53532)
|
||||
|
||||
Starting at 9.1.0, existing heatmap panels will start using a new implementation. This can be disabled by setting the `useLegacyHeatmapPanel` feature flag to true. It can be tested on a single dashbobard by adding `?__feature.useLegacyHeatmapPanel=true` to any dashboard URL. Please report any [heatmap migration issues.](https://github.com/grafana/grafana/issues/new/choose). The most notable changes are:
|
||||
|
||||
- Significantly improved rendering performance
|
||||
- When calculating heatmaps, the buckets are now placed on reasonable borders (1m, 5m, 30s etc)
|
||||
- Round cells are no longer supported
|
||||
Issue [#50229](https://github.com/grafana/grafana/issues/50229)
|
||||
|
||||
### Plugin development fixes & changes
|
||||
|
||||
- **Plugins:** Only pass `rootUrls` field in request when not empty. [#53135](https://github.com/grafana/grafana/pull/53135), [@wbrowne](https://github.com/wbrowne)
|
||||
13
docs/sources/shared/getting-started/first-step.md
Normal file
13
docs/sources/shared/getting-started/first-step.md
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
aliases:
|
||||
- /docs/grafana/latest/shared/getting-started/first-step/
|
||||
title: First step of Getting started with...
|
||||
---
|
||||
|
||||
#### Install Grafana and add your first dashboard
|
||||
|
||||
Use the instructions in [Build your first dashboard]({{< relref "../build-first-dashboard/" >}}) to:
|
||||
|
||||
- Install Grafana.
|
||||
- Sign in to Grafana.
|
||||
- Build your first dashboard.
|
||||
@@ -27,7 +27,7 @@ For more information, refer to [Enable debug logging in Grafana CLI]({{< relref
|
||||
|
||||
Order of transformations matters. If the final data output from multiple transformations looks wrong, try changing the transformation order. Each transformation transforms data returned by the previous transformation, not the original raw data.
|
||||
|
||||
For more information, refer to [Debug a transformation]({{< relref "../panels/transform-data/#debug-a-transformation" >}}).
|
||||
For more information, refer to [Debug a transformation]({{< relref "../panels/transform-data/debug-transformation/" >}}).
|
||||
|
||||
## Text missing with server-side image rendering (RPM-based Linux)
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ The base layer loads in a blank world map from the tile server to the Grafana pa
|
||||
|
||||
### Configure the default base layer with provisioning
|
||||
|
||||
You can configure the default base map using config files with Grafana’s provisioning system. For more information on all the settings, refer to the [provisioning docs page]({{< relref "../../administration/provisioning/" >}}).
|
||||
You can configure the default base map using config files with Grafana’s provisioning system. For more information on all the settings, refer to the [provisioning docs page]({{< relref "../administration/provisioning/" >}}).
|
||||
|
||||
Use the JSON configuration option `default_baselayer_config` to define the default base map. There are currently four base map options to choose from: `carto`, `esri-xyz`, `osm-standard`, `xyz`. Here are some provisioning examples for each base map option.
|
||||
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /docs/grafana/latest/features/panels/geomap/arcgis/
|
||||
- /docs/grafana/latest/panels/visualizations/geomap/arcgis/
|
||||
description: ArcGIS layer
|
||||
keywords:
|
||||
- grafana
|
||||
- Geomap
|
||||
- panel
|
||||
- documentation
|
||||
title: ArcGIS layer
|
||||
weight: 10
|
||||
---
|
||||
|
||||
# ArcGIS layer
|
||||
|
||||
An ArcGIS layer is a layer from an ESRI ArcGIS MapServer.
|
||||
|
||||
## Options
|
||||
|
||||
- **Server Instance** to select the map type.
|
||||
- World Street Map
|
||||
{{< figure src="/static/img/docs/geomap-panel/geomap-arcgis-wsm-9-1-0.png" max-width="1200px" caption="Geomap panel ArcGIS World Street Map" >}}
|
||||
- World Imagery
|
||||
{{< figure src="/static/img/docs/geomap-panel/geomap-arcgis-wi-9-1-0.png" max-width="1200px" caption="Geomap panel ArcGIS World Imagery" >}}
|
||||
- World Physical
|
||||
{{< figure src="/static/img/docs/geomap-panel/geomap-arcgis-wp-9-1-0.png" max-width="1200px" caption="Geomap panel ArcGIS World Physical" >}}
|
||||
- Topographic
|
||||
{{< figure src="/static/img/docs/geomap-panel/geomap-arcgis-topographic-9-1-0.png" max-width="1200px" caption="Geomap panel ArcGIS Topographic" >}}
|
||||
- USA Topographic
|
||||
{{< figure src="/static/img/docs/geomap-panel/geomap-arcgis-usa-topographic-9-1-0.png" max-width="1200px" caption="Geomap panel ArcGIS USA Topographic" >}}
|
||||
- World Ocean
|
||||
{{< figure src="/static/img/docs/geomap-panel/geomap-arcgis-ocean-9-1-0.png" max-width="1200px" caption="Geomap panel ArcGIS World Ocean" >}}
|
||||
- Custom MapServer (see [XYZ]({{< relref "xyz/" >}}) for formatting)
|
||||
- URL template
|
||||
- Attribution
|
||||
- **Opacity** from 0 (transparent) to 1 (opaque)
|
||||
|
||||
{{< figure src="/static/img/docs/geomap-panel/geomap-arcgis-options-9-1-0.png" max-width="1200px" caption="Geomap panel ArcGIS options" >}}
|
||||
|
||||
## More Information
|
||||
|
||||
- [**ArcGIS Services**](https://services.arcgisonline.com/arcgis/rest/services)
|
||||
- [**About ESRI**](https://www.esri.com/en-us/about/about-esri/overview)
|
||||
@@ -1,34 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /docs/grafana/latest/features/panels/geomap/carto/
|
||||
- /docs/grafana/latest/panels/visualizations/geomap/carto/
|
||||
description: CARTO layer
|
||||
keywords:
|
||||
- grafana
|
||||
- Geomap
|
||||
- panel
|
||||
- documentation
|
||||
title: CARTO layer
|
||||
weight: 4
|
||||
---
|
||||
|
||||
# CARTO layer
|
||||
|
||||
A CARTO layer is from CARTO Raster basemaps.
|
||||
|
||||
## Options
|
||||
|
||||
- **Theme**
|
||||
- Auto
|
||||
- Light
|
||||
{{< figure src="/static/img/docs/geomap-panel/geomap-carto-light-9-1-0.png" max-width="1200px" caption="Geomap panel CARTO light example" >}}
|
||||
- Dark
|
||||
{{< figure src="/static/img/docs/geomap-panel/geomap-carto-dark-9-1-0.png" max-width="1200px" caption="Geomap panel CARTO dark example" >}}
|
||||
- **Show labels** shows the Country details on top of the map.
|
||||
- **Opacity** from 0 (transparent) to 1 (opaque)
|
||||
|
||||
{{< figure src="/static/img/docs/geomap-panel/geomap-carto-options-9-1-0.png" max-width="1200px" caption="Geomap panel CARTO options" >}}
|
||||
|
||||
## More Information
|
||||
|
||||
- [**About CARTO**](https://carto.com/about-us/)
|
||||
@@ -1,96 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /docs/grafana/latest/features/panels/geomap/controls/
|
||||
- /docs/grafana/latest/panels/visualizations/geomap/controls/
|
||||
description: Map Controls
|
||||
keywords:
|
||||
- grafana
|
||||
- Geomap
|
||||
- panel
|
||||
- documentation
|
||||
title: Map controls
|
||||
weight: 100
|
||||
---
|
||||
|
||||
# Map Controls
|
||||
|
||||
The map controls section contains various options for map information and tool overlays.
|
||||
{{< figure src="/static/img/docs/geomap-panel/geomap-map-controls-9-1-0.png" max-width="1200px" caption="Geomap panel map controls" >}}
|
||||
|
||||
## Zoom
|
||||
|
||||
This section describes each of the zoom controls.
|
||||
|
||||
### Show zoom control
|
||||
|
||||
Displays zoom controls in the upper left corner. This control can be useful when using systems that don't have a mouse.
|
||||
|
||||
{{< figure src="/static/img/docs/geomap-panel/geomap-map-controls-zoom-9-1-0.png" max-width="1200px" caption="Geomap panel zoom" >}}
|
||||
|
||||
### Mouse wheel zoom
|
||||
|
||||
Enables the mouse wheel to be used for zooming in or out.
|
||||
|
||||
## Show attribution
|
||||
|
||||
Displays attribution for basemap layers.
|
||||
|
||||
{{< figure src="/static/img/docs/geomap-panel/geomap-map-controls-attribution-9-1-0.png" max-width="1200px" caption="Geomap panel attribution" >}}
|
||||
|
||||
## Show scale
|
||||
|
||||
Displays scale information in the bottom left corner.
|
||||
|
||||
{{< figure src="/static/img/docs/geomap-panel/geomap-map-controls-scale-9-1-0.png" max-width="1200px" caption="Geomap panel scale" >}}
|
||||
|
||||
> **Note:** Currently only displays units in [m]/[km].
|
||||
|
||||
## Show measure tools
|
||||
|
||||
Displays measure tools in the upper right corner. Measurements appear only when this control is open.
|
||||
|
||||
{{< figure src="/static/img/docs/geomap-panel/geomap-map-controls-measure-9-1-0.png" max-width="1200px" caption="Geomap panel measure" >}}
|
||||
|
||||
- **Click** to start measuring
|
||||
- **Continue clicking** to continue measurement
|
||||
- **Double-click** to end measurement
|
||||
|
||||
> **Note:** <br /> - When you change measurement type or units, the previous measurement is removed from the map. <br /> - If the control is closed and then re-opened, the most recent measurement is displayed. <br /> - A measurement can be modified by clicking and dragging on it.
|
||||
|
||||
### Length
|
||||
|
||||
Get the spherical length of a geometry. This length is the sum of the great circle distances between coordinates. For multi-part geometries, the length is the sum of the length of each part. Geometries are assumed to be in 'EPSG:3857'.
|
||||
|
||||
- **Metric (m/km)**
|
||||
- **Feet (ft)**
|
||||
- **Miles (mi)**
|
||||
- **Nautical miles (nmi)**
|
||||
|
||||
{{< figure src="/static/img/docs/geomap-panel/geomap-map-controls-measure-length-9-1-0.png" max-width="1200px" caption="Geomap panel measure length" >}}
|
||||
|
||||
### Area
|
||||
|
||||
Get the spherical area of a geometry. This area is calculated assuming that polygon edges are segments of great circles on a sphere. Geometries are assumed to be in 'EPSG:3857'.
|
||||
|
||||
- **Square Meters (m²)**
|
||||
- **Square Kilometers (km²)**
|
||||
- **Square Feet (ft²)**
|
||||
- **Square Miles (mi²)**
|
||||
- **Acres (acre)**
|
||||
- **Hectare (ha)**
|
||||
|
||||
{{< figure src="/static/img/docs/geomap-panel/geomap-map-controls-measure-area-9-1-0.png" max-width="1200px" caption="Geomap panel measure area" >}}
|
||||
|
||||
## Show debug
|
||||
|
||||
Displays debug information in the upper right corner. This can be useful for debugging or validating a data source.
|
||||
|
||||
- **Zoom** displays current zoom level of the map.
|
||||
- **Center** displays the current **longitude**, **latitude** of the map center.
|
||||
|
||||
{{< figure src="/static/img/docs/geomap-panel/geomap-map-controls-debug-9-1-0.png" max-width="1200px" caption="Geomap panel debug" >}}
|
||||
|
||||
## Tooltip
|
||||
|
||||
- **None** displays tooltips only when a data point is clicked.
|
||||
- **Details** displays tooltips when a mouse pointer hovers over a data point.
|
||||
@@ -1,32 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /docs/grafana/latest/features/panels/geomap/daynight/
|
||||
- /docs/grafana/latest/panels/visualizations/geomap/daynight/
|
||||
description: Night / Day layer
|
||||
keywords:
|
||||
- grafana
|
||||
- Geomap
|
||||
- panel
|
||||
- documentation
|
||||
title: Night / Day layer
|
||||
weight: 20
|
||||
---
|
||||
|
||||
# Night / Day layer (Alpha)
|
||||
|
||||
The Night / Day layer displays night and day regions based on the current time range.
|
||||
|
||||
{{< figure src="/static/img/docs/geomap-panel/geomap-day-night-9-1-0.png" max-width="1200px" caption="Geomap panel Night / Day" >}}
|
||||
|
||||
## Options
|
||||
|
||||
- **Show** toggles time source from panel time range
|
||||
- **Night region color** picks color for night region
|
||||
- **Display sun** toggles sun icon
|
||||
- **Opacity** from 0 (transparent) to 1 (opaque)
|
||||
|
||||
{{< figure src="/static/img/docs/geomap-panel/geomap-day-night-options-9-1-0.png" max-width="1200px" caption="Geomap panel Night / Day options" >}}
|
||||
|
||||
## More information
|
||||
|
||||
- [**Extensions for OpenLayers - DayNight**](https://viglino.github.io/ol-ext/examples/layer/map.daynight.html)
|
||||
@@ -1,27 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /docs/grafana/latest/features/panels/geomap/geojson/
|
||||
- /docs/grafana/latest/panels/visualizations/geomap/geojson/
|
||||
description: GeoJSON layer
|
||||
keywords:
|
||||
- grafana
|
||||
- Geomap
|
||||
- panel
|
||||
- documentation
|
||||
title: GeoJSON layer
|
||||
weight: 3
|
||||
---
|
||||
|
||||
# GeoJSON layer
|
||||
|
||||
The GeoJSON layer allows you to select and load a static GeoJSON file from the filesystem.
|
||||
|
||||
- **GeoJSON URL** provides a choice of GeoJSON files that ship with Grafana.
|
||||
- **Default Style** controls which styles to apply when no rules above match.
|
||||
- **Color** configures the color of the default style
|
||||
- **Opacity** configures the default opacity
|
||||
- **Style Rules** apply styles based on feature properties
|
||||
- **Rule** allows you to select a _feature_, _condition_, and _value_ from the GeoJSON file in order to define a rule. The trash bin icon can be used to delete the current rule.
|
||||
- **Color** configures the color of the style for the current rule
|
||||
- **Opacity** configures the transparency level for the current rule
|
||||
- **Add style rule** creates additional style rules.
|
||||
@@ -1,30 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /docs/grafana/latest/features/panels/geomap/heatmap/
|
||||
- /docs/grafana/latest/panels/visualizations/geomap/heatmap/
|
||||
description: Heatmap layer
|
||||
keywords:
|
||||
- grafana
|
||||
- Geomap
|
||||
- panel
|
||||
- documentation
|
||||
title: Heatmap layer
|
||||
weight: 2
|
||||
---
|
||||
|
||||
# Heatmap layer
|
||||
|
||||
The heatmap layer clusters various data points to visualize locations with different densities.
|
||||
To add a heatmap layer:
|
||||
|
||||
Click on the drop-down menu under Data Layer and choose `Heatmap`.
|
||||
|
||||
Similar to `Markers`, you are prompted with various options to determine which data points to visualize and how you want to visualize them.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
- **Weight values** configure the intensity of the heatmap clusters. `Fixed value` keeps a constant weight value throughout all data points. This value should be in the range of 0~1. Similar to Markers, there is an alternate option in the drop-down to automatically scale the weight values depending on data values.
|
||||
- **Radius** configures the size of the heatmap clusters.
|
||||
- **Blur** configures the amount of blur on each cluster.
|
||||
@@ -1,26 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /docs/grafana/latest/features/panels/geomap/markers/
|
||||
- /docs/grafana/latest/panels/visualizations/geomap/markers/
|
||||
description: Markers layer
|
||||
keywords:
|
||||
- grafana
|
||||
- Geomap
|
||||
- panel
|
||||
- documentation
|
||||
title: Markers layer
|
||||
weight: 1
|
||||
---
|
||||
|
||||
# Markers layer
|
||||
|
||||
The markers layer allows you to display data points as different marker shapes such as circles, squares, triangles, stars, and more.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
- **Marker Color** configures the color of the marker. The default `Single color` keeps all points a single color. There is an alternate option to have multiple colors depending on the data point values and the threshold set at the `Thresholds` section.
|
||||
- **Marker Size** configures the size of the marker. The default is `Fixed size`, which makes all marker sizes the same regardless of the data points. However, there is also an option to scale the circles to the corresponding data points. `Min` and `Max` marker size has to be set such that the Marker layer can scale within this range.
|
||||
- **Marker Shape** allows you to choose the shape, icon, or graphic to aid in providing additional visual context to your data. Choose from assets that are included with Grafana such as simple shapes or the Unicon library. You can also specify a URL containing an image asset. The image must be a scalable vector graphic (SVG).
|
||||
- **Fill opacity** configures the transparency of each marker.
|
||||
@@ -1,29 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /docs/grafana/latest/features/panels/geomap/osm/
|
||||
- /docs/grafana/latest/panels/visualizations/geomap/osm/
|
||||
description: Open street map layer
|
||||
keywords:
|
||||
- grafana
|
||||
- Geomap
|
||||
- panel
|
||||
- documentation
|
||||
title: Open street map layer
|
||||
weight: 6
|
||||
---
|
||||
|
||||
# Open Street Map layer
|
||||
|
||||
A map from a collaborative free geographic world database.
|
||||
|
||||
{{< figure src="/static/img/docs/geomap-panel/geomap-osm-9-1-0.png" max-width="1200px" caption="Geomap panel Open Street Map" >}}
|
||||
|
||||
## Options
|
||||
|
||||
- **Opacity** from 0 (transparent) to 1 (opaque)
|
||||
|
||||
{{< figure src="/static/img/docs/geomap-panel/geomap-osm-options-9-1-0.png" max-width="1200px" caption="Geomap panel Open Street Map options" >}}
|
||||
|
||||
## More Information
|
||||
|
||||
- [**About Open Street Map**](https://www.openstreetmap.org/about)
|
||||
@@ -1,35 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- /docs/grafana/latest/features/panels/geomap/zyx/
|
||||
- /docs/grafana/latest/panels/visualizations/geomap/zyx/
|
||||
description: ArcGIS layer
|
||||
keywords:
|
||||
- grafana
|
||||
- Geomap
|
||||
- panel
|
||||
- documentation
|
||||
title: XYZ tile layer
|
||||
weight: 5
|
||||
---
|
||||
|
||||
# XYZ tile layer
|
||||
|
||||
The XYZ tile layer is a map from a generic tile layer.
|
||||
|
||||
{{< figure src="/static/img/docs/geomap-panel/geomap-xyz-9-1-0.png" max-width="1200px" caption="Geomap panel xyz example" >}}
|
||||
|
||||
## Options
|
||||
|
||||
- **URL template**
|
||||
|
||||
> **Note:** Set a valid tile server url, with {z}/{x}/{y} for example: https://tile.openstreetmap.org/{z}/{x}/{y}.png
|
||||
|
||||
- **Attribution** sets the reference string for the layer if displayed in [map controls]({{< relref "controls/#show-attribution" >}})
|
||||
- **Opacity** from 0 (transparent) to 1 (opaque)
|
||||
|
||||
{{< figure src="/static/img/docs/geomap-panel/geomap-xyz-options-9-1-0.png" max-width="1200px" caption="Geomap panel xyz options" >}}
|
||||
|
||||
## More information
|
||||
|
||||
- [**Tiled Web Map Wikipedia**](https://en.wikipedia.org/wiki/Tiled_web_map)
|
||||
- [**List of Open Street Map Tile Servers**](https://wiki.openstreetmap.org/wiki/Tile_servers)
|
||||
@@ -25,7 +25,7 @@ The graph panel can render metrics as a line, a path of dots, or a series of bar
|
||||
Graph visualizations allow you to apply:
|
||||
|
||||
- [Alerts]({{< relref "../alerting/" >}}) - This is the only type of visualization that allows you to set alerts.
|
||||
- [Transform data]({{< relref "../panels/transform-data/#add-a-transformation-function-to-data" >}})
|
||||
- [Transform data]({{< relref "../panels/transform-data/add-transformation-to-data/" >}})
|
||||
- [Add a field override]({{< relref "../panels/override-field-values/add-a-field-override/" >}})
|
||||
- [Configure thresholds]({{< relref "../panels/configure-thresholds/" >}})
|
||||
|
||||
|
||||
@@ -18,91 +18,87 @@ The Heatmap panel visualization allows you to view histograms over time. For mor
|
||||
|
||||

|
||||
|
||||
## Calculate from data
|
||||
## Axes options
|
||||
|
||||
This setting determines if the data is already a calculated heatmap (from the data source/transformer), or one that should be
|
||||
calculated in the panel.
|
||||
Use these settings to adjust how axes are displayed in your visualization.
|
||||
|
||||
### X Bucket
|
||||
### Y Axis
|
||||
|
||||
This setting determines how the X-axis is split into buckets. You can specify a time interval in the **Size** input. For example, a time range of `1h` makes the cells 1-hour wide on the X-axis.
|
||||
- **Unit -** The display unit for the Y axis value
|
||||
- **Scale -** The scale to use for the Y axis value.
|
||||
- **linear -** Linear scale.
|
||||
- **log (base 2) -** Logarithmic scale with base 2.
|
||||
- **log (base 10) -** Logarithmic scale with base 10.
|
||||
- **log (base 32) -** Logarithmic scale with base 32.
|
||||
- **log (base 1024) -** Logarithmic scale with base 1024.
|
||||
- **Y-Min -** The minimum Y value (default auto).
|
||||
- **Y-Max -** The maximum Y value (default auto).
|
||||
- **Decimals -** Number of decimals to render Y axis values with (default auto).
|
||||
|
||||
### Y Bucket
|
||||
### Buckets
|
||||
|
||||
This setting determines how the Y-axis is split into buckets.
|
||||
> **Note:** If the data format is **Time series buckets**, then this section will not be available.
|
||||
|
||||
### Y Bucket scale
|
||||
- **Y Axis Buckets -** Number of buckets Y axis will be split into.
|
||||
- **Size -** (Only visible if **Scale** is _linear_). Size of each Y axis bucket. This option has priority over **Y Axis Buckets**.
|
||||
- **Split Factor -** (Only visible if **Scale** is _log (base 2)_ or greater). By default Grafana splits Y values by log base. This option allows to split each default bucket into specified number of buckets.
|
||||
- **X Axis Buckets -** Number of buckets X axis will be split into.
|
||||
- **Size -** Size of each X axis bucket. Number or time interval (10s, 5m, 1h, etc). Supported intervals: ms, s, m, h, d, w, M, y. This option has priority over **X Axis Buckets**.
|
||||
|
||||
Select one of the following Y-axis value scales:
|
||||
#### Bucket bound
|
||||
|
||||
- **linear -** Linear scale.
|
||||
- **log (base 2) -** Logarithmic scale with base 2.
|
||||
- **log (base 10) -** Logarithmic scale with base 10.
|
||||
When Data format is Time series buckets data source returns series with names representing bucket bound. But depending on data source, a bound may be upper or lower. This option allows to adjust a bound type. If Auto is set, a bound option will be chosen based on panels’ data source type.
|
||||
|
||||
## Y Axes
|
||||
#### Bucket size
|
||||
|
||||
Defines how the Y axis is displayed
|
||||
The Bucket count and size options are used by Grafana to calculate how big each cell in the heatmap is. You can define the bucket size either by count (the first input box) or by specifying a size interval. For the Y-Axis the size interval is just a value but for the X-bucket you can specify a time interval in the Size input, for example, the time range 1h. This will make the cells 1h wide on the X-axis.
|
||||
|
||||
### Placement
|
||||
#### Data format
|
||||
|
||||
- **Left** On the left
|
||||
- **Right** On the right
|
||||
- **Hidden** Hidden
|
||||
Choose an option in the **Format** list.
|
||||
|
||||
### Unit
|
||||
- **Time series -** Grafana does the bucketing by going through all time series values. The bucket sizes and intervals are set in the Buckets options.
|
||||
- **Time series buckets -** Each time series already represents a Y-Axis bucket. The time series name (alias) needs to be a numeric value representing the upper or lower interval for the bucket. Grafana does no bucketing, so the bucket size options are hidden.
|
||||
|
||||
Unit configuration
|
||||
## Display options
|
||||
|
||||
### Decimals
|
||||
Use these settings to refine your visualization.
|
||||
|
||||
This setting determines decimal configuration.
|
||||
|
||||
### Min/Max value
|
||||
|
||||
This setting configures the axis range.
|
||||
|
||||
### Reverse
|
||||
|
||||
When selected, the axis appears in reverse order.
|
||||
|
||||
## Colors
|
||||
### Colors
|
||||
|
||||
The color spectrum controls the mapping between value count (in each bucket) and the color assigned to each bucket. The leftmost color on the spectrum represents the minimum count and the color on the right most side represents the maximum count. Some color schemes are automatically inverted when using the light theme.
|
||||
|
||||
You can also change the color mode to Opacity. In this case, the color will not change but the amount of opacity will change with the bucket count
|
||||
|
||||
- **Mode**
|
||||
- **Scheme -** Bucket value represented by cell color.
|
||||
- **Scheme -** If the mode is **scheme**, then select a color scheme.
|
||||
- **opacity -** Bucket value represented by cell opacity. Opaque cell means maximum value.
|
||||
- **Color -** Cell base color.
|
||||
- **Scale -** Scale for mapping bucket values to the opacity.
|
||||
- **linear -** Linear scale. Bucket value maps linearly to the opacity.
|
||||
- **sqrt -** Power scale. Cell opacity calculated as `value ^ k`, where `k` is a configured **Exponent** value. If exponent is less than `1`, you will get a logarithmic scale. If exponent is greater than `1`, you will get an exponential scale. In case of `1`, scale will be the same as linear.
|
||||
- **Exponent -** value of the exponent, greater than `0`.
|
||||
- **spectrum -** Bucket value represented by cell color.
|
||||
- **Scheme -** If the mode is **spectrum**, then select a color scheme.
|
||||
|
||||
### Start/end color from value
|
||||
### Color scale
|
||||
|
||||
By default, Grafana calculates cell colors based on minimum and maximum bucket values. With Min and Max you can overwrite those values. Consider a bucket value as a Z-axis and Min and Max as Z-Min and Z-Max, respectively.
|
||||
By default, Grafana calculates cell colors based on minimum and maximum buckets values. With Min and Max you can overwrite those values. Think of a bucket value as a Z-axis and Min and Max as Z-Min and Z-Max respectively.
|
||||
|
||||
- **Start -** Minimum value using for cell color calculation. If the bucket value is less than Min, then it is mapped to the "minimum" color. The series min value is the default value.
|
||||
- **End -** Maximum value using for cell color calculation. If the bucket value is greater than Max, then it is mapped to the "maximum" color. The series max value is the default value.
|
||||
- **Min -** Minimum value using for cell color calculation. If the bucket value is less than Min, then it is mapped to the "minimum" color. Default is series min value.
|
||||
- **Max -** Maximum value using for cell color calculation. If the bucket value is greater than Max, then it is mapped to the "maximum" color. Default is series max value.
|
||||
|
||||
## Cell display
|
||||
### Legend
|
||||
|
||||
Use these settings to refine your visualization.
|
||||
Choose whether to display the heatmap legend on the visualization or not.
|
||||
|
||||
## Additional display options
|
||||
### Buckets
|
||||
|
||||
- **Hide zero -** Do not draw cells with zero values.
|
||||
- **Space -** Space in pixels between cells. Default is 1 pixel.
|
||||
- **Round -** Cell roundness in pixels. Default is 0.
|
||||
|
||||
### Tooltip
|
||||
|
||||
- **Show tooltip -** Show heatmap tooltip.
|
||||
- **Show Histogram -** Show a Y-axis histogram on the tooltip. A histogram represents the distribution of the bucket values for a specific timestamp.
|
||||
|
||||
### Legend
|
||||
|
||||
Choose whether you want to display the heatmap legend on the visualization.
|
||||
|
||||
### Exemplars
|
||||
|
||||
Set the color used to show exemplar data.
|
||||
- **Histogram -** Show Y axis histogram on the tooltip. Histogram represents distribution of the bucket values for the specific timestamp.
|
||||
- **Decimals -** Number of decimals to render bucket value with (default auto).
|
||||
|
||||
@@ -48,7 +48,7 @@ Controls the opacity of state regions.
|
||||
|
||||
## Value mappings
|
||||
|
||||
To assign colors to boolean or string values, you can use [Value mappings]({{< relref "../panels/configure-value-mappings/" >}}).
|
||||
To assign colors to boolean or string values, use [Value mappings]({{< relref "../panels/format-data/about-value-mapping/" >}}).
|
||||
|
||||
{{< figure src="/static/img/docs/v8/value_mappings_side_editor.png" max-width="300px" caption="Value mappings side editor" >}}
|
||||
|
||||
|
||||
@@ -65,9 +65,9 @@ In the future we will add more workflows and integrations so that correlating be
|
||||
|
||||
The data you want to visualize can come from many different places and it is usually not in exactly the right form. Users can now transform non-time series data into tables (e.g., JSON files or even simple lookup tables) in seconds without any customization or additional overhead. They can then combine non-time series data with any other data in Grafana; data from an external database or a panel that already exists in one of their current dashboards.
|
||||
|
||||
By chaining a simple set of point and click [transformations]({{< relref "../panels/transform-data/#transformation-functions" >}}), users will be able join, pivot, filter, re-name and do calculations to get the results they need. Perfect for operations across queries or data sources missing essential data transformations.
|
||||
By chaining a simple set of point and click [transformations]({{< relref "../panels/transform-data/transformation-functions/" >}}), users will be able join, pivot, filter, re-name and do calculations to get the results they need. Perfect for operations across queries or data sources missing essential data transformations.
|
||||
|
||||
[Transformations]({{< relref "../panels/transform-data/" >}}) also adds the ability to do math across queries. Lots of data sources do not support this natively, so being able to do it in Grafana is a powerful feature.
|
||||
[Transformations]({{< relref "../panels/transform-data/about-transformation/" >}}) also adds the ability to do math across queries. Lots of data sources do not support this natively, so being able to do it in Grafana is a powerful feature.
|
||||
|
||||
For users with large dashboards or with heavy queries, being able to reuse the query result from one panel in another panel can be a huge performance gain for slow queries (e.g log or sql queries). From the data source menu in the query editor, you can choose the `--dashboard--` option and then choose the query result from another panel on the same dashboard.
|
||||
|
||||
@@ -85,7 +85,7 @@ We are also introducing a new shared data model for both time series and table d
|
||||
- **Outer join:** Joins many time series/tables by a field. This can be used to outer join multiple time series on the _time_ field to show many time series in one table.
|
||||
- **Add field from calculation:** This is a powerful transformation that allows you perform many different types of math operations and add the result as a new field. Can be used to calculate the difference between two series or fields and add the result to a new field. Or multiply one field with another and add the result to a new field.
|
||||
|
||||
Learn more about this feature in [Transformations](({{< relref "../panels/transform-data/#transformation-functions" >}}).
|
||||
Learn more about this feature in [Transformations]({{< relref "../panels/transform-data/transformation-functions/" >}}).
|
||||
|
||||
## Field options and overrides
|
||||
|
||||
|
||||
@@ -84,8 +84,8 @@ You can now add override rules that use a regex matcher to choose which fields t
|
||||
|
||||
Grafana 7.2 includes the following transformation enhancements:
|
||||
|
||||
- A new [Group By]({{< relref "../panels/transform-data/#group-by" >}}) transformation that allows you to group by multiple fields and add any number of aggregations for other fields.
|
||||
- The [Labels to fields]({{< relref "../panels/transform-data/#labels-to-fields" >}}) transformation now allows you to pick one label and use that as the name of the value field.
|
||||
- A new [Group By]({{< relref "../panels/transform-data/transformation-functions/#group-by" >}}) transformation that allows you to group by multiple fields and add any number of aggregations for other fields.
|
||||
- The [Labels to fields]({{< relref "../panels/transform-data/transformation-functions/#labels-to-fields" >}}) transformation now allows you to pick one label and use that as the name of the value field.
|
||||
- You can drag transformations to reorder them. Remember that transformations are processed in the order they are listed in the UI, so think before you move something!
|
||||
|
||||
{{< figure src="/static/img/docs/v72/transformations.gif" max-width="800px" caption="Group by and reordering of transformations" >}}
|
||||
|
||||
@@ -38,10 +38,10 @@ Apart from major performance improvements, the new Time series panel implements
|
||||
The following documentation topics were added for this feature:
|
||||
|
||||
- [Time series panel]({{< relref "../visualizations/time-series/" >}})
|
||||
- [Graph time series as lines]({{< relref "../visualizations/time-series#line-style" >}})
|
||||
- [Graph time series as bars]({{< relref "../visualizations/time-series#bar-alignment" >}})
|
||||
- [Graph time series as points]({{< relref "../visualizations/time-series#show-points" >}})
|
||||
- [Change axis display]({{< relref "../visualizations/time-series#axis-options" >}})
|
||||
- [Graph time series as lines]({{< relref "../visualizations/time-series/graph-time-series-as-lines/" >}})
|
||||
- [Graph time series as bars]({{< relref "../visualizations/time-series/graph-time-series-as-bars/" >}})
|
||||
- [Graph time series as points]({{< relref "../visualizations/time-series/graph-time-series-as-points/" >}})
|
||||
- [Change axis display]({{< relref "../visualizations/time-series/change-axis-display/" >}})
|
||||
|
||||
### Node graph panel visualization (Beta)
|
||||
|
||||
@@ -61,7 +61,7 @@ The following transformations were added in Grafana 7.4.
|
||||
|
||||
The _Sort by_ transformation allows you to sort data before sending it to the visualization.
|
||||
|
||||
For more information, refer to [Sort by]({{< relref "../panels/transform-data/" >}}).
|
||||
For more information, refer to [Sort by]({{< relref "../panels/transform-data/transformation-functions/#sort-by" >}}).
|
||||
|
||||
#### Filter data by value transform
|
||||
|
||||
@@ -69,7 +69,7 @@ The new _Filter data by value_ transformation allows you to filter your data dir
|
||||
|
||||
This transformation is very useful if your data source does not natively filter by values. You might also use this to narrow values to display if you are using a shared query.
|
||||
|
||||
For more information, refer to [Filter data by value]({{< relref "../panels/transform-data/#filter-data-by-value" >}}).
|
||||
For more information, refer to [Filter data by value]({{< relref "../panels/transform-data/transformation-functions/#filter-data-by-value" >}}).
|
||||
|
||||
### New override option
|
||||
|
||||
|
||||
@@ -95,9 +95,9 @@ For more information, refer to [Histogram]({{< relref "../visualizations/histogr
|
||||
The Time series is out of beta! We are removing the `Beta` tag and graduating the Time series visualization to a stable state.
|
||||
|
||||
- **Time series** is now the default visualization option, replacing the **Graph (old)**.
|
||||
- The Time series panel now supports stacking. For more information, refer to [Graph stacked time series]({{< relref "../visualizations/time-series#stack-series" >}}).
|
||||
- The Time series panel now supports stacking. For more information, refer to [Graph stacked time series]({{< relref "../visualizations/time-series/graph-time-series-stacking/" >}}).
|
||||
- You can now add alerts in the Time series panel, just like the old Graph panel.
|
||||
- Updated [connect null values]({{< relref "../visualizations/time-series#connect-null-values" >}}) options.
|
||||
- Updated [connect null values]({{< relref "../visualizations/time-series/graph-time-series-as-lines/#connect-null-values" >}}) options.
|
||||
- We added support for a shared crosshair and a tooltip that’s now smarter when it comes to data display in the tooltip.
|
||||
- Various performance improvements.
|
||||
|
||||
@@ -121,7 +121,7 @@ Lots of panel editor improvements, heavily informed by user research and communi
|
||||
|
||||
- All options are now shown in a single pane.
|
||||
- You can now search panel options.
|
||||
- The Value mappings feature has been completely redesigned. For more information, refer to [Configure value mappings]({{< relref "../panels/configure-value-mappings/" >}}).
|
||||
- The Value mappings feature has been completely redesigned. For more information, refer to [About value mappings]({{< relref "../panels/format-data/about-value-mapping/" >}}).
|
||||
- New **Table view** option is always available.
|
||||
|
||||
The [Panels]({{< relref "../panels/" >}}) section has been updated to reflect these changes.
|
||||
|
||||
@@ -52,7 +52,7 @@ Color scheme: **Green-Yellow-Red (by value)**
|
||||
|
||||
For more on how to configure Graphs with by value color schemes read [Graph and color schemes]({{< relref "../visualizations/time-series/" >}}).
|
||||
|
||||
You can also create annotations in the new Time series panel bringing it closer to parity with the legacy Graph panel. To learn more, refer to the [time series panel]({{< relref "../visualizations/time-series/" >}}).
|
||||
You can also create [annotations]({{< relref "../visualizations/time-series/annotate-time-series/" >}}) in the new Time series panel bringing it closer to parity with the legacy Graph panel. To learn more, refer to the [time series panel]({{< relref "../visualizations/time-series/" >}}).
|
||||
|
||||
### Transformations improvements
|
||||
|
||||
@@ -60,7 +60,7 @@ Grafana 8.1 includes some significant enhancements to transformations, including
|
||||
|
||||
#### Config from query (Beta)
|
||||
|
||||
This transformation enables panel config (Threshold, Min, Max, etc.) to be derived from query results. For more information, refer to [Config from query results]({{< relref "../panels/transform-data/#config-from-query-results" >}}).
|
||||
This transformation enables panel config (Threshold, Min, Max, etc.) to be derived from query results. For more information, refer to [Config from query results]({{< relref "../panels/transform-data/transformation-functions/#config-from-query-results" >}}).
|
||||
|
||||
#### Rows to fields (Beta)
|
||||
|
||||
@@ -82,7 +82,7 @@ Output:
|
||||
|
||||
As you can see each row in the source data becomes a separate field. Each field now also has a max config option set. Options like **Min**, **Max**, **Unit** and **Thresholds** are all part of field configuration and if set like this will be used by the visualization instead of any options manually configured in the panel editor options pane.
|
||||
|
||||
For more on how to use this transformation, refer to [Rows to fields transform]({{< relref "../panels/transform-data/#rows-to-fields" >}}).
|
||||
For more on how to use this transformation, refer to [Rows to fields transform]({{< relref "../panels/transform-data/transformation-functions/#rows-to-fields" >}}).
|
||||
|
||||
#### Contextual & Inline Help
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ Service accounts are an evolution in machine access within Grafana.
|
||||
You can create multiple API tokens per service account with independent expiration dates, and temporarily disable a service account without deleting it.
|
||||
These benefits make service accounts a more flexible way for Terraform and other apps to authenticate with Grafana.
|
||||
|
||||
Service accounts also work with [role-based access control]({{< relref "../administration/roles-and-permissions/access-control" >}}) in [Grafana Enterprise]({{< relref "../enterprise/" >}}).
|
||||
Service accounts also work with [role-based access control]({{< relref "../enterprise/access-control/" >}}) in [Grafana Enterprise]({{< relref "../enterprise/" >}}).
|
||||
You can improve security by granting service accounts specific roles to limit the functions they can perform.
|
||||
Service accounts have been in beta since Grafana v8.5.
|
||||
During that time, we've improved the UI and migration path from API keys, made it possible to add service accounts to teams, and inherit team permissions.
|
||||
@@ -187,7 +187,7 @@ This is an early-access feature available only to self-managed customers.
|
||||
|
||||
#### RBAC for app plugins, usage insights, and query caching
|
||||
|
||||
As part of our continued improvements to role-based access control (RBAC), we are rolling out RBAC across all of Grafana's features.
|
||||
As part of our continued improvements to RBAC, we are rolling out role-based access control (RBAC) across all of Grafana's features.
|
||||
In v9.1, you can determine which users, teams, and roles can access app plugins like OnCall and Synthetics.
|
||||
|
||||
> **Note:** You can't yet define view or edit roles for app plugins.
|
||||
|
||||
@@ -4,5 +4,5 @@
|
||||
"packages": [
|
||||
"packages/*"
|
||||
],
|
||||
"version": "9.1.1"
|
||||
"version": "9.1.0"
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"license": "AGPL-3.0-only",
|
||||
"private": true,
|
||||
"name": "grafana",
|
||||
"version": "9.1.1",
|
||||
"version": "9.1.0",
|
||||
"repository": "github:grafana/grafana",
|
||||
"scripts": {
|
||||
"api-tests": "jest --notify --watch --config=devenv/e2e-api-tests/jest.js",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"author": "Grafana Labs",
|
||||
"license": "Apache-2.0",
|
||||
"name": "@grafana/data",
|
||||
"version": "9.1.1",
|
||||
"version": "9.1.0",
|
||||
"description": "Grafana Data Library",
|
||||
"keywords": [
|
||||
"typescript"
|
||||
@@ -22,7 +22,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@braintree/sanitize-url": "6.0.0",
|
||||
"@grafana/schema": "9.1.1",
|
||||
"@grafana/schema": "9.1.0",
|
||||
"@types/d3-interpolate": "^1.4.0",
|
||||
"d3-interpolate": "1.4.0",
|
||||
"date-fns": "2.29.1",
|
||||
|
||||
@@ -94,15 +94,6 @@ describe('valueFormats', () => {
|
||||
|
||||
expect(toFixed(100.4)).toBe('100');
|
||||
expect(toFixed(100.5)).toBe('101');
|
||||
expect(toFixed(27.4)).toBe('27.4');
|
||||
expect(toFixed(27.5)).toBe('27.5');
|
||||
|
||||
expect(toFixed(-100)).toBe('-100');
|
||||
|
||||
expect(toFixed(-100.5)).toBe('-100');
|
||||
expect(toFixed(-100.6)).toBe('-101');
|
||||
expect(toFixed(-27.5)).toBe('-27.5');
|
||||
expect(toFixed(-27.6)).toBe('-27.6');
|
||||
});
|
||||
|
||||
it('toFixed should handle number correctly if decimal is not null', () => {
|
||||
|
||||
@@ -80,11 +80,10 @@ export function toFixed(value: number, decimals?: DecimalCount): string {
|
||||
}
|
||||
|
||||
function getDecimalsForValue(value: number): number {
|
||||
const absValue = Math.abs(value);
|
||||
const log10 = Math.floor(Math.log(absValue) / Math.LN10);
|
||||
const log10 = Math.floor(Math.log(Math.abs(value)) / Math.LN10);
|
||||
let dec = -log10 + 1;
|
||||
const magn = Math.pow(10, -dec);
|
||||
const norm = absValue / magn; // norm is between 1.0 and 10.0
|
||||
const norm = value / magn; // norm is between 1.0 and 10.0
|
||||
|
||||
// special case for 2.5, requires an extra decimal
|
||||
if (norm > 2.25) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"author": "Grafana Labs",
|
||||
"license": "Apache-2.0",
|
||||
"name": "@grafana/e2e-selectors",
|
||||
"version": "9.1.1",
|
||||
"version": "9.1.0",
|
||||
"description": "Grafana End-to-End Test Selectors Library",
|
||||
"keywords": [
|
||||
"cli",
|
||||
|
||||
@@ -123,7 +123,7 @@ export const Components = {
|
||||
DataPane: {
|
||||
content: 'Panel editor data pane content',
|
||||
},
|
||||
applyButton: 'Apply changes and go back to dashboard',
|
||||
applyButton: 'panel editor apply',
|
||||
toggleVizPicker: 'toggle-viz-picker',
|
||||
toggleVizOptions: 'toggle-viz-options',
|
||||
toggleTableView: 'toggle-table-view',
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"author": "Grafana Labs",
|
||||
"license": "Apache-2.0",
|
||||
"name": "@grafana/e2e",
|
||||
"version": "9.1.1",
|
||||
"version": "9.1.0",
|
||||
"description": "Grafana End-to-End Test Library",
|
||||
"keywords": [
|
||||
"cli",
|
||||
@@ -48,7 +48,7 @@
|
||||
"@babel/core": "7.18.9",
|
||||
"@babel/preset-env": "7.18.9",
|
||||
"@cypress/webpack-preprocessor": "5.12.0",
|
||||
"@grafana/e2e-selectors": "9.1.1",
|
||||
"@grafana/e2e-selectors": "9.1.0",
|
||||
"@grafana/tsconfig": "^1.2.0-rc1",
|
||||
"@mochajs/json-file-reporter": "^1.2.0",
|
||||
"babel-loader": "8.2.5",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"author": "Grafana Labs",
|
||||
"license": "Apache-2.0",
|
||||
"name": "@grafana/runtime",
|
||||
"version": "9.1.1",
|
||||
"version": "9.1.0",
|
||||
"description": "Grafana Runtime Library",
|
||||
"keywords": [
|
||||
"grafana",
|
||||
@@ -23,9 +23,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@grafana/agent-web": "^0.4.0",
|
||||
"@grafana/data": "9.1.1",
|
||||
"@grafana/e2e-selectors": "9.1.1",
|
||||
"@grafana/ui": "9.1.1",
|
||||
"@grafana/data": "9.1.0",
|
||||
"@grafana/e2e-selectors": "9.1.0",
|
||||
"@grafana/ui": "9.1.0",
|
||||
"@sentry/browser": "6.19.7",
|
||||
"history": "4.10.1",
|
||||
"lodash": "4.17.21",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"author": "Grafana Labs",
|
||||
"license": "Apache-2.0",
|
||||
"name": "@grafana/schema",
|
||||
"version": "9.1.1",
|
||||
"version": "9.1.0",
|
||||
"description": "Grafana Schema Library",
|
||||
"keywords": [
|
||||
"typescript"
|
||||
|
||||
@@ -133,8 +133,7 @@ GraphThresholdsStyleConfig: {
|
||||
LegendPlacement: "bottom" | "right" @cuetsy(kind="type")
|
||||
|
||||
// TODO docs
|
||||
// Note: "hidden" needs to remain as an option for plugins compatibility
|
||||
LegendDisplayMode: "list" | "table" | "hidden" @cuetsy(kind="enum")
|
||||
LegendDisplayMode: "list" | "table" @cuetsy(kind="enum")
|
||||
|
||||
// TODO docs
|
||||
TableSortByFieldState: {
|
||||
@@ -176,7 +175,7 @@ OptionsWithLegend: {
|
||||
|
||||
// TODO docs
|
||||
OptionsWithTimezones: {
|
||||
timezone?: [...string]
|
||||
timezones?: [...string]
|
||||
} @cuetsy(kind="interface")
|
||||
|
||||
// TODO docs
|
||||
|
||||
@@ -168,7 +168,6 @@ export interface GraphThresholdsStyleConfig {
|
||||
export type LegendPlacement = ('bottom' | 'right');
|
||||
|
||||
export enum LegendDisplayMode {
|
||||
Hidden = 'hidden',
|
||||
List = 'list',
|
||||
Table = 'table',
|
||||
}
|
||||
@@ -209,11 +208,11 @@ export interface OptionsWithLegend {
|
||||
}
|
||||
|
||||
export interface OptionsWithTimezones {
|
||||
timezone?: string[];
|
||||
timezones?: string[];
|
||||
}
|
||||
|
||||
export const defaultOptionsWithTimezones: Partial<OptionsWithTimezones> = {
|
||||
timezone: [],
|
||||
timezones: [],
|
||||
};
|
||||
|
||||
export interface OptionsWithTextFormatting {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"author": "Grafana Labs",
|
||||
"license": "Apache-2.0",
|
||||
"name": "@grafana/toolkit",
|
||||
"version": "9.1.1",
|
||||
"version": "9.1.0",
|
||||
"description": "Grafana Toolkit",
|
||||
"keywords": [
|
||||
"grafana",
|
||||
@@ -38,10 +38,10 @@
|
||||
"@babel/preset-env": "^7.18.9",
|
||||
"@babel/preset-react": "^7.18.6",
|
||||
"@babel/preset-typescript": "^7.18.6",
|
||||
"@grafana/data": "9.1.1",
|
||||
"@grafana/data": "9.1.0",
|
||||
"@grafana/eslint-config": "^4.0.0",
|
||||
"@grafana/tsconfig": "^1.2.0-rc1",
|
||||
"@grafana/ui": "9.1.1",
|
||||
"@grafana/ui": "9.1.0",
|
||||
"@jest/core": "27.5.1",
|
||||
"@types/command-exists": "^1.2.0",
|
||||
"@types/eslint": "8.4.1",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"author": "Grafana Labs",
|
||||
"license": "Apache-2.0",
|
||||
"name": "@grafana/ui",
|
||||
"version": "9.1.1",
|
||||
"version": "9.1.0",
|
||||
"description": "Grafana Components Library",
|
||||
"keywords": [
|
||||
"grafana",
|
||||
@@ -32,9 +32,9 @@
|
||||
"dependencies": {
|
||||
"@emotion/css": "11.9.0",
|
||||
"@emotion/react": "11.9.3",
|
||||
"@grafana/data": "9.1.1",
|
||||
"@grafana/e2e-selectors": "9.1.1",
|
||||
"@grafana/schema": "9.1.1",
|
||||
"@grafana/data": "9.1.0",
|
||||
"@grafana/e2e-selectors": "9.1.0",
|
||||
"@grafana/schema": "9.1.0",
|
||||
"@grafana/slate-react": "0.22.10-grafana",
|
||||
"@monaco-editor/react": "4.3.1",
|
||||
"@popperjs/core": "2.11.5",
|
||||
|
||||
@@ -93,17 +93,16 @@ const copyText = async (text: string, buttonRef: React.MutableRefObject<HTMLButt
|
||||
} else {
|
||||
// Use a fallback method for browsers/contexts that don't support the Clipboard API.
|
||||
// See https://web.dev/async-clipboard/#feature-detection.
|
||||
// Use textarea so the user can copy multi-line content.
|
||||
const textarea = document.createElement('textarea');
|
||||
const input = document.createElement('input');
|
||||
// Normally we'd append this to the body. However if we're inside a focus manager
|
||||
// from react-aria, we can't focus anything outside of the managed area.
|
||||
// Instead, let's append it to the button. Then we're guaranteed to be able to focus + copy.
|
||||
buttonRef.current?.appendChild(textarea);
|
||||
textarea.value = text;
|
||||
textarea.focus();
|
||||
textarea.select();
|
||||
buttonRef.current?.appendChild(input);
|
||||
input.value = text;
|
||||
input.focus();
|
||||
input.select();
|
||||
document.execCommand('copy');
|
||||
textarea.remove();
|
||||
input.remove();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ export const ColorPickerInput = forwardRef<HTMLInputElement, ColorPickerInputPro
|
||||
return (
|
||||
<ClickOutsideWrapper onClick={() => setIsOpen(false)}>
|
||||
<div className={styles.wrapper}>
|
||||
{isOpen && !inputProps.disabled && (
|
||||
{isOpen && (
|
||||
<RgbaStringColorPicker
|
||||
data-testid={'color-popover'}
|
||||
color={currentColor}
|
||||
|
||||
@@ -23,7 +23,6 @@ interface Props {
|
||||
setScrollTop?: (position: ScrollbarPosition) => void;
|
||||
autoHeightMin?: number | string;
|
||||
updateAfterMountMs?: number;
|
||||
onScroll?: React.UIEventHandler;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -43,7 +42,6 @@ export const CustomScrollbar: FC<Props> = ({
|
||||
scrollRefCallback,
|
||||
updateAfterMountMs,
|
||||
scrollTop,
|
||||
onScroll,
|
||||
children,
|
||||
}) => {
|
||||
const ref = useRef<Scrollbars & { view: HTMLDivElement }>(null);
|
||||
@@ -134,7 +132,6 @@ export const CustomScrollbar: FC<Props> = ({
|
||||
renderThumbHorizontal={renderThumbHorizontal}
|
||||
renderThumbVertical={renderThumbVertical}
|
||||
renderView={renderView}
|
||||
onScroll={onScroll}
|
||||
>
|
||||
{children}
|
||||
</Scrollbars>
|
||||
|
||||
@@ -65,9 +65,6 @@ function dateInfo(date: Date): number[] {
|
||||
}
|
||||
|
||||
export const getBodyStyles = (theme: GrafanaTheme2) => {
|
||||
// If a time range is part of only 1 day but does not encompass the whole day,
|
||||
// the class that react-calendar uses is '--hasActive' by itself (without being part of a '--range')
|
||||
const hasActiveSelector = `.react-calendar__tile--hasActive:not(.react-calendar__tile--range)`;
|
||||
return {
|
||||
title: css`
|
||||
color: ${theme.colors.text};
|
||||
@@ -129,7 +126,6 @@ export const getBodyStyles = (theme: GrafanaTheme2) => {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
${hasActiveSelector},
|
||||
.react-calendar__tile--active,
|
||||
.react-calendar__tile--active:hover {
|
||||
color: ${theme.colors.primary.contrastText};
|
||||
@@ -156,13 +152,11 @@ export const getBodyStyles = (theme: GrafanaTheme2) => {
|
||||
}
|
||||
}
|
||||
|
||||
${hasActiveSelector},
|
||||
.react-calendar__tile--rangeStart {
|
||||
border-top-left-radius: 20px;
|
||||
border-bottom-left-radius: 20px;
|
||||
}
|
||||
|
||||
${hasActiveSelector},
|
||||
.react-calendar__tile--rangeEnd {
|
||||
border-top-right-radius: 20px;
|
||||
border-bottom-right-radius: 20px;
|
||||
|
||||
@@ -130,7 +130,7 @@ const NarrowScreenForm: React.FC<FormProps> = (props) => {
|
||||
const collapsed = hideQuickRanges ? false : collapsedFlag;
|
||||
|
||||
const onChangeTimeOption = (timeOption: TimeOption) => {
|
||||
return onChange(mapOptionToTimeRange(timeOption, timeZone));
|
||||
return onChange(mapOptionToTimeRange(timeOption));
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -176,7 +176,7 @@ const FullScreenForm: React.FC<FormProps> = (props) => {
|
||||
const theme = useTheme2();
|
||||
const styles = getFullScreenStyles(theme, props.hideQuickRanges);
|
||||
const onChangeTimeOption = (timeOption: TimeOption) => {
|
||||
return onChange(mapOptionToTimeRange(timeOption, timeZone));
|
||||
return onChange(mapOptionToTimeRange(timeOption));
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -44,7 +44,7 @@ export interface GraphNGProps extends Themeable2 {
|
||||
width: number;
|
||||
height: number;
|
||||
timeRange: TimeRange;
|
||||
timeZone: TimeZone[] | TimeZone;
|
||||
timeZones: TimeZone[] | TimeZone;
|
||||
legend: VizLegendOptions;
|
||||
fields?: XYFieldMatchers; // default will assume timeseries data
|
||||
renderers?: Renderers;
|
||||
@@ -216,17 +216,17 @@ export class GraphNG extends React.Component<GraphNGProps, GraphNGState> {
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps: GraphNGProps) {
|
||||
const { frames, structureRev, timeZone, propsToDiff } = this.props;
|
||||
const { frames, structureRev, timeZones, propsToDiff } = this.props;
|
||||
|
||||
const propsChanged = !sameProps(prevProps, this.props, propsToDiff);
|
||||
|
||||
if (frames !== prevProps.frames || propsChanged || timeZone !== prevProps.timeZone) {
|
||||
if (frames !== prevProps.frames || propsChanged || timeZones !== prevProps.timeZones) {
|
||||
let newState = this.prepState(this.props, false);
|
||||
|
||||
if (newState) {
|
||||
const shouldReconfig =
|
||||
this.state.config === undefined ||
|
||||
timeZone !== prevProps.timeZone ||
|
||||
timeZones !== prevProps.timeZones ||
|
||||
structureRev !== prevProps.structureRev ||
|
||||
!structureRev ||
|
||||
propsChanged;
|
||||
|
||||
@@ -41,8 +41,8 @@ Object {
|
||||
},
|
||||
"labelGap": 0,
|
||||
"rotate": undefined,
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na",
|
||||
"show": true,
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na/false",
|
||||
"show": false,
|
||||
"side": 3,
|
||||
"size": [Function],
|
||||
"space": [Function],
|
||||
@@ -79,7 +79,7 @@ Object {
|
||||
"key": "__global_",
|
||||
"scales": Array [
|
||||
"x",
|
||||
"__fixed/na-na/na-na/auto/linear/na",
|
||||
"__fixed/na-na/na-na/auto/linear/na/false",
|
||||
],
|
||||
},
|
||||
},
|
||||
@@ -87,7 +87,7 @@ Object {
|
||||
"mode": 1,
|
||||
"padding": undefined,
|
||||
"scales": Object {
|
||||
"__fixed/na-na/na-na/auto/linear/na": Object {
|
||||
"__fixed/na-na/na-na/auto/linear/na/false": Object {
|
||||
"auto": true,
|
||||
"dir": 1,
|
||||
"distr": 1,
|
||||
@@ -125,7 +125,7 @@ Object {
|
||||
"stroke": "#ff0000",
|
||||
},
|
||||
"pxAlign": undefined,
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na",
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na/false",
|
||||
"show": true,
|
||||
"spanGaps": false,
|
||||
"stroke": "#ff0000",
|
||||
@@ -148,7 +148,7 @@ Object {
|
||||
"stroke": "#ff0000",
|
||||
},
|
||||
"pxAlign": undefined,
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na",
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na/false",
|
||||
"show": true,
|
||||
"spanGaps": false,
|
||||
"stroke": "#ff0000",
|
||||
@@ -171,7 +171,7 @@ Object {
|
||||
"stroke": "#ff0000",
|
||||
},
|
||||
"pxAlign": undefined,
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na",
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na/false",
|
||||
"show": true,
|
||||
"spanGaps": false,
|
||||
"stroke": "#ff0000",
|
||||
@@ -194,7 +194,7 @@ Object {
|
||||
"stroke": "#ff0000",
|
||||
},
|
||||
"pxAlign": undefined,
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na",
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na/false",
|
||||
"show": true,
|
||||
"spanGaps": false,
|
||||
"stroke": "#ff0000",
|
||||
@@ -217,7 +217,7 @@ Object {
|
||||
"stroke": "#ff0000",
|
||||
},
|
||||
"pxAlign": undefined,
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na",
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na/false",
|
||||
"show": true,
|
||||
"spanGaps": false,
|
||||
"stroke": "#ff0000",
|
||||
|
||||
@@ -151,7 +151,9 @@ export function buildScaleKey(config: FieldConfig<GraphFieldConfig>) {
|
||||
|
||||
const scaleLabel = Boolean(config.custom?.axisLabel) ? config.custom!.axisLabel : defaultPart;
|
||||
|
||||
return `${scaleUnit}/${scaleRange}/${scaleSoftRange}/${scalePlacement}/${scaleDistribution}/${scaleLabel}`;
|
||||
const shouldHideFromViz = Boolean(config.custom?.hideFrom?.viz);
|
||||
|
||||
return `${scaleUnit}/${scaleRange}/${scaleSoftRange}/${scalePlacement}/${scaleDistribution}/${scaleLabel}/${shouldHideFromViz}`;
|
||||
}
|
||||
|
||||
function getScaleDistributionPart(config: ScaleDistributionConfig) {
|
||||
|
||||
@@ -93,7 +93,7 @@ export class Sparkline extends PureComponent<SparklineProps, State> {
|
||||
}
|
||||
}
|
||||
|
||||
getYRange(field: Field): Range.MinMax {
|
||||
getYRange(field: Field) {
|
||||
let { min, max } = this.state.alignedDataFrame.fields[1].state?.range!;
|
||||
|
||||
if (min === max) {
|
||||
@@ -103,11 +103,12 @@ export class Sparkline extends PureComponent<SparklineProps, State> {
|
||||
min = 0;
|
||||
max! *= 2;
|
||||
}
|
||||
|
||||
return [min, max!];
|
||||
}
|
||||
|
||||
return [Math.max(min!, field.config.min ?? -Infinity), Math.min(max!, field.config.max ?? Infinity)];
|
||||
return [
|
||||
Math.max(min!, field.config.min ?? -Infinity),
|
||||
Math.min(max!, field.config.max ?? Infinity),
|
||||
] as Range.MinMax;
|
||||
}
|
||||
|
||||
prepareConfig(data: DataFrame) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { FC, memo, useCallback, useEffect, useMemo, useRef } from 'react';
|
||||
import React, { FC, memo, useCallback, useEffect, useMemo } from 'react';
|
||||
import {
|
||||
Cell,
|
||||
Column,
|
||||
@@ -131,7 +131,6 @@ export const Table: FC<Props> = memo((props: Props) => {
|
||||
enablePagination,
|
||||
} = props;
|
||||
|
||||
const listRef = useRef<FixedSizeList>(null);
|
||||
const tableStyles = useStyles2(getTableStyles);
|
||||
const headerHeight = noHeader ? 0 : tableStyles.cellHeight;
|
||||
|
||||
@@ -208,11 +207,11 @@ export const Table: FC<Props> = memo((props: Props) => {
|
||||
} = useTable(options, useFilters, useSortBy, usePagination, useAbsoluteLayout, useResizeColumns);
|
||||
|
||||
let listHeight = height - (headerHeight + footerHeight);
|
||||
|
||||
if (enablePagination) {
|
||||
listHeight -= tableStyles.cellHeight;
|
||||
}
|
||||
const pageSize = Math.round(listHeight / tableStyles.cellHeight) - 1;
|
||||
|
||||
useEffect(() => {
|
||||
// Don't update the page size if it is less than 1
|
||||
if (pageSize <= 0) {
|
||||
@@ -281,18 +280,9 @@ export const Table: FC<Props> = memo((props: Props) => {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const handleScroll: React.UIEventHandler = (event) => {
|
||||
const { scrollTop } = event.target as HTMLDivElement;
|
||||
|
||||
if (listRef.current !== null) {
|
||||
listRef.current.scrollTo(scrollTop);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div {...getTableProps()} className={tableStyles.table} aria-label={ariaLabel} role="table">
|
||||
<CustomScrollbar onScroll={handleScroll}>
|
||||
<CustomScrollbar hideVerticalTrack={true}>
|
||||
<div className={tableStyles.tableContentWrapper(totalColumnsWidth)}>
|
||||
{!noHeader && <HeaderRow headerGroups={headerGroups} showTypeIcons={showTypeIcons} />}
|
||||
{itemCount > 0 ? (
|
||||
@@ -301,8 +291,7 @@ export const Table: FC<Props> = memo((props: Props) => {
|
||||
itemCount={itemCount}
|
||||
itemSize={tableStyles.rowHeight}
|
||||
width={'100%'}
|
||||
ref={listRef}
|
||||
style={{ overflow: undefined }}
|
||||
style={{ overflow: 'hidden auto' }}
|
||||
>
|
||||
{RenderRow}
|
||||
</FixedSizeList>
|
||||
|
||||
@@ -21,12 +21,12 @@ export class UnthemedTimeSeries extends React.Component<TimeSeriesProps> {
|
||||
|
||||
prepConfig = (alignedFrame: DataFrame, allFrames: DataFrame[], getTimeRange: () => TimeRange) => {
|
||||
const { eventBus, sync } = this.context as PanelContext;
|
||||
const { theme, timeZone, renderers, tweakAxis, tweakScale } = this.props;
|
||||
const { theme, timeZones, renderers, tweakAxis, tweakScale } = this.props;
|
||||
|
||||
return preparePlotConfigBuilder({
|
||||
frame: alignedFrame,
|
||||
theme,
|
||||
timeZones: Array.isArray(timeZone) ? timeZone : [timeZone],
|
||||
timeZones: Array.isArray(timeZones) ? timeZones : [timeZones],
|
||||
getTimeRange,
|
||||
eventBus,
|
||||
sync,
|
||||
|
||||
@@ -272,6 +272,7 @@ export const preparePlotConfigBuilder: UPlotConfigPrepFn<{
|
||||
formatValue: (v, decimals) => formattedValueToString(fmt(v, config.decimals ?? decimals)),
|
||||
theme,
|
||||
grid: { show: customConfig.axisGridShow },
|
||||
show: customConfig.hideFrom?.viz === false,
|
||||
...axisColorOpts,
|
||||
},
|
||||
field
|
||||
|
||||
@@ -72,23 +72,17 @@ export class UPlotScaleBuilder extends PlotConfigBuilder<ScaleProps, Scale> {
|
||||
|
||||
let hardMinOnly = softMin == null && hardMin != null;
|
||||
let hardMaxOnly = softMax == null && hardMax != null;
|
||||
let hasFixedRange = hardMinOnly && hardMaxOnly;
|
||||
|
||||
// uPlot range function
|
||||
const rangeFn = (u: uPlot, dataMin: number | null, dataMax: number | null, scaleKey: string) => {
|
||||
const rangeFn = (u: uPlot, dataMin: number, dataMax: number, scaleKey: string) => {
|
||||
const scale = u.scales[scaleKey];
|
||||
|
||||
let minMax: uPlot.Range.MinMax = [dataMin, dataMax];
|
||||
|
||||
// happens when all series on a scale are `show: false`, re-returning nulls will auto-disable axis
|
||||
if (!hasFixedRange && dataMin == null && dataMax == null) {
|
||||
return minMax;
|
||||
}
|
||||
|
||||
if (scale.distr === 1 || scale.distr === 2) {
|
||||
if (centeredZero) {
|
||||
let absMin = Math.abs(dataMin!);
|
||||
let absMax = Math.abs(dataMax!);
|
||||
let absMin = Math.abs(dataMin);
|
||||
let absMax = Math.abs(dataMax);
|
||||
let max = Math.max(absMin, absMax);
|
||||
dataMin = -max;
|
||||
dataMax = max;
|
||||
@@ -97,7 +91,7 @@ export class UPlotScaleBuilder extends PlotConfigBuilder<ScaleProps, Scale> {
|
||||
// @ts-ignore here we may use hardMin / hardMax to make sure any extra padding is computed from a more accurate delta
|
||||
minMax = uPlot.rangeNum(hardMinOnly ? hardMin : dataMin, hardMaxOnly ? hardMax : dataMax, rangeConfig);
|
||||
} else if (scale.distr === 3) {
|
||||
minMax = uPlot.rangeLog(dataMin!, dataMax!, scale.log ?? 10, true);
|
||||
minMax = uPlot.rangeLog(dataMin, dataMax, scale.log ?? 10, true);
|
||||
}
|
||||
|
||||
// if all we got were hard limits, treat them as static min/max
|
||||
@@ -109,17 +103,10 @@ export class UPlotScaleBuilder extends PlotConfigBuilder<ScaleProps, Scale> {
|
||||
minMax[1] = hardMax!;
|
||||
}
|
||||
|
||||
// guard against invalid y ranges
|
||||
if (minMax[0]! >= minMax[1]!) {
|
||||
minMax[0] = 0;
|
||||
minMax[1] = 100;
|
||||
}
|
||||
|
||||
return minMax;
|
||||
};
|
||||
|
||||
let auto = !isTime && !hasFixedRange;
|
||||
|
||||
let auto = !isTime && !(hardMinOnly && hardMaxOnly);
|
||||
if (isBooleanUnit(scaleKey)) {
|
||||
auto = false;
|
||||
range = [0, 1];
|
||||
|
||||
@@ -87,7 +87,7 @@ const initHook = (u: uPlot) => {
|
||||
window.requestAnimationFrame(handlePressedKeys);
|
||||
};
|
||||
|
||||
const onKeyDown = (e: KeyboardEvent) => {
|
||||
vizLayoutViz.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Tab') {
|
||||
// Hide the cursor if the user tabs away
|
||||
u.setCursor({ left: -5, top: -5 });
|
||||
@@ -112,9 +112,9 @@ const initHook = (u: uPlot) => {
|
||||
window.requestAnimationFrame(handlePressedKeys);
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
const onKeyUp = (e: KeyboardEvent) => {
|
||||
vizLayoutViz.addEventListener('keyup', (e) => {
|
||||
if (!KNOWN_KEYS.has(e.key)) {
|
||||
return;
|
||||
}
|
||||
@@ -129,9 +129,9 @@ const initHook = (u: uPlot) => {
|
||||
u.setSelect(u.select);
|
||||
dragStartX = null;
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
const onFocus = () => {
|
||||
vizLayoutViz.addEventListener('focus', (e) => {
|
||||
// We only want to initialize the cursor if the user is using keyboard controls
|
||||
if (!vizLayoutViz?.matches(':focus-visible')) {
|
||||
return;
|
||||
@@ -141,30 +141,14 @@ const initHook = (u: uPlot) => {
|
||||
const drawWidth = parseFloat(u.over.style.width);
|
||||
const drawHeight = parseFloat(u.over.style.height);
|
||||
u.setCursor({ left: drawWidth / 2, top: drawHeight / 2 });
|
||||
};
|
||||
});
|
||||
|
||||
const onBlur = () => {
|
||||
vizLayoutViz.addEventListener('blur', (e) => {
|
||||
keysLastHandledAt = null;
|
||||
dragStartX = null;
|
||||
pressedKeys.clear();
|
||||
u.setSelect({ left: 0, top: 0, width: 0, height: 0 }, false);
|
||||
};
|
||||
|
||||
vizLayoutViz.addEventListener('keydown', onKeyDown);
|
||||
vizLayoutViz.addEventListener('keyup', onKeyUp);
|
||||
vizLayoutViz.addEventListener('focus', onFocus);
|
||||
vizLayoutViz.addEventListener('blur', onBlur);
|
||||
|
||||
const onDestroy = () => {
|
||||
vizLayoutViz?.removeEventListener('keydown', onKeyDown);
|
||||
vizLayoutViz?.removeEventListener('keyup', onKeyUp);
|
||||
vizLayoutViz?.removeEventListener('focus', onFocus);
|
||||
vizLayoutViz?.removeEventListener('blur', onBlur);
|
||||
|
||||
vizLayoutViz = null;
|
||||
};
|
||||
|
||||
(u.hooks.destroy ??= []).push(onDestroy);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@jaegertracing/jaeger-ui-components",
|
||||
"version": "9.1.1",
|
||||
"version": "9.1.0",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"license": "Apache-2.0",
|
||||
@@ -31,10 +31,10 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@emotion/css": "11.9.0",
|
||||
"@grafana/data": "9.1.1",
|
||||
"@grafana/e2e-selectors": "9.1.1",
|
||||
"@grafana/runtime": "9.1.1",
|
||||
"@grafana/ui": "9.1.1",
|
||||
"@grafana/data": "9.1.0",
|
||||
"@grafana/e2e-selectors": "9.1.0",
|
||||
"@grafana/runtime": "9.1.0",
|
||||
"@grafana/ui": "9.1.0",
|
||||
"chance": "^1.0.10",
|
||||
"classnames": "^2.2.5",
|
||||
"combokeys": "^3.0.0",
|
||||
|
||||
@@ -54,7 +54,6 @@ case "$1" in
|
||||
|
||||
if [ ! -d $PROVISIONING_CFG_DIR/alerting ]; then
|
||||
mkdir -p $PROVISIONING_CFG_DIR/alerting
|
||||
cp /usr/share/grafana/conf/provisioning/alerting/sample.yaml $PROVISIONING_CFG_DIR/alerting/sample.yaml
|
||||
fi
|
||||
|
||||
# configuration files should not be modifiable by grafana user, as this can be a security issue
|
||||
|
||||
@@ -68,7 +68,6 @@ if [ $1 -eq 1 ] ; then
|
||||
|
||||
if [ ! -d $PROVISIONING_CFG_DIR/alerting ]; then
|
||||
mkdir -p $PROVISIONING_CFG_DIR/alerting
|
||||
cp /usr/share/grafana/conf/provisioning/alerting/sample.yaml $PROVISIONING_CFG_DIR/alerting/sample.yaml
|
||||
fi
|
||||
|
||||
# Set user permissions on /var/log/grafana, /var/lib/grafana
|
||||
|
||||
@@ -43,13 +43,13 @@ Labels:
|
||||
Annotations:
|
||||
{{ range .Annotations.SortedPairs }} - {{ .Name }} = {{ .Value }}
|
||||
{{ end }}
|
||||
{{ if gt (len .GeneratorURL) 0 }}Source: [{{ .GeneratorURL }}]({{ .GeneratorURL }})
|
||||
{{ if gt (len .GeneratorURL) 0 }}Source: {{ .GeneratorURL }}
|
||||
|
||||
{{ end }}{{ if gt (len .SilenceURL) 0 }}Silence: [{{ .SilenceURL }}]({{ .SilenceURL }})
|
||||
{{ end }}{{ if gt (len .SilenceURL) 0 }}Silence: {{ .SilenceURL }}
|
||||
|
||||
{{ end }}{{ if gt (len .DashboardURL) 0 }}Dashboard: [{{ .DashboardURL }}]({{ .DashboardURL }})
|
||||
{{ end }}{{ if gt (len .DashboardURL) 0 }}Dashboard: {{ .DashboardURL }}
|
||||
|
||||
{{ end }}{{ if gt (len .PanelURL) 0 }}Panel: [{{ .PanelURL }}]({{ .PanelURL }})
|
||||
{{ end }}{{ if gt (len .PanelURL) 0 }}Panel: {{ .PanelURL }}
|
||||
|
||||
{{ end }}
|
||||
{{ end }}{{ end }}
|
||||
|
||||
@@ -148,13 +148,13 @@ Labels:
|
||||
Annotations:
|
||||
- ann1 = annv1
|
||||
|
||||
Source: [http://localhost/alert1](http://localhost/alert1)
|
||||
Source: http://localhost/alert1
|
||||
|
||||
Silence: [http://localhost/grafana/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1](http://localhost/grafana/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1)
|
||||
Silence: http://localhost/grafana/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval1
|
||||
|
||||
Dashboard: [http://localhost/grafana/d/dbuid123](http://localhost/grafana/d/dbuid123)
|
||||
Dashboard: http://localhost/grafana/d/dbuid123
|
||||
|
||||
Panel: [http://localhost/grafana/d/dbuid123?viewPanel=puid123](http://localhost/grafana/d/dbuid123?viewPanel=puid123)
|
||||
Panel: http://localhost/grafana/d/dbuid123?viewPanel=puid123
|
||||
|
||||
|
||||
|
||||
@@ -166,9 +166,9 @@ Labels:
|
||||
Annotations:
|
||||
- ann1 = annv2
|
||||
|
||||
Source: [http://localhost/alert2](http://localhost/alert2)
|
||||
Source: http://localhost/alert2
|
||||
|
||||
Silence: [http://localhost/grafana/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval2](http://localhost/grafana/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval2)
|
||||
Silence: http://localhost/grafana/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval2
|
||||
|
||||
|
||||
|
||||
@@ -183,13 +183,13 @@ Labels:
|
||||
Annotations:
|
||||
- ann1 = annv3
|
||||
|
||||
Source: [http://localhost/alert3](http://localhost/alert3)
|
||||
Source: http://localhost/alert3
|
||||
|
||||
Silence: [http://localhost/grafana/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval3](http://localhost/grafana/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval3)
|
||||
Silence: http://localhost/grafana/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval3
|
||||
|
||||
Dashboard: [http://localhost/grafana/d/dbuid456](http://localhost/grafana/d/dbuid456)
|
||||
Dashboard: http://localhost/grafana/d/dbuid456
|
||||
|
||||
Panel: [http://localhost/grafana/d/dbuid456?viewPanel=puid456](http://localhost/grafana/d/dbuid456?viewPanel=puid456)
|
||||
Panel: http://localhost/grafana/d/dbuid456?viewPanel=puid456
|
||||
|
||||
|
||||
|
||||
@@ -201,9 +201,9 @@ Labels:
|
||||
Annotations:
|
||||
- ann1 = annv4
|
||||
|
||||
Source: [http://localhost/alert4](http://localhost/alert4)
|
||||
Source: http://localhost/alert4
|
||||
|
||||
Silence: [http://localhost/grafana/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval4](http://localhost/grafana/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval4)
|
||||
Silence: http://localhost/grafana/alerting/silence/new?alertmanager=grafana&matcher=alertname%3Dalert1&matcher=lbl1%3Dval4
|
||||
|
||||
|
||||
`,
|
||||
|
||||
@@ -43,7 +43,6 @@ const (
|
||||
// AdaptiveCardsMessage represents a message for adaptive cards.
|
||||
type AdaptiveCardsMessage struct {
|
||||
Attachments []AdaptiveCardsAttachment `json:"attachments"`
|
||||
Summary string `json:"summary,omitempty"` // Summary is the text shown in notifications
|
||||
Type string `json:"type"`
|
||||
}
|
||||
|
||||
@@ -69,10 +68,10 @@ type AdaptiveCardsAttachment struct {
|
||||
// AdapativeCard repesents an Adaptive Card.
|
||||
// https://adaptivecards.io/explorer/AdaptiveCard.html
|
||||
type AdaptiveCard struct {
|
||||
Body []AdaptiveCardItem
|
||||
Schema string
|
||||
Type string
|
||||
Version string
|
||||
Body []AdaptiveCardItem `json:"body"`
|
||||
Schema string `json:"$schema"`
|
||||
Type string `json:"type"`
|
||||
Version string `json:"version"`
|
||||
}
|
||||
|
||||
// NewAdaptiveCard returns a prepared Adaptive Card.
|
||||
@@ -85,22 +84,6 @@ func NewAdaptiveCard() AdaptiveCard {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *AdaptiveCard) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(struct {
|
||||
Body []AdaptiveCardItem `json:"body"`
|
||||
Schema string `json:"$schema"`
|
||||
Type string `json:"type"`
|
||||
Version string `json:"version"`
|
||||
MsTeams map[string]interface{} `json:"msTeams,omitempty"`
|
||||
}{
|
||||
Body: c.Body,
|
||||
Schema: c.Schema,
|
||||
Type: c.Type,
|
||||
Version: c.Version,
|
||||
MsTeams: map[string]interface{}{"width": "Full"},
|
||||
})
|
||||
}
|
||||
|
||||
// AppendItem appends an item, such as text or an image, to the Adaptive Card.
|
||||
func (c *AdaptiveCard) AppendItem(i AdaptiveCardItem) {
|
||||
c.Body = append(c.Body, i)
|
||||
@@ -334,9 +317,6 @@ func (tn *TeamsNotifier) Notify(ctx context.Context, as ...*types.Alert) (bool,
|
||||
},
|
||||
})
|
||||
|
||||
msg := NewAdaptiveCardsMessage(card)
|
||||
msg.Summary = tmpl(tn.Title)
|
||||
|
||||
// This check for tmplErr must happen before templating the URL
|
||||
if tmplErr != nil {
|
||||
tn.log.Warn("failed to template Teams message", "err", tmplErr.Error())
|
||||
@@ -349,7 +329,7 @@ func (tn *TeamsNotifier) Notify(ctx context.Context, as ...*types.Alert) (bool,
|
||||
u = tn.URL
|
||||
}
|
||||
|
||||
b, err := json.Marshal(msg)
|
||||
b, err := json.Marshal(NewAdaptiveCardsMessage(card))
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("failed to marshal JSON: %w", err)
|
||||
}
|
||||
|
||||
@@ -70,14 +70,10 @@ func TestTeamsNotifier(t *testing.T) {
|
||||
}},
|
||||
"type": "AdaptiveCard",
|
||||
"version": "1.4",
|
||||
"msTeams": map[string]interface{}{
|
||||
"width": "Full",
|
||||
},
|
||||
},
|
||||
"contentType": "application/vnd.microsoft.card.adaptive",
|
||||
}},
|
||||
"summary": "[FIRING:1] (val1)",
|
||||
"type": "message",
|
||||
"type": "message",
|
||||
},
|
||||
expMsgError: nil,
|
||||
}, {
|
||||
@@ -126,14 +122,10 @@ func TestTeamsNotifier(t *testing.T) {
|
||||
}},
|
||||
"type": "AdaptiveCard",
|
||||
"version": "1.4",
|
||||
"msTeams": map[string]interface{}{
|
||||
"width": "Full",
|
||||
},
|
||||
},
|
||||
"contentType": "application/vnd.microsoft.card.adaptive",
|
||||
}},
|
||||
"summary": "alert1",
|
||||
"type": "message",
|
||||
"type": "message",
|
||||
},
|
||||
expMsgError: nil,
|
||||
}, {
|
||||
@@ -182,9 +174,6 @@ func TestTeamsNotifier(t *testing.T) {
|
||||
}},
|
||||
"type": "AdaptiveCard",
|
||||
"version": "1.4",
|
||||
"msTeams": map[string]interface{}{
|
||||
"width": "Full",
|
||||
},
|
||||
},
|
||||
"contentType": "application/vnd.microsoft.card.adaptive",
|
||||
}},
|
||||
@@ -237,9 +226,6 @@ func TestTeamsNotifier(t *testing.T) {
|
||||
}},
|
||||
"type": "AdaptiveCard",
|
||||
"version": "1.4",
|
||||
"msTeams": map[string]interface{}{
|
||||
"width": "Full",
|
||||
},
|
||||
},
|
||||
"contentType": "application/vnd.microsoft.card.adaptive",
|
||||
}},
|
||||
|
||||
@@ -2224,15 +2224,11 @@ var expNonEmailNotifications = map[string][]string{
|
||||
}
|
||||
],
|
||||
"type": "AdaptiveCard",
|
||||
"version": "1.4",
|
||||
"msTeams": {
|
||||
"width": "Full"
|
||||
}
|
||||
"version": "1.4"
|
||||
},
|
||||
"contentType": "application/vnd.microsoft.card.adaptive"
|
||||
}
|
||||
],
|
||||
"summary": "[FIRING:1] TeamsAlert (default)",
|
||||
"type": "message"
|
||||
}`,
|
||||
},
|
||||
|
||||
@@ -430,13 +430,7 @@ func buildFilterString(metricType string, filterParts []string) string {
|
||||
}
|
||||
|
||||
func buildSLOFilterExpression(q sloQuery) string {
|
||||
sloName := fmt.Sprintf("projects/%s/services/%s/serviceLevelObjectives/%s", q.ProjectName, q.ServiceId, q.SloId)
|
||||
|
||||
if q.SelectorName == "select_slo_burn_rate" {
|
||||
return fmt.Sprintf(`%s("%s", "%s")`, q.SelectorName, sloName, q.LookbackPeriod)
|
||||
} else {
|
||||
return fmt.Sprintf(`%s("%s")`, q.SelectorName, sloName)
|
||||
}
|
||||
return fmt.Sprintf(`%s("projects/%s/services/%s/serviceLevelObjectives/%s")`, q.SelectorName, q.ProjectName, q.ServiceId, q.SloId)
|
||||
}
|
||||
|
||||
func setMetricAggParams(params *url.Values, query *metricQuery, durationSeconds int, intervalMs int64) {
|
||||
|
||||
@@ -589,26 +589,6 @@ func TestCloudMonitoring(t *testing.T) {
|
||||
|
||||
dl := qqueries[0].buildDeepLink()
|
||||
assert.Empty(t, dl)
|
||||
|
||||
req.Queries[0].JSON = json.RawMessage(`{
|
||||
"queryType": "slo",
|
||||
"sloQuery": {
|
||||
"projectName": "test-proj",
|
||||
"alignmentPeriod": "stackdriver-auto",
|
||||
"perSeriesAligner": "ALIGN_NEXT_OLDER",
|
||||
"aliasBy": "",
|
||||
"selectorName": "select_slo_burn_rate",
|
||||
"serviceId": "test-service",
|
||||
"sloId": "test-slo",
|
||||
"lookbackPeriod": "1h"
|
||||
},
|
||||
"metricQuery": {}
|
||||
}`)
|
||||
|
||||
qes, err = service.buildQueryExecutors(req)
|
||||
require.NoError(t, err)
|
||||
qqqueries := getCloudMonitoringQueriesFromInterface(t, qes)
|
||||
assert.Equal(t, `aggregation.alignmentPeriod=%2B60s&aggregation.perSeriesAligner=ALIGN_NEXT_OLDER&filter=select_slo_burn_rate%28%22projects%2Ftest-proj%2Fservices%2Ftest-service%2FserviceLevelObjectives%2Ftest-slo%22%2C+%221h%22%29&interval.endTime=2018-03-15T13%3A34%3A00Z&interval.startTime=2018-03-15T13%3A00%3A00Z`, qqqueries[0].Target)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -68,7 +68,6 @@ type (
|
||||
SelectorName string
|
||||
ServiceId string
|
||||
SloId string
|
||||
LookbackPeriod string
|
||||
}
|
||||
|
||||
grafanaQuery struct {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user