diff --git a/.betterer.results b/.betterer.results
index 74c1c477bbd..c61b1819cc9 100644
--- a/.betterer.results
+++ b/.betterer.results
@@ -794,50 +794,12 @@ exports[`better eslint`] = {
[0, 0, 0, "Do not re-export imported variable (\`notifyApp\`)", "2"],
[0, 0, 0, "Do not re-export imported variable (\`hideAppNotification\`)", "3"]
],
- "public/app/core/components/AccessControl/PermissionListItem.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"]
- ],
"public/app/core/components/AccessControl/index.ts:5381": [
[0, 0, 0, "Do not use export all (\`export * from ...\`)", "0"]
],
- "public/app/core/components/AppChrome/AppChrome.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"]
- ],
- "public/app/core/components/AppChrome/TopBar/SignInLink.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"]
- ],
- "public/app/core/components/AppChrome/TopBar/TopSearchBarCommandPaletteTrigger.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"]
- ],
- "public/app/core/components/AppNotifications/AppNotificationItem.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"]
- ],
"public/app/core/components/DynamicImports/SafeDynamicImport.tsx:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
],
- "public/app/core/components/EmptyListCTA/EmptyListCTA.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"]
- ],
- "public/app/core/components/FolderFilter/FolderFilter.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"]
- ],
- "public/app/core/components/ForgottenPassword/ChangePassword.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"]
- ],
- "public/app/core/components/ForgottenPassword/ForgottenPassword.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "2"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "3"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "4"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "5"]
- ],
- "public/app/core/components/FormPrompt/FormPrompt.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "2"]
- ],
"public/app/core/components/GraphNG/GraphNG.tsx:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"],
@@ -849,79 +811,14 @@ exports[`better eslint`] = {
"public/app/core/components/LocalStorageValueProvider/index.tsx:5381": [
[0, 0, 0, "Do not re-export imported variable (\`./LocalStorageValueProvider\`)", "0"]
],
- "public/app/core/components/Login/LoginLayout.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"]
- ],
- "public/app/core/components/Login/LoginServiceButtons.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"]
- ],
- "public/app/core/components/NestedFolderPicker/NestedFolderList.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"]
- ],
- "public/app/core/components/PageNotFound/EntityNotFound.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "2"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "3"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "4"]
- ],
- "public/app/core/components/PanelTypeFilter/PanelTypeFilter.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"]
- ],
- "public/app/core/components/PluginHelp/PluginHelp.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"]
- ],
- "public/app/core/components/RolePicker/BuiltinRoleSelector.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"]
- ],
- "public/app/core/components/RolePicker/RolePickerInput.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"]
- ],
- "public/app/core/components/RolePicker/RolePickerMenu.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "2"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "3"]
- ],
- "public/app/core/components/RolePicker/RolePickerSubMenu.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"]
- ],
- "public/app/core/components/Select/OldFolderPicker.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"]
- ],
- "public/app/core/components/Signup/SignupPage.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"]
- ],
- "public/app/core/components/Signup/VerifyEmail.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "2"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "3"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "4"]
- ],
"public/app/core/components/TagFilter/TagFilter.tsx:5381": [
- [0, 0, 0, "Unexpected any. Specify a different type.", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"]
+ [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
],
"public/app/core/components/TimeSeries/utils.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"],
[0, 0, 0, "Unexpected any. Specify a different type.", "2"]
],
- "public/app/core/components/Upgrade/UpgradeBox.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "2"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "3"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "4"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "5"]
- ],
- "public/app/core/components/help/HelpModal.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"]
- ],
"public/app/core/config.ts:5381": [
[0, 0, 0, "Do not re-export imported variable (\`config\`)", "0"],
[0, 0, 0, "Do not re-export imported variable (\`Settings\`)", "1"]
@@ -936,15 +833,6 @@ exports[`better eslint`] = {
[0, 0, 0, "Do not re-export imported variable (\`TimeSeries\`)", "6"],
[0, 0, 0, "Do not re-export imported variable (\`updateLegendValues\`)", "7"]
],
- "public/app/core/navigation/GrafanaRouteError.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "2"]
- ],
- "public/app/core/navigation/RouterDebugger.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"]
- ],
"public/app/core/navigation/types.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
],
@@ -1035,161 +923,18 @@ exports[`better eslint`] = {
[0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"]
],
- "public/app/features/actions/ActionEditorModalContent.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"]
- ],
- "public/app/features/actions/ActionsInlineEditor.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"]
- ],
"public/app/features/actions/ParamsEditor.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"]
],
- "public/app/features/admin/AdminEditOrgPage.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "2"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "3"]
- ],
- "public/app/features/admin/AdminFeatureTogglesPage.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "2"]
- ],
"public/app/features/admin/AdminFeatureTogglesTable.tsx:5381": [
[0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
[0, 0, 0, "No untranslated strings. Wrap text with ", "1"],
[0, 0, 0, "No untranslated strings. Wrap text with ", "2"]
],
- "public/app/features/admin/AdminListOrgsPage.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"]
- ],
- "public/app/features/admin/AdminOrgsTable.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "2"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "3"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "4"]
- ],
- "public/app/features/admin/AdminSettings.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"]
- ],
- "public/app/features/admin/ServerStats.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "2"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "3"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "4"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "5"]
- ],
"public/app/features/admin/UpgradePage.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "2"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "3"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "4"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "5"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "6"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "7"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "8"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "9"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "10"]
- ],
- "public/app/features/admin/UserCreatePage.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"]
- ],
- "public/app/features/admin/UserLdapSyncInfo.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "2"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "3"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "4"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "5"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "6"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "7"]
- ],
- "public/app/features/admin/UserListAdminPage.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"]
- ],
- "public/app/features/admin/UserListPublicDashboardPage/DashboardsListModalButton.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"]
- ],
- "public/app/features/admin/UserListPublicDashboardPage/UserListPublicDashboardPage.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"]
- ],
- "public/app/features/admin/UserOrgs.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "2"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "3"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "4"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "5"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "6"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "7"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "8"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "9"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "10"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "11"]
- ],
- "public/app/features/admin/UserPermissions.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "2"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "3"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "4"]
- ],
- "public/app/features/admin/UserProfile.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "2"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "3"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "4"]
- ],
- "public/app/features/admin/UserSessions.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "2"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "3"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "4"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "5"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "6"]
- ],
- "public/app/features/admin/Users/AnonUsersTable.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"]
- ],
- "public/app/features/admin/Users/OrgUsersTable.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "2"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "3"]
- ],
- "public/app/features/admin/Users/UsersTable.tsx:5381": [
[0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
[0, 0, 0, "No untranslated strings. Wrap text with ", "1"]
],
- "public/app/features/admin/ldap/LdapConnectionStatus.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"]
- ],
- "public/app/features/admin/ldap/LdapPage.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"]
- ],
- "public/app/features/admin/ldap/LdapSyncInfo.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"]
- ],
- "public/app/features/admin/ldap/LdapUserGroups.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"]
- ],
- "public/app/features/admin/ldap/LdapUserInfo.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"]
- ],
- "public/app/features/admin/ldap/LdapUserPermissions.tsx:5381": [
- [0, 0, 0, "No untranslated strings. Wrap text with ", "0"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "1"],
- [0, 0, 0, "No untranslated strings. Wrap text with ", "2"]
- ],
"public/app/features/alerting/routes.tsx:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
],
@@ -6011,22 +5756,6 @@ exports[`no gf-form usage`] = {
[0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"],
[0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"]
],
- "public/app/features/admin/partials/edit_org.html:5381": [
- [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"],
- [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"],
- [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"],
- [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"],
- [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"],
- [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"],
- [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"],
- [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"]
- ],
- "public/app/features/admin/partials/styleguide.html:5381": [
- [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"],
- [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"],
- [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"],
- [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"]
- ],
"public/app/features/annotations/partials/event_editor.html:5381": [
[0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"],
[0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"],
diff --git a/.drone.yml b/.drone.yml
index d010b7598b2..055db278c6c 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -184,12 +184,27 @@ steps:
- yarn-install
image: node:20.9.0-alpine
name: betterer-frontend
+- commands:
+ - echo $(/usr/bin/github-app-external-token) > /github-app/token
+ environment:
+ GITHUB_APP_ID:
+ from_secret: github-app-app-id
+ GITHUB_APP_INSTALLATION_ID:
+ from_secret: github-app-installation-id
+ GITHUB_APP_PRIVATE_KEY:
+ from_secret: github-app-private-key
+ image: us-docker.pkg.dev/grafanalabs-global/docker-deployment-tools-prod/github-app-secret-writer:2024-11-05-v11688112090.1-83920c59
+ name: github-app-generate-token
+ volumes:
+ - name: github-app
+ path: /github-app
- commands:
- apk add --update curl jq bash
- - is_fork=$(curl --retry 5 "https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST"
+ - GITHUB_TOKEN=$(cat /github-app/token)
+ - is_fork=$(curl --retry 5 "https://$${GITHUB_TOKEN}@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST"
| jq .head.repo.fork)
- if [ "$is_fork" != false ]; then return 1; fi
- - git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"
+ - git clone "https://x-access-token:$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"
../grafana-enterprise
- cd ../grafana-enterprise
- if git checkout ${DRONE_SOURCE_BRANCH}; then echo "checked out ${DRONE_SOURCE_BRANCH}";
@@ -199,12 +214,14 @@ steps:
- ln -s src grafana
- cd ./grafana-enterprise
- ./build.sh
- environment:
- GITHUB_TOKEN:
- from_secret: github_token
+ depends_on:
+ - github-app-generate-token
failure: ignore
image: alpine/git:2.40.1
name: clone-enterprise
+ volumes:
+ - name: github-app
+ path: /github-app
- commands:
- yarn run ci:test-frontend
depends_on:
@@ -230,6 +247,8 @@ volumes:
- host:
path: /var/run/docker.sock
name: docker
+- name: github-app
+ temp: {}
---
clone:
retries: 3
@@ -248,12 +267,27 @@ platform:
os: linux
services: []
steps:
+- commands:
+ - echo $(/usr/bin/github-app-external-token) > /github-app/token
+ environment:
+ GITHUB_APP_ID:
+ from_secret: github-app-app-id
+ GITHUB_APP_INSTALLATION_ID:
+ from_secret: github-app-installation-id
+ GITHUB_APP_PRIVATE_KEY:
+ from_secret: github-app-private-key
+ image: us-docker.pkg.dev/grafanalabs-global/docker-deployment-tools-prod/github-app-secret-writer:2024-11-05-v11688112090.1-83920c59
+ name: github-app-generate-token
+ volumes:
+ - name: github-app
+ path: /github-app
- commands:
- apk add --update curl jq bash
- - is_fork=$(curl --retry 5 "https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST"
+ - GITHUB_TOKEN=$(cat /github-app/token)
+ - is_fork=$(curl --retry 5 "https://$${GITHUB_TOKEN}@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST"
| jq .head.repo.fork)
- if [ "$is_fork" != false ]; then return 1; fi
- - git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"
+ - git clone "https://x-access-token:$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"
../grafana-enterprise
- cd ../grafana-enterprise
- if git checkout ${DRONE_SOURCE_BRANCH}; then echo "checked out ${DRONE_SOURCE_BRANCH}";
@@ -263,12 +297,14 @@ steps:
- ln -s src grafana
- cd ./grafana-enterprise
- ./build.sh
- environment:
- GITHUB_TOKEN:
- from_secret: github_token
+ depends_on:
+ - github-app-generate-token
failure: ignore
image: alpine/git:2.40.1
name: clone-enterprise
+ volumes:
+ - name: github-app
+ path: /github-app
- commands:
- echo $DRONE_RUNNER_NAME
image: alpine:3.20.3
@@ -318,6 +354,8 @@ volumes:
- host:
path: /var/run/docker.sock
name: docker
+- name: github-app
+ temp: {}
---
clone:
retries: 3
@@ -336,12 +374,27 @@ platform:
os: linux
services: []
steps:
+- commands:
+ - echo $(/usr/bin/github-app-external-token) > /github-app/token
+ environment:
+ GITHUB_APP_ID:
+ from_secret: github-app-app-id
+ GITHUB_APP_INSTALLATION_ID:
+ from_secret: github-app-installation-id
+ GITHUB_APP_PRIVATE_KEY:
+ from_secret: github-app-private-key
+ image: us-docker.pkg.dev/grafanalabs-global/docker-deployment-tools-prod/github-app-secret-writer:2024-11-05-v11688112090.1-83920c59
+ name: github-app-generate-token
+ volumes:
+ - name: github-app
+ path: /github-app
- commands:
- apk add --update curl jq bash
- - is_fork=$(curl --retry 5 "https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST"
+ - GITHUB_TOKEN=$(cat /github-app/token)
+ - is_fork=$(curl --retry 5 "https://$${GITHUB_TOKEN}@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST"
| jq .head.repo.fork)
- if [ "$is_fork" != false ]; then return 1; fi
- - git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"
+ - git clone "https://x-access-token:$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"
../grafana-enterprise
- cd ../grafana-enterprise
- if git checkout ${DRONE_SOURCE_BRANCH}; then echo "checked out ${DRONE_SOURCE_BRANCH}";
@@ -351,12 +404,14 @@ steps:
- ln -s src grafana
- cd ./grafana-enterprise
- ./build.sh
- environment:
- GITHUB_TOKEN:
- from_secret: github_token
+ depends_on:
+ - github-app-generate-token
failure: ignore
image: alpine/git:2.40.1
name: clone-enterprise
+ volumes:
+ - name: github-app
+ path: /github-app
- commands:
- echo $DRONE_RUNNER_NAME
image: alpine:3.20.3
@@ -426,6 +481,8 @@ volumes:
- host:
path: /var/run/docker.sock
name: docker
+- name: github-app
+ temp: {}
---
clone:
retries: 3
@@ -455,12 +512,27 @@ steps:
CGO_ENABLED: 0
image: golang:1.23.1-alpine
name: compile-build-cmd
+- commands:
+ - echo $(/usr/bin/github-app-external-token) > /github-app/token
+ environment:
+ GITHUB_APP_ID:
+ from_secret: github-app-app-id
+ GITHUB_APP_INSTALLATION_ID:
+ from_secret: github-app-installation-id
+ GITHUB_APP_PRIVATE_KEY:
+ from_secret: github-app-private-key
+ image: us-docker.pkg.dev/grafanalabs-global/docker-deployment-tools-prod/github-app-secret-writer:2024-11-05-v11688112090.1-83920c59
+ name: github-app-generate-token
+ volumes:
+ - name: github-app
+ path: /github-app
- commands:
- apk add --update curl jq bash
- - is_fork=$(curl --retry 5 "https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST"
+ - GITHUB_TOKEN=$(cat /github-app/token)
+ - is_fork=$(curl --retry 5 "https://$${GITHUB_TOKEN}@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST"
| jq .head.repo.fork)
- if [ "$is_fork" != false ]; then return 1; fi
- - git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"
+ - git clone "https://x-access-token:$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"
../grafana-enterprise
- cd ../grafana-enterprise
- if git checkout ${DRONE_SOURCE_BRANCH}; then echo "checked out ${DRONE_SOURCE_BRANCH}";
@@ -470,12 +542,14 @@ steps:
- ln -s src grafana
- cd ./grafana-enterprise
- ./build.sh
- environment:
- GITHUB_TOKEN:
- from_secret: github_token
+ depends_on:
+ - github-app-generate-token
failure: ignore
image: alpine/git:2.40.1
name: clone-enterprise
+ volumes:
+ - name: github-app
+ path: /github-app
- commands:
- apk add --update make
- make gen-go
@@ -515,6 +589,8 @@ volumes:
- host:
path: /var/run/docker.sock
name: docker
+- name: github-app
+ temp: {}
---
clone:
retries: 3
@@ -533,6 +609,20 @@ platform:
os: linux
services: []
steps:
+- commands:
+ - echo $(/usr/bin/github-app-external-token) > /github-app/token
+ environment:
+ GITHUB_APP_ID:
+ from_secret: github-app-app-id
+ GITHUB_APP_INSTALLATION_ID:
+ from_secret: github-app-installation-id
+ GITHUB_APP_PRIVATE_KEY:
+ from_secret: github-app-private-key
+ image: us-docker.pkg.dev/grafanalabs-global/docker-deployment-tools-prod/github-app-secret-writer:2024-11-05-v11688112090.1-83920c59
+ name: github-app-generate-token
+ volumes:
+ - name: github-app
+ path: /github-app
- commands:
- echo $DRONE_RUNNER_NAME
image: alpine:3.20.3
@@ -736,10 +826,12 @@ steps:
image: cypress/included:13.10.0
name: end-to-end-tests-old-arch/various-suite
- commands:
+ - GITHUB_TOKEN=$(cat /github-app/token)
- cd /
- ./cpp-e2e/scripts/ci-run.sh azure ${DRONE_SOURCE_BRANCH}
depends_on:
- grafana-server
+ - github-app-generate-token
environment:
AZURE_SP_APP_ID:
from_secret: azure_sp_app_id
@@ -748,11 +840,12 @@ steps:
AZURE_TENANT:
from_secret: azure_tenant
CYPRESS_CI: "true"
- GITHUB_TOKEN:
- from_secret: github_token
HOST: grafana-server
image: us-docker.pkg.dev/grafanalabs-dev/cloud-data-sources/e2e-13.10.0:1.0.0
name: end-to-end-tests-cloud-plugins-suite-azure
+ volumes:
+ - name: github-app
+ path: /github-app
when:
paths:
include:
@@ -795,6 +888,7 @@ steps:
- success
- failure
- commands:
+ - GITHUB_TOKEN=$(cat /github-app/token)
- if [ ! -d ./playwright-report/trace ]; then echo 'all tests passed'; exit 0; fi
- export E2E_PLAYWRIGHT_REPORT_URL=https://storage.googleapis.com/releng-pipeline-artifacts-dev/${DRONE_BUILD_NUMBER}/playwright-report/index.html
- 'curl -L -X POST https://api.github.com/repos/grafana/grafana/issues/${DRONE_PULL_REQUEST}/comments
@@ -806,17 +900,19 @@ steps:
\"}"'
depends_on:
- playwright-e2e-report-upload
- environment:
- GITHUB_TOKEN:
- from_secret: github_token
+ - github-app-generate-token
failure: ignore
image: byrnedo/alpine-curl:0.1.8
name: playwright-e2e-report-post-link
+ volumes:
+ - name: github-app
+ path: /github-app
when:
status:
- success
- failure
- commands:
+ - export GITHUB_TOKEN=$(cat /github-app/token)
- if [ -z `find ./e2e -type f -name *spec.ts.mp4` ]; then echo 'missing videos';
false; fi
- apt-get update
@@ -836,15 +932,17 @@ steps:
- end-to-end-tests-panels-suite
- end-to-end-tests-smoke-tests-suite
- end-to-end-tests-various-suite
+ - github-app-generate-token
environment:
E2E_TEST_ARTIFACTS_BUCKET: releng-pipeline-artifacts-dev
GCP_GRAFANA_UPLOAD_ARTIFACTS_KEY:
from_secret: gcp_upload_artifacts_key
- GITHUB_TOKEN:
- from_secret: github_token
failure: ignore
image: google/cloud-sdk:431.0.0
name: e2e-tests-artifacts-upload
+ volumes:
+ - name: github-app
+ path: /github-app
when:
status:
- success
@@ -889,6 +987,8 @@ volumes:
- host:
path: /var/run/docker.sock
name: docker
+- name: github-app
+ temp: {}
---
clone:
retries: 3
@@ -953,12 +1053,27 @@ services:
image: memcached:1.6.9-alpine
name: memcached
steps:
+- commands:
+ - echo $(/usr/bin/github-app-external-token) > /github-app/token
+ environment:
+ GITHUB_APP_ID:
+ from_secret: github-app-app-id
+ GITHUB_APP_INSTALLATION_ID:
+ from_secret: github-app-installation-id
+ GITHUB_APP_PRIVATE_KEY:
+ from_secret: github-app-private-key
+ image: us-docker.pkg.dev/grafanalabs-global/docker-deployment-tools-prod/github-app-secret-writer:2024-11-05-v11688112090.1-83920c59
+ name: github-app-generate-token
+ volumes:
+ - name: github-app
+ path: /github-app
- commands:
- apk add --update curl jq bash
- - is_fork=$(curl --retry 5 "https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST"
+ - GITHUB_TOKEN=$(cat /github-app/token)
+ - is_fork=$(curl --retry 5 "https://$${GITHUB_TOKEN}@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST"
| jq .head.repo.fork)
- if [ "$is_fork" != false ]; then return 1; fi
- - git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"
+ - git clone "https://x-access-token:$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"
../grafana-enterprise
- cd ../grafana-enterprise
- if git checkout ${DRONE_SOURCE_BRANCH}; then echo "checked out ${DRONE_SOURCE_BRANCH}";
@@ -968,12 +1083,14 @@ steps:
- ln -s src grafana
- cd ./grafana-enterprise
- ./build.sh
- environment:
- GITHUB_TOKEN:
- from_secret: github_token
+ depends_on:
+ - github-app-generate-token
failure: ignore
image: alpine/git:2.40.1
name: clone-enterprise
+ volumes:
+ - name: github-app
+ path: /github-app
- commands:
- mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.1.1/grabpl
@@ -1158,6 +1275,8 @@ volumes:
- name: mysql80
temp:
medium: memory
+- name: github-app
+ temp: {}
---
clone:
retries: 3
@@ -1287,12 +1406,27 @@ platform:
os: linux
services: []
steps:
+- commands:
+ - echo $(/usr/bin/github-app-external-token) > /github-app/token
+ environment:
+ GITHUB_APP_ID:
+ from_secret: github-app-app-id
+ GITHUB_APP_INSTALLATION_ID:
+ from_secret: github-app-installation-id
+ GITHUB_APP_PRIVATE_KEY:
+ from_secret: github-app-private-key
+ image: us-docker.pkg.dev/grafanalabs-global/docker-deployment-tools-prod/github-app-secret-writer:2024-11-05-v11688112090.1-83920c59
+ name: github-app-generate-token
+ volumes:
+ - name: github-app
+ path: /github-app
- commands:
- apk add --update curl jq bash
- - is_fork=$(curl --retry 5 "https://$GITHUB_TOKEN@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST"
+ - GITHUB_TOKEN=$(cat /github-app/token)
+ - is_fork=$(curl --retry 5 "https://$${GITHUB_TOKEN}@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST"
| jq .head.repo.fork)
- if [ "$is_fork" != false ]; then return 1; fi
- - git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"
+ - git clone "https://x-access-token:$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"
../grafana-enterprise
- cd ../grafana-enterprise
- if git checkout ${DRONE_SOURCE_BRANCH}; then echo "checked out ${DRONE_SOURCE_BRANCH}";
@@ -1302,12 +1436,14 @@ steps:
- ln -s src grafana
- cd ./grafana-enterprise
- ./build.sh
- environment:
- GITHUB_TOKEN:
- from_secret: github_token
+ depends_on:
+ - github-app-generate-token
failure: ignore
image: alpine/git:2.40.1
name: clone-enterprise
+ volumes:
+ - name: github-app
+ path: /github-app
- commands:
- apk add --update git make
- make swagger-clean && make openapi3-gen
@@ -1318,9 +1454,6 @@ steps:
&& return 1; fi
depends_on:
- clone-enterprise
- environment:
- GITHUB_TOKEN:
- from_secret: github_token
image: golang:1.23.1-alpine
name: swagger-gen
trigger:
@@ -1331,6 +1464,8 @@ volumes:
- host:
path: /var/run/docker.sock
name: docker
+- name: github-app
+ temp: {}
---
clone:
retries: 3
@@ -1395,9 +1530,24 @@ services:
image: memcached:1.6.9-alpine
name: memcached
steps:
+- commands:
+ - echo $(/usr/bin/github-app-external-token) > /github-app/token
+ environment:
+ GITHUB_APP_ID:
+ from_secret: github-app-app-id
+ GITHUB_APP_INSTALLATION_ID:
+ from_secret: github-app-installation-id
+ GITHUB_APP_PRIVATE_KEY:
+ from_secret: github-app-private-key
+ image: us-docker.pkg.dev/grafanalabs-global/docker-deployment-tools-prod/github-app-secret-writer:2024-11-05-v11688112090.1-83920c59
+ name: github-app-generate-token
+ volumes:
+ - name: github-app
+ path: /github-app
- commands:
- apk add --update curl jq bash
- - git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"
+ - GITHUB_TOKEN=$(cat /github-app/token)
+ - git clone "https://x-access-token:$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"
../grafana-enterprise
- cd ../grafana-enterprise
- if git checkout ${DRONE_SOURCE_BRANCH}; then echo "checked out ${DRONE_SOURCE_BRANCH}";
@@ -1407,12 +1557,14 @@ steps:
- ln -s src grafana
- cd ./grafana-enterprise
- ./build.sh
- environment:
- GITHUB_TOKEN:
- from_secret: github_token
+ depends_on:
+ - github-app-generate-token
failure: ignore
image: alpine/git:2.40.1
name: clone-enterprise
+ volumes:
+ - name: github-app
+ path: /github-app
- commands:
- go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd
depends_on: []
@@ -1509,6 +1661,8 @@ volumes:
- name: mysql80
temp:
medium: memory
+- name: github-app
+ temp: {}
---
clone:
retries: 3
@@ -1933,6 +2087,20 @@ platform:
os: linux
services: []
steps:
+- commands:
+ - echo $(/usr/bin/github-app-external-token) > /github-app/token
+ environment:
+ GITHUB_APP_ID:
+ from_secret: github-app-app-id
+ GITHUB_APP_INSTALLATION_ID:
+ from_secret: github-app-installation-id
+ GITHUB_APP_PRIVATE_KEY:
+ from_secret: github-app-private-key
+ image: us-docker.pkg.dev/grafanalabs-global/docker-deployment-tools-prod/github-app-secret-writer:2024-11-05-v11688112090.1-83920c59
+ name: github-app-generate-token
+ volumes:
+ - name: github-app
+ path: /github-app
- commands:
- echo $DRONE_RUNNER_NAME
image: alpine:3.20.3
@@ -2139,10 +2307,12 @@ steps:
image: cypress/included:13.10.0
name: end-to-end-tests-old-arch/various-suite
- commands:
+ - GITHUB_TOKEN=$(cat /github-app/token)
- cd /
- ./cpp-e2e/scripts/ci-run.sh azure ${DRONE_SOURCE_BRANCH}
depends_on:
- grafana-server
+ - github-app-generate-token
environment:
AZURE_SP_APP_ID:
from_secret: azure_sp_app_id
@@ -2151,11 +2321,12 @@ steps:
AZURE_TENANT:
from_secret: azure_tenant
CYPRESS_CI: "true"
- GITHUB_TOKEN:
- from_secret: github_token
HOST: grafana-server
image: us-docker.pkg.dev/grafanalabs-dev/cloud-data-sources/e2e-13.10.0:1.0.0
name: end-to-end-tests-cloud-plugins-suite-azure
+ volumes:
+ - name: github-app
+ path: /github-app
when:
paths:
include:
@@ -2198,6 +2369,7 @@ steps:
- success
- failure
- commands:
+ - GITHUB_TOKEN=$(cat /github-app/token)
- if [ ! -d ./playwright-report/trace ]; then echo 'all tests passed'; exit 0; fi
- export E2E_PLAYWRIGHT_REPORT_URL=https://storage.googleapis.com/releng-pipeline-artifacts-dev/${DRONE_BUILD_NUMBER}/playwright-report/index.html
- 'curl -L -X POST https://api.github.com/repos/grafana/grafana/issues/${DRONE_PULL_REQUEST}/comments
@@ -2209,17 +2381,19 @@ steps:
\"}"'
depends_on:
- playwright-e2e-report-upload
- environment:
- GITHUB_TOKEN:
- from_secret: github_token
+ - github-app-generate-token
failure: ignore
image: byrnedo/alpine-curl:0.1.8
name: playwright-e2e-report-post-link
+ volumes:
+ - name: github-app
+ path: /github-app
when:
status:
- success
- failure
- commands:
+ - export GITHUB_TOKEN=$(cat /github-app/token)
- if [ -z `find ./e2e -type f -name *spec.ts.mp4` ]; then echo 'missing videos';
false; fi
- apt-get update
@@ -2239,15 +2413,17 @@ steps:
- end-to-end-tests-panels-suite
- end-to-end-tests-smoke-tests-suite
- end-to-end-tests-various-suite
+ - github-app-generate-token
environment:
E2E_TEST_ARTIFACTS_BUCKET: releng-pipeline-artifacts-dev
GCP_GRAFANA_UPLOAD_ARTIFACTS_KEY:
from_secret: gcp_upload_artifacts_key
- GITHUB_TOKEN:
- from_secret: github_token
failure: ignore
image: google/cloud-sdk:431.0.0
name: e2e-tests-artifacts-upload
+ volumes:
+ - name: github-app
+ path: /github-app
when:
status:
- success
@@ -2404,6 +2580,8 @@ volumes:
- host:
path: /var/run/docker.sock
name: docker
+- name: github-app
+ temp: {}
---
clone:
retries: 3
@@ -3534,6 +3712,7 @@ platform:
services: []
steps:
- commands:
+ - export GITHUB_TOKEN=$(cat /github-app/token)
- apk add perl
- v_target=`echo $${TAG} | perl -pe 's/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/v\1.\2.x/'`
- curl -L $${GH_CLI_URL} | tar -xz --strip-components=1 -C /usr
@@ -3542,10 +3721,11 @@ steps:
depends_on: []
environment:
GH_CLI_URL: https://github.com/cli/cli/releases/download/v2.50.0/gh_2.50.0_linux_amd64.tar.gz
- GITHUB_TOKEN:
- from_secret: github_token
image: byrnedo/alpine-curl:0.1.8
name: create-release-pr
+ volumes:
+ - name: github-app
+ path: /github-app
trigger:
event:
- promote
@@ -3555,6 +3735,8 @@ volumes:
- host:
path: /var/run/docker.sock
name: docker
+- name: github-app
+ temp: {}
---
clone:
retries: 3
@@ -3604,6 +3786,21 @@ steps:
image: grafana/grafana-ci-deploy:1.3.3
name: publish-storybook
- commands:
+ - echo $(/usr/bin/github-app-external-token) > /github-app/token
+ environment:
+ GITHUB_APP_ID:
+ from_secret: github-app-app-id
+ GITHUB_APP_INSTALLATION_ID:
+ from_secret: github-app-installation-id
+ GITHUB_APP_PRIVATE_KEY:
+ from_secret: github-app-private-key
+ image: us-docker.pkg.dev/grafanalabs-global/docker-deployment-tools-prod/github-app-secret-writer:2024-11-05-v11688112090.1-83920c59
+ name: github-app-generate-token
+ volumes:
+ - name: github-app
+ path: /github-app
+- commands:
+ - export GITHUB_TOKEN=$(cat /github-app/token)
- apk add perl
- v_target=`echo $${TAG} | perl -pe 's/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/v\1.\2.x/'`
- curl -L $${GH_CLI_URL} | tar -xz --strip-components=1 -C /usr
@@ -3611,12 +3808,14 @@ steps:
-f latest=$${LATEST} --repo=grafana/grafana release-pr.yml
depends_on:
- publish-artifacts
+ - github-app-generate-token
environment:
GH_CLI_URL: https://github.com/cli/cli/releases/download/v2.50.0/gh_2.50.0_linux_amd64.tar.gz
- GITHUB_TOKEN:
- from_secret: github_token
image: byrnedo/alpine-curl:0.1.8
name: create-release-pr
+ volumes:
+ - name: github-app
+ path: /github-app
trigger:
event:
- promote
@@ -4118,6 +4317,7 @@ services: []
steps:
- commands:
- export GRAFANA_DIR=$$(pwd)
+ - export GITHUB_TOKEN=$(cat /github-app/token)
- cd /src && ./scripts/drone_build_main.sh
environment:
_EXPERIMENTAL_DAGGER_CLOUD_TOKEN:
@@ -4137,8 +4337,6 @@ steps:
from_secret: grafana_api_key
GCP_KEY_BASE64:
from_secret: gcp_key_base64
- GITHUB_TOKEN:
- from_secret: github_token
GO_VERSION: 1.23.1
GPG_PASSPHRASE:
from_secret: packages_gpg_passphrase
@@ -4157,6 +4355,8 @@ steps:
volumes:
- name: docker
path: /var/run/docker.sock
+ - name: github-app
+ path: /github-app
trigger:
branch: main
event:
@@ -4192,6 +4392,7 @@ services: []
steps:
- commands:
- export GRAFANA_DIR=$$(pwd)
+ - export GITHUB_TOKEN=$(cat /github-app/token)
- cd /src && ./scripts/drone_build_tag_grafana.sh
environment:
_EXPERIMENTAL_DAGGER_CLOUD_TOKEN:
@@ -4211,8 +4412,6 @@ steps:
from_secret: grafana_api_key
GCP_KEY_BASE64:
from_secret: gcp_key_base64
- GITHUB_TOKEN:
- from_secret: github_token
GO_VERSION: 1.23.1
GPG_PASSPHRASE:
from_secret: packages_gpg_passphrase
@@ -4231,6 +4430,8 @@ steps:
volumes:
- name: docker
path: /var/run/docker.sock
+ - name: github-app
+ path: /github-app
trigger:
event:
exclude:
@@ -4353,6 +4554,7 @@ services: []
steps:
- commands:
- export GRAFANA_DIR=$$(pwd)
+ - export GITHUB_TOKEN=$(cat /github-app/token)
- cd /src && ./scripts/drone_build_tag_grafana.sh
environment:
_EXPERIMENTAL_DAGGER_CLOUD_TOKEN:
@@ -4372,8 +4574,6 @@ steps:
from_secret: grafana_api_key
GCP_KEY_BASE64:
from_secret: gcp_key_base64
- GITHUB_TOKEN:
- from_secret: github_token
GO_VERSION: 1.23.1
GPG_PASSPHRASE:
from_secret: packages_gpg_passphrase
@@ -4392,6 +4592,8 @@ steps:
volumes:
- name: docker
path: /var/run/docker.sock
+ - name: github-app
+ path: /github-app
trigger:
ref:
- refs/heads/v[0-9]*
@@ -4589,6 +4791,7 @@ services: []
steps:
- commands:
- export GRAFANA_DIR=$$(pwd)
+ - export GITHUB_TOKEN=$(cat /github-app/token)
- cd /src && ./scripts/drone_build_nightly_grafana.sh
environment:
_EXPERIMENTAL_DAGGER_CLOUD_TOKEN:
@@ -4608,8 +4811,6 @@ steps:
from_secret: grafana_api_key
GCP_KEY_BASE64:
from_secret: gcp_key_base64
- GITHUB_TOKEN:
- from_secret: github_token
GO_VERSION: 1.23.1
GPG_PASSPHRASE:
from_secret: packages_gpg_passphrase
@@ -4628,6 +4829,8 @@ steps:
volumes:
- name: docker
path: /var/run/docker.sock
+ - name: github-app
+ path: /github-app
- commands:
- mkdir -p $${DESTINATION}/$${DRONE_BUILD_EVENT}
- printenv GCP_KEY_BASE64 | base64 -d > /tmp/key.json
@@ -4652,8 +4855,6 @@ steps:
from_secret: grafana_api_key
GCP_KEY_BASE64:
from_secret: gcp_key_base64
- GITHUB_TOKEN:
- from_secret: github_token
GPG_PASSPHRASE:
from_secret: packages_gpg_passphrase
GPG_PRIVATE_KEY:
@@ -4718,8 +4919,6 @@ steps:
from_secret: grafana_api_key
GCP_KEY_BASE64:
from_secret: gcp_key_base64
- GITHUB_TOKEN:
- from_secret: github_token
GPG_PASSPHRASE:
from_secret: packages_gpg_passphrase
GPG_PRIVATE_KEY:
@@ -4734,6 +4933,7 @@ steps:
name: rgm-copy
- commands:
- export GRAFANA_DIR=$$(pwd)
+ - export GITHUB_TOKEN=$(cat /github-app/token)
- cd /src && ./scripts/drone_publish_nightly_grafana.sh
depends_on:
- rgm-copy
@@ -4755,8 +4955,6 @@ steps:
from_secret: grafana_api_key
GCP_KEY_BASE64:
from_secret: gcp_key_base64
- GITHUB_TOKEN:
- from_secret: github_token
GO_VERSION: 1.23.1
GPG_PASSPHRASE:
from_secret: packages_gpg_passphrase
@@ -4775,6 +4973,8 @@ steps:
volumes:
- name: docker
path: /var/run/docker.sock
+ - name: github-app
+ path: /github-app
- depends_on:
- rgm-publish
image: us.gcr.io/kubernetes-dev/package-publish:latest
@@ -4844,9 +5044,26 @@ platform:
services: []
steps:
- commands:
+ - echo $(/usr/bin/github-app-external-token) > /github-app/token
+ environment:
+ GITHUB_APP_ID:
+ from_secret: github-app-app-id
+ GITHUB_APP_INSTALLATION_ID:
+ from_secret: github-app-installation-id
+ GITHUB_APP_PRIVATE_KEY:
+ from_secret: github-app-private-key
+ image: us-docker.pkg.dev/grafanalabs-global/docker-deployment-tools-prod/github-app-secret-writer:2024-11-05-v11688112090.1-83920c59
+ name: github-app-generate-token
+ volumes:
+ - name: github-app
+ path: /github-app
+- commands:
+ - export GITHUB_TOKEN=$(cat /github-app/token)
- 'dagger run --silent /src/grafana-build artifacts -a $${ARTIFACTS} --grafana-ref=$${GRAFANA_REF}
--enterprise-ref=$${ENTERPRISE_REF} --grafana-repo=$${GRAFANA_REPO} --version=$${VERSION} '
- --go-version=1.23.1
+ depends_on:
+ - github-app-generate-token
environment:
_EXPERIMENTAL_DAGGER_CLOUD_TOKEN:
from_secret: dagger_token
@@ -4865,8 +5082,6 @@ steps:
from_secret: grafana_api_key
GCP_KEY_BASE64:
from_secret: gcp_key_base64
- GITHUB_TOKEN:
- from_secret: github_token
GO_VERSION: 1.23.1
GPG_PASSPHRASE:
from_secret: packages_gpg_passphrase
@@ -4885,6 +5100,8 @@ steps:
volumes:
- name: docker
path: /var/run/docker.sock
+ - name: github-app
+ path: /github-app
- commands:
- printenv GCP_KEY_BASE64 | base64 -d > /tmp/key.json
- gcloud auth activate-service-account --key-file=/tmp/key.json
@@ -4906,8 +5123,6 @@ steps:
from_secret: grafana_api_key
GCP_KEY_BASE64:
from_secret: gcp_key_base64
- GITHUB_TOKEN:
- from_secret: github_token
GPG_PASSPHRASE:
from_secret: packages_gpg_passphrase
GPG_PRIVATE_KEY:
@@ -5471,6 +5686,7 @@ steps:
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM koalaman/shellcheck:stable
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM rockylinux:9
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM scottyhardy/docker-wine:stable-9.0
+ - trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM us-docker.pkg.dev/grafanalabs-global/docker-deployment-tools-prod/github-app-secret-writer:2024-11-05-v11688112090.1-83920c59
depends_on:
- authenticate-gcr
image: aquasec/trivy:0.21.0
@@ -5509,6 +5725,7 @@ steps:
- trivy --exit-code 1 --severity HIGH,CRITICAL koalaman/shellcheck:stable
- trivy --exit-code 1 --severity HIGH,CRITICAL rockylinux:9
- trivy --exit-code 1 --severity HIGH,CRITICAL scottyhardy/docker-wine:stable-9.0
+ - trivy --exit-code 1 --severity HIGH,CRITICAL us-docker.pkg.dev/grafanalabs-global/docker-deployment-tools-prod/github-app-secret-writer:2024-11-05-v11688112090.1-83920c59
depends_on:
- authenticate-gcr
environment:
@@ -5541,6 +5758,24 @@ volumes:
- name: config
temp: {}
---
+get:
+ name: app-id
+ path: ci/data/repo/grafana/grafana/github-app
+kind: secret
+name: github-app-app-id
+---
+get:
+ name: app-installation-id
+ path: ci/data/repo/grafana/grafana/github-app
+kind: secret
+name: github-app-installation-id
+---
+get:
+ name: private-key
+ path: ci/data/repo/grafana/grafana/github-app
+kind: secret
+name: github-app-private-key
+---
get:
name: credentials.json
path: infra/data/ci/grafana-release-eng/grafanauploads
@@ -5571,12 +5806,6 @@ get:
kind: secret
name: gar
---
-get:
- name: pat
- path: ci/data/repo/grafana/grafana/grafanabot
-kind: secret
-name: github_token
----
get:
name: machine-user-token
path: infra/data/ci/drone
@@ -5740,6 +5969,6 @@ kind: secret
name: gcr_credentials
---
kind: signature
-hmac: bb28bcd274c9d2ce724db12659ed6e3dcc461f8a07ae0eb9385a64ca5daad4de
+hmac: b164dd562488c482f2e670688fca02ae20dcd2e7841ec80c95838472842b4b5e
...
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 99a3971e3e4..3e2d5aa5f7b 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -40,6 +40,7 @@
/docs/sources/alerting/ @brendamuir
/docs/sources/dashboards/ @imatwawana
+/docs/sources/datasources/ @lwandz13
/docs/sources/panels-visualizations/ @imatwawana
/docs/sources/release-notes/ @irenerl24 @GrafanaWriter
/docs/sources/upgrade-guide/ @imatwawana
@@ -664,6 +665,7 @@ playwright.config.ts @grafana/plugins-platform-frontend
/pkg/services/caching/ @grafana/grafana-operator-experience-squad
/pkg/services/cloudmigration/ @grafana/grafana-operator-experience-squad
/pkg/services/gcom/ @grafana/grafana-operator-experience-squad
+/pkg/services/authapi/ @grafana/grafana-operator-experience-squad
# Feature toggles
/pkg/services/featuremgmt/ @grafana/grafana-backend-services-squad
diff --git a/Dockerfile b/Dockerfile
index 9c71569fc58..563a75e954a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
-ARG BASE_IMAGE=alpine:3.19.1
+ARG BASE_IMAGE=alpine:3.20
ARG JS_IMAGE=node:20-alpine
ARG JS_PLATFORM=linux/amd64
ARG GO_IMAGE=golang:1.23.1-alpine
diff --git a/devenv/dev-dashboards/transforms/config-from-query.json b/devenv/dev-dashboards/transforms/config-from-query.json
index c9dd139a501..cb65f966667 100644
--- a/devenv/dev-dashboards/transforms/config-from-query.json
+++ b/devenv/dev-dashboards/transforms/config-from-query.json
@@ -1,552 +1,810 @@
{
- "annotations": {
- "list": [
- {
- "builtIn": 1,
- "datasource": "-- Grafana --",
- "enable": true,
- "hide": true,
- "iconColor": "rgba(0, 211, 255, 1)",
- "name": "Annotations & Alerts",
- "target": {
- "limit": 100,
- "matchAny": false,
- "tags": [],
- "type": "dashboard"
- },
+ "annotations": {
+ "list": [
+ {
+ "builtIn": 1,
+ "datasource": {
+ "type": "datasource",
+ "uid": "grafana"
+ },
+ "enable": true,
+ "hide": true,
+ "iconColor": "rgba(0, 211, 255, 1)",
+ "name": "Annotations & Alerts",
+ "target": {
+ "limit": 100,
+ "matchAny": false,
+ "tags": [],
"type": "dashboard"
- }
- ]
- },
- "description": "",
- "editable": true,
- "graphTooltip": 0,
- "links": [],
- "panels": [
- {
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 0,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "linear",
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "thresholdsStyle": {
- "mode": "line"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- }
- },
- "overrides": []
},
- "gridPos": {
- "h": 9,
- "w": 12,
- "x": 0,
- "y": 0
- },
- "id": 2,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom"
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "targets": [
- {
- "hide": false,
- "max": 100,
- "min": 1,
- "refId": "A",
- "scenarioId": "random_walk",
- "startValue": 50
- },
- {
- "alias": "",
- "csvContent": "min,max,threshold1\n1000,1000,8000\n0,100,80\n\n",
- "refId": "config",
- "scenarioId": "csv_content"
- }
- ],
- "title": "Min, max, threshold from separate query",
- "transformations": [
- {
- "id": "configFromData",
- "options": {
- "configRefId": "config",
- "mappings": []
- }
- }
- ],
- "type": "timeseries"
- },
- {
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "thresholds"
- },
- "custom": {
- "align": "left",
- "displayMode": "auto"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- }
- },
- "overrides": [
- {
- "matcher": {
- "id": "byName",
- "options": "SensorA"
- },
- "properties": [
- {
- "id": "custom.displayMode",
- "value": "color-text"
- }
- ]
- }
- ]
- },
- "gridPos": {
- "h": 9,
- "w": 12,
- "x": 12,
- "y": 0
- },
- "id": 5,
- "options": {
- "showHeader": true
- },
- "pluginVersion": "8.1.0-pre",
- "targets": [
- {
- "csvContent": "Name, Value, SensorA, MyUnit, MyColor\nGoogle, 10, 50, km/h, blue\nGoogle, 100, 100,km/h, orange\n",
- "hide": false,
- "refId": "A",
- "scenarioId": "csv_content"
- }
- ],
- "title": "Custom mappings and apply to self",
- "transformations": [
- {
- "id": "configFromData",
- "options": {
- "applyTo": {
- "id": "byName",
- "options": "SensorA"
- },
- "applyToConfig": true,
- "configRefId": "A",
- "mappings": [
- {
- "configProperty": "unit",
- "fieldName": "MyUnit",
- "handlerKey": "unit"
- },
- {
- "fieldName": "MyColor",
- "handlerKey": "color"
- }
- ]
- }
- }
- ],
- "type": "table"
- },
- {
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "thresholds"
- },
- "custom": {
- "align": "center",
- "displayMode": "auto"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- }
- },
- "overrides": [
- {
- "matcher": {
- "id": "byName",
- "options": "Value"
- },
- "properties": [
- {
- "id": "custom.displayMode",
- "value": "color-background-solid"
- }
- ]
- }
- ]
- },
- "gridPos": {
- "h": 5,
- "w": 12,
- "x": 0,
- "y": 9
- },
- "id": 7,
- "options": {
- "showHeader": true
- },
- "pluginVersion": "8.1.0-pre",
- "targets": [
- {
- "csvContent": "ID, DisplayText\n21412312312, Homer\n12421412413, Simpsons \n12321312313, Bart",
- "hide": false,
- "refId": "A",
- "scenarioId": "csv_content"
- }
- ],
- "title": "Mapping data",
- "transformations": [
- {
- "id": "configFromData",
- "options": {
- "applyToConfig": true,
- "configRefId": "A",
- "mappings": [
- {
- "fieldName": "Color",
- "handlerKey": "mappings.color"
- },
- {
- "fieldName": "Value",
- "handlerKey": "mappings.value"
- }
- ]
- }
- }
- ],
- "type": "table"
- },
- {
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "thresholds"
- },
- "custom": {
- "align": "center",
- "displayMode": "auto"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- }
- },
- "overrides": [
- {
- "matcher": {
- "id": "byName",
- "options": "Value"
- },
- "properties": [
- {
- "id": "custom.displayMode",
- "value": "color-background-solid"
- }
- ]
- }
- ]
- },
- "gridPos": {
- "h": 10,
- "w": 12,
- "x": 12,
- "y": 9
- },
- "id": 6,
- "options": {
- "showHeader": true
- },
- "pluginVersion": "8.1.0-pre",
- "targets": [
- {
- "csvContent": "Value, Color\nOK, blue\nPretty bad, red\nYay it's green, green\nSomething is off, orange\nNo idea, #88AA00\nAm I purple?, purple",
- "hide": false,
- "refId": "A",
- "scenarioId": "csv_content"
- }
- ],
- "title": "Value mappings from query result applied to itself",
- "transformations": [
- {
- "id": "configFromData",
- "options": {
- "applyTo": {
- "id": "byName",
- "options": "Value"
- },
- "applyToConfig": true,
- "configRefId": "A",
- "mappings": [
- {
- "fieldName": "Color",
- "handlerKey": "mappings.color"
- },
- {
- "fieldName": "Value",
- "handlerKey": "mappings.value"
- }
- ]
- }
- }
- ],
- "type": "table"
- },
- {
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "thresholds"
- },
- "custom": {
- "align": "center",
- "displayMode": "auto"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- }
- },
- "overrides": []
- },
- "gridPos": {
- "h": 5,
- "w": 12,
- "x": 0,
- "y": 14
- },
- "id": 8,
- "options": {
- "showHeader": true
- },
- "pluginVersion": "8.1.0-pre",
- "targets": [
- {
- "csvContent": "ID, Value\n21412312312, 100\n12421412413, 20\n12321312313, 10",
- "hide": false,
- "refId": "A",
- "scenarioId": "csv_content"
- }
- ],
- "title": "Display data",
- "transformations": [
- {
- "id": "configFromData",
- "options": {
- "applyToConfig": true,
- "configRefId": "A",
- "mappings": [
- {
- "fieldName": "Color",
- "handlerKey": "mappings.color"
- },
- {
- "fieldName": "Value",
- "handlerKey": "mappings.value"
- }
- ]
- }
- }
- ],
- "type": "table"
- },
- {
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisLabel": "",
- "axisPlacement": "auto",
- "axisSoftMin": 0,
- "fillOpacity": 80,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineWidth": 1
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- }
- },
- "overrides": []
- },
- "gridPos": {
- "h": 10,
- "w": 12,
- "x": 0,
- "y": 19
- },
- "id": 9,
- "options": {
- "barWidth": 0.97,
- "groupWidth": 0.7,
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom"
- },
- "orientation": "horizontal",
- "showValue": "auto",
- "text": {},
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "8.1.0-pre",
- "targets": [
- {
- "csvContent": "ID, Value\nA21412312312, 100\nA12421412413, 20\nA12321312313, 10\n",
- "hide": false,
- "refId": "data",
- "scenarioId": "csv_content"
- },
- {
- "csvContent": "ID, DisplayText\nA21412312312, Homer\nA12421412413, Marge \nA12321312313, Bart",
- "hide": false,
- "refId": "mappings",
- "scenarioId": "csv_content"
- }
- ],
- "title": "Value mapping ID -> DisplayText from separate query",
- "transformations": [
- {
- "id": "configFromData",
- "options": {
- "applyTo": {
- "id": "byName",
- "options": "ID"
- },
- "applyToConfig": false,
- "configRefId": "mappings",
- "mappings": [
- {
- "fieldName": "ID",
- "handlerKey": "mappings.value"
- },
- {
- "fieldName": "DisplayText",
- "handlerKey": "mappings.text"
- }
- ]
- }
- }
- ],
- "type": "barchart"
+ "type": "dashboard"
}
- ],
- "refresh": "",
- "schemaVersion": 33,
- "tags": [
- "gdev",
- "transform"
- ],
- "templating": {
- "list": []
+ ]
+ },
+ "description": "",
+ "editable": true,
+ "fiscalYearStartMonth": 0,
+ "graphTooltip": 0,
+ "links": [],
+ "panels": [
+ {
+ "datasource": {
+ "type": "grafana-testdata-datasource",
+ "uid": "PD8C576611E62080A"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "barWidthFactor": 0.6,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "line"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 9,
+ "w": 12,
+ "x": 0,
+ "y": 0
+ },
+ "id": 2,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "grafana-testdata-datasource",
+ "uid": "PD8C576611E62080A"
+ },
+ "hide": false,
+ "max": 100,
+ "min": 1,
+ "refId": "A",
+ "scenarioId": "random_walk",
+ "startValue": 50
+ },
+ {
+ "alias": "",
+ "csvContent": "min,max,threshold1\n1000,1000,8000\n0,100,80\n\n",
+ "datasource": {
+ "type": "grafana-testdata-datasource",
+ "uid": "PD8C576611E62080A"
+ },
+ "refId": "config",
+ "scenarioId": "csv_content"
+ }
+ ],
+ "title": "Min, max, threshold from separate query",
+ "transformations": [
+ {
+ "id": "configFromData",
+ "options": {
+ "configRefId": "config",
+ "mappings": []
+ }
+ }
+ ],
+ "type": "timeseries"
},
- "time": {
- "from": "now-6h",
- "to": "now"
+ {
+ "datasource": {
+ "type": "grafana-testdata-datasource",
+ "uid": "PD8C576611E62080A"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "custom": {
+ "align": "left",
+ "cellOptions": {
+ "type": "auto"
+ },
+ "inspect": false
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": [
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "SensorA"
+ },
+ "properties": [
+ {
+ "id": "custom.cellOptions",
+ "value": {
+ "type": "color-text"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "gridPos": {
+ "h": 9,
+ "w": 12,
+ "x": 12,
+ "y": 0
+ },
+ "id": 5,
+ "options": {
+ "cellHeight": "sm",
+ "footer": {
+ "countRows": false,
+ "fields": "",
+ "reducer": [
+ "sum"
+ ],
+ "show": false
+ },
+ "showHeader": true
+ },
+ "pluginVersion": "11.4.0-pre",
+ "targets": [
+ {
+ "csvContent": "Name, Value, SensorA, MyUnit, MyColor\nGoogle, 10, 50, km/h, blue\nGoogle, 100, 100,km/h, orange\n",
+ "datasource": {
+ "type": "grafana-testdata-datasource",
+ "uid": "PD8C576611E62080A"
+ },
+ "hide": false,
+ "refId": "A",
+ "scenarioId": "csv_content"
+ }
+ ],
+ "title": "Custom mappings and apply to self",
+ "transformations": [
+ {
+ "id": "configFromData",
+ "options": {
+ "applyTo": {
+ "id": "byName",
+ "options": "SensorA"
+ },
+ "applyToConfig": true,
+ "configRefId": "A",
+ "mappings": [
+ {
+ "configProperty": "unit",
+ "fieldName": "MyUnit",
+ "handlerKey": "unit"
+ },
+ {
+ "fieldName": "MyColor",
+ "handlerKey": "color"
+ }
+ ]
+ }
+ }
+ ],
+ "type": "table"
},
- "timepicker": {},
- "timezone": "",
- "title": "Transforms - Config from query",
- "uid": "Juj4_7ink",
- "version": 1
- }
+ {
+ "datasource": {
+ "type": "grafana-testdata-datasource",
+ "uid": "PD8C576611E62080A"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "custom": {
+ "align": "center",
+ "cellOptions": {
+ "type": "auto"
+ },
+ "inspect": false
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": [
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "Value"
+ },
+ "properties": [
+ {
+ "id": "custom.cellOptions",
+ "value": {
+ "mode": "basic",
+ "type": "color-background"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "gridPos": {
+ "h": 5,
+ "w": 12,
+ "x": 0,
+ "y": 9
+ },
+ "id": 7,
+ "options": {
+ "cellHeight": "sm",
+ "footer": {
+ "countRows": false,
+ "fields": "",
+ "reducer": [
+ "sum"
+ ],
+ "show": false
+ },
+ "showHeader": true
+ },
+ "pluginVersion": "11.4.0-pre",
+ "targets": [
+ {
+ "csvContent": "ID, DisplayText\n21412312312, Homer\n12421412413, Simpsons \n12321312313, Bart",
+ "datasource": {
+ "type": "grafana-testdata-datasource",
+ "uid": "PD8C576611E62080A"
+ },
+ "hide": false,
+ "refId": "A",
+ "scenarioId": "csv_content"
+ }
+ ],
+ "title": "Mapping data",
+ "transformations": [
+ {
+ "id": "configFromData",
+ "options": {
+ "applyToConfig": true,
+ "configRefId": "A",
+ "mappings": [
+ {
+ "fieldName": "Color",
+ "handlerKey": "mappings.color"
+ },
+ {
+ "fieldName": "Value",
+ "handlerKey": "mappings.value"
+ }
+ ]
+ }
+ }
+ ],
+ "type": "table"
+ },
+ {
+ "datasource": {
+ "type": "grafana-testdata-datasource",
+ "uid": "PD8C576611E62080A"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "custom": {
+ "align": "center",
+ "cellOptions": {
+ "type": "auto"
+ },
+ "inspect": false
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": [
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "Value"
+ },
+ "properties": [
+ {
+ "id": "custom.cellOptions",
+ "value": {
+ "mode": "basic",
+ "type": "color-background"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "gridPos": {
+ "h": 10,
+ "w": 12,
+ "x": 12,
+ "y": 9
+ },
+ "id": 6,
+ "options": {
+ "cellHeight": "sm",
+ "footer": {
+ "countRows": false,
+ "fields": "",
+ "reducer": [
+ "sum"
+ ],
+ "show": false
+ },
+ "showHeader": true
+ },
+ "pluginVersion": "11.4.0-pre",
+ "targets": [
+ {
+ "csvContent": "Value, Color\nOK, blue\nPretty bad, red\nYay it's green, green\nSomething is off, orange\nNo idea, #88AA00\nAm I purple?, purple",
+ "datasource": {
+ "type": "grafana-testdata-datasource",
+ "uid": "PD8C576611E62080A"
+ },
+ "hide": false,
+ "refId": "A",
+ "scenarioId": "csv_content"
+ }
+ ],
+ "title": "Value mappings from query result applied to itself",
+ "transformations": [
+ {
+ "id": "configFromData",
+ "options": {
+ "applyTo": {
+ "id": "byName",
+ "options": "Value"
+ },
+ "applyToConfig": true,
+ "configRefId": "A",
+ "mappings": [
+ {
+ "fieldName": "Color",
+ "handlerKey": "mappings.color"
+ },
+ {
+ "fieldName": "Value",
+ "handlerKey": "mappings.value"
+ }
+ ]
+ }
+ }
+ ],
+ "type": "table"
+ },
+ {
+ "datasource": {
+ "type": "grafana-testdata-datasource",
+ "uid": "PD8C576611E62080A"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "custom": {
+ "align": "center",
+ "cellOptions": {
+ "type": "auto"
+ },
+ "inspect": false
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 5,
+ "w": 12,
+ "x": 0,
+ "y": 14
+ },
+ "id": 8,
+ "options": {
+ "cellHeight": "sm",
+ "footer": {
+ "countRows": false,
+ "fields": "",
+ "reducer": [
+ "sum"
+ ],
+ "show": false
+ },
+ "showHeader": true
+ },
+ "pluginVersion": "11.4.0-pre",
+ "targets": [
+ {
+ "csvContent": "ID, Value\n21412312312, 100\n12421412413, 20\n12321312313, 10",
+ "datasource": {
+ "type": "grafana-testdata-datasource",
+ "uid": "PD8C576611E62080A"
+ },
+ "hide": false,
+ "refId": "A",
+ "scenarioId": "csv_content"
+ }
+ ],
+ "title": "Display data",
+ "transformations": [
+ {
+ "id": "configFromData",
+ "options": {
+ "applyToConfig": true,
+ "configRefId": "A",
+ "mappings": [
+ {
+ "fieldName": "Color",
+ "handlerKey": "mappings.color"
+ },
+ {
+ "fieldName": "Value",
+ "handlerKey": "mappings.value"
+ }
+ ]
+ }
+ }
+ ],
+ "type": "table"
+ },
+ {
+ "datasource": {
+ "type": "grafana-testdata-datasource",
+ "uid": "PD8C576611E62080A"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "axisSoftMin": 0,
+ "fillOpacity": 80,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineWidth": 1,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 10,
+ "w": 12,
+ "x": 0,
+ "y": 19
+ },
+ "id": 9,
+ "options": {
+ "barRadius": 0,
+ "barWidth": 0.97,
+ "fullHighlight": false,
+ "groupWidth": 0.7,
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "orientation": "horizontal",
+ "showValue": "auto",
+ "stacking": "none",
+ "text": {},
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ },
+ "xTickLabelRotation": 0,
+ "xTickLabelSpacing": 0
+ },
+ "pluginVersion": "8.1.0-pre",
+ "targets": [
+ {
+ "csvContent": "ID, Value\nA21412312312, 100\nA12421412413, 20\nA12321312313, 10\n",
+ "datasource": {
+ "type": "grafana-testdata-datasource",
+ "uid": "PD8C576611E62080A"
+ },
+ "hide": false,
+ "refId": "data",
+ "scenarioId": "csv_content"
+ },
+ {
+ "csvContent": "ID, DisplayText\nA21412312312, Homer\nA12421412413, Marge \nA12321312313, Bart",
+ "datasource": {
+ "type": "grafana-testdata-datasource",
+ "uid": "PD8C576611E62080A"
+ },
+ "hide": false,
+ "refId": "mappings",
+ "scenarioId": "csv_content"
+ }
+ ],
+ "title": "Value mapping ID -> DisplayText from separate query",
+ "transformations": [
+ {
+ "id": "configFromData",
+ "options": {
+ "applyTo": {
+ "id": "byName",
+ "options": "ID"
+ },
+ "applyToConfig": false,
+ "configRefId": "mappings",
+ "mappings": [
+ {
+ "fieldName": "ID",
+ "handlerKey": "mappings.value"
+ },
+ {
+ "fieldName": "DisplayText",
+ "handlerKey": "mappings.text"
+ }
+ ]
+ }
+ }
+ ],
+ "type": "barchart"
+ },
+ {
+ "datasource": {
+ "default": true,
+ "type": "grafana-testdata-datasource",
+ "uid": "PD8C576611E62080A"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "barWidthFactor": 0.6,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "dashed+area"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "blue",
+ "value": null
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 10,
+ "w": 12,
+ "x": 12,
+ "y": 19
+ },
+ "id": 10,
+ "maxDataPoints": 100,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "grafana-testdata-datasource",
+ "uid": "PD8C576611E62080A"
+ },
+ "rawFrameContent": "[\n {\n \"schema\": {\n \"refId\": \"A\",\n \"meta\": {\n \"typeVersion\": [\n 0,\n 0\n ],\n \"custom\": {\n \"customStat\": 10\n }\n },\n \"fields\": [\n {\n \"name\": \"time\",\n \"type\": \"time\",\n \"typeInfo\": {\n \"frame\": \"time.Time\",\n \"nullable\": true\n },\n \"config\": {\n \"interval\": 300000\n }\n },\n {\n \"name\": \"A-series\",\n \"type\": \"number\",\n \"typeInfo\": {\n \"frame\": \"float64\",\n \"nullable\": true\n },\n \"labels\": {},\n \"config\": {}\n }\n ]\n },\n \"data\": {\n \"values\": [\n [\n 1732120345536,\n 1732120645536,\n 1732120945536,\n 1732121245536,\n 1732121545536,\n 1732121845536,\n 1732122145536,\n 1732122445536,\n 1732122745536,\n 1732123045536,\n 1732123345536,\n 1732123645536,\n 1732123945536,\n 1732124245536,\n 1732124545536,\n 1732124845536,\n 1732125145536,\n 1732125445536,\n 1732125745536,\n 1732126045536,\n 1732126345536,\n 1732126645536,\n 1732126945536,\n 1732127245536,\n 1732127545536,\n 1732127845536,\n 1732128145536,\n 1732128445536,\n 1732128745536,\n 1732129045536,\n 1732129345536,\n 1732129645536,\n 1732129945536,\n 1732130245536,\n 1732130545536,\n 1732130845536,\n 1732131145536,\n 1732131445536,\n 1732131745536,\n 1732132045536,\n 1732132345536,\n 1732132645536,\n 1732132945536,\n 1732133245536,\n 1732133545536,\n 1732133845536,\n 1732134145536,\n 1732134445536,\n 1732134745536,\n 1732135045536,\n 1732135345536,\n 1732135645536,\n 1732135945536,\n 1732136245536,\n 1732136545536,\n 1732136845536,\n 1732137145536,\n 1732137445536,\n 1732137745536,\n 1732138045536,\n 1732138345536,\n 1732138645536,\n 1732138945536,\n 1732139245536,\n 1732139545536,\n 1732139845536,\n 1732140145536,\n 1732140445536,\n 1732140745536,\n 1732141045536,\n 1732141345536,\n 1732141645536\n ],\n [\n 36.67835770082578,\n 35.674537924065,\n 8.339763723800829,\n 16.313291374141446,\n 66.05915891584247,\n 55.975417240601566,\n 33.75563648171818,\n 10.561077849025175,\n 20.31936089572975,\n 26.11219409670694,\n 57.542750561307564,\n 67.10954340535248,\n 82.95323961635275,\n 100.9691805551439,\n 59.829706792214644,\n 94.58723331927925,\n 89.3082374466047,\n 58.69065135820439,\n 97.144192150251,\n 139.99199318295675,\n 157.9473973408396,\n 177.94452058033198,\n 188.84065573954362,\n 154.3930906887033,\n 130.14406878049226,\n 116.65818233680316,\n 100.96041794526472,\n 144.65142921584447,\n 175.75178611497054,\n 203.55271609883386,\n 238.4931714915047,\n 253.38754249911452,\n 271.1735238723396,\n 258.54418620287515,\n 260.8463123020904,\n 216.10614084307323,\n 253.30389406688175,\n 249.37108721413884,\n 243.7226799137106,\n 216.74579233434042,\n 262.50043010512826,\n 238.71564300219498,\n 218.3552317737898,\n 195.6154411937393,\n 154.1987522722987,\n 124.00066408416897,\n 146.6474694384778,\n 101.68405646311294,\n 104.5791139459948,\n 85.39428966503652,\n 78.45166775446714,\n 56.285707917841535,\n 36.22861441808941,\n 35.098428846082555,\n 68.67835646605371,\n 101.67142528391042,\n 151.04038339587296,\n 114.77414457402928,\n 72.65341528313934,\n 113.42643748928826,\n 151.09282092262364,\n 163.24422498859587,\n 183.86606816236363,\n 230.24678524811478,\n 205.94887669562561,\n 211.24387656976373,\n 217.26738326873522,\n 214.66898480692646,\n 206.95531499977153,\n 194.19724584765092,\n 146.16071387746757,\n 188.30193538777615\n ]\n ]\n }\n }\n]",
+ "refId": "A",
+ "scenarioId": "raw_frame"
+ }
+ ],
+ "title": "Config from query / threshold does not overwrite Base threshold",
+ "transformations": [
+ {
+ "id": "configFromData",
+ "options": {
+ "configRefId": "A",
+ "mappings": [
+ {
+ "fieldName": "A-series",
+ "handlerArguments": {
+ "threshold": {
+ "color": "yellow"
+ }
+ },
+ "handlerKey": "threshold1"
+ }
+ ]
+ }
+ }
+ ],
+ "type": "timeseries"
+ }
+ ],
+ "refresh": "",
+ "schemaVersion": 40,
+ "tags": [
+ "gdev",
+ "transform"
+ ],
+ "templating": {
+ "list": []
+ },
+ "time": {
+ "from": "2024-11-20T16:31:51.747Z",
+ "to": "2024-11-20T22:28:15.688Z"
+ },
+ "timepicker": {},
+ "timezone": "",
+ "title": "Transforms - Config from query",
+ "uid": "Juj4_7ink",
+ "version": 1,
+ "weekStart": ""
+}
diff --git a/docs/sources/alerting/alerting-rules/create-grafana-managed-rule.md b/docs/sources/alerting/alerting-rules/create-grafana-managed-rule.md
index 4637db17de0..7c3a5986f61 100644
--- a/docs/sources/alerting/alerting-rules/create-grafana-managed-rule.md
+++ b/docs/sources/alerting/alerting-rules/create-grafana-managed-rule.md
@@ -72,9 +72,13 @@ refs:
data-sources:
- pattern: /docs/grafana/
destination: /docs/grafana//datasources/
+ - pattern: /docs/grafana-cloud/
+ - destination: /docs/grafana-cloud/connect-externally-hosted/data-sources/
compatible-data-sources:
- pattern: /docs/grafana/
- destination: /docs/grafana/GRAFANA_VERSION>/alerting/fundamentals/alert-rules/#supported-data-sources
+ destination: /docs/grafana//alerting/fundamentals/alert-rules/#supported-data-sources
+ - pattern: /docs/grafana-cloud/
+ destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/#supported-data-sources
---
# Configure Grafana-managed alert rules
@@ -100,7 +104,7 @@ To make a backup of your configuration and to be able to restore deleted alertin
If you are using Grafana OSS:
1. Configure your [data sources](ref:data-sources).
-1. Check which [data sources](ref:compatible-data-sources) are compatible with and supported by Grafana Alerting.
+2. Check which [data sources](ref:compatible-data-sources) are compatible with and supported by Grafana Alerting.
If you are using Grafana OSS, Enterprise, or Cloud:
diff --git a/docs/sources/dashboards/create-reports/index.md b/docs/sources/dashboards/create-reports/index.md
index 71efdd8d33f..d3a15f00404 100644
--- a/docs/sources/dashboards/create-reports/index.md
+++ b/docs/sources/dashboards/create-reports/index.md
@@ -155,7 +155,7 @@ You can save a report as a draft at any point during the report creation or upda
### Choose template variables
-> **Note:** Available in [Grafana Enterprise](ref:grafana-enterprise) version 7.5 and later behind the `reportVariables` feature flag, Grafana Enterprise version 8.0 and later without a feature flag, and [Grafana Cloud](/docs/grafana-cloud/).
+> **Note:** Available in [Grafana Enterprise](ref:grafana-enterprise) and [Grafana Cloud](/docs/grafana-cloud/).
You can configure report-specific template variables for the dashboard on the report page. The variables that you select will override the variables from the dashboard, and they are used when rendering a PDF file of the report. For detailed information about using template variables, refer to the [Templates and variables](ref:templates-and-variables) section.
@@ -234,7 +234,6 @@ This feature relies on the same plugin that supports the [image rendering](ref:i
### Scheduling
> **Note:** Available in [Grafana Enterprise](ref:grafana-enterprise) and [Grafana Cloud](/docs/grafana-cloud/).
-> The scheduler was significantly changed in Grafana Enterprise version 8.1.
Scheduled reports can be sent once, or repeated on an hourly, daily, weekly, or monthly basis, or sent at custom intervals. You can also disable scheduling by selecting **Never**, for example to send the report via the API.
diff --git a/docs/sources/datasources/influxdb/_index.md b/docs/sources/datasources/influxdb/_index.md
index 586cb89a682..c3f722d848f 100644
--- a/docs/sources/datasources/influxdb/_index.md
+++ b/docs/sources/datasources/influxdb/_index.md
@@ -4,7 +4,7 @@ aliases:
- ../data-sources/influxdb/provision-influxdb/
- ../features/datasources/influxdb/
- provision-influxdb/
-description: Guide for using InfluxDB in Grafana
+description: InfluxDB data source for Grafana
keywords:
- grafana
- influxdb
@@ -19,242 +19,42 @@ menuTitle: InfluxDB
title: InfluxDB data source
weight: 700
refs:
- explore:
+ annotations:
- pattern: /docs/grafana/
- destination: /docs/grafana//explore/
+ destination: /docs/grafana//dashboards/build-dashboards/annotate-visualizations/
- pattern: /docs/grafana-cloud/
- destination: /docs/grafana//explore/
- build-dashboards:
+ destination: /docs/grafana-cloud/visualizations/dashboards/build-dashboards/annotate-visualizations/
+ alerting:
- pattern: /docs/grafana/
- destination: /docs/grafana//dashboards/build-dashboards/
+ destination: /docs/grafana//alerting/
- pattern: /docs/grafana-cloud/
- destination: /docs/grafana//dashboards/build-dashboards/
- data-source-management:
+ destination: /docs/grafana-cloud/alerting-and-irm/alerting/
+ transformations:
- pattern: /docs/grafana/
- destination: /docs/grafana//administration/data-source-management/
+ destination: /docs/grafana//panels-visualizations/query-transform-data/transform-data/
+ - pattern: /docs/grafana-cloud/
+ destination: /docs/grafana-cloud/visualizations/panels-visualizations/query-transform-data/transform-data/
---
# InfluxDB data source
{{< docs/shared lookup="influxdb/intro.md" source="grafana" version="" >}}
-Grafana includes built-in support for InfluxDB.
-This topic explains options, variables, querying, and other features specific to the InfluxDB data source, which include
-its [feature-rich code editor for queries and visual query builder]({{< relref "./query-editor" >}}).
+Grafana includes built-in support for InfluxDB. You do not have to install a plugin to add the InfluxDB data source.
-For instructions on how to add a data source to Grafana, refer to
-the [administration documentation](ref:data-source-management).
-Only users with the organization administrator role can add data sources.
-Administrators can also [configure the data source via YAML](#provision-the-data-source) with Grafana's provisioning
-system.
+Grafana offers multiple configuration options for the InfluxDB data source, including a choice of three query languages and a robust query editor that includes both a code editor and a visual query builder.
-Once you've added the InfluxDB data source, you can [configure it](#configure-the-data-source) so that your Grafana
-instance's users can create queries in its [query editor]({{< relref "./query-editor" >}}) when
-they [build dashboards](ref:build-dashboards) and use [Explore](ref:explore).
+## Get started with the InfluxDB data source
-## Configure the data source
+The following documents will help you get started with the InfluxDB data source in Grafana:
-To configure basic settings for the data source, complete the following steps:
+- [Get started with Grafana and InfluxDB](/docs/grafana//getting-started/get-started-grafana-influxdb/)
+- [Configure the InfluxDB data source](./configure-influxdb-data-source/)
+- [InfluxDB query editor](./query-editor/)
+- [InfluxDB templates and variables](./template-variables/)
-1. Click **Connections** in the left-side menu.
-1. Under Your connections, click **Data sources**.
-1. Enter `InfluxDB` in the search bar.
-1. Select **InfluxDB**.
+Once you have configured the data source you can:
- The **Settings** tab of the data source is displayed.
-
-1. Set the data source's basic configuration options carefully:
-
-| Name | Description |
-| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| **Name** | Sets the name you use to refer to the data source in panels and queries. We recommend something like `InfluxDB-InfluxQL`. |
-| **Default** | Sets whether the data source is pre-selected for new panels. |
-| **URL** | The HTTP protocol, IP address, and port of your InfluxDB API. InfluxDB's default API port is 8086. |
-| **Min time interval** | _(Optional)_ Refer to [Min time interval](#configure-min-time-interval). |
-| **Max series** | _(Optional)_ Limits the number of series and tables that Grafana processes. Lower this number to prevent abuse, and increase it if you have many small time series and not all are shown. Defaults to 1,000. |
-
-You can also configure settings specific to the InfluxDB data source. These options are described in the sections below.
-
-### Min time interval
-
-The **Min time interval** setting defines a lower limit for the auto group-by time interval.
-
-This value _must_ be formatted as a number followed by a valid time identifier:
-
-| Identifier | Description |
-| ---------- | ----------- |
-| `y` | year |
-| `M` | month |
-| `w` | week |
-| `d` | day |
-| `h` | hour |
-| `m` | minute |
-| `s` | second |
-| `ms` | millisecond |
-
-We recommend setting this value to match your InfluxDB write frequency.
-For example, use `1m` if InfluxDB writes data every minute.
-
-You can also override this setting in a dashboard panel under its data source options.
-
-### Select a query language
-
-InfluxDB data source options differ depending on which query language you select:
-
-- [InfluxQL](https://docs.influxdata.com/influxdb/v1.8/query_language/explore-data/), a SQL-like language for querying
- InfluxDB, with statements such as SELECT, FROM, WHERE, and GROUP BY that are familiar to SQL users.
- InfluxQL is available in InfluxDB 1.0 onwards.
-- [SQL](https://www.influxdata.com/products/sql/) native SQL language with
- support [FlightSQL](https://www.influxdata.com/glossary/apache-arrow-flight-sql/).
-- [Flux](https://docs.influxdata.com/influxdb/v2.0/query-data/get-started/), which provides significantly broader
- functionality than InfluxQL. It supports not only queries but also built-in functions for data shaping, string
- manipulation, and joining to non-InfluxDB data sources, but also processing time-series data.
- It's similar to JavaScript with a functional style.
-
-To help choose the best language for your needs, refer to
-a [comparison of Flux vs InfluxQL](https://docs.influxdata.com/influxdb/v1.8/flux/flux-vs-influxql/)
-and [why InfluxData created Flux](https://www.influxdata.com/blog/why-were-building-flux-a-new-data-scripting-and-query-language/).
-
-{{% admonition type="note" %}}
-Though not required, we recommend that you append your query language choice to the data source's **Name** setting:
-
-- InfluxDB-InfluxQL
-- InfluxDB-SQL
-- InfluxDB-Flux
-
-{{% /admonition %}}
-
-### Configure InfluxQL
-
-Configure these options if you select the InfluxQL (classic InfluxDB) query language:
-
-| Name | Description |
-| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| **Allowed cookies** | Defines which cookies are forwarded to the data source. All other cookies are deleted. |
-| **Database** | Sets the ID of the bucket to query. Copy this from the [Buckets page](https://docs.influxdata.com/influxdb/v2.0/organizations/buckets/view-buckets/) of the InfluxDB UI. |
-| **User** | Sets the username to sign into InfluxDB. |
-| **Password** | Defines the token you use to query the bucket defined in **Database**. Copy this from the [Tokens page](https://docs.influxdata.com/influxdb/v2.0/security/tokens/view-tokens/) of the InfluxDB UI. |
-| **HTTP mode** | Sets the HTTP method used to query your data source. The POST verb allows for larger queries that would return an error using the GET verb. Defaults to GET. |
-
-### Configure SQL
-
-Configure these options if you select the SQL query language:
-
-| Name | Description |
-| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| **Database** | Sets the ID of the bucket to query. Copy this from the Buckets page of the InfluxDB UI. |
-| **Token** | API token used for SQL queries. It can be generated on InfluxDB Cloud dashboard under [Load Data > API Tokens](https://docs.influxdata.com/influxdb/cloud-serverless/get-started/setup/#create-an-all-access-api-token) menu. |
-| **Insecure Connection** | Disable gRPC TLS security. |
-
-### Configure Flux
-
-Configure these options if you select the Flux query language:
-
-| Name | Description |
-| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| **Organization** | The [Influx organization](https://v2.docs.influxdata.com/v2.0/organizations/) that will be used for Flux queries. This is also used to for the `v.organization` query macro. |
-| **Token** | The authentication token used for Flux queries. With Influx 2.0, use the [influx authentication token to function](https://v2.docs.influxdata.com/v2.0/security/tokens/create-token/). Token must be set as `Authorization` header with the value `Token `. For influx 1.8, the token is `username:password`. |
-| **Default bucket** | _(Optional)_ The [Influx bucket](https://v2.docs.influxdata.com/v2.0/organizations/buckets/) that will be used for the `v.defaultBucket` macro in Flux queries. |
-
-### Provision the data source
-
-You can define and configure the data source in YAML files as part of Grafana's provisioning system.
-For more information about provisioning, and for available configuration options, refer
-to [Provisioning Grafana][provisioning-data-sources].
-
-{{% admonition type="note" %}}
-`database` [field is deprecated](https://github.com/grafana/grafana/pull/58647).
-We suggest to use `dbName` field in `jsonData`. Please see the examples below.
-No need to change existing provisioning settings.
-{{% /admonition %}}
-
-#### Provisioning examples
-
-**InfluxDB 1.x example:**
-
-```yaml
-apiVersion: 1
-
-datasources:
- - name: InfluxDB_v1
- type: influxdb
- access: proxy
- user: grafana
- url: http://localhost:8086
- jsonData:
- dbName: site
- httpMode: GET
- secureJsonData:
- password: grafana
-```
-
-**InfluxDB 2.x for Flux example:**
-
-```yaml
-apiVersion: 1
-
-datasources:
- - name: InfluxDB_v2_Flux
- type: influxdb
- access: proxy
- url: http://localhost:8086
- jsonData:
- version: Flux
- organization: organization
- defaultBucket: bucket
- tlsSkipVerify: true
- secureJsonData:
- token: token
-```
-
-**InfluxDB 2.x for InfluxQL example:**
-
-```yaml
-apiVersion: 1
-
-datasources:
- - name: InfluxDB_v2_InfluxQL
- type: influxdb
- access: proxy
- url: http://localhost:8086
- jsonData:
- dbName: site
- httpHeaderName1: 'Authorization'
- secureJsonData:
- httpHeaderValue1: 'Token '
-```
-
-**InfluxDB 3.x for SQL example:**
-
-```yaml
-apiVersion: 1
-
-datasources:
- - name: InfluxDB_v3_InfluxQL
- type: influxdb
- access: proxy
- url: http://localhost:8086
- jsonData:
- version: SQL
- dbName: site
- httpMode: POST
- insecureGrpc: false
- secureJsonData:
- token: ''
-```
-
-## Query the data source
-
-The InfluxDB data source's query editor has two modes, InfluxQL and Flux, depending on your choice of query language in
-the [data source configuration](#configure-the-data-source):
-
-For details, refer to the [query editor documentation]({{< relref "./query-editor" >}}).
-
-## Use template variables
-
-Instead of hard-coding details such as server, application, and sensor names in metric queries, you can use variables.
-Grafana lists these variables in dropdown select boxes at the top of the dashboard to help you change the data displayed
-in your dashboard.
-Grafana refers to such variables as template variables.
-
-For details, see the [template variables documentation]({{< relref "./template-variables" >}}).
+- Add [annotations](ref:annotations)
+- Set up [alerting](ref:alerting)
+- Add [transformations](ref:transformations)
diff --git a/docs/sources/datasources/influxdb/configure-influxdb-data-source/_index.md b/docs/sources/datasources/influxdb/configure-influxdb-data-source/_index.md
new file mode 100644
index 00000000000..f81c0069ce8
--- /dev/null
+++ b/docs/sources/datasources/influxdb/configure-influxdb-data-source/_index.md
@@ -0,0 +1,259 @@
+---
+aliases:
+ - ../data-sources/influxdb/
+ - ../data-sources/influxdb/provision-influxdb/
+ - ../features/datasources/influxdb/
+ - provision-influxdb/
+description: Guide for using InfluxDB in Grafana
+keywords:
+ - grafana
+ - influxdb
+ - guide
+ - flux
+labels:
+ products:
+ - cloud
+ - enterprise
+ - oss
+menuTitle: Configure the InfluxDB data source
+title: Configure the InfluxDB data source
+weight: 300
+refs:
+ provision-grafana:
+ - pattern: /docs/grafana/
+ destination: /docs/grafana//administration/provisioning/#provision-grafana
+ - pattern: /docs/grafana-cloud/
+ destination: /docs/grafana//administration/provisioning/#provision-grafana
+---
+
+# Configure the InfluxDB data source
+
+This document provides instructions for configuring the InfluxDB data source and explains the available configuration options.
+
+## Before you begin
+
+To configure the InfluxDB data source you must have the `Administrator` role.
+
+{{< admonition type="note" >}}
+Select the query language you want to use with InfluxDB before adding the InfluxDB data source. Configuration options differ based on query language type.
+{{< /admonition >}}
+
+InfluxData provides three query languages. Some key points to consider:
+
+- SQL is only available for InfluxDB v3.x.
+- Flux is a functional data scripting language for InfluxDB 2.x. Refer to [Query InfluxDB with Flux](https://docs.influxdata.com/influxdb/cloud/query-data/get-started/query-influxdb/) for a basic guide on working with Flux.
+- InfluxQL is SQL-like query language developed by InfluxData. It doesn't support more advanced functions such as JOINs.
+
+To help choose the best language for your needs, refer to
+a [comparison of Flux vs InfluxQL](https://docs.influxdata.com/influxdb/v1.8/flux/flux-vs-influxql/)
+and [Why InfluxData created Flux](https://www.influxdata.com/blog/why-were-building-flux-a-new-data-scripting-and-query-language/).
+
+## Add the InfluxDB data source
+
+Complete the following steps to set up a new InfluxDB data source:
+
+1. Click **Connections** in the left-side menu.
+2. Click **Add new connection**.
+3. Type `InfluxDB` in the search bar.
+4. Select the **InfluxDB** data source.
+5. Click **Add new data source** in the upper right.
+
+You are taken to the **Settings** tab where you will configure the data source.
+
+## InfluxDB common configuration options
+
+The following configuration options apply to **all three query language options**.
+
+- **Name** - Sets the name you use to refer to the data source in panels and queries. Examples: `InfluxDB-InfluxQL`, `InfluxDB_SQL`.
+- **Default** - Toggle to set as the default data source.
+- **Query language** - Select the query language for your InfluxDB instance. The three options are:
+ - **InfluxQL** - SQL-like language for querying InfluxDB, with statements such as SELECT, FROM, WHERE, and GROUP BY that are familiar to SQL users.
+ - **SQL** - Native SQL language starting with InfluxDB v.3.0. Refer to InfluxData's [SQL reference documentation](https://docs.influxdata.com/influxdb/cloud-serverless/reference/sql/) for a list of supported statements, operators, and functions.
+ - **Flux** - Flux is a data scripting language developed by InfluxData that allows you to query, analyze, and act on data. Refer to [Get started with Flux](https://docs.influxdata.com/influxdb/cloud/query-data/get-started/) for guidance on using Flux.
+
+**HTTP section:**
+
+- **URL** - The HTTP protocol, IP address, and port of your InfluxDB API. InfluxDB’s default API port is `8086`.
+- **Allowed cookies** - Defines which cookies are forwarded to the data source. All other cookies are deleted by default.
+- **Timeout** - Set an HTTP request timeout in seconds.
+
+**Auth section:**
+
+- **Basic auth** - The most common authentication method. Use your InfluxData user name and password to authenticate. Toggling requires you to add the user and password under **Basic auth details**.
+- **With credentials** - Toggle to enable credentials such as cookies or auth headers to be sent with cross-site requests.
+- **TLS client auth** - Toggle to use client authentication. When enabled, add the `Server name`, `Client cert` and `Client key` under the **TLS/SSL auth details** section. The client provides a certificate that the server validates to establish the client’s trusted identity. The client key encrypts the data between client and server.
+- **With CA cert** - Authenticate with a CA certificate. Follow the instructions of your CA (Certificate Authority) to download the certificate file.
+- **Skip TLS verify** - Toggle to bypass TLS certificate validation.
+- **Forward OAuth identity** - Forward the OAuth access token (and also the OIDC ID token if available) of the user querying the data source.
+
+**Basic auth details:**
+
+If you enable **Basic auth** under the Auth section you need to configure the following:
+
+- **User** - Add the username used to sign in to InfluxDB.
+- **Password** - Defines the token you use to query the bucket defined in **Database**. Retrieve this from the [Tokens page](https://docs.influxdata.com/influxdb/v2.0/security/tokens/view-tokens/) in the InfluxDB UI.
+
+**TLS/SSL auth details:**
+
+TLS/SSL certificates are encrypted and stored in the Grafana database.
+
+- **CA cert** - If you toggle **With CA cert** add your self-signed cert here.
+- **Server name** - Name of the server. Example: server1.domain.com
+- **Client cert** - Add the client certificate.
+- **Client key** - Add the client key.
+
+**Custom HTTP headers:**
+
+- **Header** - Add a custom HTTP header. Select an option from the drop-down. Allows custom headers to be passed based on the needs of your InfluxDB instance.
+- **Value** - The value for the header.
+
+**Private data source connect:**
+
+- **Private data source connect** - _Only for Grafana Cloud users._ Private data source connect, or PDC, allows you to establish a private, secured connection between a Grafana Cloud instance, or stack, and data sources secured within a private network. Click the drop-down to locate the URL for PDC. For more information regarding Grafana PDC refer to [Private data source connect (PDC)](https://grafana.com/docs/grafana-cloud/connect-externally-hosted/private-data-source-connect/).
+
+Click **Manage private data source connect** to be taken to your PDC connection page, where you'll find your PDC configuration details.
+
+Once you have added your connection settings, click **Save & test** to test the data source connection.
+
+### InfluxQL-specific configuration section
+
+The following settings are specific to the InfluxQL query language option.
+
+**InfluxQL InfluxDB details section:**
+
+- **Database** - Sets the ID of the bucket to query. Refer to [View buckets](https://docs.influxdata.com/influxdb/v2.0/organizations/buckets/view-buckets/) in InfluxData's documentation on how to locate the list of available buckets and their corresponding IDs.
+- **User** - The user name used to sign in to InfluxDB.
+- **Password** - Defines the token used to query the bucket defined in **Database**. Retrieve the password from the [Tokens page](https://docs.influxdata.com/influxdb/v2.0/security/tokens/view-tokens/) of the InfluxDB UI.
+- **HTTP method** - Sets the HTTP method used to query your data source. The POST method allows for larger queries that would return an error using the GET method. The default method is `POST`.
+- **Min time interval** - _(Optional)_ Sets the minimum time interval for auto group-by. Grafana recommends setting this to match the data write frequency. For example, if your data is written every minute, it’s recommended to set this interval to 1 minute, so that each group contains data from each new write. The default is `10s`. Refer to [Min time interval](#min-time-interval) for format examples.
+- **Max series** - _(Optional)_ Sets a limit on the maximum number of series or tables that Grafana processes. Set a lower limit to prevent system overload, or increase it if you have many small time series and need to display more of them. The default is `1000`.
+
+### SQL-specific configuration section
+
+The following settings are specific to the SQL query language option.
+
+**SQL InfluxDB details section:**
+
+- **Database** - Specify the **bucket ID**. Refer to the **Buckets page** in the InfluxDB UI to locate the ID.
+- **Token** The API token used for SQL queries. Generated on InfluxDB Cloud dashboard under [Load Data > API Tokens](https://docs.influxdata.com/influxdb/cloud-serverless/get-started/setup/#create-an-all-access-api-token) menu.
+- **Insecure Connection** - Toggle to disable gRPC TLS security.
+- **Max series** - _(Optional)_ Sets a limit on the maximum number of series or tables that Grafana processes. Set a lower limit to prevent system overload, or increase it if you have many small time series and need to display more of them. The default is `1000`.
+
+### Flux-specific configuration section
+
+The following settings are specific to the Flux query language option.
+
+**Flux InfluxDB details section:**
+
+- **Organization** - The [Influx organization](https://v2.docs.influxdata.com/v2.0/organizations/) used for Flux queries. Also used for the `v.organization` query macro.
+- **Token** - The authentication token used for Flux queries. With Influx 2.0, use the [influx authentication token to function](https://v2.docs.influxdata.com/v2.0/security/tokens/create-token/). Token must be set as `Authorization` header with the value `Token `. For Influx 1.8, the token is `username:password`.
+- **Default bucket** - _(Optional)_ The [Influx bucket](https://v2.docs.influxdata.com/v2.0/organizations/buckets/) used for the `v.defaultBucket` macro in Flux queries.
+- **Min time interval** - Sets the minimum time interval for auto group-by. Grafana recommends aligning this setting with the data write frequency. For example, if data is written every minute, set the interval to 1 minute to ensure each group includes data from every new write. The default is `10s`.
+- **Max series** - Sets a limit on the maximum number of series or tables that Grafana processes. Set a lower limit to prevent system overload, or increase it if you have many small time series and need to display more of them. The default is `1000`.
+
+### Min time interval
+
+The **Min time interval** setting defines a lower limit for the auto group-by time interval.
+
+This value **must be** formatted as a number followed by a valid time identifier:
+
+| Identifier | Description |
+| ---------- | ----------- |
+| `y` | year |
+| `M` | month |
+| `w` | week |
+| `d` | day |
+| `h` | hour |
+| `m` | minute |
+| `s` | second |
+| `ms` | millisecond |
+
+You can also override this setting in a dashboard panel under its data source options.
+
+## Provision the InfluxDB data source
+
+You can define and configure the data source in YAML files as part of Grafana's provisioning system.
+For more information about provisioning, and for available configuration options, refer
+to [Provision Grafana](ref:provision-grafana).
+
+{{% admonition type="note" %}}
+The `database` [field is deprecated](https://github.com/grafana/grafana/pull/58647).
+Grafana recommends using the `dbName` field in `jsonData`. There is no need to change existing provisioning settings.
+{{% /admonition %}}
+
+### Provisioning examples
+
+Provisioning differs based on query language.
+
+**InfluxDB 1.x example:**
+
+```yaml
+apiVersion: 1
+
+datasources:
+ - name: InfluxDB_v1
+ type: influxdb
+ access: proxy
+ user: grafana
+ url: http://localhost:8086
+ jsonData:
+ dbName: site
+ httpMode: GET
+ secureJsonData:
+ password: grafana
+```
+
+**InfluxDB 2.x for Flux example:**
+
+```yaml
+apiVersion: 1
+
+datasources:
+ - name: InfluxDB_v2_Flux
+ type: influxdb
+ access: proxy
+ url: http://localhost:8086
+ jsonData:
+ version: Flux
+ organization: organization
+ defaultBucket: bucket
+ tlsSkipVerify: true
+ secureJsonData:
+ token: token
+```
+
+**InfluxDB 2.x for InfluxQL example:**
+
+```yaml
+apiVersion: 1
+
+datasources:
+ - name: InfluxDB_v2_InfluxQL
+ type: influxdb
+ access: proxy
+ url: http://localhost:8086
+ jsonData:
+ dbName: site
+ httpHeaderName1: 'Authorization'
+ secureJsonData:
+ httpHeaderValue1: 'Token '
+```
+
+**InfluxDB 3.x for SQL example:**
+
+```yaml
+apiVersion: 1
+
+datasources:
+ - name: InfluxDB_v3_InfluxQL
+ type: influxdb
+ access: proxy
+ url: http://localhost:8086
+ jsonData:
+ version: SQL
+ dbName: site
+ httpMode: POST
+ insecureGrpc: false
+ secureJsonData:
+ token: ''
+```
diff --git a/docs/sources/datasources/influxdb/query-editor/index.md b/docs/sources/datasources/influxdb/query-editor/index.md
index 76f1a50d733..14b3c1294d4 100644
--- a/docs/sources/datasources/influxdb/query-editor/index.md
+++ b/docs/sources/datasources/influxdb/query-editor/index.md
@@ -2,14 +2,15 @@
aliases:
- ../../data-sources/influxdb/query-editor/
- influxdb-flux/
-description: Guide for Flux in Grafana
+description: This topic describes the InfluxDB query editor, modes and querying the InfluxDB data source.
labels:
products:
- cloud
- enterprise
- oss
-title: Query Editor
-weight: 200
+title: InfluxDB query Editor
+menuTitle: Query editor
+weight: 400
refs:
explore:
- pattern: /docs/grafana/
@@ -31,45 +32,80 @@ refs:
destination: /docs/grafana//panels-visualizations/visualizations/logs/
- pattern: /docs/grafana-cloud/
destination: grafana-cloud/visualizations/panels-visualizations/visualizations/logs/
+ query-editor:
+ - pattern: /docs/grafana/
+ destination: /docs/grafana//panels-visualizations/query-transform-data/#query-editors
+ - pattern: /docs/grafana-cloud/
+ destination: /docs/grafana-cloud/visualizations/panels-visualizations/query-transform-data/#query-editors
+ build-dashboards:
+ - pattern: /docs/grafana/
+ destination: /docs/grafana//dashboards/build-dashboards/
+ - pattern: /docs/grafana-cloud/
+ destination: /docs/grafana-cloud/visualizations/dashboards/build-dashboards/
+ data-source-management:
+ - pattern: /docs/grafana/
+ destination: /docs/grafana//administration/data-source-management/
+ - pattern: /docs/grafana-cloud/
+ destination: /docs/grafana//administration/data-source-management/
+ annotations:
+ - pattern: /docs/grafana/
+ destination: /docs/grafana//dashboards/build-dashboards/annotate-visualizations/
+ - pattern: /docs/grafana-cloud/
+ destination: /docs/grafana-cloud/visualizations/dashboards/build-dashboards/annotate-visualizations/
+ configure-influxdb-data-source:
+ - pattern: /docs/grafana/
+ destination: /docs/grafana//datasources/influxdb/configure-influxdb-data-source/
+ - pattern: /docs/grafana-cloud/
+ destination: /docs/grafana//datasources/influxdb/configure-influxdb-data-source/
---
# InfluxDB query editor
-This topic explains querying specific to the InfluxDB data source.
-For general documentation on querying data sources in Grafana, see [Query and transform data](ref:query-transform-data).
+Grafana's query editors are unique to each data source. For general information on Grafana query editors, refer to [Query editors](ref:query-editor). For general information on querying data sources in Grafana, refer to [Query and transform data](ref:query-transform-data).
+
+The InfluxDB query editor is located on the [Explore page](ref:explore). You can also access the InfluxDB query editor from a dashboard panel. Click the ellipsis in the upper right of the panel and select **Edit**.
+
+You can also use the query editor to retrieve [log data](#query-logs) and [annotate](#apply-annotations) visualizations.
## Choose a query editing mode
-The InfluxDB data source's query editor has two modes depending on your choice of query language in
-the [data source configuration]({{< relref "../#configure-the-data-source" >}}):
+The InfluxDB data source has three different types of query editors, each corresponding to the query language selected in the [data source configuration](https://grafana.com/docs/grafana//datasources/influxdb/configure-influxdb-data-source/#influxdb-configuration-options):
- [InfluxQL](#influxql-query-editor)
- [SQL](#sql-query-editor)
- [Flux](#flux-query-editor)
-You also use the query editor to retrieve [log data](#query-logs) and [annotate](#apply-annotations) visualizations.
+Editor options vary based on query language.
## InfluxQL query editor
-The InfluxQL query editor helps you select metrics and tags to create InfluxQL queries.
+The InfluxQL query editor helps you select metrics and tags to create InfluxQL queries. There are two modes: `visual editor mode` and `raw query mode`. To switch between the two modes click the **pencil icon** in the upper right.
-**To enter edit mode:**
+Visual query editor mode contains the following components:
-1. Hover over any part of the panel to display the actions menu on the top right corner.
-1. Click the menu and select **Edit**.
+- **FROM** - Select a measurement to query.
+- **WHERE** - Select filters by clicking the **+ sign**.
+- **SELECT** - Select fields and functions from the drop-down. You can add multiple fields and functions by clicking the **+ sign**.
+- **GROUP BY** - Select a tag from the drop-down menu.
+- **TIMEZONE** - _Optional_ Group data by a specific timezone.
+- **ORDER BY TIME** - Sort data by time in either ascending or descending order.
+- **LIMIT** - _Optional_ Limits the number of rows returned by the query.
+- **SLIMIT** - _Optional_ Limits the number of series returned by the query. Refer to [SLIMIT clause](https://docs.influxdata.com/influxdb/cloud/query-data/influxql/explore-data/limit-and-slimit/#slimit-clause) for more information on this option.
+- **FORMAT AS** - Select a format option from the drop-down menu.
+- **ALIAS** - Add an alias. Refer to [Alias patterns](#alias-patterns) for more information.
+
+### Raw query editor mode
+
+You can write raw InfluxQL queries by switching to raw query mode. Click the pencil in the upper right of the query editor to switch modes. Note that when you switch to visual editor mode, you will lose any changes made in raw query mode.
+
+If you use raw query mode, your query must include `WHERE $timeFilter`. You should also provide a group by time and an aggregation function. Otherwise, InfluxDB may return hundreds of thousands of data points, potentially causing your browser to hang.

-### Filter data (WHERE)
-
-To add a tag filter, click the plus icon to the right of the `WHERE` condition.
-
-To remove tag filters, click the tag key, then select **--remove tag filter--**.
-
-#### Match by regular expressions
+### Match by regular expressions
You can enter regular expressions for metric names or tag filter values.
-Wrap the regex pattern in forward slashes (`/`).
+Wrap the regex pattern in forward slashes (`/`), as shown in this example: `/measurement/`.
Grafana automatically adjusts the filter tag condition to use the InfluxDB regex match condition operator (`=~`).
@@ -77,56 +113,35 @@ Grafana automatically adjusts the filter tag condition to use the InfluxDB regex
In the `SELECT` row, you can specify which fields and functions to use.
-If you have a group by time, you must have an aggregation function.
-Some functions like `derivative` also require an aggregation function.
+If you **group by time** you must use an aggregation function. Certain functions such as `derivative` also require an aggregation function.
-The editor helps you build this part of the query.
-For example:
+If you have the following:

-This query editor input generates an InfluxDB `SELECT` clause:
+The query editor input generates an InfluxDB `SELECT` clause:
```sql
SELECT derivative(mean("value"), 10s) / 10 AS "REQ/s"
FROM....
```
-**To select multiple fields:**
+You can also use a \* in a SELECT statement to select all fields.
-1. Click the plus button.
-1. Select **Field > field** to add another `SELECT` clause.
+```sql
+SELECT * FROM
+```
- You can also `SELECT` an asterisk (`*`) to select all fields.
+### GROUP BY results
-### Group query results
+To group results by a tag, specify the tag in the **GROUP BY** row:
-To group results by a tag, define it in a "Group By".
+1. Click the **+ sign** in the GROUP BY row.
+1. Select a tag from the drop-down.
-**To group by a tag:**
+You can GROUP BY multiple options.
-1. Click the plus icon at the end of the GROUP BY row.
-1. Select a tag from the dropdown that appears.
-
-**To remove the "Group By":**
-
-1. Click the tag.
-1. Click the "x" icon.
-
-### Text editor mode (RAW)
-
-You can write raw InfluxQL queries by switching the editor mode.
-However, be careful when writing queries manually.
-
-If you use raw query mode, your query _must_ include at least `WHERE $timeFilter`.
-
-Also, _always_ provide a group by time and an aggregation function.
-Otherwise, InfluxDB can easily return hundreds of thousands of data points that can hang your browser.
-
-**To switch to raw query mode:**
-
-1. Click the hamburger icon.
-1. Toggle **Switch editor mode**.
+To remove a GROUP BY option click the **X icon** next to the option.
### Alias patterns
@@ -138,20 +153,21 @@ Otherwise, InfluxDB can easily return hundreds of thousands of data points that
| `$col` | Column name. |
| `$tag_exampletag` | The value of the `exampletag` tag. The syntax is `$tag*yourTagName` and must start with `$tag*`. To use your tag as an alias in the ALIAS BY field, you must use the tag to group by in the query. |
-You can also use `[[tag_hostname]]` pattern replacement syntax.
+You can also use the `[[tag_hostname]]` pattern replacement syntax.
-For example, entering the value `Host: [[tag_hostname]]` in the ALIAS BY field replaces it with the `hostname` tag value
-for each legend value.
-An example legend value would be `Host: server1`.
+For example, entering the value `Host: [[tag_hostname]]` in the ALIAS BY field replaces it with the `hostname` tag value for each legend value.
+
+An example legend value is `Host: server1`.
## SQL query editor
-Grafana support [SQL querying language](https://docs.influxdata.com/influxdb/cloud-serverless/query-data/sql/)
-with [InfluxDB v3.0](https://www.influxdata.com/blog/introducing-influxdb-3-0/) and higher.
+Grafana supports the [SQL query language](https://docs.influxdata.com/influxdb/cloud-serverless/query-data/sql/) in [InfluxDB v3.0](https://www.influxdata.com/blog/introducing-influxdb-3-0/) and higher.
+
+You construct your SQL query directly in the query editor.
### Macros
-You can use macros within the query to replace them with the values from Grafana's context.
+You can use macros in your query to automatically substitute them with values from Grafana's context.
| Macro example | Replaced with |
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -179,12 +195,12 @@ Examples:
## Flux query editor
Grafana supports Flux when running InfluxDB v1.8 and higher.
-If your data source is [configured for Flux]({{< relref "./#configure-the-data-source" >}}), you can use
-the [Flux query and scripting language](https://www.influxdata.com/products/flux/) in the query editor, which serves as
+If your data source is [configured for Flux](ref:configure-influxdb-data-source), you can use
+the [Flux](https://docs.influxdata.com/flux/v0/) in the query editor, which serves as
a text editor for raw Flux queries with macro support.
For more information and connection details, refer
-to [1.8 compatibility](https://github.com/influxdata/influxdb-client-go/#influxdb-18-api-compatibility).
+to [InfluxDB 1.8 API compatibility](https://github.com/influxdata/influxdb-client-go/#influxdb-18-api-compatibility).
### Use macros
@@ -199,7 +215,7 @@ Macros support copying and pasting from [Chronograf](https://www.influxdata.com/
| `v.defaultBucket` | The data source configuration's "Default Bucket" setting. |
| `v.organization` | The data source configuration's "Organization" setting. |
-For example, the query editor interpolates this query:
+For example, consider the following Flux query:
```flux
from(bucket: v.defaultBucket)
@@ -210,8 +226,7 @@ from(bucket: v.defaultBucket)
|> yield(name: "mean")
```
-Into this query to send to InfluxDB, with interval and time period values changing according to the active time
-selection:
+This Flux query is interpolated into the following query and sent to InfluxDB, with the interval and time period values changing according to the active time selection:
```flux
from(bucket: "grafana")
@@ -222,33 +237,20 @@ from(bucket: "grafana")
|> yield(name: "mean")
```
-To view the interpolated version of a query with the query inspector, refer to [Panel Inspector](ref:panel-inspector).
+To view the interpolated version of a query with the Query inspector, refer to [Panel Inspector](ref:panel-inspector).
## Query logs
-You can query and display log data from InfluxDB in [Explore](ref:explore) and with the [Logs panel](ref:logs) for dashboards.
+You can query and display log data from InfluxDB in [Explore](ref:explore) and in the dashboard [Logs panel](ref:logs).
-Select the InfluxDB data source, then enter a query to display your logs.
+Select an InfluxDB data source in the Query editor. Under the **Select measurement field** next to the **FROM** section, choose a measurement containing your log data, then choose the appropriate fields that will display the log message. Add any additional filters by clicking the **+ sign** next to the **WHERE** field. Add additional conditions in the GROUP BY, ORDER BY and the rest of the options.
-### Create log queries
-
-The Logs Explorer next to the query field, accessed by the **Measurements/Fields** button, lists measurements and
-fields.
-Choose the desired measurement that contains your log data, then choose which field to use to display the log message.
-
-Once InfluxDB returns the result, the log panel lists log rows and displays a bar chart, where the x axis represents the
-time and the y axis represents the frequency/count.
-
-### Filter search
-
-To add a filter, click the plus icon to the right of the **Measurements/Fields** button, or next to a condition.
-
-To remove tag filters, click the first select, then choose **--remove filter--**.
+After InfluxDB returns the results, the log panel displays log rows along with a bar chart. The x-axis represents time, while the y-axis shows the frequency or count.
## Apply annotations
-[Annotations][annotate-visualizations] overlay rich event information on top of graphs.
-You can add annotation queries in the Dashboard menu's Annotations view.
+[Annotations](ref:annotations) overlay rich event information on top of graphs.
+You can add annotation queries in the dashboard menu's **Annotations view**.
For InfluxDB, your query **must** include `WHERE $timeFilter`.
diff --git a/docs/sources/datasources/influxdb/template-variables/index.md b/docs/sources/datasources/influxdb/template-variables/index.md
index 5351258ed1b..72d48bdccbf 100644
--- a/docs/sources/datasources/influxdb/template-variables/index.md
+++ b/docs/sources/datasources/influxdb/template-variables/index.md
@@ -17,7 +17,7 @@ labels:
- oss
menuTitle: Template variables
title: InfluxDB template variables
-weight: 300
+weight: 600
refs:
add-template-variables-chained-variables:
- pattern: /docs/grafana/
@@ -39,57 +39,62 @@ refs:
destination: /docs/grafana//dashboards/variables/add-template-variables/#add-ad-hoc-filters
- pattern: /docs/grafana-cloud/
destination: /docs/grafana//dashboards/variables/add-template-variables/#add-ad-hoc-filters
- add-template-variables-adds-a-query-variable:
+ add-template-variables-add-a-query-variable:
- pattern: /docs/grafana/
destination: /docs/grafana//dashboards/variables/add-template-variables/#add-a-query-variable
- pattern: /docs/grafana-cloud/
destination: /docs/grafana//dashboards/variables/add-template-variables/#add-a-query-variable
+ variable-best-practices:
+ - pattern: /docs/grafana/
+ destination: /docs/grafana//dashboards/variables/#variable-best-practices
+ - pattern: /docs/grafana-cloud/
+ destination: /docs/grafana-cloud/visualizations/dashboards/variables/#variable-best-practices
---
# InfluxDB template variables
-Instead of hard-coding details such as server, application, and sensor names in metric queries, you can use variables.
-Grafana lists these variables in dropdown select boxes at the top of the dashboard to help you change the data displayed in your dashboard.
-Grafana refers to such variables as template variables.
+Instead of hard-coding details such as server, application, and sensor names in metric queries, you can use variables. Grafana displays these variables in drop-down select boxes at the top of the dashboard to help you change the data displayed in your dashboard. Grafana refers to such variables as template variables.
-For an introduction to templating and template variables, refer to the [Templating](ref:variables) and [Add and manage variables](ref:add-template-variables) documentation.
+For additional information using variables and templates, refer to the following documentation:
+
+- [Variables](ref:variables)
+- [Templates](ref:variables)
+- [Add and manage variables](ref:add-template-variables)
+- [Variable best practices](ref:variable-best-practices)
## Use query variables
-If you add a query template variable, you can write an InfluxDB exploration (metadata) query.
-These queries can return results like measurement names, key names, or key values.
+By adding a query template variable, you can write an InfluxDB metadata exploration query. These queries return results such as measurement names, key names, and key values.
-For more information, refer to [Add query variable](ref:add-template-variables-adds-a-query-variable).
+For more information, refer to [Add a query variable](ref:add-template-variables-add-a-query-variable).
-For example, to create a variable that contains all values for tag `hostname`, specify a query like this in the query variable **Query**:
+To create a variable containing all values for the `hostname` tag, use the following query format in the **Query** variable:
```sql
SHOW TAG VALUES WITH KEY = "hostname"
```
-### Chain or nest variables
+## Chain or nest variables
You can also create nested variables, sometimes called [chained variables](ref:add-template-variables-chained-variables).
-For example, if you had a variable called `region`, you could have the `hosts` variable show only hosts from the selected region with a query like:
+For example, if you have a variable named `region`, you can configure the `hosts` variable to display only hosts from the selected region using the following query:
```sql
SHOW TAG VALUES WITH KEY = "hostname" WHERE region = '$region'
```
-You can fetch key names for a given measurement:
+You can also fetch key names for a given measurement:
```sql
SHOW TAG KEYS [FROM ]
```
-If you have a variable with key names, you can use this variable in a group-by clause.
-This helps you change group-by using the variable list at the top of the dashboard.
+If you have a variable containing key names, you can use it in a **GROUP BY** clause. This allows you to adjust the grouping by selecting from the variable list at the top of the dashboard
-### Use ad hoc filters
+## Use ad hoc filters
-InfluxDB supports the special **Ad hoc filters** variable type.
-You can use this variable type to specify any number of key/value filters, and Grafana applies them automatically to all of your InfluxDB queries.
+InfluxDB supports the **Ad hoc filters** variable type. This variable type allows you to define multiple key/value filters, which Grafana then automatically applies to all your InfluxDB queries.
For more information, refer to [Add ad hoc filters](ref:add-template-variables-add-ad-hoc-filters).
@@ -97,13 +102,13 @@ For more information, refer to [Add ad hoc filters](ref:add-template-variables-a
The InfluxDB data source supports two variable syntaxes for use in the **Query** field:
-- `$`, which is easier to read and write but does not allow you to use a variable in the middle of a word.
+- `$` - This syntax is easy to read and write but does not allow you to use a variable in the middle of a word or expression.
```sql
SELECT mean("value") FROM "logins" WHERE "hostname" =~ /^$host$/ AND $timeFilter GROUP BY time($__interval), "hostname"
```
-- `${varname}`
+- `${varname}` - Use this syntax when you want to interpolate a variable in the middle of an expression.
```sql
SELECT mean("value") FROM "logins" WHERE "hostname" =~ /^[[host]]$/ AND $timeFilter GROUP BY time($__interval), "hostname"
@@ -113,4 +118,4 @@ When you enable the **Multi-value** or **Include all value** options, Grafana co
### Templated dashboard example
-To view an example templated dashboard, refer to this [InfluxDB templated dashboard](https://play.grafana.org/d/f62a0410-5abb-4dd8-9dfc-caddfc3e2ffd/eccb2445-b0a2-5e83-8e0f-6d5ea53ad575).
+To view an example of a templated dashboard, refer to this [InfluxDB example dashboard](https://play.grafana.org/d/f62a0410-5abb-4dd8-9dfc-caddfc3e2ffd/eccb2445-b0a2-5e83-8e0f-6d5ea53ad575).
diff --git a/docs/sources/panels-visualizations/query-transform-data/transform-data/index.md b/docs/sources/panels-visualizations/query-transform-data/transform-data/index.md
index d0ac307a1bc..726a5da5a8b 100644
--- a/docs/sources/panels-visualizations/query-transform-data/transform-data/index.md
+++ b/docs/sources/panels-visualizations/query-transform-data/transform-data/index.md
@@ -286,6 +286,8 @@ In the field mapping specify:
Grafana builds value mappings from your query result and applies them to the real data query results. You should see values being mapped and colored according to the config query results.
+> **Note:** When you use this transformation for thresholds, the visualization continues to use the panel's base threshold.
+
### Convert field type
Use this transformation to modify the field type of a specified field.
diff --git a/docs/sources/panels-visualizations/visualizations/node-graph/index.md b/docs/sources/panels-visualizations/visualizations/node-graph/index.md
index e7e2b7c9dcc..7f488c8a40f 100644
--- a/docs/sources/panels-visualizations/visualizations/node-graph/index.md
+++ b/docs/sources/panels-visualizations/visualizations/node-graph/index.md
@@ -110,6 +110,38 @@ Edges can also show statistics when you hover over the edge. Similar to nodes, y
The first data source supporting this visualization is X-Ray data source for its Service map feature. For more information, refer to the [X-Ray plugin documentation](https://grafana.com/grafana/plugins/grafana-x-ray-datasource).
+## Node graph navigation
+
+You can use pan, zoom, and other functions to navigate a node graph.
+
+### Pan
+
+You can pan the view by clicking outside any node or edge and dragging your mouse.
+
+### Zoom
+
+Use the buttons in the lower right corner to zoom in or out. You can also use the mouse wheel or touchpad scroll, together with either Ctrl or Cmd key to do so.
+
+### Hidden nodes
+
+The number of nodes shown at a given time is limited to maintain a reasonable visualization performance. Nodes that are not currently visible are hidden behind clickable markers that show an approximate number of hidden nodes that are connected by a particular edge. You can click on the marker to expand the graph around that node.
+
+
+
+### Grid view
+
+You can switch to the grid view to have a better overview of the most interesting nodes in the graph. Grid view shows nodes in a grid without edges and can be sorted by stats shown inside the node or by stats represented by the a colored border of the nodes.
+
+
+
+To sort the nodes, click on the stats inside the legend. The marker next to the stat name shows which stat is currently used for sorting and sorting direction.
+
+
+
+Click on the node and select "Show in Graph layout" option to switch back to graph layout and focus on the selected node, to show it in context of the full graph.
+
+
+
## Configuration options
{{< docs/shared lookup="visualizations/config-options-intro.md" source="grafana" version="" >}}
@@ -153,38 +185,6 @@ In node graphs, some data fields may have pre-configured data links. To add a di
{{< docs/shared lookup="visualizations/overrides-options.md" source="grafana" version="" >}}
-## Navigating the node graph
-
-You can use pan, zoom, and other functions to navigate a node graph.
-
-### Pan
-
-You can pan the view by clicking outside any node or edge and dragging your mouse.
-
-### Zoom
-
-Use the buttons in the lower right corner to zoom in or out. You can also use the mouse wheel or touchpad scroll, together with either Ctrl or Cmd key to do so.
-
-### Hidden nodes
-
-The number of nodes shown at a given time is limited to maintain a reasonable visualization performance. Nodes that are not currently visible are hidden behind clickable markers that show an approximate number of hidden nodes that are connected by a particular edge. You can click on the marker to expand the graph around that node.
-
-
-
-### Grid view
-
-You can switch to the grid view to have a better overview of the most interesting nodes in the graph. Grid view shows nodes in a grid without edges and can be sorted by stats shown inside the node or by stats represented by the a colored border of the nodes.
-
-
-
-To sort the nodes, click on the stats inside the legend. The marker next to the stat name shows which stat is currently used for sorting and sorting direction.
-
-
-
-Click on the node and select "Show in Graph layout" option to switch back to graph layout and focus on the selected node, to show it in context of the full graph.
-
-
-
## Data API
This visualization needs a specific shape of the data to be returned from the data source in order to correctly display it.
diff --git a/docs/sources/panels-visualizations/visualizations/stat/index.md b/docs/sources/panels-visualizations/visualizations/stat/index.md
index ad6da7f2889..eb989ae6d4e 100644
--- a/docs/sources/panels-visualizations/visualizations/stat/index.md
+++ b/docs/sources/panels-visualizations/visualizations/stat/index.md
@@ -23,6 +23,11 @@ refs:
destination: /docs/grafana//panels-visualizations/query-transform-data/calculation-types/
- pattern: /docs/grafana-cloud/
destination: /docs/grafana-cloud/visualizations/panels-visualizations/query-transform-data/calculation-types/
+ create-dashboard:
+ - pattern: /docs/grafana/
+ destination: /docs/grafana//dashboards/build-dashboards/create-dashboard/
+ - pattern: /docs/grafana-cloud/
+ destination: /docs/grafana-cloud/visualizations/dashboards/build-dashboards/create-dashboard/
---
# Stat
@@ -35,7 +40,7 @@ A stat visualization displays your data in single values of interest—such
For example, if you're monitoring the utilization of various services, you can use a stat visualization to show their latest usage:
-{{< figure src="/static/img/docs/v66/stat_panel_dark3.png" max-width="1025px" alt="A stat panel showing latest usage of various services" >}}
+
Use a stat visualization when you need to:
@@ -47,7 +52,7 @@ Use a stat visualization when you need to:
## Configure a stat visualization
-Once you've [created a dashboard](https://grafana.com/docs/grafana//dashboards/build-dashboards/create-dashboard/), the following video shows you how to configure a stat visualization:
+Once you've [created a dashboard](ref:create-dashboard), the following video shows you how to configure a stat visualization:
{{< youtube id="yNRnLyVntUw" start="1048" >}}
@@ -73,9 +78,9 @@ The following tables are examples of the type of data you need for a stat visual
| 59 |
| 40 |
-The data is visualized as follows, with the last value displayed, along with a sparkline and [percentage change](#show-percent-change):
+The data is visualized as follows, with the last value displayed, along with a sparkline and [percentage change](#value-options):
-{{< figure src="/static/img/docs/stat-panel/stat_panel_single.png" max-width="1025px" alt="A stat panel showing the latest number of high priority bugs" >}}
+
#### Time-series data
@@ -89,7 +94,7 @@ The data is visualized as follows, with the last value displayed, along with a s
The data is visualized as follows, with the mean value displayed for each room, along with the room name, sparkline, and unit of measurement:
-{{< figure src="/static/img/docs/stat-panel/stat_panel_multiple.png" max-width="1025px" alt="A stat panel showing some statistics for each room in square meters" >}}
+
By default, a stat displays one of the following:
@@ -98,131 +103,87 @@ By default, a stat displays one of the following:
You can use the [**Text mode**](#text-mode) to control how the text is displayed.
-## Automatic layout adjustment
+## Configuration options
-The panel automatically adjusts the layout depending on available width and height in the dashboard. It automatically hides the graph (sparkline) if the panel becomes too small.
+{{< docs/shared lookup="visualizations/config-options-intro.md" source="grafana" version="" >}}
-## Panel options
+### Panel options
{{< docs/shared lookup="visualizations/panel-options.md" source="grafana" version="" >}}
-## Value options
+### Value options
Use the following options to refine how your visualization displays its values:
-### Show
+
+| Option | Description |
+| ------ | ----------- |
+| Show | Display a single value per column or series, or show values for each row. Choose from:
**Calculate** - Display a calculated value based on all rows.
**All values** - Show a separate stat for every row. If you select this option, then you can also limit the number of rows to display.
|
+| Calculation | This option is displayed when you select **Calculate** as your **Show** option. Select a reducer function that Grafana will use to reduce many fields to a single value. For a list of available calculations, refer to [Calculation types](ref:calculation-types). |
+| Limit | This option is displayed when you select **All values** as your **Show** option. Set the maximum number of rows to display. Default is 5,000. |
+| Fields | Select the fields displayed in the visualization. |
-Display a single value per column or series, or show values for each row.
+
-#### Calculate
+### Stat styles
-Display a calculated value based on all rows.
+The stat visualization automatically adjusts the layout depending on available width and height in the dashboard, but you can also use the following options to further style the visualization.
-- **Calculation -** Select a reducer function that Grafana will use to reduce many fields to a single value. For a list of available calculations, refer to [Calculation types](ref:calculation-types).
-- **Fields -** Select the fields display in the visualization.
+
+| Option | Description |
+| ------ | ----------- |
+| Orientation | Select a stacking direction. Choose from:
**Auto** - Grafana selects the ideal orientation.
**Horizontal** - Bars stretch horizontally, left to right.
**Vertical** - Bars stretch vertically, top to bottom.
|
+| [Text mode](#text-mode) | You can use the **Text mode** option to control what text the visualization renders. If the value is not important, only the name and color is, then change the **Text mode** to **Name**. The value will still be used to determine color and is displayed in a tooltip. |
+| [Wide layout](#wide-layout) | Set whether wide layout is enabled or not. Wide layout is enabled by default. This option is only applicable when **Text mode** is set to **Value and name**. |
+| Color mode | Select a color mode. Choose from:
**None** - No color applied to the value.
**Value** - Applies color to the value and graph area.
**Background Gradient** - Applies color to the value, graph area, and background, with a slight background gradient.
**Background Solid** - Applies color to the value, graph area, and background, with a solid background color.
**None** - Hides the graph sparkline and only shows the value.
**Area** - Shows the graph sparkline below the value. This requires that your query returns a time column.
The graph sparkline is automatically hidden if the panel becomes too small.|
+| Text alignment | Select an alignment mode. Choose from:
**Auto** - If only a single value is shown (no repeat), then the value is centered. If multiple series or rows are shown, then the value is left-aligned.
**Center** - Stat value is centered.
|
+| Show percent change | Set whether percent change is displayed or not. Disabled by default. This option is applicable when the **Show** setting, under **Value options**, is set to **Calculate**. |
+| Percent change color mode | This option is only displayed when **Show percent change** is enabled. Choose from:
**Standard** - Green if the percent change is positive, red if the percent change is negative.
**Inverted** - Red if the percent change is positive, green if the percent change is negative.
**Same as Value** - Use the same color as the value.
|
+
-#### All values
-
-Show a separate stat for every row. If you select this option, then you can also limit the number of rows to display.
-
-- **Limit -** The maximum number of rows to display. Default is 5,000.
-- **Fields -** Select the fields display in the visualization.
-
-## Stat styles
-
-Style your visualization.
-
-### Orientation
-
-Choose a stacking direction.
-
-- **Auto -** Grafana selects what it thinks is the best orientation.
-- **Horizontal -** Bars stretch horizontally, left to right.
-- **Vertical -** Bars stretch vertically, top to bottom.
-
-### Text mode
+#### Text mode
You can use the Text mode option to control what text the visualization renders. If the value is not important, only the name and color is, then change the **Text mode** to **Name**. The value will still be used to determine color and is displayed in a tooltip.
-- **Auto -** If the data contains multiple series or fields, show both name and value.
-- **Value -** Show only value, never name. Name is displayed in the hover tooltip instead.
-- **Value and name -** Always show value and name.
-- **Name -** Show name instead of value. Value is displayed in the hover tooltip.
-- **None -** Show nothing (empty). Name and value are displayed in the hover tooltip.
+- **Auto** - If the data contains multiple series or fields, show both name and value.
+- **Value** - Show only value, never name. Name is displayed in the hover tooltip instead.
+- **Value and name** - Always show value and name.
+- **Name** - Show name instead of value. Value is displayed in the hover tooltip.
+- **None** - Show nothing (empty). Name and value are displayed in the hover tooltip.
-### Wide layout
+#### Wide layout
Set whether wide layout is enabled or not. Wide layout is enabled by default.
-- **On -** Wide layout is enabled.
-- **Off -** Wide layout is disabled.
+- **On** - Wide layout is enabled.
+- **Off** - Wide layout is disabled.
-{{< admonition type="note" >}}
This option is only applicable when **Text mode** is set to **Value and name**. When wide layout is enabled, the value and name are displayed side-by-side with the value on the right, if the panel is wide enough. When wide layout is disabled, the value is always rendered underneath the name.
-{{< /admonition >}}
-### Color mode
-
-Select a color mode.
-
-- **None -** No color applied to the value.
-- **Value -** Applies color to the value and graph area.
-- **Background Gradient -** Applies color to the value, graph area, and background, with a slight background gradient.
-- **Background Solid -** Applies color to the value, graph area, and background, with a solid background color.
-
-### Graph mode
-
-Select a graph and sparkline mode.
-
-- **None -** Hides the graph and only shows the value.
-- **Area -** Shows the area graph below the value. This requires that your query returns a time column.
-
-### Text alignment
-
-Choose an alignment mode.
-
-- **Auto -** If only a single value is shown (no repeat), then the value is centered. If multiple series or rows are shown, then the value is left-aligned.
-- **Center -** Stat value is centered.
-
-### Show percent change
-
-Set whether percent change is displayed or not. Disabled by default.
-
-{{< admonition type="note" >}}
-This option is not applicable when the **Show** setting, under **Value options**, is set to **All values**.
-{{< /admonition >}}
-
-### Percent change color mode
-
-This option is only displayed when **Show percent change** is enabled. Choose from:
-
-- **Standard -** Green if the percent change is positive, red if the percent change is negative.
-- **Inverted -** Red if the percent change is positive, green if the percent change is negative.
-- **Same as Value -** Use the same color as the value.
-
-## Text size
+### Text size
Adjust the sizes of the gauge text.
-- **Title -** Enter a numeric value for the gauge title size.
-- **Value -** Enter a numeric value for the gauge value size.
+- **Title** - Enter a numeric value for the gauge title size.
+- **Value** - Enter a numeric value for the gauge value size.
-## Standard options
+### Standard options
{{< docs/shared lookup="visualizations/standard-options.md" source="grafana" version="" >}}
-## Data links
+### Data links
{{< docs/shared lookup="visualizations/datalink-options.md" source="grafana" version="" >}}
-## Value mappings
+### Value mappings
{{< docs/shared lookup="visualizations/value-mappings-options.md" source="grafana" version="" >}}
-## Thresholds
+### Thresholds
{{< docs/shared lookup="visualizations/thresholds-options-2.md" source="grafana" version="" >}}
-## Field overrides
+### Field overrides
{{< docs/shared lookup="visualizations/overrides-options.md" source="grafana" version="" >}}
diff --git a/docs/sources/setup-grafana/configure-grafana/enterprise-configuration/index.md b/docs/sources/setup-grafana/configure-grafana/enterprise-configuration/index.md
index e025c241b48..5aaaa2253a6 100644
--- a/docs/sources/setup-grafana/configure-grafana/enterprise-configuration/index.md
+++ b/docs/sources/setup-grafana/configure-grafana/enterprise-configuration/index.md
@@ -174,6 +174,10 @@ Name of the TrueType font file with italic style.
Maximum number of panel rendering request retries before returning an error. To disable the retry feature, enter `0`. This is available in public preview and requires the `reportingRetries` feature toggle.
+### allowed_domains
+
+Allowed domains to receive reports. Use an asterisk (`*`) to allow all domains. Use a comma-separated list to allow multiple domains. Example: allowed_domains = grafana.com, example.org
+
## [auditing]
[Auditing]({{< relref "../../configure-security/audit-grafana" >}}) allows you to track important changes to your Grafana instance. By default, audit logs are logged to file but the auditing feature also supports sending logs directly to Loki.
diff --git a/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md b/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md
index 5537f1d1e73..6b907ebd1fa 100644
--- a/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md
+++ b/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md
@@ -21,67 +21,67 @@ For more information about feature release stages, refer to [Release life cycle
Most [generally available](https://grafana.com/docs/release-life-cycle/#general-availability) features are enabled by default. You can disable these feature by setting the feature flag to "false" in the configuration.
-| Feature toggle name | Description | Enabled by default |
-| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
-| `disableEnvelopeEncryption` | Disable envelope encryption (emergency only) | |
-| `publicDashboards` | [Deprecated] Public dashboards are now enabled by default; to disable them, use the configuration setting. This feature toggle will be removed in the next major version. | Yes |
-| `publicDashboardsScene` | Enables public dashboard rendering using scenes | Yes |
-| `featureHighlights` | Highlight Grafana Enterprise features | |
-| `correlations` | Correlations page | Yes |
-| `cloudWatchCrossAccountQuerying` | Enables cross-account querying in CloudWatch datasources | Yes |
-| `accessControlOnCall` | Access control primitives for OnCall | Yes |
-| `nestedFolders` | Enable folder nesting | Yes |
-| `logsContextDatasourceUi` | Allow datasource to provide custom UI for context view | Yes |
-| `lokiQuerySplitting` | Split large interval queries into subqueries with smaller time intervals | Yes |
-| `prometheusMetricEncyclopedia` | Adds the metrics explorer component to the Prometheus query builder as an option in metric select | Yes |
-| `influxdbBackendMigration` | Query InfluxDB InfluxQL without the proxy | Yes |
-| `lokiMetricDataplane` | Changes metric responses from Loki to be compliant with the dataplane specification. | Yes |
-| `dataplaneFrontendFallback` | Support dataplane contract field name change for transformations and field name matchers where the name is different | Yes |
-| `recordedQueriesMulti` | Enables writing multiple items from a single query within Recorded Queries | Yes |
-| `logsExploreTableVisualisation` | A table visualisation for logs in Explore | Yes |
-| `transformationsRedesign` | Enables the transformations redesign | Yes |
-| `traceQLStreaming` | Enables response streaming of TraceQL queries of the Tempo data source | |
-| `awsAsyncQueryCaching` | Enable caching for async queries for Redshift and Athena. Requires that the datasource has caching and async query support enabled | Yes |
-| `prometheusConfigOverhaulAuth` | Update the Prometheus configuration page with the new auth component | Yes |
-| `alertingNoDataErrorExecution` | Changes how Alerting state manager handles execution of NoData/Error | Yes |
-| `angularDeprecationUI` | Display Angular warnings in dashboards and panels | Yes |
-| `dashgpt` | Enable AI powered features in dashboards | Yes |
-| `alertingInsights` | Show the new alerting insights landing page | Yes |
-| `panelMonitoring` | Enables panel monitoring through logs and measurements | Yes |
-| `formatString` | Enable format string transformer | Yes |
-| `transformationsVariableSupport` | Allows using variables in transformations | Yes |
-| `kubernetesPlaylists` | Use the kubernetes API in the frontend for playlists, and route /api/playlist requests to k8s | Yes |
-| `recoveryThreshold` | Enables feature recovery threshold (aka hysteresis) for threshold server-side expression | Yes |
-| `lokiStructuredMetadata` | Enables the loki data source to request structured metadata from the Loki server | Yes |
-| `managedPluginsInstall` | Install managed plugins directly from plugins catalog | Yes |
-| `addFieldFromCalculationStatFunctions` | Add cumulative and window functions to the add field from calculation transformation | Yes |
-| `annotationPermissionUpdate` | Change the way annotation permissions work by scoping them to folders and dashboards. | Yes |
-| `dashboardSceneForViewers` | Enables dashboard rendering using Scenes for viewer roles | Yes |
-| `dashboardSceneSolo` | Enables rendering dashboards using scenes for solo panels | Yes |
-| `dashboardScene` | Enables dashboard rendering using scenes for all roles | Yes |
-| `ssoSettingsApi` | Enables the SSO settings API and the OAuth configuration UIs in Grafana | Yes |
-| `logsInfiniteScrolling` | Enables infinite scrolling for the Logs panel in Explore and Dashboards | Yes |
-| `exploreMetrics` | Enables the new Explore Metrics core app | Yes |
-| `alertingSimplifiedRouting` | Enables users to easily configure alert notifications by specifying a contact point directly when editing or creating an alert rule | Yes |
-| `logRowsPopoverMenu` | Enable filtering menu displayed when text of a log line is selected | Yes |
-| `lokiQueryHints` | Enables query hints for Loki | Yes |
-| `alertingQueryOptimization` | Optimizes eligible queries in order to reduce load on datasources | |
-| `promQLScope` | In-development feature that will allow injection of labels into prometheus queries. | Yes |
-| `groupToNestedTableTransformation` | Enables the group to nested table transformation | Yes |
-| `tlsMemcached` | Use TLS-enabled memcached in the enterprise caching feature | Yes |
-| `cloudWatchNewLabelParsing` | Updates CloudWatch label parsing to be more accurate | Yes |
-| `accessActionSets` | Introduces action sets for resource permissions. Also ensures that all folder editors and admins can create subfolders without needing any additional permissions. | Yes |
-| `newDashboardSharingComponent` | Enables the new sharing drawer design | |
-| `notificationBanner` | Enables the notification banner UI and API | Yes |
-| `pluginProxyPreserveTrailingSlash` | Preserve plugin proxy trailing slash. | |
-| `pinNavItems` | Enables pinning of nav items | Yes |
-| `openSearchBackendFlowEnabled` | Enables the backend query flow for Open Search datasource plugin | Yes |
-| `cloudWatchRoundUpEndTime` | Round up end time for metric queries to the next minute to avoid missing data | Yes |
-| `cloudwatchMetricInsightsCrossAccount` | Enables cross account observability for Cloudwatch Metric Insights query builder | Yes |
-| `singleTopNav` | Unifies the top search bar and breadcrumb bar into one | Yes |
-| `azureMonitorDisableLogLimit` | Disables the log limit restriction for Azure Monitor when true. The limit is enabled by default. | |
-| `preinstallAutoUpdate` | Enables automatic updates for pre-installed plugins | Yes |
-| `alertingUIOptimizeReducer` | Enables removing the reducer from the alerting UI when creating a new alert rule and using instant query | Yes |
+| Feature toggle name | Description | Enabled by default |
+| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------ |
+| `disableEnvelopeEncryption` | Disable envelope encryption (emergency only) | |
+| `publicDashboardsScene` | Enables public dashboard rendering using scenes | Yes |
+| `featureHighlights` | Highlight Grafana Enterprise features | |
+| `correlations` | Correlations page | Yes |
+| `cloudWatchCrossAccountQuerying` | Enables cross-account querying in CloudWatch datasources | Yes |
+| `accessControlOnCall` | Access control primitives for OnCall | Yes |
+| `nestedFolders` | Enable folder nesting | Yes |
+| `logsContextDatasourceUi` | Allow datasource to provide custom UI for context view | Yes |
+| `lokiQuerySplitting` | Split large interval queries into subqueries with smaller time intervals | Yes |
+| `prometheusMetricEncyclopedia` | Adds the metrics explorer component to the Prometheus query builder as an option in metric select | Yes |
+| `influxdbBackendMigration` | Query InfluxDB InfluxQL without the proxy | Yes |
+| `lokiMetricDataplane` | Changes metric responses from Loki to be compliant with the dataplane specification. | Yes |
+| `dataplaneFrontendFallback` | Support dataplane contract field name change for transformations and field name matchers where the name is different | Yes |
+| `unifiedRequestLog` | Writes error logs to the request logger | Yes |
+| `recordedQueriesMulti` | Enables writing multiple items from a single query within Recorded Queries | Yes |
+| `logsExploreTableVisualisation` | A table visualisation for logs in Explore | Yes |
+| `transformationsRedesign` | Enables the transformations redesign | Yes |
+| `traceQLStreaming` | Enables response streaming of TraceQL queries of the Tempo data source | |
+| `awsAsyncQueryCaching` | Enable caching for async queries for Redshift and Athena. Requires that the datasource has caching and async query support enabled | Yes |
+| `prometheusConfigOverhaulAuth` | Update the Prometheus configuration page with the new auth component | Yes |
+| `alertingNoDataErrorExecution` | Changes how Alerting state manager handles execution of NoData/Error | Yes |
+| `angularDeprecationUI` | Display Angular warnings in dashboards and panels | Yes |
+| `dashgpt` | Enable AI powered features in dashboards | Yes |
+| `alertingInsights` | Show the new alerting insights landing page | Yes |
+| `panelMonitoring` | Enables panel monitoring through logs and measurements | Yes |
+| `formatString` | Enable format string transformer | Yes |
+| `transformationsVariableSupport` | Allows using variables in transformations | Yes |
+| `kubernetesPlaylists` | Use the kubernetes API in the frontend for playlists, and route /api/playlist requests to k8s | Yes |
+| `recoveryThreshold` | Enables feature recovery threshold (aka hysteresis) for threshold server-side expression | Yes |
+| `lokiStructuredMetadata` | Enables the loki data source to request structured metadata from the Loki server | Yes |
+| `managedPluginsInstall` | Install managed plugins directly from plugins catalog | Yes |
+| `addFieldFromCalculationStatFunctions` | Add cumulative and window functions to the add field from calculation transformation | Yes |
+| `annotationPermissionUpdate` | Change the way annotation permissions work by scoping them to folders and dashboards. | Yes |
+| `dashboardSceneForViewers` | Enables dashboard rendering using Scenes for viewer roles | Yes |
+| `dashboardSceneSolo` | Enables rendering dashboards using scenes for solo panels | Yes |
+| `dashboardScene` | Enables dashboard rendering using scenes for all roles | Yes |
+| `ssoSettingsApi` | Enables the SSO settings API and the OAuth configuration UIs in Grafana | Yes |
+| `logsInfiniteScrolling` | Enables infinite scrolling for the Logs panel in Explore and Dashboards | Yes |
+| `exploreMetrics` | Enables the new Explore Metrics core app | Yes |
+| `alertingSimplifiedRouting` | Enables users to easily configure alert notifications by specifying a contact point directly when editing or creating an alert rule | Yes |
+| `logRowsPopoverMenu` | Enable filtering menu displayed when text of a log line is selected | Yes |
+| `lokiQueryHints` | Enables query hints for Loki | Yes |
+| `alertingQueryOptimization` | Optimizes eligible queries in order to reduce load on datasources | |
+| `promQLScope` | In-development feature that will allow injection of labels into prometheus queries. | Yes |
+| `groupToNestedTableTransformation` | Enables the group to nested table transformation | Yes |
+| `tlsMemcached` | Use TLS-enabled memcached in the enterprise caching feature | Yes |
+| `cloudWatchNewLabelParsing` | Updates CloudWatch label parsing to be more accurate | Yes |
+| `accessActionSets` | Introduces action sets for resource permissions. Also ensures that all folder editors and admins can create subfolders without needing any additional permissions. | Yes |
+| `newDashboardSharingComponent` | Enables the new sharing drawer design | |
+| `notificationBanner` | Enables the notification banner UI and API | Yes |
+| `pluginProxyPreserveTrailingSlash` | Preserve plugin proxy trailing slash. | |
+| `pinNavItems` | Enables pinning of nav items | Yes |
+| `openSearchBackendFlowEnabled` | Enables the backend query flow for Open Search datasource plugin | Yes |
+| `cloudWatchRoundUpEndTime` | Round up end time for metric queries to the next minute to avoid missing data | Yes |
+| `cloudwatchMetricInsightsCrossAccount` | Enables cross account observability for Cloudwatch Metric Insights query builder | Yes |
+| `singleTopNav` | Unifies the top search bar and breadcrumb bar into one | Yes |
+| `azureMonitorDisableLogLimit` | Disables the log limit restriction for Azure Monitor when true. The limit is enabled by default. | |
+| `preinstallAutoUpdate` | Enables automatic updates for pre-installed plugins | Yes |
+| `alertingUIOptimizeReducer` | Enables removing the reducer from the alerting UI when creating a new alert rule and using instant query | Yes |
## Public preview feature toggles
@@ -148,7 +148,6 @@ Experimental features might be changed or removed without prior notice.
| `alertStateHistoryLokiSecondary` | Enable Grafana to write alert state history to an external Loki instance in addition to Grafana annotations. |
| `alertStateHistoryLokiPrimary` | Enable a remote Loki instance as the primary source for state history reads. |
| `alertStateHistoryLokiOnly` | Disable Grafana alerts from emitting annotations when a remote Loki instance is available. |
-| `unifiedRequestLog` | Writes error logs to the request logger |
| `extraThemes` | Enables extra themes |
| `lokiPredefinedOperations` | Adds predefined query operations to Loki query editor |
| `pluginsFrontendSandbox` | Enables the plugins frontend sandbox |
@@ -189,6 +188,7 @@ Experimental features might be changed or removed without prior notice.
| `kubernetesFeatureToggles` | Use the kubernetes API for feature toggle management in the frontend |
| `newFolderPicker` | Enables the nested folder picker without having nested folders enabled |
| `onPremToCloudMigrationsAlerts` | Enables the migration of alerts and its child resources to your Grafana Cloud stack. Requires `onPremToCloudMigrations` to be enabled in conjunction. |
+| `onPremToCloudMigrationsAuthApiMig` | Enables the use of auth api instead of gcom for internal token services. Requires `onPremToCloudMigrations` to be enabled in conjunction. |
| `sqlExpressions` | Enables using SQL and DuckDB functions as Expressions. |
| `nodeGraphDotLayout` | Changed the layout algorithm for the node graph |
| `kubernetesAggregator` | Enable grafana's embedded kube-aggregator |
diff --git a/docs/sources/tutorials/alerting-get-started-pt2/index.md b/docs/sources/tutorials/alerting-get-started-pt2/index.md
index cd8804fb924..e0564de272c 100644
--- a/docs/sources/tutorials/alerting-get-started-pt2/index.md
+++ b/docs/sources/tutorials/alerting-get-started-pt2/index.md
@@ -217,16 +217,6 @@ Create a notification policy if you want to handle metrics returned by alert rul
The alert rule that you are about to create is meant to monitor web traffic page views. The objective is to explore what an alert instance is and how to leverage routing individual alert instances by using label matchers and notification policies.
-### Add a data source
-
-Grafana includes a [test data source](https://grafana.com/docs/grafana/latest/datasources/testdata/) that creates simulated time series data.
-
-1. In Grafana navigate to **Connections > Add new connection**.
-1. Search for **TestData**.
-1. Click **Add new data source**.
-1. Click **Save & test**.
-
- You should see a message confirming that the data source is working.
@@ -243,6 +233,8 @@ Make it short and descriptive as this will appear in your alert notification. Fo
In this section, we use the default options for Grafana-managed alert rule creation. The default options let us define the query, a expression (used to manipulate the data -- the `WHEN` field in the UI), and the condition that must be met for the alert to be triggered (in default mode is the threshold).
+Grafana includes a [test data source](https://grafana.com/docs/grafana/latest/datasources/testdata/) that creates simulated time series data. This data source is included in the demo environment for this tutorial. If you're working in Grafana Cloud or your own local Grafana instance, you can add the data source through the **Connections** menu.
+
1. Select **TestData** data source from the drop-down menu.
1. From **Scenario** select **CSV Content**.
1. In the Query editor, switch to **Code** mode by clicking the button on the right.
diff --git a/docs/sources/tutorials/alerting-get-started/index.md b/docs/sources/tutorials/alerting-get-started/index.md
index d43d7bebe69..4b832c334e9 100644
--- a/docs/sources/tutorials/alerting-get-started/index.md
+++ b/docs/sources/tutorials/alerting-get-started/index.md
@@ -189,15 +189,9 @@ Next, we establish an [alert rule](https://grafana.com/docs/grafana/latest/alert
In this section, we use the default options for Grafana-managed alert rule creation. The default options let us define the query, a expression (used to manipulate the data -- the `WHEN` field in the UI), and the condition that must be met for the alert to be triggered (in default mode is the threshold).
-1. Select the **Prometheus** data source from the drop-down menu.
-1. In the Query editor, switch to **Code** mode by clicking the button on the right.
-1. Enter the following query:
+Grafana includes a [test data source](https://grafana.com/docs/grafana/latest/datasources/testdata/) that creates simulated time series data. This data source is included in the demo environment for this tutorial. If you're working in Grafana Cloud or your own local Grafana instance, you can add the data source through the **Connections** menu.
- ```promql
- vector(1)
- ```
-
- In Prometheus, `vector(1)` is a special type of PromQL query that generates a constant vector. This is useful in testing and query manipulation, where you might need a constant value for calculations or comparisons. This query allows you to create an alert rule that is always firing.
+1. Select the **TestData** data source from the drop-down menu.
1. In the **Alert condition** section:
@@ -205,9 +199,9 @@ In this section, we use the default options for Grafana-managed alert rule creat
1. Click **Preview alert rule condition** to run the query.
- It should return a single sample with the value 1 at the current timestamp. And, since `1` is above `0`, the alert condition has been met, and the alert rule state is `Firing`.
+ It should return random time series data. The alert rule state should be `Firing`.
- {{< figure src="/media/docs/alerting/firing-alert-preview.png" max-width="1200px" caption="A preview of a firing alert" >}}
+ {{< figure src="/media/docs/alerting/random-walk-firing-alert-rule.png" max-width="1200px" caption="A preview of a firing alert" >}}
### Set evaluation behavior
diff --git a/docs/sources/tutorials/grafana-fundamentals/index.md b/docs/sources/tutorials/grafana-fundamentals/index.md
index fce27f6977e..20f9616fea8 100644
--- a/docs/sources/tutorials/grafana-fundamentals/index.md
+++ b/docs/sources/tutorials/grafana-fundamentals/index.md
@@ -392,24 +392,23 @@ To begin, let's set up a webhook contact point. Once we have a usable endpoint,
### Create a contact point for Grafana-managed alert rules
-In this step, we set up a new contact point. This contact point uses the _webhooks_ channel. In order to make this work, we also need an endpoint for our webhook channel to receive the alert notification. We can use [requestbin.com](https://requestbin.com) to quickly set up that test endpoint. This way we can make sure that our alert manager is actually sending a notification somewhere.
+In this step, we set up a new contact point. This contact point uses the _webhooks_ channel. In order to make this work, we also need an endpoint for our webhook channel to receive the alert notification. We can use [Webhook.site](https://webhook.site/) to quickly set up that test endpoint. This way we can make sure that our alert manager is actually sending a notification somewhere.
-1. Browse to [requestbin.com](https://requestbin.com).
-1. Under the **Create Request Bin** button, click the link to create a **public bin** instead.
-1. From Request Bin, copy the endpoint URL.
+1. Browse to [Webhook.site](https://webhook.site/).
+1. Copy Your unique URL.
-Your Request Bin is now waiting for the first request.
+Your webhook endpoint is now waiting for the first request.
-Next, let's configure a Contact Point in Grafana's Alerting UI to send notifications to our Request Bin.
+Next, let's configure a Contact Point in Grafana's Alerting UI to send notifications to our webhook endpoint.
1. Return to Grafana. In Grafana's sidebar, hover over the **Alerting** (bell) icon and then click **Manage Contact points**.
1. Click **+ Add contact point**.
-1. In **Name**, write **RequestBin**.
+1. In **Name**, write **Webhook**.
1. In **Integration**, choose **Webhook**.
-1. In **URL**, paste the endpoint to your request bin.
+1. In **URL**, paste the endpoint to your webhook endpoint.
-1. Click **Test**, and then click **Send test notification** to send a test alert notification to your request bin.
-1. Navigate back to the Request Bin you created earlier. On the left side, there's now a `POST /` entry. Click it to see what information Grafana sent.
+1. Click **Test**, and then click **Send test notification** to send a test alert notification to your webhook endpoint.
+1. Navigate back to the webhook endpoint you created earlier. On the left side, there's now a `POST /` entry. Click it to see what information Grafana sent.
1. Return to Grafana and click **Save contact point**.
We have now created a dummy webhook endpoint and created a new Alerting Contact Point in Grafana. Now we can create an alert rule and link it to this new channel.
@@ -424,24 +423,25 @@ Now that Grafana knows how to notify us, it's time to set up an alert rule:
1. In Grafana's sidebar, hover over the **Alerting** (bell) icon and then click **Alert rules**.
- In this tutorial, we use the default options for Grafana-managed alert rule creation. The default options let us define the query, a expression (used to manipulate the data -- the `WHEN` field in the UI), and the condition that must be met for the alert to be triggered (in default mode is the threshold).
+ In this tutorial, we use the advanced options for Grafana-managed alert rule creation. The advanced options let us define queries, expressions (used to manipulate the data), and the condition that must be met for the alert to be triggered (the default condition is the threshold).
1. Click **+ New alert rule**.
1. For **Section 1**, name the rule `fundamentals-test`.
-1. For **Section 2**, Find the **query A** box, and choose your Prometheus data source.
+1. For **Section 2**, toggle the **Advanced options** button.
+1. Find the **query A** box, and choose your Prometheus data source.
1. Enter the same Prometheus query that we used in our earlier panel:
```
sum(rate(tns_request_duration_seconds_count[5m])) by(route)
```
-1. Scroll down to bottom of section #2 and click the **Preview alert rule condition** button. You should see some data returned.
-1. Keep `Last` as the value for the reducer function (`WHEN`), and `0.2` as the threshold value. This is the value above which the alert rule should trigger. [You can read more about queries and conditions here](/docs/grafana/latest/alerting/fundamentals/alert-rules/queries-conditions/#expression-queries).
+1. Keep expressions **B** and **C** as they are. These expressions (Reduce and Threshold, respectively) are included by default when creating a new rule. Enter `0.2` as threshold value. You can read more about queries and conditions [here](/docs/grafana/latest/alerting/fundamentals/alert-rules/queries-conditions/#expression-queries).
+1. Scroll down to bottom of section #2 and click the **Preview** button. You should see some data returned.
1. In **Section 3**, in Folder, create a new folder, by clicking `New folder` and typing a name for the folder. This folder contains our alert rules. For example: `fundamentals`. Then, click `create`.
1. In the Evaluation group, repeat the above step to create a new one. Name it `fundamentals` too.
1. Choose an Evaluation interval (how often the alert rule are evaluated). For example, every `10s` (10 seconds).
1. Set the pending period. This is the time that a condition has to be met until the alert instance enters in Firing state and a notification is sent. Enter `0s`. For the purposes of this tutorial, the evaluation interval is intentionally short. This makes it easier to test. This setting makes Grafana wait until an alert instance has fired for a given time before Grafana sends the notification.
-1. In **Section 4**, choose **RequestBin** as the **Contact point**.
+1. In **Section 4**, choose **Webhook** as the **Contact point**.
1. Click **Save rule and exit** at the top of the page.
### Trigger a Grafana-managed alert rule
@@ -451,7 +451,7 @@ We have now configured an alert rule and a contact point. Now let's see if we ca
1. Browse to [localhost:8081](http://localhost:8081).
1. Add a new title and URL, repeatedly click the vote button, or refresh the page to generate a traffic spike.
-Once the query `sum(rate(tns_request_duration_seconds_count[5m])) by(route)` returns a value greater than `0.2` Grafana triggers our alert rule. Browse to the Request Bin we created earlier and find the sent Grafana alert notification with details and metadata.
+Once the query `sum(rate(tns_request_duration_seconds_count[5m])) by(route)` returns a value greater than `0.2` Grafana triggers our alert rule. Browse to the webhook endpoint we created earlier and find the sent Grafana alert notification with details and metadata.
diff --git a/kinds/dashboard/dashboard_kind.cue b/kinds/dashboard/dashboard_kind.cue
index 6a24fc92266..9ed6b5cc0c1 100644
--- a/kinds/dashboard/dashboard_kind.cue
+++ b/kinds/dashboard/dashboard_kind.cue
@@ -200,6 +200,8 @@ lineage: schemas: [{
current?: #VariableOption
// Whether multiple values can be selected or not from variable value list
multi?: bool | *false
+ // Allow custom values to be entered in the variable
+ allowCustomValue?: bool | *true
// Options that can be selected for a variable.
options?: [...#VariableOption]
// Options to config when to refresh a variable
diff --git a/package.json b/package.json
index c12722817d5..aab622b0ae3 100644
--- a/package.json
+++ b/package.json
@@ -224,7 +224,7 @@
"react-test-renderer": "18.2.0",
"redux-mock-store": "1.5.5",
"rimraf": "6.0.1",
- "rudder-sdk-js": "2.48.26",
+ "rudder-sdk-js": "2.48.29",
"sass": "1.80.7",
"sass-loader": "16.0.3",
"smtp-tester": "^2.1.0",
@@ -250,8 +250,8 @@
},
"dependencies": {
"@bsull/augurs": "^0.6.0",
- "@emotion/css": "11.13.4",
- "@emotion/react": "11.13.3",
+ "@emotion/css": "11.13.5",
+ "@emotion/react": "11.13.5",
"@fingerprintjs/fingerprintjs": "^3.4.2",
"@floating-ui/react": "0.26.28",
"@formatjs/intl-durationformat": "^0.6.0",
@@ -260,7 +260,7 @@
"@grafana/azure-sdk": "0.0.5",
"@grafana/data": "workspace:*",
"@grafana/e2e-selectors": "workspace:*",
- "@grafana/experimental": "2.1.2",
+ "@grafana/experimental": "2.1.4",
"@grafana/faro-core": "^1.3.6",
"@grafana/faro-web-sdk": "^1.3.6",
"@grafana/faro-web-tracing": "^1.8.2",
@@ -272,8 +272,8 @@
"@grafana/prometheus": "workspace:*",
"@grafana/runtime": "workspace:*",
"@grafana/saga-icons": "workspace:*",
- "@grafana/scenes": "5.25.0",
- "@grafana/scenes-react": "5.25.0",
+ "@grafana/scenes": "5.25.1",
+ "@grafana/scenes-react": "5.25.1",
"@grafana/schema": "workspace:*",
"@grafana/sql": "workspace:*",
"@grafana/ui": "workspace:*",
diff --git a/packages/grafana-data/src/field/__snapshots__/fieldOverrides.test.ts.snap b/packages/grafana-data/src/field/__snapshots__/fieldOverrides.test.ts.snap
new file mode 100644
index 00000000000..aea09b13dad
--- /dev/null
+++ b/packages/grafana-data/src/field/__snapshots__/fieldOverrides.test.ts.snap
@@ -0,0 +1,17 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`setFieldConfigDefaults applies the base threshold when one does not exist in the config 1`] = `
+{
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "red",
+ "value": -Infinity,
+ },
+ {
+ "color": "green",
+ "value": 50,
+ },
+ ],
+}
+`;
diff --git a/packages/grafana-data/src/field/fieldOverrides.test.ts b/packages/grafana-data/src/field/fieldOverrides.test.ts
index 0d16b66397b..0fd6e2d834e 100644
--- a/packages/grafana-data/src/field/fieldOverrides.test.ts
+++ b/packages/grafana-data/src/field/fieldOverrides.test.ts
@@ -730,6 +730,33 @@ describe('setFieldConfigDefaults', () => {
}
`);
});
+
+ it('applies the base threshold when one does not exist in the config', () => {
+ const defaultConfig: FieldConfig = {
+ thresholds: {
+ mode: ThresholdsMode.Absolute,
+ steps: [{ value: -Infinity, color: 'red' }],
+ },
+ };
+
+ const config: FieldConfig = {
+ thresholds: {
+ mode: ThresholdsMode.Absolute,
+ steps: [{ value: 50, color: 'green' }],
+ },
+ };
+
+ const context: FieldOverrideEnv = {
+ data: [],
+ field: { type: FieldType.number } as Field,
+ dataFrameIndex: 0,
+ fieldConfigRegistry: customFieldRegistry,
+ };
+
+ setFieldConfigDefaults(config, defaultConfig, context);
+
+ expect(config.thresholds).toMatchSnapshot();
+ });
});
describe('setDynamicConfigValue', () => {
diff --git a/packages/grafana-data/src/field/fieldOverrides.ts b/packages/grafana-data/src/field/fieldOverrides.ts
index 479f31155c6..0924a417231 100644
--- a/packages/grafana-data/src/field/fieldOverrides.ts
+++ b/packages/grafana-data/src/field/fieldOverrides.ts
@@ -2,7 +2,7 @@ import { isNumber, set, unset, get, cloneDeep } from 'lodash';
import { useMemo, useRef } from 'react';
import usePrevious from 'react-use/lib/usePrevious';
-import { VariableFormatID } from '@grafana/schema';
+import { ThresholdsMode, VariableFormatID } from '@grafana/schema';
import { compareArrayValues, compareDataFrameStructures } from '../dataframe/frameComparisons';
import { guessFieldTypeForField } from '../dataframe/processDataFrame';
@@ -347,6 +347,18 @@ export function setFieldConfigDefaults(config: FieldConfig, defaults: FieldConfi
// Combine the data source links and the panel default config links
config.links = [...config.links, ...defaults.links];
}
+
+ // if we have a base threshold set by default but not on the config, we need to merge it in
+ const defaultBaseStep =
+ defaults?.thresholds?.mode === ThresholdsMode.Absolute &&
+ defaults.thresholds?.steps.find((step) => step.value === -Infinity);
+ if (
+ config.thresholds?.mode === ThresholdsMode.Absolute &&
+ !config.thresholds.steps.some((step) => step.value === -Infinity) &&
+ defaultBaseStep
+ ) {
+ config.thresholds.steps = [defaultBaseStep, ...config.thresholds.steps];
+ }
for (const fieldConfigProperty of context.fieldConfigRegistry.list()) {
if (fieldConfigProperty.isCustom && !config.custom) {
config.custom = {};
diff --git a/packages/grafana-data/src/types/featureToggles.gen.ts b/packages/grafana-data/src/types/featureToggles.gen.ts
index d4725a2ddfc..cffab8c459a 100644
--- a/packages/grafana-data/src/types/featureToggles.gen.ts
+++ b/packages/grafana-data/src/types/featureToggles.gen.ts
@@ -22,7 +22,6 @@ export interface FeatureToggles {
['live-service-web-worker']?: boolean;
queryOverLive?: boolean;
panelTitleSearch?: boolean;
- publicDashboards?: boolean;
publicDashboardsEmailSharing?: boolean;
publicDashboardsScene?: boolean;
lokiExperimentalStreaming?: boolean;
@@ -159,6 +158,7 @@ export interface FeatureToggles {
jitterAlertRulesWithinGroups?: boolean;
onPremToCloudMigrations?: boolean;
onPremToCloudMigrationsAlerts?: boolean;
+ onPremToCloudMigrationsAuthApiMig?: boolean;
alertingSaveStatePeriodic?: boolean;
promQLScope?: boolean;
logQLScope?: boolean;
diff --git a/packages/grafana-data/src/types/templateVars.ts b/packages/grafana-data/src/types/templateVars.ts
index b8d0de9092a..e31319b9675 100644
--- a/packages/grafana-data/src/types/templateVars.ts
+++ b/packages/grafana-data/src/types/templateVars.ts
@@ -70,6 +70,7 @@ export interface AdHocVariableModel extends BaseVariableModel {
* Static keys that override any dynamic keys from the datasource.
*/
defaultKeys?: MetricFindValue[];
+ allowCustomValue?: boolean;
}
export interface GroupByVariableModel extends VariableWithOptions {
@@ -127,6 +128,7 @@ export interface VariableWithMultiSupport extends VariableWithOptions {
multi: boolean;
includeAll: boolean;
allValue?: string | null;
+ allowCustomValue?: boolean;
}
export interface VariableWithOptions extends BaseVariableModel {
diff --git a/packages/grafana-e2e-selectors/src/selectors/pages.ts b/packages/grafana-e2e-selectors/src/selectors/pages.ts
index 92f73b85303..148f4fd56e2 100644
--- a/packages/grafana-e2e-selectors/src/selectors/pages.ts
+++ b/packages/grafana-e2e-selectors/src/selectors/pages.ts
@@ -414,6 +414,9 @@ export const versionedPages = {
generalHideSelectV2: {
[MIN_GRAFANA_VERSION]: 'data-testid Variable editor Form Hide select',
},
+ selectionOptionsAllowCustomValueSwitch: {
+ [MIN_GRAFANA_VERSION]: 'data-testid Variable editor Form Allow Custom Value switch',
+ },
selectionOptionsMultiSwitch: {
'10.4.0': 'data-testid Variable editor Form Multi switch',
[MIN_GRAFANA_VERSION]: 'Variable editor Form Multi switch',
diff --git a/packages/grafana-flamegraph/package.json b/packages/grafana-flamegraph/package.json
index ace41d3a1be..0edf8356a2f 100644
--- a/packages/grafana-flamegraph/package.json
+++ b/packages/grafana-flamegraph/package.json
@@ -43,7 +43,7 @@
"not IE 11"
],
"dependencies": {
- "@emotion/css": "11.13.4",
+ "@emotion/css": "11.13.5",
"@grafana/data": "11.4.0-pre",
"@grafana/ui": "11.4.0-pre",
"@leeoniya/ufuzzy": "1.0.16",
diff --git a/packages/grafana-o11y-ds-frontend/package.json b/packages/grafana-o11y-ds-frontend/package.json
index 577a6adcd29..543d303bd14 100644
--- a/packages/grafana-o11y-ds-frontend/package.json
+++ b/packages/grafana-o11y-ds-frontend/package.json
@@ -17,10 +17,10 @@
"typecheck": "tsc --emitDeclarationOnly false --noEmit"
},
"dependencies": {
- "@emotion/css": "11.13.4",
+ "@emotion/css": "11.13.5",
"@grafana/data": "11.4.0-pre",
"@grafana/e2e-selectors": "11.4.0-pre",
- "@grafana/experimental": "2.1.2",
+ "@grafana/experimental": "2.1.4",
"@grafana/runtime": "11.4.0-pre",
"@grafana/schema": "11.4.0-pre",
"@grafana/ui": "11.4.0-pre",
diff --git a/packages/grafana-prometheus/package.json b/packages/grafana-prometheus/package.json
index 682bdbea469..9a45874a415 100644
--- a/packages/grafana-prometheus/package.json
+++ b/packages/grafana-prometheus/package.json
@@ -36,11 +36,11 @@
"postpack": "mv package.json.bak package.json"
},
"dependencies": {
- "@emotion/css": "11.13.4",
+ "@emotion/css": "11.13.5",
"@floating-ui/react": "0.26.28",
"@grafana/data": "11.4.0-pre",
- "@grafana/experimental": "2.1.2",
- "@grafana/faro-web-sdk": "1.12.1",
+ "@grafana/experimental": "2.1.4",
+ "@grafana/faro-web-sdk": "1.12.2",
"@grafana/runtime": "11.4.0-pre",
"@grafana/schema": "11.4.0-pre",
"@grafana/ui": "11.4.0-pre",
diff --git a/packages/grafana-runtime/src/services/LocationService.tsx b/packages/grafana-runtime/src/services/LocationService.tsx
index 6a148b15482..f3a26c5b110 100644
--- a/packages/grafana-runtime/src/services/LocationService.tsx
+++ b/packages/grafana-runtime/src/services/LocationService.tsx
@@ -1,5 +1,6 @@
import * as H from 'history';
import React, { useContext } from 'react';
+import { BehaviorSubject, Observable } from 'rxjs';
import { deprecationWarning, UrlQueryMap, urlUtil } from '@grafana/data';
import { attachDebugger, createLogger } from '@grafana/ui';
@@ -21,6 +22,7 @@ export interface LocationService {
getHistory: () => H.History;
getSearch: () => URLSearchParams;
getSearchObject: () => UrlQueryMap;
+ getLocationObservable: () => Observable;
/**
* This is from the old LocationSrv interface
@@ -31,6 +33,7 @@ export interface LocationService {
/** @internal */
export class HistoryWrapper implements LocationService {
private readonly history: H.History;
+ private locationObservable: BehaviorSubject;
constructor(history?: H.History) {
// If no history passed create an in memory one if being called from test
@@ -40,6 +43,12 @@ export class HistoryWrapper implements LocationService {
? H.createMemoryHistory({ initialEntries: ['/'] })
: H.createBrowserHistory({ basename: config.appSubUrl ?? '/' }));
+ this.locationObservable = new BehaviorSubject(this.history.location);
+
+ this.history.listen((location) => {
+ this.locationObservable.next(location);
+ });
+
this.partial = this.partial.bind(this);
this.push = this.push.bind(this);
this.replace = this.replace.bind(this);
@@ -48,6 +57,10 @@ export class HistoryWrapper implements LocationService {
this.getLocation = this.getLocation.bind(this);
}
+ getLocationObservable() {
+ return this.locationObservable.asObservable();
+ }
+
getHistory() {
return this.history;
}
diff --git a/packages/grafana-runtime/src/services/SidecarContext_EXPERIMENTAL.ts b/packages/grafana-runtime/src/services/SidecarContext_EXPERIMENTAL.ts
index 9f8d6e42d9e..05f4579d0ba 100644
--- a/packages/grafana-runtime/src/services/SidecarContext_EXPERIMENTAL.ts
+++ b/packages/grafana-runtime/src/services/SidecarContext_EXPERIMENTAL.ts
@@ -1,15 +1,12 @@
import { createContext, useContext } from 'react';
import { useObservable } from 'react-use';
-import { locationService as mainLocationService } from './LocationService';
import { SidecarService_EXPERIMENTAL, sidecarServiceSingleton_EXPERIMENTAL } from './SidecarService_EXPERIMENTAL';
export const SidecarContext_EXPERIMENTAL = createContext(
sidecarServiceSingleton_EXPERIMENTAL
);
-const HIDDEN_ROUTES = ['/login'];
-
/**
* This is the main way to interact with the sidecar service inside a react context. It provides a wrapper around the
* service props so that even though they are observables we just pass actual values to the components.
@@ -27,32 +24,25 @@ export function useSidecar_EXPERIMENTAL() {
const initialContext = useObservable(service.initialContextObservable, service.initialContext);
const activePluginId = useObservable(service.activePluginIdObservable, service.activePluginId);
const locationService = service.getLocationService();
- const forceHidden = HIDDEN_ROUTES.includes(mainLocationService.getLocation().pathname);
return {
- activePluginId: forceHidden ? undefined : activePluginId,
- initialContext: forceHidden ? undefined : initialContext,
+ activePluginId,
+ initialContext,
locationService,
// TODO: currently this allows anybody to open any app, in the future we should probably scope this to the
// current app but that means we will need to incorporate this better into the plugin platform APIs which
// we will do once the functionality is reasonably stable
openApp: (pluginId: string, context?: unknown) => {
- if (forceHidden) {
- return;
- }
return service.openApp(pluginId, context);
},
openAppV2: (pluginId: string, path?: string) => {
- if (forceHidden) {
- return;
- }
return service.openAppV2(pluginId, path);
},
+ openAppV3: (options: { pluginId: string; path?: string; follow?: boolean }) => {
+ return service.openAppV3(options);
+ },
closeApp: () => service.closeApp(),
isAppOpened: (pluginId: string) => {
- if (forceHidden) {
- return false;
- }
return service.isAppOpened(pluginId);
},
};
diff --git a/packages/grafana-runtime/src/services/SidecarService_EXPERIMENTAL.test.ts b/packages/grafana-runtime/src/services/SidecarService_EXPERIMENTAL.test.ts
index afa9f3aaf18..b41e0f7f70e 100644
--- a/packages/grafana-runtime/src/services/SidecarService_EXPERIMENTAL.test.ts
+++ b/packages/grafana-runtime/src/services/SidecarService_EXPERIMENTAL.test.ts
@@ -1,17 +1,28 @@
+import * as H from 'history';
+
import { config } from '../config';
+import { HistoryWrapper } from './LocationService';
import { SidecarService_EXPERIMENTAL } from './SidecarService_EXPERIMENTAL';
describe('SidecarService_EXPERIMENTAL', () => {
- beforeEach(() => {
+ let mainLocationService: HistoryWrapper;
+ let sidecarService: SidecarService_EXPERIMENTAL;
+
+ beforeAll(() => {
config.featureToggles.appSidecar = true;
});
- afterEach(() => {
- config.featureToggles.appSidecar = undefined;
+
+ afterAll(() => {
+ config.featureToggles.appSidecar = false;
+ });
+
+ beforeEach(() => {
+ mainLocationService = new HistoryWrapper(H.createMemoryHistory({ initialEntries: ['/explore'] }));
+ sidecarService = new SidecarService_EXPERIMENTAL(mainLocationService);
});
it('has the correct state after opening and closing an app', () => {
- const sidecarService = new SidecarService_EXPERIMENTAL();
sidecarService.openApp('pluginId', { filter: 'test' });
expect(sidecarService.activePluginId).toBe('pluginId');
@@ -25,7 +36,6 @@ describe('SidecarService_EXPERIMENTAL', () => {
});
it('has the correct state after opening and closing an app v2', () => {
- const sidecarService = new SidecarService_EXPERIMENTAL();
sidecarService.openAppV2('pluginId', '/test');
expect(sidecarService.activePluginId).toBe('pluginId');
@@ -37,8 +47,19 @@ describe('SidecarService_EXPERIMENTAL', () => {
expect(sidecarService.getLocationService().getLocation().pathname).toBe('/');
});
+ it('has the correct state after opening and closing an app v3', () => {
+ sidecarService.openAppV3({ pluginId: 'pluginId', path: '/test' });
+
+ expect(sidecarService.activePluginId).toBe('pluginId');
+ expect(sidecarService.getLocationService().getLocation().pathname).toBe('/a/pluginId/test');
+
+ sidecarService.closeApp();
+ expect(sidecarService.activePluginId).toBe(undefined);
+ expect(sidecarService.initialContext).toBe(undefined);
+ expect(sidecarService.getLocationService().getLocation().pathname).toBe('/');
+ });
+
it('reports correct opened state', () => {
- const sidecarService = new SidecarService_EXPERIMENTAL();
expect(sidecarService.isAppOpened('pluginId')).toBe(false);
sidecarService.openApp('pluginId');
@@ -49,7 +70,6 @@ describe('SidecarService_EXPERIMENTAL', () => {
});
it('reports correct opened state v2', () => {
- const sidecarService = new SidecarService_EXPERIMENTAL();
expect(sidecarService.isAppOpened('pluginId')).toBe(false);
sidecarService.openAppV2('pluginId');
@@ -58,4 +78,46 @@ describe('SidecarService_EXPERIMENTAL', () => {
sidecarService.closeApp();
expect(sidecarService.isAppOpened('pluginId')).toBe(false);
});
+
+ it('reports correct opened state v3', () => {
+ expect(sidecarService.isAppOpened('pluginId')).toBe(false);
+
+ sidecarService.openAppV3({ pluginId: 'pluginId' });
+ expect(sidecarService.isAppOpened('pluginId')).toBe(true);
+
+ sidecarService.closeApp();
+ expect(sidecarService.isAppOpened('pluginId')).toBe(false);
+ });
+
+ it('autocloses on not allowed routes', () => {
+ sidecarService.openAppV3({ pluginId: 'pluginId' });
+ expect(sidecarService.isAppOpened('pluginId')).toBe(true);
+ mainLocationService.push('/config');
+
+ expect(sidecarService.isAppOpened('pluginId')).toBe(false);
+ });
+
+ it('autocloses on when changing route', () => {
+ sidecarService.openAppV3({ pluginId: 'pluginId' });
+ expect(sidecarService.isAppOpened('pluginId')).toBe(true);
+ mainLocationService.push('/a/other-app');
+
+ expect(sidecarService.isAppOpened('pluginId')).toBe(false);
+ });
+
+ it('does not autocloses when set to follow', () => {
+ sidecarService.openAppV3({ pluginId: 'pluginId', follow: true });
+ expect(sidecarService.isAppOpened('pluginId')).toBe(true);
+ mainLocationService.push('/a/other-app');
+
+ expect(sidecarService.isAppOpened('pluginId')).toBe(true);
+ });
+
+ it('autocloses on not allowed routes when set to follow', () => {
+ sidecarService.openAppV3({ pluginId: 'pluginId', follow: true });
+ expect(sidecarService.isAppOpened('pluginId')).toBe(true);
+ mainLocationService.push('/config');
+
+ expect(sidecarService.isAppOpened('pluginId')).toBe(false);
+ });
});
diff --git a/packages/grafana-runtime/src/services/SidecarService_EXPERIMENTAL.ts b/packages/grafana-runtime/src/services/SidecarService_EXPERIMENTAL.ts
index 98c4a1ff1a0..2656f1d7448 100644
--- a/packages/grafana-runtime/src/services/SidecarService_EXPERIMENTAL.ts
+++ b/packages/grafana-runtime/src/services/SidecarService_EXPERIMENTAL.ts
@@ -5,7 +5,17 @@ import { BehaviorSubject, map, Observable } from 'rxjs';
import { reportInteraction } from '../analytics/utils';
import { config } from '../config';
-import { HistoryWrapper, LocationService, locationService } from './LocationService';
+import { HistoryWrapper, locationService as mainLocationService, LocationService } from './LocationService';
+
+// Only allow sidecar to be opened on these routes. It does not seem to make sense to keep the sidecar opened on
+// config/admin pages for example.
+// At this moment let's be restrictive about where the sidecar can show and add more routes if there is a need.
+const ALLOW_ROUTES = [
+ /(^\/d\/)/, // dashboards
+ /^\/explore/, // explore + explore metrics
+ /^\/a\/[^\/]+/, // app plugins
+ /^\/alerting/,
+];
/**
* This is a service that handles state and operation of a sidecar feature (sideview to render a second app in grafana).
@@ -19,15 +29,26 @@ import { HistoryWrapper, LocationService, locationService } from './LocationServ
*/
export class SidecarService_EXPERIMENTAL {
private _initialContext: BehaviorSubject;
- private memoryLocationService: LocationService;
- private history: LocationStorageHistory;
- constructor() {
+ private sidecarLocationService: LocationService;
+ private mainLocationService: LocationService;
+
+ // If true we don't close the sidecar when user navigates to another app or part of Grafana from where the sidecar
+ // was opened.
+ private follow = false;
+
+ // Keep track of where the sidecar was originally opened for autoclose behaviour.
+ private mainLocationWhenOpened: string | undefined;
+
+ private mainOnAllowedRoute = false;
+
+ constructor(mainLocationService: LocationService) {
this._initialContext = new BehaviorSubject(undefined);
- // We need a local ref for this so we can tap into the location changes and drive rerendering of components based
- // on it without having a parent Router.
- this.history = createLocationStorageHistory({ storageKey: 'grafana.sidecar.history' });
- this.memoryLocationService = new HistoryWrapper(this.history);
+ this.mainLocationService = mainLocationService;
+ this.sidecarLocationService = new HistoryWrapper(
+ createLocationStorageHistory({ storageKey: 'grafana.sidecar.history' })
+ );
+ this.handleMainLocationChanges();
}
private assertFeatureEnabled() {
@@ -39,6 +60,48 @@ export class SidecarService_EXPERIMENTAL {
return true;
}
+ private updateMainLocationWhenOpened() {
+ const pathname = this.mainLocationService.getLocation().pathname;
+ for (const route of ALLOW_ROUTES) {
+ const match = pathname.match(route)?.[0];
+ if (match) {
+ this.mainLocationWhenOpened = match;
+ return;
+ }
+ }
+ }
+
+ /**
+ * Every time the main location changes we check if we should keep the sidecar open or close it based on list
+ * of allowed routes and also based on the follow flag when opening the app.
+ */
+ private handleMainLocationChanges() {
+ this.mainOnAllowedRoute = ALLOW_ROUTES.some((prefix) =>
+ this.mainLocationService.getLocation().pathname.match(prefix)
+ );
+
+ this.mainLocationService.getLocationObservable().subscribe((location) => {
+ if (!this.activePluginId) {
+ return;
+ }
+ this.mainOnAllowedRoute = ALLOW_ROUTES.some((prefix) => location.pathname.match(prefix));
+
+ if (!this.mainOnAllowedRoute) {
+ this.closeApp();
+ return;
+ }
+
+ // We check if we moved to some other app or part of grafana from where we opened the sidecar.
+ const isTheSameLocation = Boolean(
+ this.mainLocationWhenOpened && location.pathname.startsWith(this.mainLocationWhenOpened)
+ );
+
+ if (!(isTheSameLocation || this.follow)) {
+ this.closeApp();
+ }
+ });
+ }
+
/**
* Get current app id of the app in sidecar. This is most probably provisional. In the future
* this should be driven by URL addressing so that routing for the apps don't change. Useful just internally
@@ -47,7 +110,7 @@ export class SidecarService_EXPERIMENTAL {
* @experimental
*/
get activePluginIdObservable() {
- return this.history.getLocationObservable().pipe(
+ return this.sidecarLocationService.getLocationObservable().pipe(
map((val) => {
return getPluginIdFromUrl(val?.pathname || '');
})
@@ -75,11 +138,11 @@ export class SidecarService_EXPERIMENTAL {
* @experimental
*/
get activePluginId() {
- return getPluginIdFromUrl(this.memoryLocationService.getLocation().pathname);
+ return getPluginIdFromUrl(this.sidecarLocationService.getLocation().pathname);
}
getLocationService() {
- return this.memoryLocationService;
+ return this.sidecarLocationService;
}
/**
@@ -88,26 +151,41 @@ export class SidecarService_EXPERIMENTAL {
* @experimental
*/
openApp(pluginId: string, context?: unknown) {
- if (!this.assertFeatureEnabled()) {
+ if (!(this.assertFeatureEnabled() && this.mainOnAllowedRoute)) {
return;
}
this._initialContext.next(context);
- this.memoryLocationService.push({ pathname: `/a/${pluginId}` });
-
- reportInteraction('sidecar_service_open_app', { pluginId, version: 1 });
+ this.openAppV3({ pluginId, follow: false });
}
/**
* Opens an app in a sidecar. You can also relative path inside the app to open.
+ * @deprecated
* @experimental
*/
openAppV2(pluginId: string, path?: string) {
- if (!this.assertFeatureEnabled()) {
+ this.openAppV3({ pluginId, path, follow: false });
+ }
+
+ /**
+ * Opens an app in a sidecar. You can also relative path inside the app to open.
+ * @param options.pluginId Plugin ID of the app to open
+ * @param options.path Relative path inside the app to open
+ * @param options.follow If true, the sidecar will stay open even if the main location change to another app or
+ * Grafana section
+ *
+ * @experimental
+ */
+ openAppV3(options: { pluginId: string; path?: string; follow?: boolean }) {
+ if (!(this.assertFeatureEnabled() && this.mainOnAllowedRoute)) {
return;
}
- this.memoryLocationService.push({ pathname: `/a/${pluginId}${path || ''}` });
- reportInteraction('sidecar_service_open_app', { pluginId, version: 2 });
+ this.follow = options.follow || false;
+
+ this.updateMainLocationWhenOpened();
+ this.sidecarLocationService.push({ pathname: `/a/${options.pluginId}${options.path || ''}` });
+ reportInteraction('sidecar_service_open_app', { pluginId: options.pluginId, follow: options.follow });
}
/**
@@ -118,8 +196,10 @@ export class SidecarService_EXPERIMENTAL {
return;
}
+ this.follow = false;
+ this.mainLocationWhenOpened = undefined;
this._initialContext.next(undefined);
- this.memoryLocationService.replace({ pathname: '/' });
+ this.sidecarLocationService.replace({ pathname: '/' });
reportInteraction('sidecar_service_close_app');
}
@@ -160,7 +240,7 @@ function getPluginIdFromUrl(url: string) {
function getMainAppPluginId() {
// TODO: not great but we have to get a handle on the other locationService used for the main view and easiest way
// right now is through this global singleton
- const { pathname } = locationService.getLocation();
+ const { pathname } = mainLocationService.getLocation();
// A naive way to sort of simulate core features being an app and having an appID
let mainApp = getPluginIdFromUrl(pathname);
@@ -258,4 +338,4 @@ function createLocationStorageHistory(options: LocalStorageHistoryOptions): Loca
};
}
-export const sidecarServiceSingleton_EXPERIMENTAL = new SidecarService_EXPERIMENTAL();
+export const sidecarServiceSingleton_EXPERIMENTAL = new SidecarService_EXPERIMENTAL(mainLocationService);
diff --git a/packages/grafana-schema/src/raw/dashboard/x/dashboard_types.gen.ts b/packages/grafana-schema/src/raw/dashboard/x/dashboard_types.gen.ts
index a67ab34ae38..2a0a2de17ba 100644
--- a/packages/grafana-schema/src/raw/dashboard/x/dashboard_types.gen.ts
+++ b/packages/grafana-schema/src/raw/dashboard/x/dashboard_types.gen.ts
@@ -130,6 +130,10 @@ export interface VariableModel {
* Custom all value
*/
allValue?: string;
+ /**
+ * Allow custom values to be entered in the variable
+ */
+ allowCustomValue?: boolean;
/**
* Shows current selected variable text/value on the dashboard
*/
@@ -194,6 +198,7 @@ export interface VariableModel {
}
export const defaultVariableModel: Partial = {
+ allowCustomValue: true,
includeAll: false,
multi: false,
options: [],
diff --git a/packages/grafana-sql/package.json b/packages/grafana-sql/package.json
index 611de96aad4..e86d2e86918 100644
--- a/packages/grafana-sql/package.json
+++ b/packages/grafana-sql/package.json
@@ -14,10 +14,10 @@
"typecheck": "tsc --emitDeclarationOnly false --noEmit"
},
"dependencies": {
- "@emotion/css": "11.13.4",
+ "@emotion/css": "11.13.5",
"@grafana/data": "11.4.0-pre",
"@grafana/e2e-selectors": "11.4.0-pre",
- "@grafana/experimental": "2.1.2",
+ "@grafana/experimental": "2.1.4",
"@grafana/runtime": "11.4.0-pre",
"@grafana/ui": "11.4.0-pre",
"@react-awesome-query-builder/ui": "6.6.3",
diff --git a/packages/grafana-ui/package.json b/packages/grafana-ui/package.json
index bbf2eda4c06..9b3f5d41a0e 100644
--- a/packages/grafana-ui/package.json
+++ b/packages/grafana-ui/package.json
@@ -47,9 +47,9 @@
"not IE 11"
],
"dependencies": {
- "@emotion/css": "11.13.4",
- "@emotion/react": "11.13.3",
- "@emotion/serialize": "1.3.2",
+ "@emotion/css": "11.13.5",
+ "@emotion/react": "11.13.5",
+ "@emotion/serialize": "1.3.3",
"@floating-ui/react": "0.26.28",
"@grafana/data": "11.4.0-pre",
"@grafana/e2e-selectors": "11.4.0-pre",
diff --git a/packages/grafana-ui/src/components/Table/ExpandedRow.tsx b/packages/grafana-ui/src/components/Table/ExpandedRow.tsx
index a7e8f56f767..44e7b2cf292 100644
--- a/packages/grafana-ui/src/components/Table/ExpandedRow.tsx
+++ b/packages/grafana-ui/src/components/Table/ExpandedRow.tsx
@@ -36,6 +36,8 @@ export function ExpandedRow({ tableStyles, nestedData, rowIndex, width, cellHeig
paddingLeft: EXPANDER_WIDTH,
position: 'absolute',
top,
+ backgroundColor: theme.colors.background.primary,
+ color: theme.colors.text.primary,
};
top += height + theme.spacing.gridSize;
diff --git a/packages/grafana-ui/src/components/Table/RowsList.tsx b/packages/grafana-ui/src/components/Table/RowsList.tsx
index 39479e91874..76ffe7770d4 100644
--- a/packages/grafana-ui/src/components/Table/RowsList.tsx
+++ b/packages/grafana-ui/src/components/Table/RowsList.tsx
@@ -286,6 +286,7 @@ export const RowsList = (props: RowsListProps) => {
const { bgColor, textColor } = rowBg(row.index);
style.background = bgColor;
style.color = textColor;
+ style.borderLeft = `2px solid ${bgColor}`;
}
// If there's a text wrapping field we set the height of it here
diff --git a/packages/grafana-ui/src/options/builder/axis.tsx b/packages/grafana-ui/src/options/builder/axis.tsx
index 7e7730bfcb3..2e08654298c 100644
--- a/packages/grafana-ui/src/options/builder/axis.tsx
+++ b/packages/grafana-ui/src/options/builder/axis.tsx
@@ -10,6 +10,7 @@ import { AxisColorMode, AxisConfig, AxisPlacement, ScaleDistribution, ScaleDistr
import { Field } from '../../components/Forms/Field';
import { RadioButtonGroup } from '../../components/Forms/RadioButtonGroup/RadioButtonGroup';
import { Input } from '../../components/Input/Input';
+import { Stack } from '../../components/Layout/Stack/Stack';
import { Select } from '../../components/Select/Select';
import { graphFieldOptions } from '../../components/uPlot/config';
@@ -163,21 +164,20 @@ const LOG_DISTRIBUTION_OPTIONS: Array> = [
export const ScaleDistributionEditor = ({ value, onChange }: StandardEditorProps) => {
const type = value?.type ?? ScaleDistribution.Linear;
const log = value?.log ?? 2;
+
return (
- <>
-