* [LDAP] Disable removed users on login (#74016)
* manual backport of #74016 on legacy code
* LDAP: Fix active sync with large quantities of users (#73834)
* Fix authenticate user test
* Update all use of docs/shared in Grafana to use keyword arguments
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Add version inference to remaining Grafana docs/shared usage
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
---------
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Docker: Add musl as a ubuntu dependency (#74127)
Add musl as a ubuntu dependency
(cherry picked from commit 364ca3daa0)
Co-authored-by: Kevin Minehart <kmineh0151@gmail.com>
CI: Mount /root/.docker/ dir in authenticate-gcr step (#73977)
Mount /root/.docker/ dir
(cherry picked from commit eea4adea29)
# Conflicts:
# .drone.yml
Sync-mirror GHA updates (#73504)
fixing sync-mirror run-name and altering concurrency to use branch name
(cherry picked from commit 4047cdb213)
Co-authored-by: Ricky Whitaker <ricky.whitaker@grafana.com>
Grafana versioning: Remove `pre` suffix from Grafana version (#73357)
* Remove pre suffix from version
* Fix tests
(cherry picked from commit 0aba319ea0)
Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
* Update _index.md (#72068)
* Update _index.md
Edits to the "Set up image rendering" doc.
1. First section, "Set up Image Rendering," last paragraph:
"You can also render a PNG by clicking hovering..." -- I removed "clicking" from that sentence.
2. "Alerting and Render Limits" section, link for "concurrent_render_limit" takes you to the page but not the section. This seems to be the case for all section links on this "Configure Grafana" page. I'm not sure how to fix it but switched from a relative link to a full path to see if that would help.
3. "Install Grafana Image Renderer Plugin," the link goes to the plugin overview page instead of the installation page. I tried adding the full path to see if that would go to the installation tab.
4. "Configuration" section, the same as the second edit I made, the first link, "Grafana configuration file," goes to the page but not the section link. I switched the relative path to a full path to see if it would work.
5. "Security" section, the very last sentence has the same Grafana configuration page link that goes to the correct page but not the correct section, "Grafana configuration" for the renderer token section. Same as previous ones, I switched out the relative path for the full path.
6. "Start browser with additional arguments," the second link in the first paragraph that goes to Puppeteer list of Chromium flags went to a 404 page. I couldn't figure out where they had moved it so I found a different site with a list of default flags and used that link instead.
* corrects links
* updates links
* fixes anchor link
---------
Co-authored-by: Chris Moyer <chris.moyer@grafana.com>
(cherry picked from commit b88a321ad2)
* Apply suggestions from code review
---------
Co-authored-by: Eva <ebuchala@gmail.com>
Docs: remove references to `groups_attribute_path` for Okta and GitLab docs (#72588)
remove references to groups_attribute_path for Okta and GitLab
(cherry picked from commit b96d6e2c8d)
CI: Make RGM the main pipeline for prerelease (#72295)
* Make RGM the main pipeline for prerelease
* Use grafana/grafana-build:dev-bd41660
* Use grafana/grafana-build:dev-fda506a
* Fix destination url
* Update vault secrets
* Move bucket path to environment
* Use grafana/grafana-build:dev-2f36afa
* Revert to grafana/grafana-build:main
* Add repo to rgm_main trigger
(cherry picked from commit 971f5f14be)
Co-authored-by: Guilherme Caulada <guilherme.caulada@grafana.com>
CI: use the base64 key in the windows installer steps (#72372)
use the base64 key in the windows installer steps
(cherry picked from commit 0c2b2219bb)
Update _index.md (#71400)
* Update _index.md
Added missing hyperlink for high availability and a small typo
* updates link
---------
Co-authored-by: Chris Moyer <chris.moyer@grafana.com>
(cherry picked from commit 4e50115d95)
Co-authored-by: Usman Ahmad <usman.ahmad@grafana.com>
* CI: Try setting the vault secret for 'grafana_api_key' (#71981)
* Try setting the vault secret
* Maybe?
* forgot .drone.yml
* CI: Use GCP keys in vault and not drone secrets (#72023)
* CI: Run only Grafana builds on RGM for grafana/grafana (#72144)
* Run only OSS builds on RGM for grafana/grafana
* Update script name
* Ignore windows step failure for RGM
---------
Co-authored-by: Guilherme Caulada <guilherme.caulada@grafana.com>
AuthNZ documentation revamp (#62581)
* init for base branch
* Add authnz code ownership
* Fix docs ownsership path
* docs revamp: Plan IAM strategy (#62582)
* Add planning page
* Add teams definition
* Expand on planning and benefits
* Add reasons to organize users
* Add description of User Teams
* Add Grafana organizations info
* Add a section between Teams and Orgs
* Add a section for external systems
* planning your role strategy
* Add service account documentation
* Add Auth Setup to index sidebar
* Address PR comments
* Add planning for API keys
* Add team and org sync
* Docs: role and permission section for planning docs (#64702)
* docs revamp: Service accounts (#63710)
* docs revamp: Add new documentation to sidebar index (#66104)
* docs revamp: synchronisation planning (#66409)
* Docs: api keys (#64803)
* Remove personal access tokens section
* Move auth integration planning page
* Remove auth folder
* Restore codeowners file
* reword and update info on user management and grouping
* Rename iam strategy page
* extend the section on teams and organizations
* Rename planning your IAM section
* Move to administration section
* Add definition for role sync
* Relocate planning
---------
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
(cherry picked from commit 63346674e6)
Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>
* Auth: update generic OAuth documentation (#70330)
* update generic OAuth docs
* some more fixes and corrections
* update examples and sync sections
* fix a link
* linting
* formatting and adding more links to OAuth integrations
* add a section with config walkthrough
* fix link
* move examples to the end of the doc
* extend role mapping
* small improvements
* add a before you begin section, clean up steps, remove some text
* remove unnecessary section
* merge main 2
* OAuth -> OAuth2
* remove Centrify example because it's likely outdated
* add shared intro content
* indentation
* add refresh token to tasks, clean up more sections
* linting
* linting
* Apply suggestions from code review
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-security/configure-authentication/generic-oauth/index.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* indentation and small descriptions under headings
* add a table for config options
* clean up more sections
* rewrite email address section
* rewriting login and display name sections, plus adding line breaks
* clean up more sections
* update role mapping section
* indentation again
* update section names
* incorporates final edits
* Apply suggestions from code review
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* pr feedback
* Apply suggestions from code review
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* PR feedback: rewording
---------
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Co-authored-by: Chris Moyer <chris.moyer@grafana.com>
(cherry picked from commit 276c63a656)
* linting
---------
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
Plugins: Only configure plugin proxy transport once (#71735)
only configure plugin proxy transport once
(cherry picked from commit b59ca7fb22)
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
CI: Re-enable milestone-check (#71718)
This will hopefully resolve stuck PRs until we find a better way to
disable that check.
(cherry picked from commit 44b55a1ca6)
Co-authored-by: Horst Gutmann <horst.gutmann@grafana.com>
Chore: Add auto-milestone workflow for pull-requests (#71177)
This adds a new auto-milestone workflow that will set the milestone for
a PR when it is closed. This way, contributors no longer have to think
about milestone at all.
(cherry picked from commit 8ae92db53d)
Auth: update GitHub OAuth documentation (#70459)
* github oauth doc improvements
* add skip_org_role_sync to config for github provider
* update links and section headings
* update the docs based on the first PR
* update references
(cherry picked from commit cb695cef8e)
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
CI: Update and rename pr-patch-mirror-and-apply.yml to sync-mirror.yml (#71608)
* CI: Update and rename pr-patch-mirror-and-apply.yml to sync-mirror.yml
* update CODEOWNERS
(cherry picked from commit 3afc20fae9)
* docs: restructure dashboard annotations page (#70208)
* restructured page, updated and removed images, replaced a paragraph with a procedure
* Clarify language
* Apply suggestions from code review
* removed native annotation language, added missing link, added text from UI
* fixed relref
* replaced relref with simple link
* updated links and link text in whats new for annotations updates
* fixed some grammar/wording and style issues
* Apply suggestions from code review
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* fix typo
Co-authored-by: Ezequiel Victorero <ezequiel.victorero@grafana.com>
* make link text more clear
* fix typo
---------
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Co-authored-by: Ezequiel Victorero <ezequiel.victorero@grafana.com>
(cherry picked from commit adc7f65453)
* fixed backport
* CI: Add rgm to drone (#66991)
* add drone stub that build grafana using 'grafana/build' (dagger)
---------
Co-authored-by: Ricky Whitaker <ricky.whitaker@grafana.com>
(cherry picked from commit 768efe9748)
* Add dagger token to rgm builds (#68651)
(cherry picked from commit a870b227db)
* CI: Add GPG keys to rgm, don't clone RGM just use the docker image (#71143)
* Add GPG keys to rgm, dont' clone RGM just use the docker image
(cherry picked from commit d5a4c81fa1)
CI: Ignore .pr-body.txt file (#70798)
This file is used during the backporting process but should never be
committed.
(cherry picked from commit 2b10d31bac)
Co-authored-by: Horst Gutmann <horst.gutmann@grafana.com>
docs: clarifies that only OSS or Enterprise are installed (#70619)
* clarifies that only OSS or Enterprise are installed, not both
* Apply suggestions from code review
(cherry picked from commit f77a886f0e)
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
"Release: Updated versions in package to 9.4.14"
Co-authored-by: grafana-delivery-bot[bot] <132647405+grafana-delivery-bot[bot]@users.noreply.github.com>
Docs: changes link text and adds link to the download page (#70477)
achanges link text and add link to the download page
(cherry picked from commit 5426d519c6)
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Docs: List packages together, and fix or add menuTitles. (#70338)
List packages together, and fix or add menuTitles.
(cherry picked from commit a50afe67d3)
Co-authored-by: Ursula Kallio <ursula.kallio@grafana.com>
Update make-docs procedure (#70265)
## 4.1.0 (2023-06-16)
### Added
- Mounts of `layouts` and `config` directories for the `website` project.
Ensures that local changes to mounts or shortcodes are reflected in the development server.
### Fixed
- Version inference for versioned docs pages.
Pages in versioned projects now have the `versioned: true` front matter set to ensure that "version" in $.Page.Scratch is set on builds.
## 4.0.0 (2023-06-06)
### Removed
- `doc-validator/%` target.
The behavior of the target was not as described.
Instead, to limit `doc-validator` to only specific files, refer to https://grafana.com/docs/writers-toolkit/writing-guide/tooling-and-workflows/validate-technical-documentation/#run-on-specific-files.
## 3.0.0 (2023-05-18)
### Fixed
- Compatibility with the updated Make targets in the `website` repository.
`docs` now runs this script itself, `server-docs` builds the site with the `docs` Hugo environment.
(cherry picked from commit a4a16b62c7)
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Use docs/reference for flexible linking for content reused in Grafana Cloud (#70253)
* Use docs/reference for flexible linking for content reused in Grafana Cloud
Documented in https://github.com/grafana/website/pull/13878
* Use docs-base image that has docs/reference shortcode
---------
(cherry picked from commit 3d15d54a71)
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
CI: Add CI check for `what's new` link (#70046)
* Add whatsnewchecker
* Add whatsnewchecker_test
* Small fixes
* Add step in CI
* Fix lint
* Fix starlark
* t.Cleanup instead of separate func
* Skip check for test tags
(cherry picked from commit 91272ee4f9)
# Conflicts:
# .drone.yml
# scripts/drone/events/release.star
* NPM packages: Fail `build-frontend-packages` step if `package.json` and input tag differ (#70011)
* Fail if package.json version is different than the tag
* Add tests
* Update message
* Small refactoring
* Fix lint
(cherry picked from commit a6b524fd56)
* Bump urfave/cli/v2
* go mod tidy
docs: Azure doc link update (#69749)
Update index.md
Link update
(cherry picked from commit 3e48c0b570)
Co-authored-by: Jan Garaj <jan.garaj@gmail.com>
Docs/docker compose update (#64565)
* added CLI in heading for clearity
* added new heading
* new change
* updated final version for review
* fix small line breaks
* copy edit, restructuring
* Apply suggestions from code review
* Apply suggestions from code review
* removed internal notes
* updateding the docker configuraiton file which have advanced instructions
* Update docs/sources/setup-grafana/installation/docker/index.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/installation/docker/index.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/installation/docker/index.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/installation/docker/index.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/installation/docker/index.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/installation/docker/index.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/installation/docker/index.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/installation/docker/index.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* updated persistent stroage section
* updated heading typo
* Update docs/sources/setup-grafana/installation/docker/index.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/installation/docker/index.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/installation/docker/index.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/installation/docker/index.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/installation/docker/index.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/installation/docker/index.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/installation/docker/index.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/installation/docker/index.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/installation/docker/index.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/installation/docker/index.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* fixed code identation and minor typos
* added yaml file validation check in the troubleshooting section
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
added "also"
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* add more details to apline, cloudwatch and default path sections
* Apply suggestions from code review
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* added more detailes about docker ubuntu image, fixed headings, added more clarity to the persistent vs bind stroage
* Apply suggestions from code review
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* added more improvements for the examples
* Update docs/sources/setup-grafana/installation/docker/index.md
* Update docs/sources/setup-grafana/installation/docker/index.md
* Update docs/sources/setup-grafana/installation/docker/index.md
* Update docs/sources/setup-grafana/configure-docker.md
* updates links, edits Troubleshooting section
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Dan Cech <dcech@grafana.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Dan Cech <dcech@grafana.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Dan Cech <dcech@grafana.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Dan Cech <dcech@grafana.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Dan Cech <dcech@grafana.com>
* fixes doc-validator issues
* adds link to plugin install instructions
* added improvement in the AWS cloudwatch example
* Update docs/sources/setup-grafana/configure-docker.md
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Apply suggestions from code review
suggestions looks good
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* added dan suggestion for the tags, but skip the longer description part as not really useful for end user
* Update docs/sources/setup-grafana/installation/docker/index.md
Co-authored-by: Dan Cech <dcech@grafana.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Dan Cech <dcech@grafana.com>
* Update docs/sources/setup-grafana/configure-docker.md
Co-authored-by: Dan Cech <dcech@grafana.com>
* Apply suggestions from code review
looks good
Co-authored-by: Dan Cech <dcech@grafana.com>
* added missing version
* fixed identation and small typo
* fixed the pwd data folder instruction
* fixed persistent volume creating and identation
* fixed identation
* fixed typo to get debug logs
* fixed custom plugin installation section
* created docker secret command instructions
* fixed missing path
* fixed code in docker secret and other minor typos
* incorporates feedback, copy edits secrets section
* fixed small typo in docker secrets section
* remove the additonal info command for secrets
* combined custom docker pre-installed plugin section as one
* fixed the build link typo
* various updates/fixes
* another fix
* added more clarity to the volume creating command
* fixed command for bind mounts
* fixed missing comman in the plugin command
* fixed small typo
* improve and simplifly the steps instructions
* fixed validation command
* Apply suggestions from code review
looks good!!
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* fixed typo in docker secret command explaination
* fixed minor stuff
* makes prettier
---------
Co-authored-by: Chris Moyer <chris.moyer@grafana.com>
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Co-authored-by: Dan Cech <dcech@grafana.com>
(cherry picked from commit d50e50be28)
Co-authored-by: Usman Ahmad <usman.ahmad@grafana.com>
Docs: Remove duplicate word in edit panel of configure panel options (#69592)
Documentation: Remove duplicate word in edit panel of configure panel options
(cherry picked from commit f20a8eb2a7)
Co-authored-by: SatVeer Singh <developer.satveer@gmail.com>
Prevent crash while executing concurrent mixed queries (#874)
limit parallel query execution to 1 at a time
(cherry picked from commit 96579a60e19e2a9f2d6bdaeba64e0e702211eb73)
Co-authored-by: Michael Mandrus <41969079+mmandrus@users.noreply.github.com>
Require alert.notifications:write permissions to test receivers and templates (#865)
(cherry picked from commit 3c21ab70075256d4ba8e4fbfdcb15f5a394161fa)
Chore: Update @grafana/e2e (#66365)
* Update e2e package
- Ensure health request is monitored for addDatasource flow
- Add custom timeout to configurePanel flow
* Make health check optional
(cherry picked from commit b2e32a70b9)
Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
Docs: Bring back the alias for external group sync HTTP API page (#69434)
* Docs: Bring back the alias for external group sync HTTP API page
* Update docs/sources/developers/http_api/team_sync.md
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
---------
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
(cherry picked from commit 0e5e5175b1)
Co-authored-by: Vardan Torosyan <vardants@gmail.com>
Docs: Rename External Group Sync references to Team Sync (#69395)
(cherry picked from commit 8235f774aa)
Co-authored-by: Vardan Torosyan <vardants@gmail.com>
fix: Chef cookbook has moved to sous-chefs (#68425)
* fix: Chef cookbook has moved to sous-chefs
Updates the github link for the chef configuration option.
* Update docs/sources/administration/provisioning/index.md
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
---------
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
(cherry picked from commit 1ff5170c83)
Co-authored-by: Jason Field <Jason@avon-lea.co.uk>
* fix verify_release_pipeline script execution (#69191)
* fix verify_release_pipeline script execution
* forgot to run make drone
(cherry picked from commit 68fe1e1cb0)
* make drone
---------
Co-authored-by: Kevin Minehart <kmineh0151@gmail.com>
Docs: Update the service account HTTP API documentation (#63235)
* doc: Add the service account deletion function
* doc: Add new service account documentation
(cherry picked from commit 4aa207ed83)
Co-authored-by: Pascal Zimmermann <pascal.zimmermann@theiotstudio.com>
Docs: Add JSON format for webhook notifications to differences (#68786)
(cherry picked from commit 65e2df7a2e)
Co-authored-by: George Robinson <george.robinson@grafana.com>
update prometheus query editor doc (#68595)
* initial updates to outdated info
* minor edits prior to draft PR
* commented out options no longer available
* additional edits
* removed tables, changed format to list
* updated code mode section
* finished edits to builder mode
* added revisions per Brendan
* removed commented out section
* added note short codes
(cherry picked from commit 3edeafa663)
Co-authored-by: lwandz13 <126723338+lwandz13@users.noreply.github.com>
Docker: Add `mode` label when building docker images (#68865)
Add mode label when building docker image
(cherry picked from commit bad570ee86)
Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
Utils: Reimplement util.GetRandomString to avoid modulo bias (#64481)
* reimplement GetRandomString, add tests that results are unbiased
(cherry picked from commit 7e765c870a)
Co-authored-by: Dan Cech <dcech@grafana.com>
CI: Run `trigger-test-release` only on PRs against main (#68794)
Run trigger-test-release only on PRs against main
(cherry picked from commit 623c014cda)
# Conflicts:
# .drone.yml
Docker images: Don't fail if a PR comes from a fork (#68765)
* Update grabpl
* Allow publish images to fail for PRs
(cherry picked from commit 04e2d9055d)
# Conflicts:
# .drone.yml
RBAC: Remove legacy AC editor and admin role on new dashboard route (#68762)
remove legacy AC editor and admin role on new dashboard route
(cherry picked from commit 94283f5039)
Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
Clarify Graphite version and type to set if using Grafana Cloud (#68239)
* Clarify Graphite version and type to set if using Grafana Cloud
* Update _index.md
(cherry picked from commit 9f7f82c3cc)
Co-authored-by: Fiona Liao <fiona.y.liao@gmail.com>
Revert: Allow editors to access GET /datasources (#68632)
Revert "Allow editors to access GET /datasources"
This reverts commit 5a830c43c0.
(cherry picked from commit 6a2bcba078)
Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
Prometheus: Fix fallback http method when no http method specified in jsonData (#65229)
Use POST as default if no http method specified in jsonData
(cherry picked from commit 959349d191)
CloudMonitor: Show template variables by default (#68331)
CloudMonitor: show template variables by default
(cherry picked from commit 9503f22f53)
Co-authored-by: Adam Simpson <adam@adamsimpson.net>
CI: Add `.drone.yml` in pathschanged trigger for `lint_backend` pipeline (#68348)
Add .drone.yml in pathschanged for lint_backend
(cherry picked from commit b7b13067a5)
# Conflicts:
# .drone.yml
Previously the Metric name dropdown would attempt to load _all_ the
available metric names into the Select which would eventually crash the
browser if the dataset was large enough.
We can fix this by using AsyncSelect and making another query once a
Service is selected _and_ the user types a few characters.
* fix: update tests for AsyncSelect
* fix lint
* fix: add subset of metrics on initial load
AzureMonitor: Bump credential wait time (#68120)
Bump credential wait time as 15s seems too short
(cherry picked from commit 0d3a78d86d)
# Conflicts:
# e2e/cloud-plugins-suite/azure-monitor.spec.ts
* CI: Add Windows backend tests in more places
* CI: Add promotion pipeline for publishing new windows-test-images
* CI: Ignore windows backend-test failures for now
* CI: Fix linting issue in ci_images.star file
(cherry picked from commit b2fc285a5d)
Backport of https://github.com/grafana/grafana/pull/66438
AzureMonitor: Fix logs query multi-resource and timespan values (#67914)
* Update TimeGrain interface methods
- Make them util functions because it's simpler
* Update logs ds to appropiately set resources and timespan
* Set timespan using RCF times
* Update tests
(cherry picked from commit 9d16718acc)
Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
Docs: updates Grafana installation for Red Hat, Fedora, RHEL, SUSE, and OpenSUSE (#65232)
* removes references to CentOS
* starts reorg
* complete restructure
* updates alias
* Update docs/sources/setup-grafana/installation/rpm/index.md
* Apply suggestions from code review
Co-authored-by: Dan Cech <dcech@grafana.com>
* incorporates review feedback
* adds install on suse/opensuse
* updates aliases
* Apply suggestions from code review
Co-authored-by: Dan Cech <dcech@grafana.com>
* removes start server content from both topics; adds link to start server docs in Next steps
* Apply suggestions from code review
Co-authored-by: Dan Cech <dcech@grafana.com>
* incorporates review feedback
* Apply suggestions from code review
* typo fix
---------
Co-authored-by: Dan Cech <dcech@grafana.com>
(cherry picked from commit fcdbb7a86f)
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
docs: Updates installation instruction for Debian/Ubuntu (#64232)
* draft changes
* Apply suggestions from code review
Co-authored-by: Dan Cech <dcech@grafana.com>
* reworks debian/ubuntu instructions, updates start server topic
* Apply suggestions from code review
Co-authored-by: Dan Cech <dcech@grafana.com>
* incorporates feedback; restructures to align with writers toolkit guidelines
* Apply suggestions from code review
Co-authored-by: Dan Cech <dcech@grafana.com>
* tweaks structure of server topic; renames directory, corrects relrefs
* corrects spelling
* Apply suggestions from code review
Co-authored-by: Dan Cech <dcech@grafana.com>
* removed web parameter
* removes unnecessary word
* incorporates feedback from internal reviewer
* updates alias
* updates alias
* adjust alias
---------
Co-authored-by: Dan Cech <dcech@grafana.com>
(cherry picked from commit 13af5afaf3)
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
InfluxDB: Fix adding FROM statement when the measurement is an empty string (#67827)
* If the measurement empty don't add FROM statement
* Add comment line
(cherry picked from commit 764f87b485)
Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
docs: add semi relative time ranges (#67559)
* add semi-relative time range section
* added second example and reworded
* formatting fixes
* added alerting note and fixed formatting
* wording fix
(cherry picked from commit 0271a1d094)
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
Update index.md (#67172)
Clarified some of the intro text and added JSON outer element to make the samples clearer
(cherry picked from commit 66ad704292)
Co-authored-by: Nabeel Saad <saadnabs@hotmail.com>
docs: move misplaced Configure legend page (#67597)
* move configure legend page and add alias
* updated page weight and tried fixing alias
* fixed alias
* add preemptive alias for current page location
* apply suggestion from review
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
* apply suggestions from review
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
* apply suggestions from review
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
---------
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
(cherry picked from commit 688459f25c)
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
Grafana Cloud: Put cloud artifacts to `*/release` dir (#66168)
Put cloud artifacts to */release dir
(cherry picked from commit a2634495e5)
Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
Influxdb: Handle legacy Influxdb influxql annotations with target in migration (#63225)
* handle legacy influxdb annotations with target in migration
* add types
* don't check tags that are empty strings and give annotation a type
(cherry picked from commit 7a3f7e26ce)
Co-authored-by: Brendan O'Handley <brendan.ohandley@grafana.com>
Docs: Fix broken links to section on Variable syntax page (#67340)
These links have a trailing slash which don't work when linking to a
specific element.
(cherry picked from commit 278a8fccc9)
Co-authored-by: Eric Wang <2069450+ericdwang@users.noreply.github.com>
CloudMonitor: Correctly re-render `VisualMetricQueryEditor` on `TimeRange` updates (#66756)
Compare string value rather than object
(cherry picked from commit adf12d0e90)
Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
Update index.md (#66698)
The useful links were down as they were using /docs/grafana/next/ instead of /docs/grafana/latest/ in the path
(cherry picked from commit 58e3b3a90e)
Co-authored-by: Sébastien Dauphin <dauphin.sebastien@gmail.com>
Trace View: Update the queryType to traceql for checking if same trace when clicking span link (#66645)
* TraceView: update the queryType to traceql for checking if same trace when clicking span link
* TraceView: linting
* TraceView: remove traceid check completely
(cherry picked from commit 6462c81f81)
Co-authored-by: Eric Mustin <mustin.eric@gmail.com>
Alerting: Update migration to put alerts to the default folder if dashboard folder is missing (#65577)
* extract function
* use context logger
* put alert to general folder if folder is missing
* move folderHelper init
* add test
* Update pkg/services/sqlstore/migrations/ualert/ualert.go
Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>
---------
Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>
(cherry picked from commit 7b2f44762e)
Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
Google Cloud Monitoring: Fix project variable (#66524)
Google Cloud Monitoring: fix project variable
Also fix typo found while debugging
(cherry picked from commit 02951e8a26)
Co-authored-by: Adam Simpson <adam@adamsimpson.net>
InfluxDB: Fix querying with hardcoded retention policy (#66466)
* Use default retention policy instead of hardcoded retention policy
* Load retention policies for the editor
* Fix the typo
* Add more comment line
* Update comment
* Better error message
* Put back getTagKeys and getTagValues
* Fix unit test
(cherry picked from commit 6d53c87862)
Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
Auth: Remove the session cookie only if it's invalid or revoked (#65984)
Remove the cookie if it's invalid or revoked
(cherry picked from commit 4cac95d1c2)
Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
Expressions: Fix expression load with legacy UID -100 (#65950)
* Fix expressions instance settings loading
* Introduce a new method to get name or uid
* Update public/app/features/plugins/datasource_srv.ts
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* Move getNameOrUid method outside the class
---------
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
(cherry picked from commit d4bd024951)
Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
AccessControl: Allow editors to access GET /api/datasources (#66343)
Allow editors to access GET /datasources
(cherry picked from commit 2c21090931)
Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
Auth: Fix orgrole picker disabled if isSynced user (#64033)
* fix: disable orgrolepicker if externaluser is synced
* add disable to role picker
* just took me 2 hours to center the icon
* wip
* fix: check externallySyncedUser for API call
* remove check from store
* add: tests
* refactor authproxy and made tests run
* add: feature toggle
* set feature toggle for tests
* add: IsProviderEnabled
* refactor: featuretoggle name
* IsProviderEnabled tests
* add specific tests for isProviderEnabled
* fix: org_user tests
* add: owner to featuretoggle
* add missing authlabels
* remove fmt
* feature toggle
* change config
* add test for a different authmodule
* test refactor
* gen feature toggle again
* fix basic auth user able to change the org role
* test for basic auth role
* make err.base to error
* lowered lvl of log and input mesg
(cherry picked from commit 3cd952b8ba)
Build: Add CloudMode to build versions (#65651)
* Add CloudMode to build versions
* Use linux-amd64 variant without musl for cloud mode
* Add cloud mode to version folder on package upload
* Use musl variant for CloudMode
* Only sign rpm packages if there's any to sign
* Remove trailing whitespace
(cherry picked from commit 8f282b8a6e)
Co-authored-by: Guilherme Caulada <guilherme.caulada@grafana.com>
Docs: Added note to contact Support (#65235)
* Added note to contact Support
* Update docs/sources/setup-grafana/configure-security/configure-authentication/enhanced-ldap/index.md
* Update docs/sources/setup-grafana/configure-security/configure-authentication/enhanced-ldap/index.md
* makes prettier
* Apply suggestions from code review
---------
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Co-authored-by: Chris Moyer <chris.moyer@grafana.com>
(cherry picked from commit 445734888b)
Co-authored-by: melGL <81323402+melgl@users.noreply.github.com>
* Alerting: Disable alerting incompatible panels in the dashboard picker (#65341)
* Hide dashboard hint when dashboard already selected
* Disable panels of types other than graph and timeseries
* Add a test checking disabled panels
* Make all panels selectable
* Fix tests
(cherry picked from commit bde77e4f79)
* Skip flakey test
update enhanced-ldap (#65687)
* update enhanced-ldap
documenting a potential issue with ldap active sync, when search filter and username attributes do not match.
* Update docs/sources/setup-grafana/configure-security/configure-authentication/enhanced-ldap/index.md
* formats example
* Update docs/sources/setup-grafana/configure-security/configure-authentication/enhanced-ldap/index.md
---------
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Co-authored-by: Chris Moyer <chris.moyer@grafana.com>
(cherry picked from commit 99ac39f0d2)
Co-authored-by: annelaurefroment <49911675+annelaurefroment@users.noreply.github.com>
Alerting: Fix integration test for creating silences (#65722)
* fix integration test for creating silences
to create correct silence with endsAt in the future
* Update api_alertmanager_test.go
(cherry picked from commit ed8628e39d)
Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
* Alerting: Introduce proper feature toggles for common state history backend combinations (#65497)
* define 3 feature toggles for rollout phases
* Pass feature toggles along
* Implement first feature toggle
* Try a different strategy with fall-throughs to specific configurations
* Apply toggle overrides once outside of backend composition
* Emit log messages when we coerce backends
* Run code generator for feature toggle files
* Improve wording in flag descs
* Re-run generator
* Use code-generated constants instead of plain strings
* Use converted enum values rather than strings for pre-parsing
(cherry picked from commit b2abb63286)
* Remove generated file that is only present in future versions
Give more detail and context on http_addr in grafana.ini (#65187)
* Give more detail and context on http_addr in grafana.ini
This particular configuration item is misleadingly named (it's about networking addresses rather than HTTP) and there are a bunch of ways users can misread, misconfigure, and create a situation where grafana won't start due to a bind error.
I'm trying to outline a couple of extra things about what this covers and provide good default advice, leaving room for specialists who know what they're doing to still use this, with more clarity.
* Update _index.md
* Apply suggestions from code review
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update _index.md
removed recommendation note about http_addr
* makes prettier
---------
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Co-authored-by: Chris Moyer <chris.moyer@grafana.com>
(cherry picked from commit 765073a776)
Co-authored-by: David Allen <david.allen@grafana.com>
Alerting: No longer index state history log streams by instance labels (#65474)
* Remove private labels
* No longer index by instance labels
* Labels are now invariant, only build them once
* Remove bucketing since everything is in a single stream
* Refactor statesToStreams to only return a single unified log stream
* Don't query on labels that no longer exist
* Move selector logic to loki layer, genericize client to work in terms of straight logQL
* Add support for line-level label filters in query
* Combine existing selector tests for better parallelism
* Tests for logQL construction
* Underscore instead of dot for unwrapping labels in logql
(cherry picked from commit a416100abc)
InfluxDB: Fix sending retention policy with InfluxQL queries (#63820)
* Send retention policy if that is specified
* Define the type
* Update default retention policy name
* Update unit tests
* fix unit tests
* fix unit tests again
* Load retention policies at first
* Fix tests
* Fix Editor tests
* Remove unused code
* A simpler approach
* Even simpler
* Even simpler
(cherry picked from commit 0aee7338ad)
Backport from #65184 using github.com/xorcare/pointer instead of the newer util.Pointer.
(cherry picked from commit b210a39cb7)
---------
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
Remove redundant content or delete this page entirely (#65446)
* Remove redundant content or delete this page entirely
The top of the page has redundant content pitching Grafana Cloud.
"You can also configure the MS SQL Server data source on a Grafana Cloud instance without having to host Grafana yourself." Which is directly under the highlighted area explaining the same thing. The same content is floating in the right side of all the pages as well.
Removed "> **Note:** You must install Grafana 5.1+ in order to use the integrated MS SQL data source."
Wait, why does this page exist if the data source page has the relevant updated content? https://grafana.com/docs/grafana/latest/datasources/mssql/
* makes prettier
---------
Co-authored-by: Chris Moyer <chris.moyer@grafana.com>
(cherry picked from commit 2b73f8cfd5)
Co-authored-by: mallettjared <110853992+mallettjared@users.noreply.github.com>
MegaMenu: Fixes mega menu showing scroll indicator when it shouldn't (#65452)
* MegaMenu: Fixes mega menu showing scroll indicator when it shouldn't
* fixing css
(cherry picked from commit 273e05a9a2)
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
CI: Allow overwriting of existing GitHub release assets (#65127)
* CI: Allow overwriting of existing GitHub release assets
This closes#63698
* Use c for *cli.Context in publishgithub.go
(cherry picked from commit 4ab3bd6f7e)
Co-authored-by: Horst Gutmann <horst.gutmann@grafana.com>
Alerting: Add alert instance labels to Loki log lines in addition to stream labels (#65403)
Add instance labels to log line
(cherry picked from commit de1637afe5)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
Alerting: Add "backend" label to state history writes metrics (#65395)
* Add backend label to state history writes metrics
* Update test expectations
(cherry picked from commit dd04757fc9)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
Increase coverage of 'Grafana Cloud' labels (#64646)
* Add 'Grafana Cloud' label to content
All pages are applicable to both 'Open source' and 'Grafana Cloud'
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Add 'Grafana Cloud' label to administration content with some exceptions
- Enterprise licensing is 'Open source' and 'Enterprise'.
- 'Manage Organizations', 'Provision Grafana', and 'Stats and License' are 'Open source' only.
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Remove OSS from enterprise-licensing content
* Apply suggestions from code review
---------
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
(cherry picked from commit dca5adeb98)
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
* Improve showing nextEvaluationDate for rules
Co-Authored-By: Konrad Lalik <konradlalik@gmail.com>
* Improve imports and comments
---------
Co-authored-by: Konrad Lalik <konradlalik@gmail.com>
(cherry picked from commit b90aed4fd7)
* Alerting: Fix stats that display alert count when using unified alerting (#64852)
* Alerting: Fix stats when using unified alerting
(cherry picked from commit 02a8f62021)
* bundle services is not needed for 9.4.x
---------
Co-authored-by: gotjosh <josue.abreu@gmail.com>
Database: Don't sleep 10ms before every request (#64832)
Previously every DB operation would wait 10ms before even trying.
Now we try first, and defer creating the ticker until we need it.
(cherry picked from commit f4a5f91496)
Co-authored-by: Bryan Boreham <bjboreham@gmail.com>
Docs: Use correct function in labels and annotations docs (#65032)
Use correct function in labels and annotations docs
(cherry picked from commit 0464aebc8e)
Co-authored-by: Martin Beentjes <martinbeentjes@users.noreply.github.com>
Add @imatwawana to CODEOWNERS for her area of responsibility (#64963)
(cherry picked from commit 8941ca813c)
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Docs/updates amazon cloudwatch (#64987)
* updated AWS to Amazon in the index file
* edited query editor index file -AWS with Amazon
(cherry picked from commit 0975e53fc0)
Co-authored-by: lwandz13 <126723338+lwandz13@users.noreply.github.com>
SQL Datasources: Prevent Call Stack Overflows with Large Numbers of Values for Variable (#64937)
* Push values with every map call to avoid hitting the maximum call stack size.
* Add test and refactor to for of
* Use native fill instead of lodash
---------
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
(cherry picked from commit bf687fff45)
Co-authored-by: Kyle Cunningham <codeincarnate@users.noreply.github.com>
Alerting: Fix attachment of external labels to Loki state history log streams (#65140)
Fix attachment of external labels, add tests
(cherry picked from commit 07368dec74)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
* Alerting: Switch to snappy-compressed-protobuf for outgoing push requests to Loki (#65077)
* Encode with snappy, always
* JSON encoder type
* Headers
* Copy labels formatter from promtail
* Implement snappy-proto encoding
* Create encoder interface, test both encoders, choose snappy-proto by default
* Make encoder configurable at the LokiCfg level
* Export both encoders
* Touch up comment and tests
* Drop unnecessary conversions after move to plain strings to appease linter
(cherry picked from commit bf54f2672e)
* Sample fields got renamed between 9.4 and main
Alerting: Fix ambiguous handling of equals in labels when bucketing Loki state history streams (#65013)
* Use JSON instead of data.Labels string format as label repr
* Drop debug log line
(cherry picked from commit cc7e5ce62e)
Prometheus: Feedback link for metric encyclopedia plus performance improvements (#64576)
* add filtered results
* add feedback link
* correctly debounce fuzzy search thank you leon
* reduce calls to filterMetrics()in letter search
* clean up the alphabet type
* bug fix, filter type should be subtractive
* each filter is don;t explicitly, subtracting from the results of each
* Revert "each filter is don;t explicitly, subtracting from the results of each"
This reverts commit 5648788451.
* each filter is filtered explicitly, one after the other, subtracting from the results of each
(cherry picked from commit 2e4b134743)
Alerting: Elide requests to Loki if nothing should be recorded (#65011)
Exit early if no log streams or annotations
(cherry picked from commit e39d7f44c9)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
Docs: Add documentation on how to debug backend plugins (#64814)
* Docs: Add documentation on how to debug backend plugins
* Changes from PR reviews
* PR review changes
(cherry picked from commit 41b0c17aae)
Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>
Information about SQLite limitations (#64990)
* Update _index.md
I am creating this PR to add more content about the SQLite (the default database for Grafana) limitations. SQLite is fine for small environments but not suitable when monitoring many Dashboards and sending lots of alerts frequently.
For e.g. this issue is just from this week and then got followed up by 3-4 more similar issues (all related to SQLite and are linked with this issue)
Closes#64664
By adding more information, will have less frequency of such issues reported by users.
Also, once this PR get submitted, will also create a new PR about the possible workaround to not get the error message "database locked" while using SQLite.
* Update docs/sources/setup-grafana/installation/_index.md
Thank you. Also, can you please add this link to the High Availablity text as hyperlink.
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/setup-grafana/installation/_index.md
* Update docs/sources/setup-grafana/installation/_index.md
---------
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
(cherry picked from commit ccfe09d20e)
Co-authored-by: Usman Ahmad <69509548+usmangt@users.noreply.github.com>
AzureMonitor: Fix query variable migration (#63991)
* AzureMonitor: Fix query variable migration
Somehow the query object becomes "unwriteable" post 9.4. To workaround
this I clone the query object before doing any migrations which removes
the immutability and allows the migrations to function as they did.
Fixes#63943
* refactor deepClone out to keep object the same
(cherry picked from commit 3498785184)
Co-authored-by: Adam Simpson <adam@adamsimpson.net>
Vendor errors.Join from Go standard library to avoid version incompatibilities (#64985)
Vendor errors.Join from std lib
(cherry picked from commit 40c5713cbd)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
Alerting: Create new state history "fanout" backend that dispatches to multiple other backends at once (#64774)
* Rename RecordStatesAsync to Record
* Rename QueryStates to Query
* Implement fanout writes
* Implement primary queries
* Simplify error joining
* Add test for query path
* Add tests for writes and error propagation
* Allow fanout backend to be configured
* Touch up log messages and config validation
* Consistent documentation for all backend structs
* Parse and normalize backend names more consistently against an enum
* Touch-ups to documentation
* Improve clarity around multi-record blocking
* Keep primary and secondaries more distinct
* Rename fanout backend to multiple backend
* Simplify config keys for multi backend mode
(cherry picked from commit a31672fa40)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
AzureMonitor: Increase wait for credentials to be ready in E2E test (#64969)
Increase wait for credentials to be ready
(cherry picked from commit edc47964b6)
Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
SQLStore: Fix setting query tries for integration tests (#64944)
* SQLStore: Pass testinfra database configuration to the test database
* Add test
* Bypass gocyclo check for initTestDB
(cherry picked from commit f5cb8c660e)
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
Alerting: Handful of small adjustments to log levels and parameters (#64572)
Calculate duration earlier in scheduler
(cherry picked from commit 9bcf8819d3)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
SQLStore: Fix SQLite error propagation if query retries are disabled (#64904)
* SQLStore: Add test when query retrying is disabled
* Fix condition
* Add test cases for sqlite3.ErrLocked
(cherry picked from commit 41843464d1)
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
Navigation: handle case when there is no alerting node at all (#64941)
* handle case when there is no alerting node at all
* update backend tests
(cherry picked from commit f4c62a5c5d)
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Alerting: QoL improvements to the unified alerting multi-replica devenv (#64907)
(cherry picked from commit 406431df4e)
Co-authored-by: gotjosh <josue.abreu@gmail.com>
Navigation: Correctly create `Alerts and incidents` section when using legacy alerting (#64924)
check for legacy alerting node as well
(cherry picked from commit 54dd8943ca)
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
LogContext: Fix height of upper group when using `logsContextDatasourceUi` (#64602)
fix wrong height being set
(cherry picked from commit 7cde6acbef)
Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
Fix website build errors both for Grafana and content mounted in Grafana Cloud (#64794)
* Fix reference to Grafana CLI
- Make relref for relative permalink
- Use relative path for unambiguous resolution
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Fix alerting relref anchor format
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Avoid ambiguous relref lookups by forcing relative resolution
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Remove reference to non-existent shared page
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Fix links broken in Grafana Cloud using absolute relrefs
By resolving the relref absolutely, it refers to the same location
regardless of mounted directory.
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Remove trailing slash for bundle independent resolution
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Fix typo
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* For now, avoid Hugo checking cross repository /docs/grafana-cloud link
The path is unlikely to change in the short term and this makes CI
completely green for now.
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* No need to specify path for in page anchors
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Fix prose
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
---------
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
(cherry picked from commit ebb54aea8d)
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
Alerting: Update scheduler to get updates only from database (#64635)
* stop using the scheduler's Update and Delete methods all communication must be via the database
* update scheduler's registry to calculate diff before re-setting the cache
* update fetcher to return the diff generated by registry
* update processTick to update rule eval routine if the rule was updated and it is not going to be evaluated at this tick.
* remove references to the scheduler from api package
* remove unused methods in the scheduler
(cherry picked from commit 85a954cd81)
# Conflicts:
# pkg/services/ngalert/schedule/schedule.go
# pkg/services/ngalert/schedule/schedule_unit_test.go
* Display last & next rule eval date plus eval duration
* Show next evaluation date in a humanized format
Full date still visible on hover
* Only show next evaluation column is group has an interval
(cherry picked from commit 6b95b3f8aa)
Packaging: Dockerfile copy local folder (#64766)
Dockerfile copy local folder
(cherry picked from commit dfee4249e8)
Co-authored-by: Kevin Minehart <kmineh0151@gmail.com>
CloudWatch Logs: Queries in an expression should run synchronously (#64443)
(cherry picked from commit 74436d31de)
Co-authored-by: Isabella Siu <Isabella.siu@grafana.com>
* chore: upgrade faro-core and faro-web-sdk to 1.0.2 (#64407)
With v1.0.2 Faro explicitly closes fetch requests.
This fixes an issue were (headless) chrome browser
still considers those requests as open which lead to timeouts.
(cherry picked from commit d8a497ee6e)
* fix: add missing setView and getView mocks
Alerting: Log error but don't fail initialization if state history connection test fails (#64699)
Don't return init error if ping fails, add tests
(cherry picked from commit faef3a8258)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
Dashboards: Filter out expressions when going to Explore (#64654)
* Filter out expressions when going from dashboard to explore
* Move expression UID constant to types
(cherry picked from commit c363a81806)
Co-authored-by: Kristina <kristina.durivage@grafana.com>
Frontend: Fix broken links in /plugins when pathname has a trailing slash (#64348)
Fix broken links in /plugins when pathname has a trailing slash
(cherry picked from commit a05cb1e78e)
Co-authored-by: William Assis <35489495+gassiss@users.noreply.github.com>
Navigation: Remove duplicate header on user invite page (#64677)
remove duplicated header in old navigation
(cherry picked from commit caf98101e7)
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
TimeSeries: fix time comparer not comparing date strings properly (#64622)
* fix time comparer not comparing times properly
* move isDateTime last as it's probably the most expensive check
(cherry picked from commit 3a1862f37f)
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
InfluxDB: Fix type assertion panics for interface conversion: interface {} is nil (#64556)
* fix type assertions
* fix chk
* add nil and fix tests
* add test for null bool and strings in the JSON response to be parsed as nil in Go
* reduce complexity
* reduce complexity
* reduce complexity again
* switch case for valTypes
(cherry picked from commit 50ef183208)
Co-authored-by: Brendan O'Handley <brendan.ohandley@grafana.com>
Cloudwatch Logs: Fix log group names not interpolating with multiple variables (#64567)
* Cloudwatch Logs: Fix log group names not interpolating with multiple variables
* fix test
(cherry picked from commit 75f89e67af)
Co-authored-by: Kevin Yu <kevinwcyu@users.noreply.github.com>
Docs: Changes to angular deprecation announcement (#63928)
Adjusting the content to reflect latest discussions. This page can now be used as reference for all things about angular deprecation.
(cherry picked from commit 9ca53d9596)
Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com>
Cloudwatch: Add expression field to interpolate variables in Metrics Code Builder (#64288)
(cherry picked from commit 1c8ad04f8d)
Co-authored-by: Ida Štambuk <ida.stambuk@grafana.com>
Docs: Remove Alertmanager configuration rollback from What's New (#64564)
* Docs: Remove Alertmanager configuration rollback from What's New
* Trigger Build
---------
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
(cherry picked from commit d21d498142)
Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>
* Navigation: Fix Home logo always going to `/login` (#62658)
* only redirect to /login when anonymous access is disabled
* only search for dashboards when not logged in if anon access is enabled
* fix go logic
* add unit tests
(cherry picked from commit 3336327306)
* remove file i accidentally left in :/
* import correct method
CI: Add `PrereleaseBucket` field in `versions.go` (#64519)
Add PrereleaseBucket in versions.go
(cherry picked from commit 29b3f3fbf4)
Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
CI: Move some build settings (#64491)
* Move some build settings to Vault
* CI: Remove reference to DOWNSTREAM_REPO as it isn't used
(cherry picked from commit 4b241804b4)
Docs: Last iteration on docs for images in notifications (#64392)
This commit includes some minor rephrasing to the Requirements and
Limitations of the Images in notification feature.
(cherry picked from commit 1898e76dd6)
Co-authored-by: George Robinson <george.robinson@grafana.com>
* add metric encyclopedia feature toggle and component
* remove unused button
* move file, add test file
* add tests
* add pagination and tests
* test with 10,000,000 metrics
* remove unused import
* add filter by type
* search alphabetically and add switch to exclude metrics with no metadata
* add suggested functions and filter for functions
* allow user to select variables in encyclopedia
* fix style and tests
* add fuzzy search by either metric name or all metadata
* if missing metadata, remove metadata fuzzy search option, exclude metadata, and filter by type
* add encyclopedia feature tracking
* indicate that metrics are filtered by labels
* handle metric singular or plural
* add tooltips and fix language
* add filtering tests
* change 'search' to 'browse'
* remove functions filter and tests as not part of work flow
* add m.e. button and selected metric is a tag
* fix hanging search and update styles, padding, labels, and groupings
* small performance improvements
* fix tests
* add backend metrics query option
* add loading spinner for start load and backend search
* autofocus search input
* Update docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* run prettier
* run prettier
* fix text for feature toggle
* for license check since https://cla-assistant.io/check/grafana/grafana?pullRequest=<PR#> is not working
* fixing tests
* fix feature toggle docs
* fix feature toggle
* fix feature toggle
* add owner to feature toggle
---------
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
(cherry picked from commit 9b6e531549)
Snapshots: Fix deleting snapshot with non existent dashboard ID (#64345)
* Add test for deleting snapshot for non existent dashboard
* Add test for failure to fetch guardian other than ErrDashboardNotFound
* Fix dashboard snapshot delete
(cherry picked from commit 43095d84e4)
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
OpenTSDB: Allow metric autocomplete to use suggest api on every input (#62045)
* allow metric autocomplete by suggest api
* debounce sugggest metrics
* debounce sugggest metrics with debounce-promise
* commit for tests
(cherry picked from commit 70c1850888)
Co-authored-by: Brendan O'Handley <brendan.ohandley@grafana.com>
Cloudwatch Logs: Make mixed type fields fallback to being strings (#63981)
* Cloudwatch Logs: make mixed type fields fallback to being strings
* addressing pr comments
(cherry picked from commit 70f600db10)
Co-authored-by: Kevin Yu <kevinwcyu@users.noreply.github.com>
Alerting: Fix intermittency when seeding database in rule store tests (#64322)
Force unique IDs when seeding database
(cherry picked from commit 4a1c18abf6)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
Docs: Update Images in notifications docs to be more readable and instructive (#64227)
(cherry picked from commit 9d9421154e)
Co-authored-by: George Robinson <george.robinson@grafana.com>
Alerting: Fix Classic Conditions $values variable (#64243)
This commit fixes a bug in the $values variable in notification
templates when using Classic Conditions. Since Classic Conditions
are not multi-dimensional, the values of each series that exceeded
the condition should be available as a RefID and offset. For example,
B0, B1, etc. However, this bug meant that instead just a single
condition would be printed as B, not B0.
(cherry picked from commit ed71012ced)
Co-authored-by: George Robinson <george.robinson@grafana.com>
Alerting: Expose Prometheus metrics for persisting state history (#63157)
* Create historian metrics and dependency inject
* Record counter for total number of state transitions logged
* Track write failures
* Track current number of active write goroutines
* Record histogram of how long it takes to write history data
* Don't copy the registerer
* Adjust naming of write failures metric
* Introduce WritesTotal to complement WritesFailedTotal
* Measure TransitionsFailedTotal to complement TransitionsTotal
* Rename all to state_history
* Remove redundant Total suffix
* Increment totals all the time, not just on success
* Drop ActiveWriteGoroutines
* Drop PersistDuration in favor of WriteDuration
* Drop unused gauge
* Make writes and writesFailed per org
* Add metric indicating backend and a spot for future metadata
* Drop _batch_ from names and update help
* Add metric for bytes written
* Better pairing of total + failure metric updates
* Few tweaks to wording and naming
* Record info metric during composition
* Create fakeRequester and simple happy path test using it
* Blocking test for the full historian and test for happy path metrics
* Add tests for failure case metrics
* Smoke test for full annotation persistence
* Create test for metrics on annotation persistence, both happy and failing paths
* Address linter complaints
* More linter complaints
* Remove unnecessary whitespace
* Consistency improvements to help texts
* Update tests to match new descs
(cherry picked from commit 19d01dff91)
Docs: Adding angular support deprecation to our plugin submission FAQ (#64006)
Adding angular support deprecation to our faq
(cherry picked from commit 43e281271b)
Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com>
Clarify that LDAP will create Grafana users by default when they log in for the first time (#63391)
* Clarify that enabling LDAP will create users by default when they log in
This proposed change to the doc was requested by a user in support ticket `79860`, as it was not clear to them that the OOTB behavior was for user accounts to be provisioned automatically in Grafana when signing in for the first time via LDAP.
* Update docs/sources/setup-grafana/configure-security/configure-authentication/ldap/index.md
Thanks!
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* fix boolean
Woops, `true` should be `false`
---------
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
(cherry picked from commit b136d0dfcf)
Co-authored-by: chrisharbro <102977229+chrisharbro@users.noreply.github.com>
* Replace ambiguous relrefs with partial URIs to prevent 404s
* Fix local builds that depend on latest content
* Fix broken relref
---------
(cherry picked from commit 66b54e2dbd)
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Influxdb: Fix missing columns with raw query (#64058)
* add selected columns to table when select object is not in query model because of rawQuery
* handle * and SHOW raw queries
* handle metricFindQuery
* Update public/app/plugins/datasource/influxdb/response_parser.ts
Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
* Update public/app/plugins/datasource/influxdb/response_parser.ts
Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
* Update public/app/plugins/datasource/influxdb/response_parser.ts
Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
---------
Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
(cherry picked from commit aed020d9b5)
Co-authored-by: Brendan O'Handley <brendan.ohandley@grafana.com>
fix: create temp user no longer sets ID to 0 for all users (#64149)
* fix: create temp user no longer sets ID to 0 for all users
The xorm tag added to the tempuser ID field caused xorm to create all temp users with ID 0. Removing that tag allows xorm to set the ID based on the database result instead. I also added a test which was failing before this.
Fixes#63995
(cherry picked from commit dbb72f2c6e)
Co-authored-by: Kristin Laemmert <mildwonkey@users.noreply.github.com>
Logs: Log samples not being ordered correctly (#64097)
* fix log samples being unsorted and multiple results when chunking
* use `SortDirection` enum
* changed to `sortDataFrame` to support other datasources than loki
* update tests
* change capitalization
(cherry picked from commit 2076282064)
Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
* move analytics identifiers to backend
* implement hash function
* grab secret from env
* expose and retrieve intercom secret from config
* concat email with appUrl to ensure uniqueness
* revert to just using email
* Revert "revert to just using email"
This reverts commit 8f10f9b1bc.
* add docstring
(cherry picked from commit d61bcdf4ca)
Docs: Pinning to latest for grafana plugin tools (#64140)
Pinning to latest for grafana plugin tools
(cherry picked from commit 92ee03db78)
Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com>
Docker Build: Use `tonistiigi/binfmt` image for cross compilation (#64108)
* Change docker image used for cross-compilation
* Replace fmt.Println with log.Println
* Add specific tag for docker image
(cherry picked from commit b42fd92fad)
Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
docs: Prevent internal docs on setting up plugin spellcheck from appearing on public website (#64113)
(cherry picked from commit ab512fcf88)
Co-authored-by: Andriy <andriy.urbanas@grafana.com>
SQLStore: Enable clientFoundRows for MySQL connections (#64070)
Enable clientFoundRows for MySQL connections
(cherry picked from commit 8ea71d37c2)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
NPM: Stop using the folder path before the name path (#63851)
Stop using the folder path before the name path
(cherry picked from commit 177aa254c5)
Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
Alerting: Use background context for maintenance function (#64065)
(cherry picked from commit e760f22402)
# Conflicts:
# pkg/services/ngalert/notifier/alertmanager.go
BarChart: Only apply radius to topmost bar segment when stacking (#63906)
(cherry picked from commit 9314fe1056)
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
Alerting: Fix migration pauses all alert rules on PostgreSQL (#63951)
This commit fixes a serious bug in Grafana 9.4.1 where on upgrade
a migration would pause all existing alert rules and change the
default value of the column to true.
(cherry picked from commit 030f6c948f)
Co-authored-by: George Robinson <george.robinson@grafana.com>
Alerting: Fix boolean default in migration from false to 0 (#63952)
Fix boolean default in migration from false to 0
(cherry picked from commit a05bf41ff9)
Co-authored-by: Alex Moreno <alexander.moreno@grafana.com>
Profile: Fix session table overflowing page layout in mobile (#63858)
handle table overflowing in mobile layout
(cherry picked from commit 4f01d55a3c)
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
TimeSeries: Fix legend and tooltip colors changing after data refreshes (#63823)
(cherry picked from commit b2c0175777)
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
TraceView: Add key and url escaping of json tag values (#751)
(cherry picked from commit 8b53b448bc24fbfc4492ce1f4e2b1708218f70b7)
Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
fix(dashboard version service): add DashboardUID to query and responses (#60800)
* fix(dashboard version service): add DashboardUID to query and responses
The DashboardUID was not populated in the response from Get and ListDashboardVersions. This adds the DashboardUID to the Get query (it was already in List) and populated the DashboardUID in the returned DashboardVersionDTOs.
(cherry picked from commit 42be0e106f)
Co-authored-by: Kristin Laemmert <mildwonkey@users.noreply.github.com>
Alerting: Fix available labels in the alert panel groupby dropdown (#63573)
(cherry picked from commit 5f35995cd4)
Co-authored-by: Konrad Lalik <konrad.lalik@grafana.com>
AzureMonitor: Fix template variables in ARG subscription field (#63731)
Add support for template variables in sub field
(cherry picked from commit 823aaaeb7c)
Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
Users: Fix org user always getting org id = 1 on auto assign false (#63708)
* fix org user always getting org id = 1 on auto assign false
* make tests explicit
* use correct cfg in service accounts
* fix api tests
* fix database test of ac
* fix InsertOrgUser returning affected rows as orgID
(cherry picked from commit c8db771939)
* Alerting: Instrument outgoing state history requests using weaveworks/common (#63600)
* Loki backend and client depend on a requester
* Instrument all requests to loki using weaveworks TimedClient
* Construct collector in metrics package
(cherry picked from commit e77621649d)
* Revert all changes to gomod and gosum
Bump coverage versions (#63755)
- Includes a fix to ensure only ts/tsx files have coverage generated
(cherry picked from commit 0a7474ac5c)
Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
Plugins: Fix plugins CDN not working when plugins are not in domain's root path (#63202)
* Plugins CDN: Add support for different CDN root path
* Plugins CDN: Make frontendsettings return the correct CDN base path
* Update comments
* Fix version detection
* Undo frontend changes
* Fix system.js asset path construction
* fix(plugins): translate all plugin css asset paths loaded via cdn
* refactor(plugins): rename extractPluginNameVersionFromUrl and add comments
* Fix typo in comment
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
* Hardcode CDN URL structure
/{id}/{version}/public/plugins/{id}/{assetPath} is not required anymore in the cdn url template config
---------
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
(cherry picked from commit 966bcd3545)
Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>
TestData: Fix bug when selecting "Log" streaming (#63190)
* fix wrong fields getting populated
* fix bug not being able to select another streaming type
* add correct arg type
* remove unused import
(cherry picked from commit b3c0e7e977)
Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
Alerting: Fix changing datasource and creating new query not using defaults. (#63092)
* Set default query when changing data source or adding new alert query
* Set default query when creating new alert rule
* Set fefault query for cloud and recording rules
* Create hook for getting defaults in AlertRuleForm
* fixing tests
* Use conditionals with 'if' for more clarity and rename lazy to async
* Add loading indicator for default queries
* Fix tests
* Make newModel a sync method and fix tests error
* Use useAsync instead of useEffect for an async call
(cherry picked from commit b42f973a7a)
Co-authored-by: Sonia Aguilar <33540275+soniaAguilarPeiron@users.noreply.github.com>
Datasource Onboarding: Prevent flickering of onboarding page after first load (#63360)
* Datasource Onboarding: Prevent flickering of onboarding page after first load
* add loading state to loadDatasources & refactor
* fix test
* avoid loading state when loading datasources on add
* fix test
* add explainer on why fetching datasources is needed
(cherry picked from commit c136ad1f16)
Co-authored-by: Giordano Ricci <me@giordanoricci.com>
Loki ds: Interpolation breaks in Loki queries when no scoped vars (#63694)
(cherry picked from commit 14e29451cf)
Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>
InfluxDB ds: Query variable breaks trying to interpolate `__interval` (#63682)
(cherry picked from commit ca4cd85504)
Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>
Docs: Update default value for geomaps enable_custom_baselayers option (#61880)
Docs: Update default value for geomaps disable_custom_baselayers option
The `disable_custom_baselayers` configuration option name and default
value were inverted in commit e604e69d93,
but the update to the description in the documentation was missed.
(cherry picked from commit 22f51602ba)
Co-authored-by: zsrv <95176387+zsrv@users.noreply.github.com>
InfluxDB: Fix getting empty response when querying fields with retention policy (#63669)
Revert "InfluxDB: Send retention policy with InfluxQL queries if its been specified. (#62149)"
This reverts commit a5a85e0398.
(cherry picked from commit ffed779879)
Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
Navigation: Add plugin upgrade guide to docs (#63449)
* initial attempt at plugin upgrade guide
* fix link
* small tweaks based on feedback
* add basic skeleton for tabs documentation
(cherry picked from commit f6e92da402)
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
TimeRangeInput: Fix positioning of dropdown menu (#63472)
fix TimeRangeInput positioning
(cherry picked from commit bcaf4dc0b1)
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
MSSQL Datasource: Revert functions within macros change (#63592)
* Revert functions within macros change
* Add tests for function and macro for mssql
* Remove macro support tests
---------
Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
(cherry picked from commit 356e2e1933)
Co-authored-by: Kyle Cunningham <codeincarnate@users.noreply.github.com>
CloudWatch: Remove error for multi-value variable in logs runner (#63522)
Remove error for multi template variable in CW logs runner
(cherry picked from commit 3a57304ef0)
Co-authored-by: Shirley <4163034+fridgepoet@users.noreply.github.com>
* Authn: Anon session service (#63052)
* add anon sessions package
* add usage stat fn
* implement count for cache
* add anonservice to authn broker
* lint
* add tests for remote cache count
* move anon service to services
* wrap tagging in goroutine
* make func used
(cherry picked from commit ff78103a24)
* add local cache to protect multiple writes to DB cache
(cherry picked from commit bdb084736b)
CloudMonitor: Fix query migration (#63491)
* Update query and set required fields for explore queries
* Update test case
- Validate onChange is called with the new query
(cherry picked from commit 20591cc42b)
Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
Alerting: Fix incorrect comment in eval.go (#63510)
This commit fixes an incorrect comment in the Result struct in eval.go
that I had written some time ago. The comment now documents the
actual behaviour and content of this field.
(cherry picked from commit f93a9c794d)
Co-authored-by: George Robinson <george.robinson@grafana.com>
Authn: Stat registration (#62934)
* reorganize auth usage stats
* usage stat privilege elevators
* stat count of modified role
* cfg related info
* add authn anon client
* kv store
* ensure anon enabled is collected even if client is not registered
* fix usage stats test
(cherry picked from commit 14a78b58e9)
Alerting: Get alert rules on faults (#61248) (#63051)
* Alerting: get alert rules on faults (#61248)
Two functions used to fetch alert rules from DB are updated:
- GetAlertRulesForScheduling
- ListAlertRules
Rows are scanned one by one so good ones are returned.
Common Error is logged with indication how many
rules failed on deserialization.
Resolved: #61248
* updates from review comments
(cherry picked from commit 56c8661929)
Co-authored-by: bla2ej <123992384+bla2ej@users.noreply.github.com>
Alerting: Fix confusing comment about screenshots in default.ini and docs (#63346)
(cherry picked from commit 005f5ca1df)
Co-authored-by: George Robinson <george.robinson@grafana.com>
Loki Context UI: Do not disable last label (#62866)
* improved text
* prevent all labels removed
* use `structuredClone` instead of lodash
* update test
* get `structuredClone` in test?
* fix using structuredClone
(cherry picked from commit 00edc1c6b1)
Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
PanelChrome: Make loading animation speed the same across panels (#62997)
Revert devenv dashboard change
(cherry picked from commit ed626427de)
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
Alerting: Fix a bug taking screenshots with Dashboard UID (#63220)
This commit fixes a bug where Grafana would fail to take a screenshot if
the same Dashboard UID was present across two or more different orgs.
(cherry picked from commit 1f984409a2)
Co-authored-by: George Robinson <george.robinson@grafana.com>
Provisioning: Parse boolean and numeric values from environment variables (#63085)
(cherry picked from commit a33e316f40)
Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
Navigation: add a link to starred dashboards in the megamenu (#62685)
add a link to starred dashboards in the megamenu
(cherry picked from commit fc2f7f90f8)
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Navigation: Ensure command palette is correctly translated (#61103)
* Navigation: Translate nav tree in store
* Remove usage of getNavTitle
* properly translate children
* add pubdash translation
* remove extraneous calls to translation in PageHeader
* empty commit
* correctly allow subtitle to be overrwitten (thank you tests!)
---------
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
(cherry picked from commit 504eabbe80)
Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
Prometheus: Table format throwing error on empty result (#63053)
* fix bug in prometheus table view which is throwing error when a query returns no results
(cherry picked from commit 79b750a4b2)
Co-authored-by: Galen Kistler <109082771+gtk-grafana@users.noreply.github.com>
Update publishing workflows to use organization secret (#63001)
The new tokens are managed centrally and have a longer expiry.
Administrators of the grafanabot account will be
notified of the pending expiry and the secret can be rotated centrally
without the need for a repository administrator to update their
secrets.
The existing repository secrets can safely be removed. The tokens for
those secrets will be removed by the end of this week.
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
(cherry picked from commit ba9bdf3455)
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
docs: upgrade guide refactor organizes releases into their own pages; moves upgrade guide to the root (#62402)
* organizes releases into their own pages; moves upgrade guide to the root
* adds and removes aliases
* Update docs/sources/upgrade-guide/upgrade-v8.0/index.md
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
* Update docs/sources/upgrade-guide/upgrade-v8.0/index.md
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
* Update docs/sources/upgrade-guide/upgrade-v8.0/index.md
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
* Update docs/sources/upgrade-guide/upgrade-v9.3/index.md
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
* Update docs/sources/shared/upgrade/upgrade-common-tasks.md
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
* Update docs/sources/shared/upgrade/upgrade-common-tasks.md
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
* Update docs/sources/shared/upgrade/upgrade-common-tasks.md
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
* corrects relrefs
---------
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
(cherry picked from commit ee2e294b4e)
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Add canonical URL to all HTTP API docs (#62957)
Facilitates mounting these docs in the Grafana Cloud documentation set
without affecting SEO.
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
(cherry picked from commit 4037e5e325)
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
docs: fix broken annotations link (#62834)
* docs: fix broken annotations link
Link to annotations section is broken because the section was never added. A placeholder for it was removed on this commit, but the link wasn't. This seems like the best place to point to.
* fix relref formatting
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* removed TODOs from tables
* prettier linting
---------
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
(cherry picked from commit 09943407e4)
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
Prometheus: Refactor. Use data source UID rather than the deprecated ID (#62795)
(cherry picked from commit 32e6af966f)
Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
SAML: Update library (fix single logout) (#62880)
* SAML: update library (fix single logout)
* Run go mod tidy
(cherry picked from commit 5205cfb11c)
Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>
Navigation: move Connections plugin to be just after apps (#62801)
move connections plugin to be just after apps
(cherry picked from commit c819e95687)
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Search: Fix not being able to clear sort value (#62557)
* user essentials mob! 🔱
lastFile:public/app/features/search/state/SearchStateManager.ts
* user essentials mob! 🔱
lastFile:public/app/features/search/page/components/ActionRow.tsx
* user essentials mob! 🔱
* remove searchSort state from localStorage when cleared
---------
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: Joao Silva <joao.silva@grafana.com>
(cherry picked from commit f8809eef59)
Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
Alerting: Add label query parameters to state history endpoint (#62831)
* Allow equality-only matching of arbitrary labels via query params
* Pre-initialize map
(cherry picked from commit 9eeea8f5ea)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
Alerting: implement loki query for alert state history (#61992)
* Alerting: implement loki query for alert state history
* extract selector building
* add unit tests for selector creation
* backup
* give selectors their own type
* build dataframe
* add some tests
* small changes after manual testing
* use struct client
* golint
* more golint
* Make RuleUID optional for Loki implementation
* Drop initial assumption that we only have one series
* Pare down to three columns, fix timestamp overflows, improve failure cases in loki responses
* Embed structred log lines in the dataframe as objects rather than json strings
* Include state history label filter
* Remove dead code
---------
Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>
Alerting: Fix template validation in provisioning api (#62530)
* Alerting: Fix template validation in provisioning api
Fix issue where provisioning API accepts a malformed template having extra
text outside of definition block and template name matching definition name.
(cherry picked from commit f9ec16e74f)
Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>
Alerting: Add static label to all state history entries (#62817)
* Add static label to all state history entries
* Separate label and value visually
(cherry picked from commit 647f73ddc5)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
Alerting: Add endpoint for querying state history (#62166)
* Define endpoint and generate
* Wire up and register endpoint
* Cleanup, define authorization
* Forgot the leading slash
* Wire up query and SignedInUser
* Wire up timerange query params
* Add todo for label queries
* Drop comment
* Update path to rules subtree
(cherry picked from commit 6ad1cfef38)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
Alerting: Usability adjustments to Loki representation of state history values (#62643)
* Extract label merge, add test file
* Extract error/NoData to first class fields, remove a layer from values
* Include dashUID and panelID as line-level fields
* Drop unnecessary object receiver
* Add tests for stream building
* Drop NoData field from log lines
(cherry picked from commit 9fa28c11c5)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
Tempo: Inject status and status.code for tags autocomplete (#62794)
* Tempo: Inject status for v2 and status.code for v1 in the tags list for autocomplete
* Small comment fix
(cherry picked from commit b78af0b0f0)
Co-authored-by: Andre Pereira <adrapereira@gmail.com>
Plugins: Prefer to use the data source UID when querying (#62776)
(cherry picked from commit 68862ce3e8)
Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
SQLStore: Fix folder migration for MySQL < 5.7 (#62521)
* Nested folders: Do not skip integration tests
* SQLStore: Fix folder migration
It reduces the length of the title column to be equal with the respective
dashboard column.
(cherry picked from commit 4eaff63eda)
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
Heatmap: Support heatmap rows with non-timeseries X axis (#60929)
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
(cherry picked from commit 4a8763d7b6)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Nested Folder: Fix for SQLite not to overwrite the parent on restarts (#62709)
Nested Folder: Fix for SQLite not to overwrite the arent on restarts
(cherry picked from commit adaf82ffb7)
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
Fix: Save and test error message does not persist across datasource instance settings anymore
(cherry picked from commit ce50168b70)
Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com>
Elasticsearch: Fix consistent label order in alerting (#62497)
elasticsearch: backend: sort label-values
(cherry picked from commit d9fd807375)
Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
Explore: Fix graph not updating when changing config (#62473)
* Explore: Fix graph not updating when changing config
* move useStructureRev to a seprate hook and add specific tests
(cherry picked from commit 6b6b733229)
Co-authored-by: Giordano Ricci <me@giordanoricci.com>
Tempo: Remove tempoApmTable feature flag (#62499)
Remove tempoApmTable feature flag
(cherry picked from commit 5e1506dea0)
Co-authored-by: Andre Pereira <adrapereira@gmail.com>
Navigation: wrap dashboard settings actions in `ToolbarButtonRow` for responsiveness (#62475)
wrap dashboard actions in toolbarbuttonrow for responsiveness
(cherry picked from commit 0a780d978e)
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Loki: Fix label filter expression treating int as string (#62496)
* fix: label filter expression treats int as string
* refactor: labelFilterRenderer
* test: add tests to labelFilterRenderer
* refactor: use backticks based on the operator not the value
* test: labelFilterRenderer uses the correct value type based on the operator
* test: use it.every rather than having multiple repetitive tests
(cherry picked from commit 42f8f5a9ea)
Co-authored-by: Gareth Dawson <gareth.dawson@grafana.com>
Alerting: Add Copy action to templates table (#62135)
* Add duplicate action to templates table
Co-authored-by: Virginia Cepeda <virginia.cepeda@grafana.com>
* Move duplicate icon, and remove provenance when rendering TemplateForm
* Create generic generateCopiedName method to avoid duplication and use it also in the CloneRuleEditor
* Use 'Copy' for duplicating templates and cloning alert rules
* Improve updating the template content with new unique define values when copying
Co-authored-by: Konrad Lalik <konradlalik@gmail.com>
* Fix typo
---------
Co-authored-by: Virginia Cepeda <virginia.cepeda@grafana.com>
Co-authored-by: Konrad Lalik <konradlalik@gmail.com>
(cherry picked from commit 151e57df70)
Co-authored-by: Sonia Aguilar <33540275+soniaAguilarPeiron@users.noreply.github.com>
Alerting: Allow alert rule pausing from API (#62326)
* Add is_paused attr to the POST alert rule group endpoint
* Add is_paused to alerting API POST alert rule group
* Fixed tests
* Add is_paused to alerting gettable endpoints
* Fix integration tests
* Alerting: allow to pause existing rules (#62401)
* Display Pause Rule switch in Editing Rule form
* add isPaused property to form interface and dto
* map isPaused prop with is_paused value from DTO
Also update test snapshots
* Append '(Paused)' text on alert list state column when appropriate
* Change Switch styles according to discussion with UX
Also adding a tooltip with info what this means
* Adjust styles
* Fix alignment and isPaused type definition
Co-authored-by: gillesdemey <gilles.de.mey@gmail.com>
* Fix test
* Fix test
* Fix RuleList test
---------
Co-authored-by: gillesdemey <gilles.de.mey@gmail.com>
* wip
* Fix tests and add comments to clarify AlertRuleWithOptionals
* Fix one more test
* Fix tests
* Fix typo in comment
* Fix alert rule(s) cannot be paused via API
* Add integration tests for alerting api pausing flow
* Remove duplicated integration test
---------
Co-authored-by: Virginia Cepeda <virginia.cepeda@grafana.com>
Co-authored-by: gillesdemey <gilles.de.mey@gmail.com>
Co-authored-by: George Robinson <george.robinson@grafana.com>
(cherry picked from commit 53945afedf)
Co-authored-by: Alex Moreno <alexander.moreno@grafana.com>
Alerting: Show 'start typing' message in evaluation group folder in case of empty options. (#62611)
Show start typing message in evaluation group folder in case of empty options
(cherry picked from commit c0865c863d)
Co-authored-by: Sonia Aguilar <33540275+soniaAguilarPeiron@users.noreply.github.com>
CI: Replace `grafana/grafana-oss` with `grafana-oss` when publishing to dockerhub repo (#62651)
Replace grafana/grafana-oss with grafana-oss
(cherry picked from commit 1a5b54cff3)
Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
PanelChrome: Adds display mode to support transparent option (#62647)
* PanelChrome: Add transparent displayMode
* Remove comment
* Fixes to storybook and new example
* no background on TitleItem
---------
Co-authored-by: polinaboneva <polina.boneva@grafana.com>
(cherry picked from commit 533c8e4b7a)
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
Alerting: Fix handling of special floating-point cases when writing observed values to annotations (#61074)
* Fix json serialization of state values
* Simplify two of the tests
* Fix linter complaint
* Don't return error if we fail to look up dashboard, just log it and move on
* Address linter complaint
(cherry picked from commit 03f3fbec0d)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
Expressions: Fixes the issue showing expressions editor (#62510)
* Use suggested value for uid
* update the snapshot
* use __expr__
* replace all -100 with __expr__
* update snapshot
* more changes
* revert redundant change
* Use expr.DatasourceUID where it's possible
* generate files
(cherry picked from commit 91221bc436)
Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
MySQL: Quote identifiers that include special characters (#61135)
* SQL: toRawSQL required and escape table
* Fix autocomplete for MySQL
* Change the way we escape for builder
* Rework escape ident to be smart instead
* Fix A11y for alias
* Add first e2e test
* Add test for code editor
* Add doc
* Review comments
* Move functions to sqlUtil
(cherry picked from commit 62c30dea4d)
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
TopNav: Fix right padding on signin link (#62537)
* TopNav: Fix right padding on signin link
* revert yarn lock
* Update package.json
* Update
(cherry picked from commit c0f0c3d485)
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
Navigation: add event tracking for dashboard save as events (#62568)
* add event tracking for dashboard save as events
* emit a grafana_dashboard_copied event instead
(cherry picked from commit 029253d5f6)
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Navigation: add event tracking for navigation elements (#62563)
add user tracking for navigation elements
(cherry picked from commit 77a186879d)
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Login: Fix panic when UpsertUser is called without ReqContext (#62539)
(cherry picked from commit b1151dd118)
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
PanelChrome: Styling issues (#62466)
* all panel icons are 16x16 in size; allow ToolbarButton to have its icon size set from outside;
* use TitleItem for streaming too, so that the style of focus-visible is the same
* allow menu icon to be visible when panel is focused
* remove some styling of title icons in panel header
* panel alert notices are too big
* PanelHeaderNotice: Fix styling issue with background and hover when
feature toggle is not enable
---------
Co-authored-by: Alexandra Vargas <alexa1866@gmail.com>
(cherry picked from commit d48a8fd227)
Co-authored-by: Polina Boneva <13227501+polibb@users.noreply.github.com>
Plugins: Update migration guide for 9.4/forwarded headers (#62505)
Update plugin migration guide in regards to v9.4 and forwarding
of headers in grafana-plugin-sdk-go.
(cherry picked from commit 6c02c7079f)
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Navigation: Sign in button now works correctly when served under a sub path (#62504)
make sure getUrlForPartial always includes the basePath + unit tests
(cherry picked from commit fd2641a542)
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Alerting: Clarify PagerDuty integrationKey format (#62463)
**What is this feature?**
Simply a documentation update.
**Why do we need this feature?**
Clarify the doc, so people don't waste time integrating the wrong key,
e.g. #8979, #9036, https://community.librenms.org/t/19013
**Who is this feature for?**
Developers doing a PagerDuty integration.
(cherry picked from commit a7c4872bcd)
Co-authored-by: Andre Miras <AndreMiras@users.noreply.github.com>
Alerting: Allow separate read and write path URLs for Loki state history (#62268)
Extract config parsing and add tests
(cherry picked from commit e7ace4ed62)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
Alerting: Configurable externalLabels for Loki state history (#62404)
* Add config option for external labels
* Remove redundant nilcheck
(cherry picked from commit b4682fe3cb)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
Alerting: Allow pausing alerts from provisioning (#62263)
* Allow pausing alerts from provisioning
* Update swagger
* Add IsPaused to provision export endpoints
* Add pause field in sample.yml
* Add exception for reset state in first loop iteration of scheduler if rule is paused
* Update provision definition and swagger docs
* Fix provisioning export tests
* Suggestion: Simplify if condition
* Add more context to a comment
(cherry picked from commit 7a465f42a6)
Co-authored-by: Alex Moreno <alexander.moreno@grafana.com>
description: 'Needs to match, exactly, the name of a milestone. The version to be released please respect: major.minor.patch or major.minor.patch-beta<number> format. example:7.4.3or 7.4.3-beta1'
required:true
env:
YARN_ENABLE_IMMUTABLE_INSTALLS:false
YARN_ENABLE_IMMUTABLE_INSTALLS:false
jobs:
main:
runs-on:ubuntu-latest
steps:
# This is a basic workflow to help you get started with Actions
# This is a basic workflow to help you get started with Actions
- **Query:** Prevent crash while executing concurrent mixed queries
- **Alerting:** Require alert.notifications:write permissions to test receivers and templates
- **RBAC:** Remove legacy AC editor and admin role on new dashboard route. [#68775](https://github.com/grafana/grafana/issues/68775), [@grafanabot](https://github.com/grafanabot)
- **Revert:** Allow editors to access GET /datasources. [#68653](https://github.com/grafana/grafana/issues/68653), [@grafanabot](https://github.com/grafanabot)
- **Explore:** Remove data source onboarding page. [#68642](https://github.com/grafana/grafana/issues/68642), [@grafanabot](https://github.com/grafanabot)
<!-- 9.4.12 END -->
<!-- 9.4.10 START -->
# 9.4.10 (2023-05-08)
### Features and enhancements
- **Chore:** Upgrade Go to 1.20.4. [#67760](https://github.com/grafana/grafana/issues/67760), [@papagian](https://github.com/papagian)
- **TimeSeries:** Fix leading null-fill for missing intervals. [#67572](https://github.com/grafana/grafana/issues/67572), [@leeoniya](https://github.com/leeoniya)
- **Alerting:** Fix misleading status code in provisioning API. [#67357](https://github.com/grafana/grafana/issues/67357), [@grafanabot](https://github.com/grafanabot)
- **Azure Monitor:** Fix bug that was not showing resources for certain locations. [#66617](https://github.com/grafana/grafana/issues/66617), [@grafanabot](https://github.com/grafanabot)
<!-- 9.4.10 END -->
<!-- 9.4.9 START -->
# 9.4.9 (2023-04-24)
### Features and enhancements
- **Chore:** Upgrade Go to 1.20.3. [#66836](https://github.com/grafana/grafana/issues/66836), [@sakjur](https://github.com/sakjur)
- **Alerting:** Fix share URL for Prometheus rules on subpath (#66752). [#66802](https://github.com/grafana/grafana/issues/66802), [@gillesdemey](https://github.com/gillesdemey)
- **Trace View:** Update the queryType to traceql for checking if same trace when clicking span link. [#66670](https://github.com/grafana/grafana/issues/66670), [@ericmustin](https://github.com/ericmustin)
- **InfluxDB:** Fix querying with hardcoded retention policy. [#66587](https://github.com/grafana/grafana/issues/66587), [@itsmylife](https://github.com/itsmylife)
- **Auth:** Remove the session cookie only if it's invalid or revoked. [#66430](https://github.com/grafana/grafana/issues/66430), [@mgyongyosi](https://github.com/mgyongyosi)
- **AccessControl:** Allow editors to access GET /api/datasources. [#66375](https://github.com/grafana/grafana/issues/66375), [@mgyongyosi](https://github.com/mgyongyosi)
- **CloudMonitoring:** Add project selector for MQL editor[fix]. [#65844](https://github.com/grafana/grafana/issues/65844), [@alyssabull](https://github.com/alyssabull)
<!-- 9.4.9 END -->
<!-- 9.4.7 START -->
# 9.4.7 (2023-03-16)
### Bug fixes
- **Alerting:** Update scheduler to receive rule updates only from database. [#64780](https://github.com/grafana/grafana/pull/64780), [@yuri-tceretian](https://github.com/yuri-tceretian)
- **Security:** Fixes for CVE-2023-1410. [#65278](https://github.com/grafana/grafana/pull/65278), [@itsmylife](https://github.com/itsmylife)
### Breaking changes
The InfluxDB backend migration feature toggle (influxdbBackendMigration) has been reintroduced in this version as issues were discovered with backend processing of InfluxDB data. Unless this feature toggle is enabled, all InfluxDB data will be parsed in the frontend. This frontend processing is the default behavior.
In Grafana 9.4.4, InfluxDB data parsing started to be handled in the backend. If you have upgraded to 9.4.4 and then added new transformations on InfluxDB data, those panels will fail to render. To resolve this either:
- Remove the affected panel and re-create it
- Edit the `time` field as `Time` in `panel.json` or `dashboard.json` Issue [#64842](https://github.com/grafana/grafana/issues/64842)
<!-- 9.4.7 END -->
<!-- 9.4.3 START -->
# 9.4.3 (2023-03-02)
### Bug fixes
- **Alerting:** Use background context for maintenance function. [#64065](https://github.com/grafana/grafana/pull/64065), [@yuri-tceretian](https://github.com/yuri-tceretian)
- **Alerting:** Fix boolean default in migration from false to 0. [#63952](https://github.com/grafana/grafana/pull/63952), [@alexmobo](https://github.com/alexmobo)
<!-- 9.4.2 END -->
<!-- 9.4.1 START -->
# 9.4.1 (2023-02-28)
<!-- 9.4.1 END -->
<!-- 9.4.0 START -->
# 9.4.0 (2023-02-28)
### Features and enhancements
- **Alerting:** Add endpoint for querying state history. [#62166](https://github.com/grafana/grafana/pull/62166), [@alexweav](https://github.com/alexweav)
- **Alerting:** Add label query parameters to state history endpoint. [#62831](https://github.com/grafana/grafana/pull/62831), [@alexweav](https://github.com/alexweav)
- **Alerting:** Add static label to all state history entries. [#62817](https://github.com/grafana/grafana/pull/62817), [@alexweav](https://github.com/alexweav)
- **Alerting:** Mark AM configuration as applied. [#61330](https://github.com/grafana/grafana/pull/61330), [@santihernandezc](https://github.com/santihernandezc)
- **InfluxDB:** Move database information into jsondata. [#62308](https://github.com/grafana/grafana/pull/62308), [@itsmylife](https://github.com/itsmylife)
- **Transformations:** Selectively apply transformation to queries. [#61735](https://github.com/grafana/grafana/pull/61735), [@ryantxu](https://github.com/ryantxu)
### Bug fixes
- **AccessControl:** Clear user permission cache for update org user role. [#62745](https://github.com/grafana/grafana/pull/62745), [@Jguer](https://github.com/Jguer)
- **Alerting:** Fix handling of special floating-point cases when writing observed values to annotations. [#61074](https://github.com/grafana/grafana/pull/61074), [@alexweav](https://github.com/alexweav)
- **ContextMenu:** Consider y coord when determining bottom collision. [#62403](https://github.com/grafana/grafana/pull/62403), [@gelicia](https://github.com/gelicia)
- **Elasticsearch:** Fix consistent label order in alerting. [#62497](https://github.com/grafana/grafana/pull/62497), [@gabor](https://github.com/gabor)
- **Explore:** Fix graph not updating when changing config. [#62473](https://github.com/grafana/grafana/pull/62473), [@Elfo404](https://github.com/Elfo404)
- **Heatmap:** Support heatmap rows with non-timeseries X axis. [#60929](https://github.com/grafana/grafana/pull/60929), [@ryantxu](https://github.com/ryantxu)
- **Login:** Fix panic when a user is upserted by a background process. [#62539](https://github.com/grafana/grafana/pull/62539), [@sakjur](https://github.com/sakjur)
- **MSSQL:** Add support for macro function calls. [#62742](https://github.com/grafana/grafana/pull/62742), [@mdvictor](https://github.com/mdvictor)
- **MySQL:** Quote identifiers that include special characters. [#61135](https://github.com/grafana/grafana/pull/61135), [@zoltanbedi](https://github.com/zoltanbedi)
- **Navigation:** Sign in button now works correctly when served under a sub path. [#62504](https://github.com/grafana/grafana/pull/62504), [@ashharrison90](https://github.com/ashharrison90)
- **Nested Folder:** Fix for SQLite not to overwrite the parent on restarts. [#62709](https://github.com/grafana/grafana/pull/62709), [@papagian](https://github.com/papagian)
- **PanelChrome:** Adds display mode to support transparent option. [#62647](https://github.com/grafana/grafana/pull/62647), [@torkelo](https://github.com/torkelo)
- **Plugins:** Case-sensitive routes for standalone pages. [#62779](https://github.com/grafana/grafana/pull/62779), [@leventebalogh](https://github.com/leventebalogh)
- **Plugins:** Prefer to use the data source UID when querying. [#62776](https://github.com/grafana/grafana/pull/62776), [@andresmgot](https://github.com/andresmgot)
- **SQLStore:** Fix folder migration for MySQL < 5.7. [#62521](https://github.com/grafana/grafana/pull/62521), [@papagian](https://github.com/papagian)
- **Search:** Fix not being able to clear sort value. [#62557](https://github.com/grafana/grafana/pull/62557), [@joshhunt](https://github.com/joshhunt)
- **Tempo:** Fix span name being dropped from the query. [#62257](https://github.com/grafana/grafana/pull/62257), [@CrypticSignal](https://github.com/CrypticSignal)
- **API:** Change how Cache-Control and related headers are set. [#62021](https://github.com/grafana/grafana/pull/62021), [@kylebrandt](https://github.com/kylebrandt)
- **AccessControl:** Add high availability support to access control seeder. (Enterprise)
- **Accessibility:** Make QueryEditorHelp examples keyboard interactive. [#59355](https://github.com/grafana/grafana/pull/59355), [@idastambuk](https://github.com/idastambuk)
- **Admin:** Combine org and admin user pages. [#59365](https://github.com/grafana/grafana/pull/59365), [@Clarity-89](https://github.com/Clarity-89)
- **Alerting:** Add dashboard and panel picker to the rule form. [#58304](https://github.com/grafana/grafana/pull/58304), [@konrad147](https://github.com/konrad147)
- **Alerting:** Add discord as a possible receiver in cloud rules. [#59366](https://github.com/grafana/grafana/pull/59366), [@soniaAguilarPeiron](https://github.com/soniaAguilarPeiron)
- **Alerting:** Add export button for exporting all alert rules in alert list view. [#62416](https://github.com/grafana/grafana/pull/62416), [@soniaAguilarPeiron](https://github.com/soniaAguilarPeiron)
- **Alerting:** Add header X-Grafana-Org-Id to evaluation requests. [#58972](https://github.com/grafana/grafana/pull/58972), [@yuri-tceretian](https://github.com/yuri-tceretian)
- **Alerting:** Add maxdatapoints in alert rule form. [#61904](https://github.com/grafana/grafana/pull/61904), [@soniaAguilarPeiron](https://github.com/soniaAguilarPeiron)
- **Alerting:** Add provisioning endpoint to fetch all rules. [#59989](https://github.com/grafana/grafana/pull/59989), [@alexweav](https://github.com/alexweav)
- **Alerting:** Add support for settings parse_mode and disable_notifications to Telegram receiver. [#60198](https://github.com/grafana/grafana/pull/60198), [@yuri-tceretian](https://github.com/yuri-tceretian)
- **Alerting:** Add support for tracing to alerting scheduler. [#61057](https://github.com/grafana/grafana/pull/61057), [@yuri-tceretian](https://github.com/yuri-tceretian)
- **Alerting:** Adds evaluation interval to group view. [#59974](https://github.com/grafana/grafana/pull/59974), [@gillesdemey](https://github.com/gillesdemey)
- **Alerting:** Allow state history to be disabled through configuration. [#61006](https://github.com/grafana/grafana/pull/61006), [@alexweav](https://github.com/alexweav)
- **Alerting:** Bump Prometheus Alertmanager to v0.25. [#60764](https://github.com/grafana/grafana/pull/60764), [@santihernandezc](https://github.com/santihernandezc)
- **Alerting:** Choose a previous valid AM configuration in case of error. [#58472](https://github.com/grafana/grafana/pull/58472), [@santihernandezc](https://github.com/santihernandezc)
- **Alerting:** Create endpoints for exporting in provisioning file format. [#58623](https://github.com/grafana/grafana/pull/58623), [@JacobsonMT](https://github.com/JacobsonMT)
- **Alerting:** Declare incident from a firing alert. [#61178](https://github.com/grafana/grafana/pull/61178), [@gillesdemey](https://github.com/gillesdemey)
- **Alerting:** Do not maintain Normal state. [#56336](https://github.com/grafana/grafana/pull/56336), [@yuri-tceretian](https://github.com/yuri-tceretian)
- **Alerting:** Improve UI for making more clear that evaluation interval belongs to the group. [#56397](https://github.com/grafana/grafana/pull/56397), [@soniaAguilarPeiron](https://github.com/soniaAguilarPeiron)
- **Alerting:** Improve legacy migration to include send reminder & frequency. [#60275](https://github.com/grafana/grafana/pull/60275), [@JacobsonMT](https://github.com/JacobsonMT)
- **Alerting:** PagerDuty receiver to let user configure fields Source, Client and Client URL. [#59895](https://github.com/grafana/grafana/pull/59895), [@yuri-tceretian](https://github.com/yuri-tceretian)
- **Alerting:** Rename contact point type to receiver in the user interface. [#59589](https://github.com/grafana/grafana/pull/59589), [@grobinson-grafana](https://github.com/grobinson-grafana)
- **Alerting:** Rule evaluator to get cached data source info. [#61305](https://github.com/grafana/grafana/pull/61305), [@yuri-tceretian](https://github.com/yuri-tceretian)
- **Alerting:** Support customizable timeout for screenshots. [#60981](https://github.com/grafana/grafana/pull/60981), [@grobinson-grafana](https://github.com/grobinson-grafana)
- **Alerting:** UI changes required to support v3 and Auth in Kafka Contact Point. [#61123](https://github.com/grafana/grafana/pull/61123), [@MohammadGhazanfar](https://github.com/MohammadGhazanfar)
- **Alerting:** Update Alerting and Alertmanager to v0.25.1. [#61233](https://github.com/grafana/grafana/pull/61233), [@grobinson-grafana](https://github.com/grobinson-grafana)
- **Alerting:** Upload images to Slack via files.upload. [#59163](https://github.com/grafana/grafana/pull/59163), [@grobinson-grafana](https://github.com/grobinson-grafana)
- **Auditing/Usage Insights:** Loki support for multi-tenancy. (Enterprise)
- **Auth forwarding:** Pass tokens without refresh. [#61634](https://github.com/grafana/grafana/pull/61634), [@Jguer](https://github.com/Jguer)
- **Auth:** Add expiry date for service accounts access tokens. [#58885](https://github.com/grafana/grafana/pull/58885), [@linoman](https://github.com/linoman)
- **Auth:** Add plugin roles to RolePicker. [#59667](https://github.com/grafana/grafana/pull/59667), [@linoman](https://github.com/linoman)
- **Auth:** Add skip_org_role_sync for AzureAD OAuth. [#60322](https://github.com/grafana/grafana/pull/60322), [@eleijonmarck](https://github.com/eleijonmarck)
- **Auth:** Add skip_org_role_sync for Okta. [#62106](https://github.com/grafana/grafana/pull/62106), [@eleijonmarck](https://github.com/eleijonmarck)
- **Auth:** Add skip_org_role_sync setting for GrafanaCom. [#60553](https://github.com/grafana/grafana/pull/60553), [@eleijonmarck](https://github.com/eleijonmarck)
- **Auth:** Add skip_org_role_sync setting for github. [#61673](https://github.com/grafana/grafana/pull/61673), [@eleijonmarck](https://github.com/eleijonmarck)
- **Auth:** Add skip_org_role_sync to GitLab OAuth. [#62055](https://github.com/grafana/grafana/pull/62055), [@eleijonmarck](https://github.com/eleijonmarck)
- **Auth:** Add sub claim check to JWT Auth pre-checks. [#61417](https://github.com/grafana/grafana/pull/61417), [@mgyongyosi](https://github.com/mgyongyosi)
- **Auth:** Disable team sync for JWT Authentication. [#62191](https://github.com/grafana/grafana/pull/62191), [@eleijonmarck](https://github.com/eleijonmarck)
- **Auth:** Display id Provider label in orgs/users view. [#58033](https://github.com/grafana/grafana/pull/58033), [@linoman](https://github.com/linoman)
- **Auth:** Implement skip org role sync for jwt. [#61647](https://github.com/grafana/grafana/pull/61647), [@linoman](https://github.com/linoman)
- **Auth:** Log a more useful msg if no OAuth provider configured. [#56722](https://github.com/grafana/grafana/pull/56722), [@someone-stole-my-name](https://github.com/someone-stole-my-name)
- **Auth:** Set service account access token limit on expiry dates. [#56467](https://github.com/grafana/grafana/pull/56467), [@linoman](https://github.com/linoman)
- **Azure Monitor:** Add variable function to list regions. [#62297](https://github.com/grafana/grafana/pull/62297), [@andresmgot](https://github.com/andresmgot)
- **Backend:** Consistently use context RemoteAddr function to determine remote address. [#60201](https://github.com/grafana/grafana/pull/60201), [@DanCech](https://github.com/DanCech)
- **BarChart:** Highlight bars option for easier interaction. [#60530](https://github.com/grafana/grafana/pull/60530), [@mdvictor](https://github.com/mdvictor)
- **Canvas:** Add server element. [#61104](https://github.com/grafana/grafana/pull/61104), [@drew08t](https://github.com/drew08t)
- **Canvas:** Add support for basic arrows. [#57561](https://github.com/grafana/grafana/pull/57561), [@nmarrs](https://github.com/nmarrs)
- **Canvas:** Add tooltip for data links. [#61648](https://github.com/grafana/grafana/pull/61648), [@adela-almasan](https://github.com/adela-almasan)
- **Canvas:** Improve placement when adding an element via context menu. [#61071](https://github.com/grafana/grafana/pull/61071), [@adela-almasan](https://github.com/adela-almasan)
- **Canvas:** Update context menu actions for multiple elements selected. [#61108](https://github.com/grafana/grafana/pull/61108), [@adela-almasan](https://github.com/adela-almasan)
- **Canvas:** Update element(s) selection after action. [#61204](https://github.com/grafana/grafana/pull/61204), [@adela-almasan](https://github.com/adela-almasan)
- **Chore:** Add deprecation warnings for Sentry. [#60165](https://github.com/grafana/grafana/pull/60165), [@domasx2](https://github.com/domasx2)
- **CloudMonitor:** Improve detail of MQL series labels. [#59747](https://github.com/grafana/grafana/pull/59747), [@aangelisc](https://github.com/aangelisc)
- **CloudWatch Logs:** Set default logs query and disable button when empty. [#61956](https://github.com/grafana/grafana/pull/61956), [@iwysiu](https://github.com/iwysiu)
- **CloudWatch:** Add macro for resolving period in SEARCH expressions. [#60435](https://github.com/grafana/grafana/pull/60435), [@sunker](https://github.com/sunker)
- **Cloudwatch:** Add feedback labels to log groups selector. [#60619](https://github.com/grafana/grafana/pull/60619), [@sunker](https://github.com/sunker)
- **Cloudwatch:** Add run query button. [#60089](https://github.com/grafana/grafana/pull/60089), [@sunker](https://github.com/sunker)
- **Cloudwatch:** Add support for template variables in new log group picker. [#61243](https://github.com/grafana/grafana/pull/61243), [@sunker](https://github.com/sunker)
- **Cloudwatch:** Define and use getDefaultquery instead of calling onChange on mount. [#60221](https://github.com/grafana/grafana/pull/60221), [@idastambuk](https://github.com/idastambuk)
- **Cloudwatch:** Refactor log group model. [#60873](https://github.com/grafana/grafana/pull/60873), [@sunker](https://github.com/sunker)
- **Cloudwatch:** Set CloudwatchCrossAccountQuery feature to stable. [#62348](https://github.com/grafana/grafana/pull/62348), [@sarahzinger](https://github.com/sarahzinger)
- **Cloudwatch:** Use new log group picker also for non cross-account queries. [#60913](https://github.com/grafana/grafana/pull/60913), [@sunker](https://github.com/sunker)
- **CommandPalette:** Minor usability improvements. [#61567](https://github.com/grafana/grafana/pull/61567), [@joshhunt](https://github.com/joshhunt)
- **CommandPalette:** Search for dashboards using API. [#61090](https://github.com/grafana/grafana/pull/61090), [@joshhunt](https://github.com/joshhunt)
- **Config:** Support JSON list syntax. [#61288](https://github.com/grafana/grafana/pull/61288), [@alexanderzobnin](https://github.com/alexanderzobnin)
- **DataLinks:** Allow providing a dynamic data link builder. [#60452](https://github.com/grafana/grafana/pull/60452), [@dprokop](https://github.com/dprokop)
- **Database:** Adds support for enable/disable SQLite Write-Ahead Logging (WAL) via configuration. [#58268](https://github.com/grafana/grafana/pull/58268), [@marefr](https://github.com/marefr)
- **Dataplane:** Deprecate timeseries-many in favor of timeseries-multi. [#59070](https://github.com/grafana/grafana/pull/59070), [@bohandley](https://github.com/bohandley)
- **Datasources:** Add support for getDetDefaultQuery in variable editor. [#62026](https://github.com/grafana/grafana/pull/62026), [@idastambuk](https://github.com/idastambuk)
- **Docs:** Rename Message templates to Notification templates. [#59477](https://github.com/grafana/grafana/pull/59477), [@grobinson-grafana](https://github.com/grobinson-grafana)
- **Docs:** Unified Alerting is now compatible with AWS Aurora. [#61001](https://github.com/grafana/grafana/pull/61001), [@alexweav](https://github.com/alexweav)
- **Elastic:** Remove experimental tag from v8.0+. [#61359](https://github.com/grafana/grafana/pull/61359), [@gwdawson](https://github.com/gwdawson)
- **Elasticsearch:** Deprecate raw document mode. [#62236](https://github.com/grafana/grafana/pull/62236), [@gabor](https://github.com/gabor)
- **Elasticsearch:** Support nested aggregation. [#62301](https://github.com/grafana/grafana/pull/62301), [@gabor](https://github.com/gabor)
- **Email:** Use MJML email template. (Enterprise)
- **Email:** Use MJML email templates. [#57751](https://github.com/grafana/grafana/pull/57751), [@gillesdemey](https://github.com/gillesdemey)
- **Explore:** Add feature to open log sample in split view. [#62097](https://github.com/grafana/grafana/pull/62097), [@ivanahuckova](https://github.com/ivanahuckova)
- **Explore:** Enable resize of split pane. [#58683](https://github.com/grafana/grafana/pull/58683), [@gelicia](https://github.com/gelicia)
- **Explore:** Implement logs sample in Explore. [#61864](https://github.com/grafana/grafana/pull/61864), [@ivanahuckova](https://github.com/ivanahuckova)
- **Explore:** Keyboard shortcut to go to explore. [#61837](https://github.com/grafana/grafana/pull/61837), [@torkelo](https://github.com/torkelo)
- **Explore:** Notify when compact URL is used. [#58684](https://github.com/grafana/grafana/pull/58684), [@gelicia](https://github.com/gelicia)
- **Explore:** Use Datasource Onboarding page when visiting without any datasource set up. [#60399](https://github.com/grafana/grafana/pull/60399), [@Elfo404](https://github.com/Elfo404)
- **FileDropzone:** Format the file size limit in the error message when the max file size is exceeded (1000 => 1 kB). [#62290](https://github.com/grafana/grafana/pull/62290), [@oscarkilhed](https://github.com/oscarkilhed)
- **Flame graph:** Search with uFuzzy. [#61748](https://github.com/grafana/grafana/pull/61748), [@joey-grafana](https://github.com/joey-grafana)
- **Geomap:** Add color gradients to route layer. [#59062](https://github.com/grafana/grafana/pull/59062), [@drew08t](https://github.com/drew08t)
- **Glue:** Validate target query in correlations page. [#57245](https://github.com/grafana/grafana/pull/57245), [@L-M-K-B](https://github.com/L-M-K-B)
- **Heatmap:** Remove legacy angular based implementation. [#59249](https://github.com/grafana/grafana/pull/59249), [@ryantxu](https://github.com/ryantxu)
- **InfluxDB:** Send retention policy with InfluxQL queries if its been specified. [#62149](https://github.com/grafana/grafana/pull/62149), [@brettbuddin](https://github.com/brettbuddin)
- **LDAP:** Make LDAP attribute mapping case-insensitive. [#58992](https://github.com/grafana/grafana/pull/58992), [@markkrj](https://github.com/markkrj)
- **LoginAttempts:** Reset attempts on successfull password reset. [#59215](https://github.com/grafana/grafana/pull/59215), [@kalleep](https://github.com/kalleep)
- **Logs Panel:** Add support for keyboard interactions with log lines. [#60561](https://github.com/grafana/grafana/pull/60561), [@matyax](https://github.com/matyax)
- **Logs:** Add possibility to download logs in JSON format. [#61394](https://github.com/grafana/grafana/pull/61394), [@svennergr](https://github.com/svennergr)
- **Logs:** Make `no logs found` text more visible in Explore. [#61651](https://github.com/grafana/grafana/pull/61651), [@svennergr](https://github.com/svennergr)
- **Logs:** Unify detected fields and labels in Log Details. [#60448](https://github.com/grafana/grafana/pull/60448), [@svennergr](https://github.com/svennergr)
- **Loki Autocomplete:** Suggest only possible labels for unwrap. [#61411](https://github.com/grafana/grafana/pull/61411), [@matyax](https://github.com/matyax)
- **Loki Editor Autocomplete:** Suggest unique history items. [#60262](https://github.com/grafana/grafana/pull/60262), [@matyax](https://github.com/matyax)
- **Loki Query Editor:** Add support to display query parsing errors to users. [#59427](https://github.com/grafana/grafana/pull/59427), [@matyax](https://github.com/matyax)
- **Loki Query Editor:** Update history items with successive queries. [#60327](https://github.com/grafana/grafana/pull/60327), [@matyax](https://github.com/matyax)
- **Loki:** Add format explanation to regex operations. [#60518](https://github.com/grafana/grafana/pull/60518), [@gwdawson](https://github.com/gwdawson)
- **Loki:** Add hints for query filters. [#60293](https://github.com/grafana/grafana/pull/60293), [@gwdawson](https://github.com/gwdawson)
- **Loki:** Add improvements to loki label browser. [#59387](https://github.com/grafana/grafana/pull/59387), [@gwdawson](https://github.com/gwdawson)
- **Loki:** Change format of query builder hints. [#60228](https://github.com/grafana/grafana/pull/60228), [@gwdawson](https://github.com/gwdawson)
- **Loki:** Make label browser accessible in query builder. [#58525](https://github.com/grafana/grafana/pull/58525), [@gwdawson](https://github.com/gwdawson)
- **Loki:** Push support for multi-tenancy mode. [#60866](https://github.com/grafana/grafana/pull/60866), [@joanlopez](https://github.com/joanlopez)
- **Loki:** Remove raw query toggle. [#59125](https://github.com/grafana/grafana/pull/59125), [@gwdawson](https://github.com/gwdawson)
- **Loki:** Rename "explain" toggle to "explain query". [#61150](https://github.com/grafana/grafana/pull/61150), [@gwdawson](https://github.com/gwdawson)
- **Loki:** Set custom width for modals in the loki query editor. [#59714](https://github.com/grafana/grafana/pull/59714), [@gwdawson](https://github.com/gwdawson)
- **Loki:** Show configured log line limit. [#61291](https://github.com/grafana/grafana/pull/61291), [@gwdawson](https://github.com/gwdawson)
- **Loki:** Show query size approximation. [#62109](https://github.com/grafana/grafana/pull/62109), [@gwdawson](https://github.com/gwdawson)
- **Middleware:** Add Custom Headers to HTTP responses. [#59018](https://github.com/grafana/grafana/pull/59018), [@jcalisto](https://github.com/jcalisto)
- **Navigation:** Open command palette from search box. [#61667](https://github.com/grafana/grafana/pull/61667), [@joshhunt](https://github.com/joshhunt)
- **NodeGraph:** Allow usage with single dataframe. [#58448](https://github.com/grafana/grafana/pull/58448), [@aocenas](https://github.com/aocenas)
- **OAuth:** Support pagination for GitHub orgs. [#58648](https://github.com/grafana/grafana/pull/58648), [@sdague](https://github.com/sdague)
- **PanelChrome:** Allow panel to be dragged if set as draggable from the outside. [#61698](https://github.com/grafana/grafana/pull/61698), [@axelavargas](https://github.com/axelavargas)
- **PanelChrome:** Refactor and refine items next to title. [#60514](https://github.com/grafana/grafana/pull/60514), [@axelavargas](https://github.com/axelavargas)
- **PanelRenderer:** Interpolate variables in applyFieldOverrides. [#59844](https://github.com/grafana/grafana/pull/59844), [@connorlindsey](https://github.com/connorlindsey)
- **Phlare:** Reset flame graph after query is run. [#59609](https://github.com/grafana/grafana/pull/59609), [@joey-grafana](https://github.com/joey-grafana)
- **Phlare:** Transition from LogQL/PromQL to Phlare should keep the query. [#60217](https://github.com/grafana/grafana/pull/60217), [@joey-grafana](https://github.com/joey-grafana)
- **Plugins:** Add file permission error check when attempting to verify plugin signature. [#61860](https://github.com/grafana/grafana/pull/61860), [@wbrowne](https://github.com/wbrowne)
- **Plugins:** Unsigned chromium file should not invalidate signature for Renderer plugin. [#59104](https://github.com/grafana/grafana/pull/59104), [@wbrowne](https://github.com/wbrowne)
- **Preferences:** Add pagination to org configuration page. [#60896](https://github.com/grafana/grafana/pull/60896), [@alexanderzobnin](https://github.com/alexanderzobnin)
- **Preferences:** Add theme preference to match system theme. [#61986](https://github.com/grafana/grafana/pull/61986), [@joshhunt](https://github.com/joshhunt)
- **Prometheus:** Kickstart your query, formerly query patterns. [#60718](https://github.com/grafana/grafana/pull/60718), [@bohandley](https://github.com/bohandley)
- **Prometheus:** New instant query results view in Explore. [#60479](https://github.com/grafana/grafana/pull/60479), [@gtk-grafana](https://github.com/gtk-grafana)
- **Prometheus:** Remove buffered client and feature toggle related to it. [#59898](https://github.com/grafana/grafana/pull/59898), [@itsmylife](https://github.com/itsmylife)
- **Public Dashboards:** Time range for public dashboard in NavToolbar. [#60689](https://github.com/grafana/grafana/pull/60689), [@juanicabanas](https://github.com/juanicabanas)
- **PublicDashboards:** A unique page for public dashboards. [#60744](https://github.com/grafana/grafana/pull/60744), [@juanicabanas](https://github.com/juanicabanas)
- **PublicDashboards:** Add react-hook-form for Public Dashboard modal. [#60249](https://github.com/grafana/grafana/pull/60249), [@juanicabanas](https://github.com/juanicabanas)
- **PublicDashboards:** Add share column to public dashboards table. [#61102](https://github.com/grafana/grafana/pull/61102), [@owensmallwood](https://github.com/owensmallwood)
- **PublicDashboards:** Adds middleware for email sharing. (Enterprise)
- **PublicDashboards:** Adds tables and models for email sharing. (Enterprise)
- **PublicDashboards:** Checkboxes list refactor. [#61947](https://github.com/grafana/grafana/pull/61947), [@juanicabanas](https://github.com/juanicabanas)
- **PublicDashboards:** Create API for sharing by email. (Enterprise)
- **PublicDashboards:** Enterprise service skeleton for public dashboards with feature flag. (Enterprise)
- **PublicDashboards:** Modal warns when using unsupported datasources. [#58926](https://github.com/grafana/grafana/pull/58926), [@owensmallwood](https://github.com/owensmallwood)
- **PublicDashboards:** Page to request access to protected pubdash. (Enterprise)
- **PublicDashboards:** Revert Time range setting added. [#60698](https://github.com/grafana/grafana/pull/60698), [@juanicabanas](https://github.com/juanicabanas)
- **PublicDashboards:** Time range conditionally shown. [#60425](https://github.com/grafana/grafana/pull/60425), [@juanicabanas](https://github.com/juanicabanas)
- **PublicDashboards:** Time range setting added. [#60487](https://github.com/grafana/grafana/pull/60487), [@juanicabanas](https://github.com/juanicabanas)
- **PublicDashboards:** Time range settings. [#61585](https://github.com/grafana/grafana/pull/61585), [@juanicabanas](https://github.com/juanicabanas)
- **PublicDashboards:** Time range switch added. [#60257](https://github.com/grafana/grafana/pull/60257), [@juanicabanas](https://github.com/juanicabanas)
- **PublicDashboards:** Time range wording changed. [#60473](https://github.com/grafana/grafana/pull/60473), [@juanicabanas](https://github.com/juanicabanas)
- **RBAC:** Add an endpoint to search through assignments. (Enterprise)
- **RBAC:** Add config option to reset basic roles on start up. [#59598](https://github.com/grafana/grafana/pull/59598), [@gamab](https://github.com/gamab)
- **RBAC:** Add config option to reset basic roles on start up. (Enterprise)
- **RBAC:** Add permission to get usage report preview. [#61570](https://github.com/grafana/grafana/pull/61570), [@alexanderzobnin](https://github.com/alexanderzobnin)
- **RBAC:** Permission check performance improvements for the new search. [#60729](https://github.com/grafana/grafana/pull/60729), [@IevaVasiljeva](https://github.com/IevaVasiljeva)
- **RBAC:** Register plugin permissions's action and its accepted scopes. (Enterprise)
- **RBAC:** Runtime plugin role registration and update. (Enterprise)
- **Report Settings:** Add UI to upload logo files. (Enterprise)
- **Reporting:** Allow to upload report branding images. (Enterprise)
- **RolePicker:** Align groupHeader to the list items horizontally. [#61060](https://github.com/grafana/grafana/pull/61060), [@mgyongyosi](https://github.com/mgyongyosi)
- **SAML:** Support auto login. [#61685](https://github.com/grafana/grafana/pull/61685), [@alexanderzobnin](https://github.com/alexanderzobnin)
- **SMTP:** Update SMTP TemplatesPatterns to do an 'or' filter instead of 'and'. [#61421](https://github.com/grafana/grafana/pull/61421), [@mmandrus](https://github.com/mmandrus)
- **SQL Datasources:** Move database setting to jsonData. [#58649](https://github.com/grafana/grafana/pull/58649), [@zoltanbedi](https://github.com/zoltanbedi)
- **SQL Datasources:** Use health check for config test. [#59867](https://github.com/grafana/grafana/pull/59867), [@zoltanbedi](https://github.com/zoltanbedi)
- **SQL:** Return no data response when no rows returned. [#59121](https://github.com/grafana/grafana/pull/59121), [@zoltanbedi](https://github.com/zoltanbedi)
- **Search:** Remember sorting preference between visits. [#62248](https://github.com/grafana/grafana/pull/62248), [@joshhunt](https://github.com/joshhunt)
- **Segment:** Individual segments are now keyboard accessible. [#60555](https://github.com/grafana/grafana/pull/60555), [@ashharrison90](https://github.com/ashharrison90)
- **Server:** Switch from separate server & cli to a unified grafana binary. [#58286](https://github.com/grafana/grafana/pull/58286), [@DanCech](https://github.com/DanCech)
- **SharePDF:** Add zoom select. (Enterprise)
- **Slugify:** Replace gosimple/slug with a simple function. [#59517](https://github.com/grafana/grafana/pull/59517), [@ryantxu](https://github.com/ryantxu)
- **Table Panel:** Refactor Cell Options to Allow for Options per Cell Type. [#59363](https://github.com/grafana/grafana/pull/59363), [@codeincarnate](https://github.com/codeincarnate)
- **Table panel:** Use link elements instead of div elements with on click events to aid with keyboard accessibility. [#59393](https://github.com/grafana/grafana/pull/59393), [@oscarkilhed](https://github.com/oscarkilhed)
- **TablePanel:** Improve and align table styles with the rest of Grafana. [#60365](https://github.com/grafana/grafana/pull/60365), [@torkelo](https://github.com/torkelo)
- **Teams:** Support paginating and filtering more then 1000 teams. [#58761](https://github.com/grafana/grafana/pull/58761), [@kalleep](https://github.com/kalleep)
- **Teams:** Use generated TS types. [#60618](https://github.com/grafana/grafana/pull/60618), [@Clarity-89](https://github.com/Clarity-89)
- **Tempo:** Trace to logs custom query with interpolation. [#61702](https://github.com/grafana/grafana/pull/61702), [@aocenas](https://github.com/aocenas)
- **Tempo:** Update column width for Loki search. [#61924](https://github.com/grafana/grafana/pull/61924), [@joey-grafana](https://github.com/joey-grafana)
- **Tempo:** Update docs and default Tempo metrics query. [#62185](https://github.com/grafana/grafana/pull/62185), [@joey-grafana](https://github.com/joey-grafana)
- **TestDatasource:** Add scenario for generating trace data. [#59299](https://github.com/grafana/grafana/pull/59299), [@aocenas](https://github.com/aocenas)
- **TextPanel:** Refactor to functional component. [#60885](https://github.com/grafana/grafana/pull/60885), [@ryantxu](https://github.com/ryantxu)
- **Theme:** Use `Inter` font by default. [#59544](https://github.com/grafana/grafana/pull/59544), [@ashharrison90](https://github.com/ashharrison90)
- **Trace View:** Disallow a span colour that is the same or looks similar to previous colour. [#58146](https://github.com/grafana/grafana/pull/58146), [@joey-grafana](https://github.com/joey-grafana)
- **Tracing:** Add keyboard accessibility to SpanDetailRow. [#59412](https://github.com/grafana/grafana/pull/59412), [@joey-grafana](https://github.com/joey-grafana)
- **Transformations:** Add context parameter to transformDataFrame and operators. [#60694](https://github.com/grafana/grafana/pull/60694), [@torkelo](https://github.com/torkelo)
- **Transformations:** Grouping to matrix empty value option. [#55591](https://github.com/grafana/grafana/pull/55591), [@hugo082](https://github.com/hugo082)
- **UsageInsights:** Record events for Explore queries. [#59931](https://github.com/grafana/grafana/pull/59931), [@daniellee](https://github.com/daniellee)
- **Variables:** Support for colons in time variables custom format. [#61404](https://github.com/grafana/grafana/pull/61404), [@yesoreyeram](https://github.com/yesoreyeram)
### Bug fixes
- **Alerting:** Fix ConditionsCmd No Data for "has no value". [#58634](https://github.com/grafana/grafana/pull/58634), [@grobinson-grafana](https://github.com/grobinson-grafana)
- **Alerting:** Redo refactoring from reverted fix in #56812. [#61051](https://github.com/grafana/grafana/pull/61051), [@grobinson-grafana](https://github.com/grobinson-grafana)
- **Alerting:** Set Dashboard and Panel IDs on rule group replacement. [#60374](https://github.com/grafana/grafana/pull/60374), [@alexmobo](https://github.com/alexmobo)
- **Alerting:** Store alertmanager configuration history in a separate table in the database. [#60197](https://github.com/grafana/grafana/pull/60197), [@alexweav](https://github.com/alexweav)
- **Azure Monitor:** Fix health check for empty default subscription. [#60569](https://github.com/grafana/grafana/pull/60569), [@andresmgot](https://github.com/andresmgot)
- **Command Palette:** Links now work when grafana is served under a subpath. [#60033](https://github.com/grafana/grafana/pull/60033), [@ashharrison90](https://github.com/ashharrison90)
- **CommandPalette:** Fix long dashboard names freezing the browser. [#61278](https://github.com/grafana/grafana/pull/61278), [@joshhunt](https://github.com/joshhunt)
- **Dropdown:** Make escape close a dropdown. [#62098](https://github.com/grafana/grafana/pull/62098), [@ashharrison90](https://github.com/ashharrison90)
- **Explore:** Fix a11y issue with show all series button in Graph. [#58943](https://github.com/grafana/grafana/pull/58943), [@Elfo404](https://github.com/Elfo404)
- **Explore:** Re-initialize graph when number of series to show changes. [#60499](https://github.com/grafana/grafana/pull/60499), [@Elfo404](https://github.com/Elfo404)
- **Fix:** Unlocking the UI for AuthProxy users. [#59507](https://github.com/grafana/grafana/pull/59507), [@gamab](https://github.com/gamab)
- **LDAP:** Disable user in case it has been removed from LDAP directory. [#60231](https://github.com/grafana/grafana/pull/60231), [@mgyongyosi](https://github.com/mgyongyosi)
- **LibraryPanels:** Fix issue where viewer with folder edit permissions could not update library panel. [#58420](https://github.com/grafana/grafana/pull/58420), [@kaydelaney](https://github.com/kaydelaney)
- **MultiSelect:** Fix `actionMeta` not available in `onChange` callback. [#62339](https://github.com/grafana/grafana/pull/62339), [@svennergr](https://github.com/svennergr)
- **Navigation:** Fix finding the active nav item for plugins. [#62123](https://github.com/grafana/grafana/pull/62123), [@leventebalogh](https://github.com/leventebalogh)
- **PanelChrome:** Allow hovering on description when status error is visible. [#61757](https://github.com/grafana/grafana/pull/61757), [@ivanortegaalba](https://github.com/ivanortegaalba)
- **PanelEditor:** Fixes issue where panel edit would show the panel plugin options of the previous edit panel. [#59861](https://github.com/grafana/grafana/pull/59861), [@torkelo](https://github.com/torkelo)
- **PublicDashboards:** Footer alignment fix for Firefox browser. [#62108](https://github.com/grafana/grafana/pull/62108), [@juanicabanas](https://github.com/juanicabanas)
- **PublicDashboards:** Footer position fix. [#61954](https://github.com/grafana/grafana/pull/61954), [@juanicabanas](https://github.com/juanicabanas)
- **RBAC:** Fix DeleteUserPermissions not being called on Upsert org sync. [#60531](https://github.com/grafana/grafana/pull/60531), [@Jguer](https://github.com/Jguer)
- **RBAC:** Handle edge case where there is duplicated acl entries for a role on a single dashboard. [#58079](https://github.com/grafana/grafana/pull/58079), [@kalleep](https://github.com/kalleep)
- **Resource Query Cache:** Do not store 207 status codes. (Enterprise)
- **SAML:** Do not register SAML support bundle collector when SAML is disabled. (Enterprise)
- **SSE:** Fix math expression to support NoData results. [#61721](https://github.com/grafana/grafana/pull/61721), [@yuri-tceretian](https://github.com/yuri-tceretian)
- **Security:** Fix XSS in runbook URL. [#59540](https://github.com/grafana/grafana/pull/59540), [@dsotirakis](https://github.com/dsotirakis)
- **TimeSeries:** Better y-axis ticks for IEC units. [#59984](https://github.com/grafana/grafana/pull/59984), [@leeoniya](https://github.com/leeoniya)
- **TimeSeries:** Fix rendering when zooming to time ranges between datapoints. [#59444](https://github.com/grafana/grafana/pull/59444), [@leeoniya](https://github.com/leeoniya)
- **Traces:** Fix for multiple $\_\_tags in trace to metrics. [#59641](https://github.com/grafana/grafana/pull/59641), [@joey-grafana](https://github.com/joey-grafana)
- **Variables:** Allow user to filter values in dropdown using white space. [#60622](https://github.com/grafana/grafana/pull/60622), [@yusuf-multhan](https://github.com/yusuf-multhan)
### Breaking changes
Removes the non-functional feature toggle `influxdbBackendMigration`. InfluxDB is working %100 with server access mode. You can keep using your dashboards, and data sources as you have been using. This won't affect them. If you are upgrading from older versions of Grafana please be sure to check your dashboard config and check for warnings. Issue [#61308](https://github.com/grafana/grafana/issues/61308)
Removes support for "detected fields" in the details of a log line, however all supported interactions (filter, statistics, visibility) are now supported for all fields. If you are using Loki you can get those fields back by using a parser operation like `logfmt` or `json`.
In the elasticsearch data source, the "Raw document" display mode is deprecated. We recommend using the "Raw Data" mode instead. Issue [#62236](https://github.com/grafana/grafana/issues/62236)
Sentry frontend logging provider will be removed with next major version. Issue [#60165](https://github.com/grafana/grafana/issues/60165)
### Plugin development fixes & changes
- **FileDropzone:** Display max file size. [#62334](https://github.com/grafana/grafana/pull/62334), [@oscarkilhed](https://github.com/oscarkilhed)
- **Chore:** Bump d3-color to 3.1.0. [#61609](https://github.com/grafana/grafana/pull/61609), [@jackw](https://github.com/jackw)
- **UI/Alert:** Infer the `role` property based on the `severity`. [#61242](https://github.com/grafana/grafana/pull/61242), [@leventebalogh](https://github.com/leventebalogh)
- **PanelChrome:** Menu is wrapped in a render prop for full outside control. [#60537](https://github.com/grafana/grafana/pull/60537), [@polibb](https://github.com/polibb)
- **Toolkit:** Deprecate all plugin related commands. [#60290](https://github.com/grafana/grafana/pull/60290), [@academo](https://github.com/academo)
@@ -13,7 +13,6 @@ The following checklist/summary should give you a quick overview of what to ask/
- Reviewed and approved?
- All checks passed?
- Proper pull request title?
- Milestone assigned?
- Add to changelog/release notes?
- Needs backporting?
@@ -40,10 +39,18 @@ See [formatting guidelines](create-pull-request.md#formatting-guidelines) for mo
### Assign a milestone
A milestone **should** be added to every pull request. Several things in the Grafana release process requires at least pull requests to be in a milestone, for example [generating changelog/release notes](#include-in-changelog-and-release-notes).
Several things in the Grafana release process requires at least pull requests to be in a milestone, for example [generating changelog/release notes](#include-in-changelog-and-release-notes).
This makes it easier to track what changes go into a certain release. Without this information, release managers have to go through git commits which is not an efficient process.
That being said, _you don't have to assign a milestone manually_ to a pull request.
Instead, when it is merged & closed then a bot will look for the most appropriate miletone and assign it to the pull request.
That milestone should always reflect the branch that the pull request is merged into.
For every major and minor release there is a milestone ending with `.x` (e.g. `10.0.x` for the 10.0.x releases).
Pull requests targetting `main` should use the `.x` milestone of the next minor (or major) version (you can find that version number inside the `package.json` file).
Backport pull requestss should use the version of the target branch (e.g. `9.4.x` for the `v9.4.x` branch).
### Include in changelog and release notes?
At Grafana we generate the [changelog](https://github.com/grafana/grafana/blob/main/CHANGELOG.md) and [release notes](https://grafana.com/docs/grafana/latest/release-notes/) based on merged pull requests. Including changes in the changelog/release notes is very important to provide a somewhat complete picture of what changes a Grafana release actually includes.
@@ -78,15 +85,15 @@ The changelog/release notes are divided into sections and here's a description o
**Features and enhancements:**
Milestone assigned and labeled with `add to changelog` and any of the other section rules don't apply.
Labeled with `add to changelog` and any of the other section rules don't apply.
**Bug fixes:**
Milestone assigned and labeled with `add to changelog` and either labeled with `type/bug` or the pull request title contains `fix` or `fixes`.
Labeled with `add to changelog` and either labeled with `type/bug` or the pull request title contains `fix` or `fixes`.
**Plugin development fixes & changes:**
Milestone assigned and labeled with `area/grafana/toolkit`, `area/grafana/ui` or `area/grafana/runtime`.
Labeled with `area/grafana/toolkit`, `area/grafana/ui` or `area/grafana/runtime`.
When you contribute to documentation, it is a good practice to build the docs on your local machine to make sure your changes appear as you expect. This README explains the process for doing that.
When you contribute to documentation, it's a good practice to build the docs on your local machine to make sure your changes appear as you expect. This README explains the process for doing that.
To build a local version, you need to run a process in a Docker container.
Grafana periodically updates the Docker image, [`docs-base`](https://hub.docker.com/r/grafana/docs-base), to update the styling of the Docs.
## Requirements
Docker >= 2.1.0.3
Yarn >= 1.22.4
-Docker >= 2.1.0.3
-Yarn >= 1.22.4
## Build the doc site
First, make sure the Docker daemon is running on your machine. Then, follow these steps:
1. On the command line, first change to the docs folder: `cd docs`.
1. Run `make docs`. This launches a preview of the website with the current grafana docs at `http://localhost:3002/docs/grafana/next/` which will refresh automatically when changes are made to content in the `sources` directory.
1. Run `make docs`. This launches a preview of the website with the current grafana docs at `http://localhost:3002/docs/grafana/latest/` which will refresh automatically when changes are made to content in the `sources` directory.
If you have the grafana/website repo checked out in the same directory as the grafana repo, then you can run `make docs-local-static` to use local assets (such as images).
@@ -52,7 +57,7 @@ To specify different menu text from the page title, use the front matter paramet
### Add images
Images are currently hosted in the grafana/website repo.
Please see our help documentation on [Image, diagram, and screenshot guidelines](https://grafana.com/docs/writers-toolkit/writing-guide/image-guidelines/) for comprehensive information.
# PATH-like list of directories within which to find projects.
# If all projects are checked out into the same directory, ~/repos/ for example, then the default should work.
ifeq($(originREPOS_PATH),undefined)
export REPOS_PATH:=$(realpath $(GIT_ROOT)/..)
endif
# How to treat Hugo relref errors.
ifeq($(originHUGO_REFLINKSERRORLEVEL),undefined)
export HUGO_REFLINKSERRORLEVEL:= WARNING
endif
.PHONY:docs-rm
docs-rm:## Remove the docs container.
$(PODMAN) rm -f $(DOCS_CONTAINER)
.PHONY:docs-pull
docs-pull:## Pull documentation base image.
$(PODMAN) pull -q $(DOCS_IMAGE)
make-docs:## Fetch the latest make-docs script.
make-docs:
if[[ ! -f "$(PWD)/make-docs"]];then
echo'WARN: No make-docs script found in the working directory. Run `make update` to download it.' >&2
exit1
fi
.PHONY:docs
docs:## Serve documentation locally, which includes pulling the latest `DOCS_IMAGE` (default: `grafana/docs-base:latest`) container image. See also `docs-no-pull`.
docs:docs-pullmake-docs
$(PWD)/make-docs $(PROJECTS)
.PHONY:docs-no-pull
docs-no-pull:## Serve documentation locally without pulling the `DOCS_IMAGE` (default: `grafana/docs-base:latest`) container image.
docs-no-pull:make-docs
$(PWD)/make-docs $(PROJECTS)
.PHONY:docs-debug
docs-debug:## Run Hugo web server with debugging enabled. TODO: support all SERVER_FLAGS defined in website Makefile.
docs-debug:make-docs
WEBSITE_EXEC='hugo server --bind 0.0.0.0 --port 3002 --debug'$(PWD)/make-docs $(PROJECTS)
.PHONY:doc-validator
doc-validator:## Run doc-validator on the entire docs folder.
To finalize the installation of Grafana Enterprise, restart Grafana to enable all Grafana Enterprise features. Refer to [restart Grafana]({{< relref "../../setup-grafana/restart-grafana/" >}}) for more information.
To finalize the installation of Grafana Enterprise, restart Grafana to enable all Grafana Enterprise features. Refer to [restart Grafana]({{< relref "../../setup-grafana/start-restart-grafana/" >}}) for more information.
## License expiration
@@ -121,7 +125,7 @@ If your license has expired, most of Grafana keeps working as normal. Some enter
2. Log in to your [Grafana Cloud Account](/login) and make sure you're in the correct organization in the dropdown at the top of the page.
3. Under the **Grafana Enterprise** section in the menu bar to the left, choose licenses and download the currently valid license with which you want to run Grafana. If you cannot see a valid license on Grafana.com, please contact your account manager at Grafana Labs to renew your subscription.
4. Replace the current `license.jwt`-file with the one you've just downloaded.
@@ -121,6 +121,6 @@ To restart Grafana on a Kubernetes cluster,
1. After you update the service, navigate to your Grafana instance, sign in with Grafana Admin credentials, and navigate to the Statistics and Licensing page to validate that your license is active.
For more information about restarting Grafana, refer to [Restart Grafana]({{< relref "../../../../setup-grafana/restart-grafana/" >}}).
For more information about restarting Grafana, refer to [Restart Grafana]({{< relref "../../../../setup-grafana/start-restart-grafana/" >}}).
> If you experience issues when you update the EKS cluster, refer to [Amazon EKS troubleshooting](https://docs.aws.amazon.com/eks/latest/userguide/troubleshooting.html).
> **Note:** Available in [Grafana Enterprise]({{< relref "../../../../introduction/grafana-enterprise/" >}}) and [Grafana Cloud Advanced](/docs/grafana-cloud).
{{% admonition type="note" %}}
Available in [Grafana Enterprise]({{< relref "../../../../introduction/grafana-enterprise/" >}}) and [Grafana Cloud Advanced](/docs/grafana-cloud).
{{% /admonition %}}
A permission is comprised of an action and a scope. When creating a custom role, consider the actions the user can perform and the resource(s) on which they can perform those actions.
@@ -23,128 +25,129 @@ To learn more about the Grafana resources to which you can apply RBAC, refer to
The following list contains role-based access control actions.
| `alert.instances.external:read` | `datasources:*`<br>`datasources:uid:*` | Read alerts and silences in data sources that support alerting. |
| `alert.instances.external:write` | `datasources:*`<br>`datasources:uid:*` | Manage alerts and silences in data sources that support alerting. |
| `alert.instances:create` | n/a | Create silences in the current organization. |
| `alert.instances:read` | n/a | Read alerts and silences in the current organization. |
| `alert.instances:write` | n/a | Update and expire silences in the current organization. |
| `alert.notifications.external:read` | `datasources:*`<br>`datasources:uid:*` | Read templates, contact points, notification policies, and mute timings in data sources that support alerting. |
| `alert.notifications.external:write` | `datasources:*`<br>`datasources:uid:*` | Manage templates, contact points, notification policies, and mute timings in data sources that support alerting. |
| `alert.notifications:write` | n/a | Manage templates, contact points, notification policies, and mute timings in the current organization. |
| `alert.notifications:read` | n/a | Read all templates, contact points, notification policies, and mute timings in the current organization. |
| `alert.rules.external:read` | `datasources:*`<br>`datasources:uid:*` | Read alert rules in data sources that support alerting (Prometheus, Mimir, and Loki) |
| `alert.rules.external:write` | `datasources:*`<br>`datasources:uid:*` | Create, update, and delete alert rules in data sources that support alerting (Mimir and Loki). |
| `alert.rules:create` | `folders:*`<br>`folders:uid:*` | Create Grafana alert rules in a folder. Combine this permission with `folders:read` in a scope that includes the folder and `datasources:query` in the scope of data sources the user can query. |
| `alert.rules:delete` | `folders:*`<br>`folders:uid:*` | Delete Grafana alert rules in a folder. Combine this permission with `folders:read` in a scope that includes the folder and `datasources:query` in the scope of data sources the user can query. |
| `alert.rules:read` | `folders:*`<br>`folders:uid:*` | Read Grafana alert rules in a folder. Combine this permission with `folders:read` in a scope that includes the folder and `datasources:query` in the scope of data sources the user can query. |
| `alert.rules:write` | `folders:*`<br>`folders:uid:*` | Update Grafana alert rules in a folder. Combine this permission with `folders:read` in a scope that includes the folder and `datasources:query` in the scope of data sources the user can query. |
| `alert.provisioning:read` | n/a | Read all Grafana alert rules, notification policies, etc via provisioning API. Permissions to folders and datasource are not required. |
| `alert.provisioning:write` | n/a | Update all Grafana alert rules, notification policies, etc via provisioning API. Permissions to folders and datasource are not required. |
| `apikeys:read` | `apikeys:*`<br>`apikeys:id:*` | Read API keys. |
| `apikeys:delete` | `apikeys:*`<br>`apikeys:id:*` | Delete API keys. |
| `dashboards:create` | `folders:*`<br>`folders:uid:*` | Create dashboards in one or more folders. |
| `dashboards:delete` | `dashboards:*`<br>`dashboards:uid:*`<br>`folders:*`<br>`folders:uid:*` | Delete one or more dashboards. |
| `dashboards.insights:read` | n/a | Read dashboard insights data and see presence indicators. |
| `dashboards.permissions:read` | `dashboards:*`<br>`dashboards:uid:*`<br>`folders:*`<br>`folders:uid:*` | Read permissions for one or more dashboards. |
| `dashboards.permissions:write` | `dashboards:*`<br>`dashboards:uid:*`<br>`folders:*`<br>`folders:uid:*` | Update permissions for one or more dashboards. |
| `dashboards:read` | `dashboards:*`<br>`dashboards:uid:*`<br>`folders:*`<br>`folders:uid:*` | Read one or more dashboards. |
| `dashboards:write` | `dashboards:*`<br>`dashboards:uid:*`<br>`folders:*`<br>`folders:uid:*` | Update one or more dashboards. |
| `orgs:delete` | `orgs:*` <br> `orgs:id:*` | Delete one or more organizations. |
| `orgs:read` | `orgs:*` <br> `orgs:id:*` | Read one or more organizations. |
| `orgs:write` | `orgs:*` <br> `orgs:id:*` | Update one or more organizations. |
| `plugins.app:access`| `plugins:*` <br> `plugins:id:*`| Access one or more application plugins (still enforcing the organization role) |
| `plugins:install` | n/a | Install and uninstall plugins. |
| `plugins:write` | `plugins:*` <br> `plugins:id:*` | Edit settings for one or more plugins. |
| `provisioning:reload` | `provisioners:*` | Reload provisioning files. To find the exact scope for specific provisioner, see [Scope definitions]({{< relref "#scope-definitions" >}}). |
| `serviceaccounts:write` | `serviceaccounts:*` | Create Grafana service accounts. |
| `serviceaccounts:create` | n/a | Update Grafana service accounts. |
| `serviceaccounts:delete` | `serviceaccounts:*` | Delete Grafana service accounts. |
| `serviceaccounts:read` | `serviceaccounts:*` | Read Grafana service accounts. |
| `serviceaccounts.permissions:write` | `serviceaccounts:*` | Update Grafana service account permissions to control who can do what with the service account. |
| `serviceaccounts.permissions:read` | `serviceaccounts:*` | Read Grafana service account permissions to see who can do what with the service account. |
| `settings:write` | `settings:*`<br>`settings:auth.saml:*`<br>`settings:auth.saml:enabled` (property level) | Update any Grafana configuration settings that can be [updated at runtime]({{< relref "../../../../setup-grafana/configure-grafana/settings-updates-at-runtime" >}}). |
| `status:accesscontrol` | `services:accesscontrol` | Get access-control enabled status. |
| `teams.permissions:read` | `teams:*`<br>`teams:id:*` | Read members and External Group Synchronization setup for teams. |
| `teams.permissions:write` | `teams:*`<br>`teams:id:*` | Add, remove and update members and manage External Group Synchronization setup for teams. |
| `teams.roles:add` | `permissions:type:delegate` | Assign a role to a team. |
| `teams.roles:read` | `teams:*` | List roles assigned directly to a team. |
| `teams.roles:remove` | `permissions:type:delegate`| Unassign a role from a team. |
| `teams:create` | n/a | Create teams. |
| `teams:delete` | `teams:*`<br>`teams:id:*` | Delete one or more teams. |
| `teams:read` | `teams:*`<br>`teams:id:*` | Read one or more teams and team preferences. |
| `teams:write` | `teams:*`<br>`teams:id:*` | Update one or more teams and team preferences. |
| `users.authtoken:read` | `global.users:*`<br>`global.users:id:*`| List authentication tokens that are assigned to a user. |
| `users.authtoken:write` | `global.users:*` <br> `global.users:id:*` | Update authentication tokens that are assigned to a user. |
| `alert.instances.external:read` | `datasources:*`<br>`datasources:uid:*` | Read alerts and silences in data sources that support alerting. |
| `alert.instances.external:write` | `datasources:*`<br>`datasources:uid:*` | Manage alerts and silences in data sources that support alerting. |
| `alert.instances:create` | n/a | Create silences in the current organization. |
| `alert.instances:read` | n/a | Read alerts and silences in the current organization. |
| `alert.instances:write` | n/a | Update and expire silences in the current organization. |
| `alert.notifications.external:read` | `datasources:*`<br>`datasources:uid:*` | Read templates, contact points, notification policies, and mute timings in data sources that support alerting. |
| `alert.notifications.external:write` | `datasources:*`<br>`datasources:uid:*` | Manage templates, contact points, notification policies, and mute timings in data sources that support alerting. |
| `alert.notifications:write` | n/a | Manage templates, contact points, notification policies, and mute timings in the current organization. |
| `alert.notifications:read` | n/a | Read all templates, contact points, notification policies, and mute timings in the current organization. |
| `alert.rules.external:read` | `datasources:*`<br>`datasources:uid:*` | Read alert rules in data sources that support alerting (Prometheus, Mimir, and Loki) |
| `alert.rules.external:write` | `datasources:*`<br>`datasources:uid:*` | Create, update, and delete alert rules in data sources that support alerting (Mimir and Loki). |
| `alert.rules:create` | `folders:*`<br>`folders:uid:*` | Create Grafana alert rules in a folder and its subfolders. Combine this permission with `folders:read` in a scope that includes the folder and `datasources:query` in the scope of data sources the user can query. |
| `alert.rules:delete` | `folders:*`<br>`folders:uid:*` | Delete Grafana alert rules in a folder and its subfolders. Combine this permission with `folders:read` in a scope that includes the folder and `datasources:query` in the scope of data sources the user can query. |
| `alert.rules:read` | `folders:*`<br>`folders:uid:*` | Read Grafana alert rules in a folder and its subfolders. Combine this permission with `folders:read` in a scope that includes the folder and `datasources:query` in the scope of data sources the user can query. |
| `alert.rules:write` | `folders:*`<br>`folders:uid:*` | Update Grafana alert rules in a folder and its subfolders. Combine this permission with `folders:read` in a scope that includes the folder and `datasources:query` in the scope of data sources the user can query. |
| `alert.provisioning:read` | n/a | Read all Grafana alert rules, notification policies, etc via provisioning API. Permissions to folders and datasource are not required. |
| `alert.provisioning:write` | n/a | Update all Grafana alert rules, notification policies, etc via provisioning API. Permissions to folders and datasource are not required. |
| `apikeys:read` | `apikeys:*`<br>`apikeys:id:*` | Read API keys. |
| `apikeys:delete` | `apikeys:*`<br>`apikeys:id:*` | Delete API keys. |
| `dashboards:create` | `folders:*`<br>`folders:uid:*` | Create dashboards in one or more folders and their subfolders. |
| `dashboards:delete` | `dashboards:*`<br>`dashboards:uid:*`<br>`folders:*`<br>`folders:uid:*` | Delete one or more dashboards. |
| `dashboards.insights:read` | n/a | Read dashboard insights data and see presence indicators. |
| `dashboards.permissions:read` | `dashboards:*`<br>`dashboards:uid:*`<br>`folders:*`<br>`folders:uid:*` | Read permissions for one or more dashboards. |
| `dashboards.permissions:write` | `dashboards:*`<br>`dashboards:uid:*`<br>`folders:*`<br>`folders:uid:*` | Update permissions for one or more dashboards. |
| `dashboards:read` | `dashboards:*`<br>`dashboards:uid:*`<br>`folders:*`<br>`folders:uid:*` | Read one or more dashboards. |
| `dashboards:write` | `dashboards:*`<br>`dashboards:uid:*`<br>`folders:*`<br>`folders:uid:*` | Update one or more dashboards. |
| `dashboards.public:write` | `dashboards:*`<br>`dashboards:uid:*` | Write public dashboard configuration. |
| `datasources.permissions:read` | `datasources:*`<br>`datasources:uid:*` | List data source permissions. |
| `datasources.permissions:write` | `datasources:*`<br>`datasources:uid:*` | Update data source permissions. |
| `datasources:query` | `datasources:*`<br>`datasources:uid:*` | Query data sources. |
| `datasources:read` | `datasources:*`<br>`datasources:uid:*` | List data sources. |
| `datasources:write` | `datasources:*`<br>`datasources:uid:*`| Update data sources. |
| `folders.permissions:read` | `folders:*`<br>`folders:uid:*` | Read permissions for one or more folders and their subfolders. |
| `folders.permissions:write` | `folders:*`<br>`folders:uid:*` | Update permissions for one or more folders and their subfolders. |
| `folders:create` | n/a | Create folders in the root level. If granted together with `folders:write`, also allows creating subfolders under all folders that the user can update. |
| `folders:delete` | `folders:*`<br>`folders:uid:*` | Delete one or more folders and their subfolders. |
| `folders:read` | `folders:*`<br>`folders:uid:*` | Read one or more folders and their subfolders. |
| `folders:write` | `folders:*`<br>`folders:uid:*` | Update one or more folders and their subfolders. If granted together with `folders:create` permission, also allows creating subfolders under these folders. |
| `ldap.config:reload` | n/a | Reload the LDAP configuration. |
| `ldap.status:read` | n/a | Verify the availability of the LDAP server or servers. |
| `ldap.user:read` | n/a | Read users via LDAP. |
| `ldap.user:sync` | n/a | Sync users via LDAP. |
| `licensing.reports:read` | n/a | Get custom permission reports. |
| `licensing:delete` | n/a | Delete the license token. |
| `orgs:delete` | `orgs:*` <br> `orgs:id:*` | Delete one or more organizations. |
| `orgs:read` | `orgs:*` <br> `orgs:id:*` | Read one or more organizations. |
| `orgs:write` | `orgs:*` <br> `orgs:id:*` | Update one or more organizations. |
| `plugins.app:access`| `plugins:*` <br> `plugins:id:*`| Access one or more application plugins (still enforcing the organization role) |
| `plugins:install` | n/a | Install and uninstall plugins. |
| `plugins:write` | `plugins:*` <br> `plugins:id:*` | Edit settings for one or more plugins. |
| `provisioning:reload` | `provisioners:*`| Reload provisioning files. To find the exact scope for specific provisioner, see [Scope definitions]({{< relref "#scope-definitions" >}}). |
| `serviceaccounts:write`| `serviceaccounts:*`| Create Grafana service accounts. |
| `serviceaccounts:create` | n/a | Update Grafana service accounts. |
| `serviceaccounts:delete` | `serviceaccounts:*` | Delete Grafana service accounts. |
| `serviceaccounts:read` | `serviceaccounts:*` | Read Grafana service accounts. |
| `serviceaccounts.permissions:write` | `serviceaccounts:*` | Update Grafana service account permissions to control who can do what with the service account. |
| `serviceaccounts.permissions:read` | `serviceaccounts:*` | Read Grafana service account permissions to see who can do what with the service account. |
| `settings:write` | `settings:*`<br>`settings:auth.saml:*`<br>`settings:auth.saml:enabled` (property level) | Update any Grafana configuration settings that can be [updated at runtime]({{< relref "../../../../setup-grafana/configure-grafana/settings-updates-at-runtime" >}}). |
| `status:accesscontrol` | `services:accesscontrol`| Get access-control enabled status. |
| `teams.permissions:read` | `teams:*`<br>`teams:id:*` | Read members and Team Sync setup for teams. |
| `teams.permissions:write` | `teams:*`<br>`teams:id:*` | Add, remove and update members and manage Team Sync setup for teams. |
| `teams.roles:add` | `permissions:type:delegate`| Assign a role to a team. |
| `teams.roles:read` | `teams:*` | List roles assigned directly to a team. |
| `teams.roles:remove`| `permissions:type:delegate`| Unassign a role from a team. |
| `teams:create` | n/a | Create teams. |
| `teams:delete` | `teams:*`<br>`teams:id:*` | Delete one or more teams. |
| `teams:read` | `teams:*`<br>`teams:id:*` | Read one or more teams and team preferences. |
| `teams:write` | `teams:*`<br>`teams:id:*` | Update one or more teams and team preferences. |
| `users.authtoken:read` | `global.users:*` <br> `global.users:id:*` | List authentication tokens that are assigned to a user. |
| `users.authtoken:write` | `global.users:*` <br> `global.users:id:*` | Update authentication tokens that are assigned to a user. |
| `users.password:write` | `global.users:*`<br> `global.users:id:*`| Update a user’s password. |
| `users.permissions:read` | `users:*` | List permissions of a user. |
@@ -193,7 +196,7 @@ The following list contains role-based access control scopes.
| `apikeys:*`<br>`apikeys:id:*` | Restrict an action to a set of API keys. For example, `apikeys:*` matches any API key, `apikey:id:1` matches the API key whose id is `1`. |
| `dashboards:*`<br>`dashboards:uid:*` | Restrict an action to a set of dashboards. For example, `dashboards:*` matches any dashboard, and `dashboards:uid:1` matches the dashboard whose UID is `1`. |
| `datasources:*`<br>`datasources:uid:*` | Restrict an action to a set of data sources. For example, `datasources:*` matches any data source, and `datasources:uid:1` matches the data source whose UID is `1`. |
| `folders:*`<br>`folders:uid:*` | Restrict an action to a set of folders. For example, `folders:*` matches any folder, and `folders:uid:1` matches the folder whose UID is `1`. |
| `folders:*`<br>`folders:uid:*` | Restrict an action to a set of folders. For example, `folders:*` matches any folder, and `folders:uid:1` matches the folder whose UID is `1`. Note that permissions granted to a folder cascade down to subfolders located under it |
| `global.users:*` <br> `global.users:id:*` | Restrict an action to a set of global users. For example, `global.users:*` matches any user and `global.users:id:1` matches the user whose ID is `1`. |
| `orgs:*` <br> `orgs:id:*` | Restrict an action to a set of organizations. For example, `orgs:*` matches any organization and `orgs:id:1` matches the organization whose ID is `1`. |
| `permissions:type:delegate` | The scope is only applicable for roles associated with the Access Control itself and indicates that you can delegate your permissions only, or a subset of it, by creating a new role or making an assignment. |
@@ -207,3 +210,4 @@ The following list contains role-based access control scopes.
| `settings:*` | Restrict an action to a subset of settings. For example, `settings:*` matches all settings, `settings:auth.saml:*` matches all SAML settings, and `settings:auth.saml:enabled` matches the enable property on the SAML settings. |
| `teams:*` <br> `teams:id:*` | Restrict an action to a set of teams from an organization. For example, `teams:*` matches any team and `teams:id:1` matches the team whose ID is `1`. |
| `users:*` <br> `users:id:*` | Restrict an action to a set of users from an organization. For example, `users:*` matches any user and `users:id:1` matches the user whose ID is `1`. |
| `n/a` | `n/a` means not applicable. If an action has `n/a` specified for the scope, then the action does not require a scope. For example, the `teams:create` action does not require a scope and allows users to create teams. |
@@ -82,7 +82,7 @@ We've compiled the following permissions rollout scenarios based on current Graf
### Provide internal viewer employees with the ability to use Explore, but prevent external viewer contractors from using Explore
1. In Grafana, create a team with the name `Internal employees`.
1. Assign the `fixed:datasources:querier` role to the `Internal employees` team.
1. Assign the `fixed:datasources:explorer` role to the `Internal employees` team.
1. Add internal employees to the `Internal employees` team, or map them from a SAML, LDAP, or Oauth team using [Team Sync]({{< relref "../../../../setup-grafana/configure-security/configure-team-sync/" >}}).
1. Assign the viewer role to both internal employees and contractors.
@@ -21,11 +25,11 @@ This setting contains information about tools that Grafana Server Admins can use
## View Grafana server settings
> Refer to [Role-based access control]({{< relref "../roles-and-permissions/access-control/" >}}) in Grafana Enterprise to understand how you can control access with RBAC permissions.
> Refer to [Role-based access control]({{< relref "../roles-and-permissions/access-control" >}}) in Grafana Enterprise to understand how you can control access with RBAC permissions.
If you are a Grafana server administrator, use the Settings tab to view the settings that are applied to your Grafana server via the [Configuration]({{< relref "../../setup-grafana/configure-grafana/#config-file-locations" >}}) file and any environmental variables.
If you are a Grafana server administrator, use the Settings tab to view the settings that are applied to your Grafana server via the [Configuration]({{< relref "../../setup-grafana/configure-grafana#configuration-file-location" >}}) file and any environmental variables.
> **Note:** Only Grafana server administrators can access the **Server Admin** menu. For more information about about administrative permissions, refer to [Roles and permissions]({{< relref "../roles-and-permissions/#grafana-server-administrators" >}}).
> **Note:** Only Grafana server administrators can access the **Server Admin** menu. For more information about about administrative permissions, refer to [Roles and permissions]({{< relref "../roles-and-permissions#grafana-server-administrators" >}}).
### View server settings
@@ -34,15 +38,15 @@ If you are a Grafana server administrator, use the Settings tab to view the sett
### Available settings
For a full list of server settings, refer to [Configuration]({{< relref "../../setup-grafana/configure-grafana/" >}}).
For a full list of server settings, refer to [Configuration]({{< relref "../../setup-grafana/configure-grafana#server" >}}).
## View Grafana server stats
> Refer to [Role-based access control]({{< relref "../roles-and-permissions/access-control/" >}}) in Grafana Enterprise to understand how you can control access with RBAC permissions.
> Refer to [Role-based access control]({{< relref "../roles-and-permissions/access-control" >}}) in Grafana Enterprise to understand how you can control access with RBAC permissions.
If you are a Grafana server admin, then you can view useful statistics about your Grafana server in the Stats & Licensing tab.
> **Note:** Only Grafana server administrators can access the **Server Admin** menu. For more information about about administrative permissions, refer to [Roles and permissions]({{< relref "../roles-and-permissions/#grafana-server-administrators" >}}).
> **Note:** Only Grafana server administrators can access the **Server Admin** menu. For more information about about administrative permissions, refer to [Roles and permissions]({{< relref "../roles-and-permissions#grafana-server-administrators" >}}).
@@ -21,22 +21,28 @@ Watch this video to learn more about creating alerts: {{< vimeo 720001934 >}}
## Add Grafana managed rule
1. In the Grafana menu, click the **Alerting** (bell) icon to open the Alerting page listing existing alerts.
1. Click **New alert rule**. The new alerting rule page opens where the Grafana managed alerts option is selected by default.
1. Click **Create alert rule**. The new alerting rule page opens where the Grafana managed alerts option is selected by default.
1. In Step 1, add the rule name.
- In **Rule name**, add a descriptive name. This name is displayed in the alert rule list. It is also the `alertname` label for every alert instance that is created from this rule.
1. In Step 2, add queries and expressions to evaluate, and then select the alert condition.
- For queries, select a data source from the drop-down.
- Add one or more [queries]({{< relref "../../panels-visualizations/query-transform-data/#add-a-query/" >}}) or [expressions]({{< relref "../../panels-visualizations/query-transform-data/expression-queries/" >}}).
- Add one or more [queries]({{< relref "/docs/grafana/latest/panels-visualizations/query-transform-data#add-a-query" >}}) or [expressions]({{< relref "/docs/grafana/latest/panels-visualizations/query-transform-data/expression-queries" >}}).
- For each expression, select either **Classic condition** to create a single alert rule, or choose from **Math**, **Reduce**, **Resample** options to generate separate alert for each series. For details on these options, see [Single and multi dimensional rule](#single-and-multi-dimensional-rule).
- Click **Run queries** to verify that the query is successful.
- Next, select the query or expression for your alert condition.
1. In Step 3, specify the alert evaluation interval.
- From the **Condition** drop-down, select the query or expression to trigger the alert rule.
- For **Evaluate every**, specify the frequency of evaluation. Must be a multiple of 10 seconds. For examples, `1m`, `30s`.
- For **Evaluate for**, specify the duration for which the condition must be true before an alert fires.
> **Note:** Once a condition is breached, the alert goes into the Pending state. If the condition remains breached for the duration specified, the alert transitions to the `Firing` state, otherwise it reverts back to the `Normal` state.
- In **Configure no data and error handling**, configure alerting behavior in the absence of data. Use the guidelines in [No data and error handling](#no-data-and-error-handling).
- Click **Preview alerts** to check the result of running the query at this moment. Preview excludes no data and error handling.
**Note:**
You can pause alert rule evaluation to prevent noisy alerting while tuning your alerts. Pausing stops alert rule evaluation and does not create any alert instances. This is different to mute timings, which stop notifications from being delivered, but still allow for alert rule evaluation and the creation of alert instances.
1. In Step 4, add the storage location, rule group, as well as additional metadata associated with the rule.
- From the **Folder** drop-down, select the folder where you want to store the rule.
- For **Group**, specify a pre-defined group. Newly created rules are appended to the end of the group. Rules within a group are run sequentially at a regular interval, with the same evaluation time.
@@ -68,7 +74,7 @@ To generate a separate alert for each series, create a multi-dimensional rule. U
#### Rule with classic condition
For more information, see [expressions documentation]({{< relref "../../panels-visualizations/query-transform-data/expression-queries/" >}}).
For more information, see [expressions documentation]({{< relref "/docs/grafana/latest/panels-visualizations/query-transform-data/expression-queries" >}}).
### No data and error handling
@@ -81,7 +87,7 @@ Configure alerting behavior in the absence of data using information in the foll
| Alerting | Set alert rule state to `Alerting`. From Grafana 8.5, the alert rule waits for the entire duration for which the condition is true before firing. |
| OK | Set alert rule state to `Normal` |
| Error | Create a new alert `DatasourceError` with the name and UID of the alert rule, and UID of the datasource that returned no data as labels. |
| re | Error | Create a new alert `DatasourceError` with the name and UID of the alert rule, and UID of the datasource that returned no data as labels. |
@@ -35,7 +35,7 @@ You can create and manage recording rules for an external Grafana Mimir or Loki
To create a Grafana Mimir or Loki managed recording rule
1. In the Grafana menu, click the **Alerting** (bell) icon to open the Alerting page listing existing alerts.
1. Click **New alert rule**. The new alerting rule page opens where the **Grafana managed alert** option is selected by default.
1. Click **Create alert rule**. The new alerting rule page opens where the **Grafana managed alert** option is selected by default.
1. In Step 1, add the rule name. The recording name must be a Prometheus metric name and contain no whitespace.
- In **Rule name**, add a descriptive name.
1. In Step 2, select **Mimir or Loki recording rule** option.
@@ -49,7 +49,7 @@ To create a Grafana Mimir or Loki managed recording rule
1. Click **Save** to save the recording rule or **Save and exit** to save the recording rule and go back to the Alerting page.
1. In the Grafana menu, click the **Alerting** (bell) icon to open the Alerting page listing existing alerts.
1. Click **New alert rule**.
1. Click **Create alert rule**.
1. In Step 1, add the rule name.
- In **Rule name**, add a descriptive name. This name is displayed in the alert rule list. It is also the `alertname` label for every alert instance that is created from this rule.
@@ -35,7 +35,7 @@ Watch this video to learn more about how to create a Mimir managed alert rule: {
## Add a Grafana Mimir or Loki managed alerting rule
1. In the Grafana menu, click the **Alerting** (bell) icon to open the Alerting page listing existing alerts.
1. Click **New alert rule**. The new alerting rule page opens where the Grafana managed alerts option is selected by default.
1. Click **Create alert rule**. The new alerting rule page opens where the Grafana managed alerts option is selected by default.
1. In Step 1, add the rule name.
- In **Rule name**, add a descriptive name. This name is displayed in the alert rule list. It is also the `alertname` label for every alert instance that is created from this rule.
1. In Step 2, select **Mimir or Loki alert** option.
@@ -20,8 +20,12 @@ The Alerting page lists all existing alert rules. By default, rules are grouped
The Mimir/Cortex/Loki rules section lists all rules for Mimir, Cortex, or Loki data sources. Cloud alert rules are also listed in this section.
When managing large volumes of alerts, you can use extended alert rule search capabilities to filter on folders, evaluation groups, and rules. Additionally, you can filter alert rules by their properties like labels, state, type, and health.
- [View and filter alert rules](#view-and-filter-alert-rules)
- [View alert rules](#view-alert-rules)
- [Export alert rules](#export-alert-rules)
- [View query definitions for provisioned alerts](#view-query-definitions-for-provisioned-alerts)
From the Alert list page, you can also make copies of alert rules to help you reuse existing alert rules.
## Export alert rules
Click **Export** to create and tune an alert rule in the UI, then export to YAML or JSON, and use in the provisioning API or files. You can also export an entire rule group to review or use.
**Note:** This is supported in both the UI and provisioning API.
## View query definitions for provisioned alerts
View read-only query definitions for provisioned alerts. Check quickly if your alert rule queries are correct, without diving into your "as-code" repository for rule definitions.
### Grouped view
Grouped view shows Grafana alert rules grouped by folder and Loki or Prometheus alert rules grouped by `namespace` + `group`. This is the default rule list view, intended for managing rules. You can expand each group to view a list of rules in this group. Expand a rule further to view its details. You can also expand action buttons and alerts resulting from the rule to view their details.
Whether you’re starting or expanding your implementation of Grafana Alerting, learn more about the key concepts and available features that help you create, manage, and take action on your alerts and improve your team’s ability to resolve issues quickly.
@@ -16,7 +16,7 @@ Grafana supports several alert rule types, the following sections will explain t
Grafana-managed rules are the most flexible alert rule type. They allow you to create alerts that can act on data from any of your existing data sources.
In additional to supporting any datasource you can also add additional [expressions]({{< relref "../../../panels-visualizations/query-transform-data/expression-queries/" >}}) to transform your data and express alert conditions.
In addition to supporting any datasource, you can add [expressions]({{< relref "/docs/grafana/latest/panels-visualizations/query-transform-data/expression-queries" >}}) to transform your data and express alert conditions.
Notifications sent via contact points are built using notification templates. Grafana's default templates are based on the [Go templating system](https://golang.org/pkg/text/template) where some fields are evaluated as text, while others are evaluated as HTML (which can affect escaping). The default template, defined in [default_template.go](https://github.com/grafana/alerting/blob/main/alerting/notifier/channels/default_template.go), is a useful reference for custom templates.
Notifications sent via contact points are built using notification templates. Grafana's default templates are based on the [Go templating system](https://golang.org/pkg/text/template) where some fields are evaluated as text, while others are evaluated as HTML (which can affect escaping).
The default template [default_template.go](https://github.com/grafana/alerting/blob/main/templates/default_template.go) is a useful reference for custom templates.
Since most of the contact point fields can be templated, you can create reusable custom templates and use them in multiple contact points.
@@ -17,7 +17,7 @@ This topic explains why labels are a fundamental component of alerting.
- The Alertmanager uses labels to match alerts for silences and alert groups in notification policies.
- The alerting UI shows labels for every alert instance generated during evaluation of that rule.
- Contact points can access labels to dynamically generate notifications that contain information specific to the alert that is resulting in a notification.
- You can add labels to an [alerting rule]({{< relref "../../alerting-rules/" >}}). Labels are manually configurable, use template functions, and can reference other labels. Labels added to an alerting rule take precedence in the event of a collision between labels (except in the case of [Grafana reserved labels](#grafana-reserved-labels)).
- You can add labels to an [alerting rule]({{< relref "/docs/grafana/latest/alerting/alerting-rules" >}}). Labels are manually configurable, use template functions, and can reference other labels. Labels added to an alerting rule take precedence in the event of a collision between labels (except in the case of [Grafana reserved labels](#grafana-reserved-labels)).
@@ -38,7 +38,7 @@ Example: A label key/value pair `Alert! 🔔="🔥"` will become `Alert_0x1f514=
# Grafana reserved labels
> **Note:** Labels prefixed with `grafana_` are reserved by Grafana for special use. If a manually configured label is added beginning with `grafana_` it may be overwritten in case of collision.
> To stop the Grafana Alerting engine from adding a reserved label, you can disable it via the `disabled_labels` option in [unified_alerting.reserved_labels]({{< relref "../../../setup-grafana/configure-grafana/#unified_alertingreserved_labels" >}}) configuration.
> To stop the Grafana Alerting engine from adding a reserved label, you can disable it via the `disabled_labels` option in [unified_alerting.reserved_labels]({{< relref "/docs/grafana/latest/setup-grafana/configure-grafana#unified_alertingreserved_labels" >}}) configuration.
Grafana reserved labels can be used in the same way as manually configured labels. The current list of available reserved labels are:
@@ -3,249 +3,335 @@ description: Learn about templating of labels and annotations
keywords:
- grafana
- alerting
-guide
-fundamentals
-templating
-labels
- annotations
title: Templating labels and annotations
weight: 117
---
# Templating labels and annotations
In Grafana it is possible to template labels and annotations just like in Prometheus. Those who have used Prometheus before should be familiar with `$labels` and `$value` as these variables contain the labels and value of the alert. You can use the same variables in Grafana to template labels and annotations, even if the alert does not use a Prometheus datasource.
In Grafana you template labels and annotations just like you would in Prometheus. If you have used Prometheus before then you should be familiar with the `$labels` and `$value` variables which contain the labels and value of the alert. You can use the same variables in Grafana, even if the alert does not use a Prometheus datasource. If you haven't used Prometheus before then don't worry as each of these variables, and how to template them, will be explained as you follow the rest of this page.
For example, suppose you want to create an alert rule in Grafana that fires when one of your instances is down for more than 5 minutes, and that each alert fired should have a summary annotation to tell you which instance is down:
## Go's templating language
Templates for labels and annotations are written in Go's templating language, [text/template](https://pkg.go.dev/text/template).
### Opening and closing tags
In text/template, templates start with `{{` and end with `}}` irrespective of whether the template prints a variable or executes control structures such as if statements. This is different from other templating languages such as Jinja where printing a variable uses `{{` and `}}` and control structures use `{%` and `%}`.
### Print
To print the value of something use `{{` and `}}`. You can print the the result of a function or the value of a variable. For example, to print the `$labels` variable you would write the following:
```
{{ $labels }}
```
### Iterate over labels
To iterate over each label in `$labels` you can use a `range`. Here `$k` refers to the name and `$v` refers to the value of the current label. For example, if your query returned a label `instance=test` then `$k` would be `instance` and `$v` would be `test`.
```
{{ range $k, $v := $labels }}
{{ $k }}={{ $v }}
{{ end }}
```
## The labels, value and values variables
### The labels variable
The `$labels` variable contains the labels from the query. For example, a query that checks if an instance is down might return an instance label with the name of the instance that is down. For example, suppose you have an alert rule that fires when one of your instances has been down for more than 5 minutes. You want to add a summary to the alert that tells you which instance is down. With the `$labels` variable, you can create a summary that prints the instance label in the summary:
```
Instance {{ $labels.instance }} has been down for more than 5 minutes
```
## Labels with dots
### Labels with dots
If the label contains a dot (full stop or period) in its name then the following will not work:
If the label you want to print contains a dot (full stop or period) in its name using the same dot in the template will not work:
```
Instance {{ $labels.instance.name }} has been down for more than 5 minutes
```
This is because it is attempting to use a non-existing field `name` in `$labels.instance` rather than `instance.name` in `$labels`. Instead use the `index` function to print `instance.name`:
This is because the template is attempting to use a non-existing field called `name` in `$labels.instance`. You should instead use the `index` function, which prints the label `instance.name` in the `$labels` variable:
```
Instance {{ index $labels "instance.name" }} has been down for more than 5 minutes
```
## Use values in labels and annotations
### The value variable
Grafana supports `$value` when templating labels and annotations. However, while `$value` in Prometheus is a floating point number contains the value of the expression, `$value` in Grafana is a string containing the labels and values of all Threshold, Reduce and Maths expressions. It does not contain the value of queries as a single query can return anywhere from 1 to 10,000s of rows or metrics.
The `$value` variable works different from Prometheus. In Prometheus`$value` is a floating point number containing the value of the expression, but in Grafana it is a string containing the labels and values of all Threshold, Reduce and Math expressions, and Classic Conditions for this alert rule. It does not contain the results of queries, as these can return anywhere from 10s to 10,000s of rows or metrics.
This `$value` variable is called the Value String. If you were to use it in the template of a summary annotation:
If you were to use the `$value` variable in the summary of an alert:
```
{{ $labels.instance }} has an average 95th percentile request latency above 1s: {{ $value }})
{{ $labels.service }} has over 5% of responses with 5xx errors: {{ $value }})
```
you will get the following summary:
The summary might look something like the following:
```
http_server has an average 95th percentile request latency above 1s: [ var='B' labels={instance=http_server} value=10 ]
api has an over 5% of responses with 5xx errors: [ var='B' labels={service=api} value=6.789 ]
```
To get just the value of `B` you can instead use`$values`:
Here `var='B'` refers to the expression with the RefID B. In Grafana, all queries and expressions are identified by a RefID that identifies each query and expression in an alert rule. Similarly `labels={service=api}` refers to the labels, and`value=6.789` refers to the value.
You might have observed that there is no RefID A. That is because in most alert rules the RefID A refers to a query, and since queries can return many rows or time series they are not included in `$value`.
### The values variable
If the `$value` variable contains more information than you need, you can instead print the labels and value of individual expressions using `$values`. Unlike `$value`, the `$values` variable is a table of objects containing the labels and floating point values of each expression, indexed by their RefID.
If you were to print the value of the expression with RefID `B` in the summary of the alert:
```
{{ $labels.instance }} has an average 95th percentile request latency above 1s: {{ $values.B }}
{{ $labels.service }} has over 5% of responses with 5xx errors: {{ $values.B }}%
```
and then you will get this summary:
The summary will contain just the value:
```
http_server has an average 95th percentile request latency above 1s: 11
api has an over 5% of responses with 5xx errors: 6.789%
```
## Alert rules with multiple queries, or expressions
If you have an alert rule with multiple queries and expressions, or a single query with a Reduce and Math expression, like in the following example:
{{< figure src="/static/img/docs/alerting/unified/grafana-alerting-histogram-quantile.png" class="docs-image--no-shadow" caption="An alert rule that uses histogram_quantile to compute 95th percentile" >}}
Then the Value String will not just include the value of the alert condition, but the labels and values of all Threshold, Reduce and Maths expressions.
**Example 1**: The Value String of an alert rule with a single query and Reduce expression `B`:
However, while `{{ $values.B }}` prints the number 6.789, it is actually a string as you are printing the object that contains both the labels and value for RefID B, not the floating point value of B. To use the floating point value of RefID B you must use the `Value` field from `$values.B`. If you were to humanize the floating point value in the summary of an alert:
{{ $labels.service }} has over 5% of responses with 5xx errors: {{ humanize $values.B.Value }}%
```
**Example 2**: The Value String of an alert rule with a single query, Reduce expression `B` and a Math expression `C`:
### No data, execution errors and timeouts
If the query in your alert rule returns no data, or fails because of a datasource error or timeout, then any Threshold, Reduce or Math expressions that use that query will also return no data or an error. When this happens these expression will be absent from `$values`. It is good practice to check that a RefID is present before using it as otherwise your template will break should your query return no data or an error. You can do this using an if statement:
If you were to write a summary annotation such as:
```
{{ $labels.instance }} has an average 95th percentile request latency above 1s: {{ $values.C }})
```
You would find that because the condition of the alert `C` is a Math expression with a boolean comparison, it must return either a `0` or a `1`. What you want instead is the average of the 95th percentile, and you can get this from the reduce expression `B`:
```
{{ $labels.instance }} has an average 95th percentile request latency above 1s: {{ $values.B }})
```
## No data and execution errors or timeouts
Should query `A` return no data then the reduce expression `B` will also return no data. This means that
`{{ $values.B }}` will be nil. To ensure that labels and annotations can still be templated even when a query returns no data, we can use an if statement to check for this condition:
```
{{ if $values.B }}{{ $labels.instance }} has a 95th percentile request latency above 1s: {{ $values.B }}){{ end }}
{{ if $values.B }}{{ $labels.service }} has over 5% of responses with 5xx errors: {{ humanizePercentage $values.B.Value }}{{ end }}
```
## Classic Conditions
If the rule uses Classic Conditions instead of Reduce and Math expressions, then `$values`contains the combination of the Ref ID and position of the condition. For example, `{{ $values.A0 }}` and `{{ $values.A1 }}`.
If the rule uses Classic Conditions instead of Threshold, Reduce and Math expressions, then the `$values`variable is indexed by both the Ref ID and position of the condition in the Classic Condition. For example, if you have a Classic Condition with RefID B containing two conditions, then `$values` will contain two conditions `B0` and `B1`.
## Reference
```
The first condition is {{ $values.B0 }}, and the second condition is {{ $values.B1 }}
```
### Variables
The following template variables are available when expanding labels and annotations:
| $labels | The labels from the query or condition. For example, `{{ $labels.instance }}` and `{{ $labels.job }}`. This is unavailable when the rule uses a [classic condition]({{< relref "../../alerting-rules/create-grafana-managed-rule/#single-and-multi-dimensional-rule" >}}). |
| $values | The values of all reduce and math expressions that were evaluated for this alert rule. For example, `{{ $values.A }}`, `{{ $values.A.Labels }}` and `{{ $values.A.Value }}` where `A` is the `refID` of the reduce or math expression. If the rule uses a classic condition instead of a reduce and math expression, then `$values` contains the combination of the `refID` and position of the condition. |
| $value | The value string of the alert instance. For example, `[ var='A' labels={instance=foo} value=10 ]`. |
### Functions
## Functions
The following functions are also available when expanding labels and annotations:
| Name | Argument type | Return type | Description |
| [graphLink](#graphlink) | string - JSON Object with `"expr"` and `"datasource"` fields | string | Returns the path to graphical view in [Explore](https://grafana.com/docs/grafana/latest/explore/) for the given expression and data source. |
| [tableLink](#tablelink) | string- JSON Object with `"expr"` and `"datasource"` fields | string | Returns the path to tabular view in [Explore](https://grafana.com/docs/grafana/latest/explore/) for the given expression and data source. |
| [args](#args) | []interface{} | map[string]interface{} | Converts a list of objects to a map with keys, for example, arg0, arg1. Use this function to pass multiple arguments to templates. |
| [externalURL](#externalurl) | nothing | string | Returns a string representing the external URL. |
| [pathPrefix](#pathprefix) | nothing | string | Returns the path of the external URL. |
### args
#### humanize
The `args` function translates a list of objects to a map with keys arg0, arg1 etc. This is intended to allow multiple arguments to be passed to templates.
**Template string**`{ humanize $value }`
#### Example
**Input**`1234567.0`
```
{{define "x"}}{{.arg0}} {{.arg1}}{{end}}{{template "x" (args 1 "2")}}
```
**Expected**`1.235M`
```
1 2
```
#### humanize1024
### externalURL
**TemplateString**`{ humanize1024 $value } `
The `externalURL` function returns the external URL of the Grafana server as configured in the ini file(s).
**Input**`1048576.0`
#### Example
**Expected**`1Mi`
```
{{ externalURL }}
```
#### humanizeDuration
```
https://example.com/grafana
```
**TemplateString**`{ humanizeDuration $value }`
### graphLink
**Input**`899.99`
The `graphLink` function returns the path to the graphical view in [Explore](https://grafana.com/docs/grafana/latest/explore/) for the given expression and data source.
The `pathPrefix` function returns the path of the Grafana server as configured in the ini file(s).
#### args
#### Example
**TemplateString**`{{define "x"}}{{.arg0}} {{.arg1}}{{end}}{{template "x" (args 1 "2")}}`
```
{{ pathPrefix }}
```
**Expected**`1 2`
```
/grafana
```
#### externalURL
### tableLink
**TemplateString**`{ externalURL }`
The `tableLink` function returns the path to the tabular view in [Explore](https://grafana.com/docs/grafana/latest/explore/) for the given expression and data source.
- community developed backend data sources with alerting enabled (`backend` and `alerting` properties are set in the [plugin.json]({{< relref "../../developers/plugins/metadata/" >}}))
- community developed backend data sources with alerting enabled (`backend` and `alerting` properties are set in the [plugin.json]({{< relref "/docs/grafana/latest/developers/plugins/metadata" >}}))
### Metrics from the alerting engine
The alerting engine publishes some internal metrics about itself. You can read more about how Grafana publishes [internal metrics]({{< relref "../../setup-grafana/set-up-grafana-monitoring/" >}}).
The alerting engine publishes some internal metrics about itself. You can read more about how Grafana publishes [internal metrics]({{< relref "/docs/grafana/latest/setup-grafana/set-up-grafana-monitoring" >}}).
Images in notifications helps recipients of alert notifications better understand why an alert has fired or resolved by including an image of the panel associated with the Grafana managed alert rule.
> **Note**: Images in notifications are not available for Grafana Mimir and Loki managed alert rules, or when Grafana is set up to send alert notifications to an external Alertmanager.
If Grafana is set up to send images in notifications, it takes a screenshot of the panel for the Grafana managed alert rule when either of the following happen:
1. The alert rule transitions from pending to firing
2. The alert rule transitions from firing to OK
Grafana does not support images for alert rules that are not associated with a panel. An alert rule is associated with a panel when it has both Dashboard UID and Panel ID annotations.
Images are stored in the [data]({{< relref "../setup-grafana/configure-grafana/#paths" >}}) path and so Grafana must have write-access to this path. If Grafana cannot write to this path then screenshots cannot be saved to disk and an error will be logged for each failed screenshot attempt. In addition to storing images on disk, Grafana can also store the image in an external image store such as Amazon S3, Azure Blob Storage, Google Cloud Storage and even Grafana where screenshots are stored in `public/img/attachments`. Screenshots older than `temp_data_lifetime` are deleted from disk but not the external image store. If Grafana is the external image store then screenshots are deleted from `data` but not from `public/img/attachments`.
> **Note**: It is recommended that you use an external image store, as not all contact points support uploading images from disk. It is also possible that the image on disk is deleted before an alert notification is sent if `temp_data_lifetime` is less than the `group_wait` and `group_interval` options used in Alertmanager.
## Requirements
To use images in notifications, Grafana must be set up to use [image rendering]({{< relref "../setup-grafana/image-rendering/" >}}). It is also recommended that Grafana is set up to upload images to an [external image store]({{< relref "../setup-grafana/configure-grafana/#external_image_storage" >}}) such as Amazon S3, Azure Blob Storage, Google Cloud Storage or even Grafana.
## Configuration
> **Note:** Grafana Cloud users can request this feature by [opening a support ticket in the Cloud Portal](https://grafana.com/profile/org#support).
If Grafana has been set up to use [image rendering]({{< relref "../setup-grafana/image-rendering/" >}}) images in notifications can be turned on via the `capture` option in `[unified_alerting.screenshots]`:
# Enable screenshots in notifications. This option requires the Grafana Image Renderer plugin.
# For more information on configuration options, refer to [rendering].
capture = true
It is recommended that `max_concurrent_screenshots` is set to a value that is less than or equal to `concurrent_render_request_limit`. The default value for both `max_concurrent_screenshots` and `concurrent_render_request_limit` is `5`:
# The maximum number of screenshots that can be taken at the same time. This option is different from
# concurrent_render_request_limit as max_concurrent_screenshots sets the number of concurrent screenshots
# that can be taken at the same time for all firing alerts where as concurrent_render_request_limit sets
# the total number of concurrent screenshots across all Grafana services.
max_concurrent_screenshots = 5
If Grafana has been set up to use an external image store, `upload_external_image_storage` should be set to `true`:
# Uploads screenshots to the local Grafana server or remote storage such as Azure, S3 and GCS. Please
# see [external_image_storage] for further configuration options. If this option is false, screenshots
# will be persisted to disk for up to temp_data_lifetime.
upload_external_image_storage = false
Restart Grafana for the changes to take affect.
## Supported notifiers
Images in notifications are supported in the following notifiers and additional support will be added in the future:
| Name | Upload images from disk | Include images from URL |
Include images from URL refers to using the external image store.
## Metrics
Grafana provides the following metrics to observe the performance and failure rate of images in notifications.
For example, if a screenshot could not be taken within the expected time (10 seconds) then the counter `grafana_screenshot_failures_total` is updated.
-`grafana_screenshot_cache_hits_total`
-`grafana_screenshot_cache_misses_total`
-`grafana_screenshot_duration_seconds`
-`grafana_screenshot_failures_total`
-`grafana_screenshot_successes_total`
-`grafana_screenshot_upload_failures_total`
-`grafana_screenshot_upload_successes_total`
## Limitations
- Images in notifications are not available for Grafana Mimir and Loki managed alert rules, or when Grafana is set up to send alert notifications to an external Alertmanager.
- When alerts generated by different alert rules are sent in a single notification, there may be screenshots for each alert rule. This happens if an alert group contains multiple alerting rules. The order the images are attached is random. If you need to guarantee the ordering of images, make sure that your alert groups contain a single alerting rule.
- Some contact points only handle a single image. In this case, the first image associated with an alert will be attached. Because the ordering is random, this may not always be an image for the same alert rule. If you need to guarantee you receive a screenshot for a particular rule, make sure that your alert groups contain a single alerting rule.
@@ -24,13 +24,13 @@ Complete the following steps to add a contact point.
1. In the Grafana menu, click the **Alerting** (bell) icon to open the Alerting page listing existing alerts.
1. Click **Contact points** to open the page listing existing contact points.
1. Click **New contact point**.
1. Click **Add contact point**.
1. From the **Alertmanager** dropdown, select an Alertmanager. By default, Grafana Alertmanager is selected.
1. In **Name**, enter a descriptive name for the contact point.
1. From **Contact point integration**, select a type and fill out mandatory fields. For example, if you choose email, enter the email addresses. Or if you choose Slack, enter the Slack channel(s) and users who should be contacted.
1. Some contact point integrations, like email or webhook, have optional settings. In **Optional settings**, specify additional settings for the selected contact point integration.
1. In Notification settings, optionally select **Disable resolved message** if you do not want to be notified when an alert resolves.
1. To add another contact point integration, click **New contact point integration** and repeat steps 6 through 8.
1. To add another contact point integration, click **Add contact point integration** and repeat steps 6 through 8.
1. Click **Save contact point** to save your changes.
You can use notification templates to customize notification messages for the contact point types.
## Create a notification template:
To create a notification template, complete the following steps.
1. In the Grafana menu, click the **Alerting** (bell) icon to open the Alerting page listing existing alerts.
2. In the Alerting page, click **Contact points** to open the page listing existing contact points.
3. From Alertmanager drop-down, select an external Alertmanager to create and manage templates for the external data source. Otherwise, keep the default option of Grafana.
The `define` tag in the Content section assigns the template name. This tag is optional, and when omitted, the template name is derived from the **Name** field. When both are specified, it is a best practice to ensure that they are the same.
## Edit a notification template:
To edit a notification template, complete the following steps.
1. In the Alerting page, click **Contact points** to open the page listing existing contact points.
1. In the Template table, find the template you want to edit, then click the **Edit** (pen icon).
1. Make your changes, then click **Save template**.
## Delete a notification template:
To delete a notification template, complete the following steps.
1. In the Alerting page, click **Contact points** to open the page listing existing contact points.
1. In the Template table, find the template you want to delete, then click the **Delete** (trash icon).
1. In the confirmation dialog, click **Yes, delete** to delete the template.
Use caution when deleting a template since Grafana does not prevent you from deleting templates that are in use.
## Create a custom template
Here's an example of how to use a custom template. You can also use the default template included in the setup.
Step 1: Configure a template to render a single alert.
```
{{ define "myalert" }}
[{{.Status}}] {{ .Labels.alertname }}
Labels:
{{ range .Labels.SortedPairs }}
{{ .Name }}: {{ .Value }}
{{ end }}
{{ if gt (len .Annotations) 0 }}
Annotations:
{{ range .Annotations.SortedPairs }}
{{ .Name }}: {{ .Value }}
{{ end }}
{{ end }}
{{ if gt (len .SilenceURL ) 0 }}
Silence alert: {{ .SilenceURL }}
{{ end }}
{{ if gt (len .DashboardURL ) 0 }}
Go to dashboard: {{ .DashboardURL }}
{{ end }}
{{ end }}
```
Step 2: Configure a template to render entire notification message.
```
{{ define "mymessage" }}
{{ if gt (len .Alerts.Firing) 0 }}
{{ len .Alerts.Firing }} firing:
{{ range .Alerts.Firing }} {{ template "myalert" .}} {{ end }}
{{ end }}
{{ if gt (len .Alerts.Resolved) 0 }}
{{ len .Alerts.Resolved }} resolved:
{{ range .Alerts.Resolved }} {{ template "myalert" .}} {{ end }}
{{ end }}
{{ end }}
```
Step 3: Add `mymessage` in the notification message field.
```
Alert summary:
{{ template "mymessage" . }}
```
## Template data
Template data is passed on to notification templates as well as sent as payload to webhook pushes.
| Labels | KeyValue | A set of labels attached to the alert. |
| Annotations | KeyValue | A set of annotations attached to the alert. |
| StartsAt | time.Time | Time the alert started firing. |
| EndsAt | time.Time | Only set if the end time of an alert is known. Otherwise set to a configurable timeout period from the time since the last alert was received. |
| GeneratorURL | string | A back link to Grafana or external Alertmanager. |
| SilenceURL | string | Link to grafana silence for with labels for this alert pre-filled. Only for Grafana managed alerts. |
| DashboardURL | string | Link to grafana dashboard, if alert rule belongs to one. Only for Grafana managed alerts. |
| PanelURL | string | Link to grafana dashboard panel, if alert rule belongs to one. Only for Grafana managed alerts. |
| Fingerprint | string | Fingerprint that can be used to identify the alert. |
| ValueString | string | A string that contains the labels and value of each reduced expression in the alert. |
## KeyValue
`KeyValue` is a set of key/value string pairs that represent labels and annotations.
Here is an example containing two annotations:
```json
{
"summary":"alert summary",
"description":"alert description"
}
```
In addition to direct access of data (labels and annotations) stored as KeyValue, there are also methods for sorting, removing and transforming.
Notification policies determine how alerts are routed to contact points. Policies have a tree structure, where each policy can have one or more child policies. Each policy, except for the root policy, can also match specific alert labels. Each alert is evaluated by the root policy and subsequently by each child policy. If you enable the `Continue matching subsequent sibling nodes` option is enabled for a specific policy, then evaluation continues even after one or more matches. A parent policy’s configuration settings and contact point information govern the behavior of an alert that does not match any of the child policies. A root policy governs any alert that does not match a specific policy.
Notification policies determine how alerts are routed to contact points. Policies have a tree structure, where each policy can have one or more child policies. Each policy, except for the root policy, can also match specific alert labels. Each alert is evaluated by the root policy and subsequently by each child policy. If the `Continue matching subsequent sibling nodes` option is enabled for a specific policy, then evaluation continues even after one or more matches. A parent policy’s configuration settings and contact point information govern the behavior of an alert that does not match any of the child policies. A root policy governs any alert that does not match a specific policy.
You can configure Grafana managed notification policies as well as notification policies for an external Alertmanager data source.
@@ -76,6 +76,23 @@ You can configure grouping to be `group_by: [alertname]` (take note that the `en
1. Make any changes using instructions in [Add new specific policy](#add-new-specific-policy).
1. Click **Save policy**.
## Searching for policies
Grafana allows you to search within the tree of policies by the following:
- **Label matchers**
- **Contact Points**
To search by contact point, simply enter a part or full name you are looking for.
To search by label matchers simply enter a valid matcher in the **Search by matchers** input field. Multiple matchers can be combined with a comma (`,`).
An example of a valid matchers search input is:
`severity=high, region=~EMEA|NASA`
> All matched policies will be **exact** matches, we currently do not support regex-style or partial matching.
@@ -28,7 +28,7 @@ To add a silence, complete the following steps.
1. In the Grafana menu, click the **Alerting** (bell) icon to open the Alerting page listing existing alerts.
2. On the Alerting page, click **Silences** to open the page listing existing silences.
3. From Alertmanager drop-down, select an external Alertmanager to create and manage silences for the external data source. Otherwise, keep the default option of Grafana.
4. Click **New Silence** to open the Create silence page.
4. Click **Add Silence** to open the Create silence page.
5. In **Silence start and end**, select the start and end date to indicate when the silence should go into effect and expire.
6. Optionally, in **Duration**, specify how long the silence is enforced. This automatically updates the end time in the **Silence start and end** field.
7. In the **Name** and **Value** fields, enter one or more _Matching Labels_. Matchers determine which rules the silence will apply to.
Images in notifications helps recipients of alert notifications better understand why an alert has fired or resolved by including a screenshot of the panel associated with the alert.
> **Note**: This feature is not supported for Mimir or Loki rules, or when Grafana sends alert notifications to an external Alertmanager.
> **Note**: This feature is not supported in Mimir or Loki, or when Grafana is configured to send alerts to other Alertmanagers such as the Prometheus Alertmanager
When an alert is fired or resolved Grafana takes a screenshot of the panel associated with the alert. This is determined via the Dashboard UID and Panel ID annotations of the rule. Grafana cannot take a screenshot for alerts that are not associated with a panel.
Because a number of contact points, such as email, do not support uploading screenshots at the time of sending a notification; Grafana can also upload the screenshot to a cloud storage service such as Amazon S3, Azure Blob Storage and Google Cloud Storage, where a link to the uploaded screenshot can be added to the notification. However, if using a cloud storage service is not an option then Grafana can be its own cloud storage service such that the screenshot is available under the same domain as Grafana.
Grafana takes at most two screenshots for each alert: once when the alert fires and again when the alert is resolved. Screenshots are not re-taken over the lifetime of the alert, instead you should open the panel in Grafana to follow the data in real time. In addition, depending on how alerts are grouped in your notification policies, Grafana might send a notification with many screenshots of the same panel. This happens because Grafana does not know how your alerts are grouped at the time a screenshot is taken, and so acts conservatively by taking a screenshot for every alert.
Should either the cloud storage service, or Grafana if acting as its own cloud storage service, be protected by a firewall, gateway service or VPN, then screenshots might not be shown in notifications.
Once a screenshot has been taken Grafana can either upload it to a cloud storage service such as Amazon S3, Azure Blob Storage or Google Cloud Storage; upload the screenshot to it's internal web server; or upload it to the service that is receiving the notification, such as Slack. Which option you should choose depends on how your Grafana is managed and which integrations you use. More information on this can be found in Requirements.
How to choose between uploading screenshots at the time of sending the notification, using a cloud storage service, or using Grafana as its own cloud storage service, depends on which contact points you plan to use and whether you use a firewall, gateway service or VPN.
For example, if a contact point supports uploading images at the time of notification is it not required to use cloud storage. Cloud storage is required when a contact point does not support uploading images at the time of sending a notification, such as email. We don't recommend using cloud storage if the cloud storage service is behind a firewall, gateway service, or VPN, as screenshots might not be shown in notifications.
Please refer to the table at the end of this page for a list of contact points and their support for images in notifications.
Refer to the table at the end of this page for a list of contact points and their support for images in notifications.
## Requirements
To use images in notifications, Grafana must be set up to use [image rendering](https://grafana.com/docs/grafana/next/setup-grafana/image-rendering/). You can either install the image rendering plugin or run it as a remote rendering service.
1.To use images in notifications, Grafana must be set up to use [image rendering]({{< relref "/docs/grafana/latest/setup-grafana/image-rendering" >}}). You can either install the image rendering plugin or run it as a remote rendering service.
When a screenshot is taken it is saved to the [data]({{< relref "../../setup-grafana/configure-grafana/#paths" >}}) path. This is where screenshots are stored before being sent in a notification or uploaded to a cloud storage service. Grafana must have write-access to this path. If Grafana cannot write to this path then screenshots cannot be saved to disk and an error will be logged for each failed screenshot attempt.
2.When a screenshot is taken it is saved to the [data]({{< relref "/docs/grafana/latest/setup-grafana/configure-grafana#paths" >}}) folder, even if Grafana is configured to upload screenshots to a cloud storage service. Grafana must have write-access to this folder otherwise screenshots cannot be saved to disk and an error will be logged for each failed screenshot attempt.
If using a [cloud storage service](https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#external_image_storage) such as Amazon S3, Azure Blob Storage or Google Cloud Storage, uploaded images need to be accessible outside of a firewall, gateway service or VPN for screenshots to be shown in notifications. Grafana will not delete screenshots from cloud storage. We recommend configuring a retention policy on the bucket to delete screenshots older than 1 month.
3. You should use a cloud storage service unless sending alerts to Discord, Email, Pushover, Slack or Telegram. These integrations support either embedding screenshots in the email or attaching screenshots to the notification, while other integrations must link screenshots uploaded to a cloud storage bucket. If a cloud storage service has been configured then integrations that support both will link screenshots from the cloud storage bucket instead of embedding or attaching screenshots to the notification.
If using Grafana as its own cloud storage service then screenshots will be saved to `static_root_path/img/attachments`. `static_root_path` is a configuration option for Grafana and can be found in `defaults.ini`. However, like when using a cloud storage service, images need to be accessible outside of a firewall, gateway service or VPN for screenshots to be shown in notifications.
4. If uploading screenshots to a cloud storage service such as Amazon S3, Azure Blob Storage or Google Cloud Storage; and accessing screenshots in the bucket requires authentication, logging into a VPN or corporate network; then image previews might not work in all instant messaging and communication platforms as some services rewrite URLs to use their CDN. If this happens we recommend using [integrations which support uploading images]({{<relref "#supported-contact-points">}}) or [disabling images in notifications]({{<relref "#configuration">}}) altogether.
When using Grafana as its own cloud storage service screenshots are copied from [data]({{< relref "../../setup-grafana/configure-grafana/#paths" >}}) to `static_root_path/img/attachments`. Screenshots older than `temp_data_lifetime` are deleted from [data]({{< relref "../../setup-grafana/configure-grafana/#paths" >}}) but not from `static_root_path/images/attachments`. To delete screenshots from `static_root_path` after a certain amount of time we recommend setting up a CRON job.
5.When uploading screenshots to a cloud storage service Grafana uses a random 20 character (30 characters for Azure Blob Storage) filename for each image. This makes URLs hard to guess but not impossible.
6. Grafana does not delete screenshots from cloud storage. We recommend configuring a retention policy with your cloud storage service to delete screenshots older than 1 month.
7. If Grafana is configured to upload screenshots to its internal web server, and accessing Grafana requires logging into a VPN or corporate network; image previews might not work in all instant messaging and communication platforms as some services rewrite URLs to use their CDN. If this happens we recommend using [integrations which support uploading images]({{<relref "#supported-contact-points">}}) or [disabling images in notifications]({{<relref "#configuration">}}) altogether.
8. Grafana does not delete screenshots uploaded to its internal web server. To delete screenshots from `static_root_path/images/attachments` after a certain amount of time we recommend setting up a CRON job.
## Configuration
> **Note:** Grafana Cloud users can request this feature by [opening a support ticket in the Cloud Portal](https://grafana.com/profile/org#support).
> **Note:** Grafana Cloud users can request this feature by [opening a support ticket in the Cloud Portal](/profile/org#support).
Having installed either the image rendering plugin, or set up Grafana to use a remote rendering service, set `capture` in `[unified_alerting.screenshots]` to `true`:
# Enable screenshots in notifications. This option requires the Grafana Image Renderer plugin.
# Enable screenshots in notifications. You must have either installed the Grafana image rendering
# plugin, or set up Grafana to use a remote rendering service.
# For more information on configuration options, refer to [rendering].
capture = false
@@ -56,9 +59,9 @@ If screenshots should be uploaded to cloud storage then `upload_external_image_s
# will be persisted to disk for up to temp_data_lifetime.
upload_external_image_storage = false
Please see [`[external_image_storage]`](https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#external_image_storage) for instructions on how to configure cloud storage. Grafana will not start if `upload_external_image_storage` is `true` and `[external_image_storage]` contains missing or invalid configuration.
Please see [`[external_image_storage]`]({{< relref "/docs/grafana/latest/setup-grafana/configure-grafana#external_image_storage" >}}) for instructions on how to configure cloud storage. Grafana will not start if `upload_external_image_storage` is `true` and `[external_image_storage]` contains missing or invalid configuration.
If Grafana is acting as its own cloud storage then `[upload_external_image_storage]` should be set to `true` and the `local` provider should be set in [`[external_image_storage]`](https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#external_image_storage).
If Grafana is acting as its own cloud storage then `[upload_external_image_storage]` should be set to `true` and the `local` provider should be set in [`[external_image_storage]`]({{< relref "/docs/grafana/latest/setup-grafana/configure-grafana#external_image_storage" >}}).
Restart Grafana for the changes to take effect.
@@ -72,37 +75,36 @@ We recommended that `max_concurrent_screenshots` is less than or equal to `concu
# the total number of concurrent screenshots across all Grafana services.
max_concurrent_screenshots = 5
## Support for images in contact points
## Supported contact points
Grafana supports a wide range of contact points with varied support for images in notifications. The table below shows the list of all contact points supported in Grafana and their support for uploading images at the time of sending the notification and images uploaded to cloud storage, including when Grafana is acting as its own cloud storage service.
Grafana supports a wide range of contact points with varied support for images in notifications. The table below shows the list of all contact points supported in Grafana and their support for uploading screenshots to the receiving service and referencing screenshots that have been uploaded to a cloud storage service.
| Name | Upload image at time of notification | Cloud storage |
| Discord | Yes (Maximum of 10 per notification) | Yes (Maximum of 10 per notification) |
| Email | Yes (Embedded in the email) | Yes |
| Google Hangouts Chat | No | Yes |
| Kafka | No | No |
| Line | No | No |
| Microsoft Teams | No | Yes |
| Opsgenie | No | Yes |
| Pagerduty | No | Yes |
| Prometheus Alertmanager | No | No |
| Pushover | Yes (Maximum of 1 per notification)| No |
| Sensu Go | No | No |
| Slack | Yes (when using Bot tokens, maximum of 5 per notification) | Yes (when using webhooks, maximum of 1 per notification) |
| Telegram | Yes | No |
| Threema | No | No |
| VictorOps | No | No |
| Webhook | No | Yes |
## Limitations
- This feature is not supported for Mimir or Loki rules, or when Grafana sends alert notifications to an external Alertmanager.
-When multiple alerts are sent in a single notification a screenshot might be included for each alert. The order the images are shown in random.
-Some contact points support at most one image per notification. In this case, the first image associated with an alert will be attached.
-We don't recommend using cloud storage if the cloud storage service is behind a firewall, gateway service, or VPN, as screenshots might not be shown in notifications.
- This feature is not supported in Mimir or Loki, or when Grafana is configured to send alerts to other Alertmanagers such as the Prometheus Alertmanager.
-A number of contact points support at most one image per notification. In this case, just the first image is either uploaded to the receiving service or referenced from cloud storage per notification.
-When multiple alerts are sent in a single notification a screenshot might be included for each alert. The order the images are shown is random.
-If uploading screenshots to a cloud storage service such as Amazon S3, Azure Blob Storage or Google Cloud Storage; and accessing screenshots in the bucket requires authentication, logging into a VPN or corporate network; image previews might not work in all instant messaging and communication platforms as some services rewrite URLs to use their CDN.
## Troubleshooting
@@ -113,9 +115,7 @@ If Grafana has been set up to send images in notifications, however notification
3. If the alert is not associated with a dashboard there will be logs for `Cannot take screenshot for alert rule as it is not associated with a dashboard`.
4. If the alert is associated with a dashboard, but no panel in the dashboard, there will be logs for `Cannot take screenshot for alert rule as it is not associated with a panel`.
5. If images cannot be taken because of mis-configuration or an issue with image rendering there will be logs for `Failed to take an image` including the Dashboard UID, Panel ID, and the error message.
6. Check that the contact point supports images in notifications, and the present configuration, as per the table.
7. If the image was uploaded to cloud storage make sure it is public.
8. If images are made available via Grafana's built in web server make sure it is accessible via the Internet.
6. Check that the contact point supports images in notifications and whether it supports uploading images to the receiving service or referencing images that have been uploaded to a cloud storage service.
@@ -20,7 +20,7 @@ A mute timing is a recurring interval of time when no new notifications for a po
Similar to silences, mute timings do not prevent alert rules from being evaluated, nor do they stop alert instances from being shown in the user interface. They only prevent notifications from being created.
You can configure Grafana managed mute timings as well as mute timings for an [external Alertmanager data source]({{< relref "../../datasources/alertmanager/" >}}). For more information, refer to [Alertmanager documentation]((https://grafana.com/docs/grafana/next/alerting/manage-notifications/alertmanager/).
You can configure Grafana managed mute timings as well as mute timings for an [external Alertmanager data source]({{< relref "/docs/grafana/latest/datasources/alertmanager" >}}). For more information, refer to [Alertmanager documentation]({{< relref "/docs/grafana/latest/alerting/manage-notifications/alertmanager" >}}).
@@ -60,17 +60,17 @@ Template the subject of an email to contain the number of firing and resolved al
1. Create a template called `email.subject` with the following content:
```
{{ define "email.subject" }}
{{ len .Alerts.Firing }} firing alert(s), {{ len .Alerts.Resolved }} resolved alert(s)
{{ end }}
```
```
{{ define "email.subject" }}
{{ len .Alerts.Firing }} firing alert(s), {{ len .Alerts.Resolved }} resolved alert(s)
{{ end }}
```
2. Execute the template from the subject field in your contact point integration:
```
{{ template "email.subject" . }}
```
```
{{ template "email.subject" . }}
```
## Template the message of an email
@@ -93,37 +93,37 @@ Resolved alerts:
The `email.message_alert` template is used to print the labels and values for each firing and resolved alert while the `email.message` template contains the structure of the email.
```
{{- define "email.message_alert" -}}
{{- range .Labels.SortedPairs }}{{ .Name }}={{ .Value }} {{ end }} has value(s)
{{- range $k, $v := .Values }} {{ $k }}={{ $v }}{{ end }}
{{- end -}}
```
{{- define "email.message_alert" -}}
{{- range .Labels.SortedPairs }}{{ .Name }}={{ .Value }} {{ end }} has value(s)
{{- range $k, $v := .Values }} {{ $k }}={{ $v }}{{ end }}
{{- end -}}
{{ define "email.message" }}
There are {{ len .Alerts.Firing }} firing alert(s), and {{ len .Alerts.Resolved }} resolved alert(s)
{{ define "email.message" }}
There are {{ len .Alerts.Firing }} firing alert(s), and {{ len .Alerts.Resolved }} resolved alert(s)
{{ if .Alerts.Firing -}}
Firing alerts:
{{- range .Alerts.Firing }}
- {{ template "email.message_alert" . }}
{{- end }}
{{- end }}
{{ if .Alerts.Firing -}}
Firing alerts:
{{- range .Alerts.Firing }}
- {{ template "email.message_alert" . }}
{{- end }}
{{- end }}
{{ if .Alerts.Resolved -}}
Resolved alerts:
{{- range .Alerts.Resolved }}
- {{ template "email.message_alert" . }}
{{- end }}
{{- end }}
{{ if .Alerts.Resolved -}}
Resolved alerts:
{{- range .Alerts.Resolved }}
- {{ template "email.message_alert" . }}
{{- end }}
{{- end }}
{{ end }}
```
{{ end }}
```
2. Execute the template from the message field in your contact point integration:
```
{{ template "email.message" . }}
```
```
{{ template "email.message" . }}
```
## Template the title of a Slack message
@@ -135,17 +135,17 @@ Template the title of a Slack message to contain the number of firing and resolv
1. Create a template called `slack.title` with the following content:
```
{{ define "slack.title" }}
{{ len .Alerts.Firing }} firing alert(s), {{ len .Alerts.Resolved }} resolved alert(s)
{{ end }}
```
```
{{ define "slack.title" }}
{{ len .Alerts.Firing }} firing alert(s), {{ len .Alerts.Resolved }} resolved alert(s)
{{ end }}
```
2. Execute the template from the title field in your contact point integration:
```
{{ template "slack.title" . }}
```
```
{{ template "slack.title" . }}
```
## Template the content of a Slack message
@@ -179,48 +179,48 @@ Go to dashboard: https://example.com/d/dlhdLqF4z?orgId=1
The `slack.print_alert` template is used to print the labels, annotations, SilenceURL and DashboardURL while the `slack.message` template contains the structure of the notification.
```
{{ define "slack.print_alert" -}}
[{{.Status}}] {{ .Labels.alertname }}
Labels:
{{ range .Labels.SortedPairs -}}
- {{ .Name }}: {{ .Value }}
{{ end -}}
{{ if .Annotations -}}
Annotations:
{{ range .Annotations.SortedPairs -}}
- {{ .Name }}: {{ .Value }}
{{ end -}}
{{ end -}}
{{ if .SilenceURL -}}
Silence: {{ .SilenceURL }}
{{ end -}}
{{ if .DashboardURL -}}
Go to dashboard: {{ .DashboardURL }}
{{- end }}
{{- end }}
```
{{ define "slack.print_alert" -}}
[{{.Status}}] {{ .Labels.alertname }}
Labels:
{{ range .Labels.SortedPairs -}}
- {{ .Name }}: {{ .Value }}
{{ end -}}
{{ if .Annotations -}}
Annotations:
{{ range .Annotations.SortedPairs -}}
- {{ .Name }}: {{ .Value }}
{{ end -}}
{{ end -}}
{{ if .SilenceURL -}}
Silence: {{ .SilenceURL }}
{{ end -}}
{{ if .DashboardURL -}}
Go to dashboard: {{ .DashboardURL }}
{{- end }}
{{- end }}
{{ define "slack.message" -}}
{{ if .Alerts.Firing -}}
{{ len .Alerts.Firing }} firing alert(s):
{{ range .Alerts.Firing }}
{{ template "slack.print_alert" . }}
{{ end -}}
{{ end }}
{{ if .Alerts.Resolved -}}
{{ len .Alerts.Resolved }} resolved alert(s):
{{ range .Alerts.Resolved }}
{{ template "slack.print_alert" .}}
{{ end -}}
{{ end }}
{{- end }}
```
{{ define "slack.message" -}}
{{ if .Alerts.Firing -}}
{{ len .Alerts.Firing }} firing alert(s):
{{ range .Alerts.Firing }}
{{ template "slack.print_alert" . }}
{{ end -}}
{{ end }}
{{ if .Alerts.Resolved -}}
{{ len .Alerts.Resolved }} resolved alert(s):
{{ range .Alerts.Resolved }}
{{ template "slack.print_alert" .}}
{{ end -}}
{{ end }}
{{- end }}
```
2. Execute the template from the text body field in your contact point integration:
```
{{ template "slack.message" . }}
```
```
{{ template "slack.message" . }}
```
## Template both email and Slack with shared templates
@@ -234,20 +234,20 @@ For example, if you want to send an email with this subject and Slack message wi
1. Create a template called `common.subject_title` with the following content:
```
{{ define "common.subject_title" }}
{{ len .Alerts.Firing }} firing alert(s), {{ len .Alerts.Resolved }} resolved alert(s)
{{ end }}
```
```
{{ define "common.subject_title" }}
{{ len .Alerts.Firing }} firing alert(s), {{ len .Alerts.Resolved }} resolved alert(s)
{{ end }}
```
2. For email, execute the template from the subject field in your email contact point integration:
```
{{ template "common.subject_title" . }}
```
```
{{ template "common.subject_title" . }}
```
3. For Slack, execute the template from the title field in your Slack contact point integration:
For more information on how to write and execute templates, refer to [Using Go's templating language]({{< relref "./using-go-templating-language" >}}) and [Create notification templates]({{< relref "./create-notification-templates" >}}).
For more information on how to write and execute templates, refer to [Using Go's templating language]({{< relref "./using-go-templating-language" >}}) and [Create notification templates]({{< relref "./create-notification-templates" >}}).
Meta monitoring is the process of monitoring your monitoring, and alerting when your monitoring is not working as it should. Whether you use Grafana Managed Alerts or Mimir, meta monitoring is possible both on-premise and in Grafana Cloud.
## Grafana Managed Alerts
Meta monitoring of Grafana Managed Alerts requires having a Prometheus server, or other metrics database, collecting and storing metrics exported by Grafana. For example, if using Prometheus you should add a `scrape_config` to Prometheus to scrape metrics from your Grafana server.
Here is an example of how this might look:
```
- job_name: grafana
honor_timestamps: true
scrape_interval: 15s
scrape_timeout: 10s
metrics_path: /metrics
scheme: http
follow_redirects: true
static_configs:
- targets:
- grafana:3000
```
The Grafana ruler, which is responsible for evaluating alert rules, and the Grafana Alertmanager, which is responsible for sending notifications of firing and resolved alerts, provide a number of metrics that let you observe them.
#### grafana_alerting_alerts
This metric is a counter that shows you the number of `normal`, `pending`, `alerting`, `nodata` and `error` alerts. For example, you might want to create an alert that fires when `grafana_alerting_alerts{state="error"}` is greater than 0.
#### grafana_alerting_schedule_alert_rules
This metric is a gauge that shows you the number of alert rules scheduled. An alert rule is scheduled unless it is paused, and the value of this metric should match the total number of non-paused alert rules in Grafana.
This metric is a histogram that shows you the time it takes to process an individual tick in the scheduler that evaluates alert rules. If the scheduler takes longer than 10 seconds to process a tick then pending evaluations will start to accumulate such that alert rules might later than expected.
This metric is a histogram that shows you how long it takes the scheduler to fetch the latest rules from the database. If this metric is elevated then so will `schedule_periodic_duration_seconds`.
#### grafana_alerting_scheduler_behind_seconds
This metric is a gauge that shows you the number of seconds that the scheduler is behind where it should be. This number will increase if `schedule_periodic_duration_seconds` is longer than 10 seconds, and decrease when it is less than 10 seconds. The smallest possible value of this metric is 0.
This metric is a histogram that shows you the number of seconds taken to send notifications for firing and resolved alerts. This metric will let you observe slow or over-utilized integrations, such as an SMTP server that is being given emails faster than it can send them.
> These metrics are not available at present in Grafana Cloud.
## Grafana Mimir
Meta monitoring in Grafana Mimir requires having a Prometheus/Mimir server, or other metrics database, collecting and storing metrics exported by the Mimir ruler.
This metric is a counter that shows you the total number of rule evaluation failures.
## Alertmanager
Meta monitoring in Alertmanager also requires having a Prometheus/Mimir server, or other metrics database, collecting and storing metrics exported by Alertmanager. For example, if using Prometheus you should add a `scrape_config` to Prometheus to scrape metrics from your Alertmanager.
Here is an example of how this might look:
```
- job_name: alertmanager
honor_timestamps: true
scrape_interval: 15s
scrape_timeout: 10s
metrics_path: /metrics
scheme: http
follow_redirects: true
static_configs:
- targets:
- alertmanager:9093
```
#### alertmanager_alerts
This metric is a counter that shows you the number of active, suppressed and unprocessed alerts in Alertmanager. Suppressed alerts are silenced alerts, and unprocessed alerts are alerts that have been sent to the Alertmanager but have not been processed.
#### alertmanager_alerts_invalid_total
This metric is a counter that shows you the number of invalid alerts that were sent to Alertmanager. This counter should not exceed 0, and so in most cases you will want to create an alert that fires if whenever this metric increases.
#### alertmanager_notifications_total
This metric is a counter that shows you how many notifications have been sent by Alertmanager. The metric uses a label "integration" to show the number of notifications sent by integration, such as email.
#### alertmanager_notifications_failed_total
This metric is a counter that shows you how many notifications have failed in total. This metric also uses a label "integration" to show the number of failed notifications by integration, such as failed emails. In most cases you will want to use the `rate` function to understand how often notifications are failing to be sent.
This metric is a histogram that shows you the amount of time it takes Alertmanager to send notifications and for those notifications to be accepted by the receiving service. This metric uses a label "integration" to show the amount of time by integration. For example, you can use this metric to show the 95th percentile latency of sending emails.
> In Grafana Cloud some of these metrics are available via the Prometheus usage datasource that is provisioned for all Grafana Cloud customers.
## Alertmanager in high availability mode
If using Alertmanager in high availability mode there are a number of additional metrics that you might want to create alerts for.
#### alertmanager_cluster_members
This metric is a gauge that shows you the current number of members in the cluster. The value of this gauge should be the same across all Alertmanagers. If different Alertmanagers are showing different numbers of members then this is indicative of an issue with your Alertmanager cluster. You should look at the metrics and logs from your Alertmanagers to better understand what might be going wrong.
#### alertmanager_cluster_failed_peers
This metric is a gauge that shows you the current number of failed peers.
#### alertmanager_cluster_health_score
This metric is a gauge showing the health score of the Alertmanager. Lower values are better, and zero means the Alertmanager is healthy.
#### alertmanager_cluster_peer_info
This metric is a gauge. It has a constant value `1`, and contains a label called "peer" containing the Peer ID of each known peer.
This metric is a counter that shows you the number of failed peer connection attempts. In most cases you will want to use the `rate` function to understand how often reconnections fail as this may be indicative of an issue or instability in your network.
> These metrics are not available in Grafana Cloud as it uses a different high availability strategy than on-premise Alertmanagers.
@@ -20,16 +20,21 @@ longer supported. We refer to these as [Differences]({{< relref "#differences" >
2. Read and write access to legacy dashboard alerts and Grafana alerts are governed by the permissions of the folders storing them. During migration, legacy dashboard alert permissions are matched to the new rules permissions as follows:
- If alert's dashboard has permissions, it will create a folder named like `Migrated {"dashboardUid": "UID", "panelId": 1, "alertId": 1}` to match permissions of the dashboard (including the inherited permissions from the folder).
- If there are no dashboard permissions and the dashboard is under a folder, then the rule is linked to this folder and inherits its permissions.
- If there are no dashboard permissions and the dashboard is under the General folder, then the rule is linked to the `General Alerting` folder, and the rule inherits the default permissions.
- If there are dashboard permissions, a folder named `Migrated {"dashboardUid": "UID", "panelId": 1, "alertId": 1}` is created to match the permissions of the dashboard (including the inherited permissions from the folder).
- If there are no dashboard permissions and the dashboard is in a folder, then the rule is linked to this folder and inherits its permissions.
- If there are no dashboard permissions and the dashboard is in the General folder, then the rule is linked to the `General Alerting` folder and the rule inherits the default permissions.
3.Since there is no `Keep Last State` option for [`NoData`]({{< relref "../alerting-rules/create-grafana-managed-rule/#no-data--error-handling" >}}) in Grafana Alerting, this option becomes `NoData` during the legacy rules migration. Option "Keep Last State" for [`Error handling`]({{< relref "../alerting-rules/create-grafana-managed-rule/#no-data--error-handling" >}}) is migrated to a new option `Error`. To match the behavior of the `Keep Last State`, in both cases, during the migration Grafana automatically creates a silence for each alert rule with a duration of 1 year.
3.`NoData` and `Error` settings are migrated as is to the corresponding settings in Grafana Alerting, except in two situations:
3.1. As there is no `Keep Last State` option for `No Data` in Grafana Alerting, this option becomes `NoData`. The `Keep Last State` option for `Error` is migrated to a new option `Error`. To match the behavior of the `Keep Last State`, in both cases, during the migration Grafana automatically creates a silence for each alert rule with a duration of 1 year.
3.2. Due to lack of validation, legacy alert rules imported via JSON or provisioned along with dashboards can contain arbitrary values for `NoData` and [`Error`](/docs/sources/alerting/alerting-rules/create-grafana-managed-rule.md#configure-no-data-and-error-handling). In this situation, Grafana will use the default setting: `NoData` for No data, and `Error` for Error.
4. Notification channels are migrated to an Alertmanager configuration with the appropriate routes and receivers. Default notification channels are added as contact points to the default route. Notification channels not associated with any Dashboard alert go to the `autogen-unlinked-channel-recv` route.
5. Unlike legacy dashboard alerts where images in notifications are enabled per contact point, images in notifications for Grafana Alerting must be enabled in the Grafana configuration, either in the configuration file or environment variables, and are enabled for either all or no contact points. Refer to [images in notifications](https://grafana.com/docs/grafana/latest/alerting/manage-notifications/images-in-notifications/).
6. Grafana Alerting does not support pausing the evaluation of alert rules. After migration, all paused alert rules will become active, which may cause unexpected notifications to be sent.
5. Unlike legacy dashboard alerts where images in notifications are enabled per contact point, images in notifications for Grafana Alerting must be enabled in the Grafana configuration, either in the configuration file or environment variables, and are enabled for either all or no contact points. Refer to [images in notifications]({{< relref "../manage-notifications/images-in-notifications" >}}).
6. The JSON format for webhook notifications has changed in Grafana Alerting and uses the format from [Prometheus Alertmanager](https://prometheus.io/docs/alerting/latest/configuration/#webhook_config).
@@ -26,12 +26,11 @@ External alertmanagers should now be configured as data sources using Grafana Co
To add an external Alertmanager, complete the following steps.
1. Click Configuration and then Data sources.
2. Search for Alertmanager.
3. Choose your Implementation and fill out the fields on the page, as required.
1. Search for Alertmanager.
1. Choose your Implementation and fill out the fields on the page, as required.
If you are provisioning your data source, set the flag `handleGrafanaManagedAlerts` in the `jsonData` field to `true` to send Grafana-managed alerts to this Alertmanager.
If you are provisioning your data source, set the flag `handleGrafanaManagedAlerts` in the `jsonData` field to `true` to send Grafana-managed alerts to this Alertmanager.
**Note:**
Prometheus, Grafana Mimir, and Cortex implementations of Alertmanager are supported. For Prometheus, contact points and notification policies are read-only in the Grafana Alerting UI.
**Note:**: Prometheus, Grafana Mimir, and Cortex implementations of Alertmanager are supported. For Prometheus, contact points and notification policies are read-only in the Grafana Alerting UI.
Annotations provide a way to mark points on the graph with rich events. When you hover over an annotation
you can get event description and event tags. The text field can include links to other systems with more detail.
Annotations provide a way to mark points on a visualization with rich events. They are visualized as vertical lines and icons on all graph panels. When you hover over an annotation, you can get event description and event tags. The text field can include links to other systems with more detail.
Grafana comes with a native annotation store and the ability to add annotation events directly from the graph panel or via the [HTTP API]({{< relref "../../../developers/http_api/annotations/" >}}).
- Directly in the panel, using the [built-in annotations query](#built-in-query)
- Using the HTTP API
- Configuring annotation queries in the dashboard settings
### Add annotation
In the first two cases, you're creating new annotations, while in the last you're querying existing annotations from data sources. The built-in annotation query also supports this.
1. In the dashboard click on the Time series panel. A context menu will appear.
1. In the context menu click on **Add annotation**.
This page explains the first and third options; for information about using the HTTP API, refer to [Annotations API]({{< relref "../../../developers/http_api/annotations/" >}}).
Annotations are supported for the following visualization types:
- Time series
- State timeline
- Candlestick
## Create annotations in panels
Grafana comes with the ability to add annotation events directly from a panel using the [built-in annotation query](#built-in-query) that exists on all dashboards. Annotations that you create this way are stored in Grafana.
To add annotations directly in the panel, the built-in query must be enabled. Learn more in [Built-in query](#built-in-query)
### Add an annotation
To add an annotation, complete the following steps:
1. In the dashboard click the panel to which you're adding the annotation. A context menu will appear.
1. Click on the trash icon in the annotation tooltip.
### Built-in query
## Fetch annotations through dashboard settings
After you added an annotation they will still be visible. This is due to the builtin annotation query that exists on all dashboards. This annotation query will
fetch all annotation events that originate from the current dashboard and show them on the panel where they were created. This includes alert state history annotations. You can
stop annotations from being fetched and drawn by opening the **Annotations** settings (via Dashboard cogs menu) and modifying the query named `Annotations & Alerts (Built-in)`.
In the dashboard settings, under **Annotations**, you can add new queries to fetch annotations using any data source, including the built-in data annotation data source. Annotation queries return events that can be visualized as event markers in graphs across the dashboard.
When you copy a dashboard using the **Save As** feature it will get a new dashboard id so annotations created on source dashboard will no longer be visible on the copy. You
can still show them if you add a new **Annotation Query** and filter by tags. But this only works if the annotations on the source dashboard had tags to filter by.
### Add new annotation queries
### Query by tag
To add a new annotation query to a dashboard, take the following steps:
You can create new queries to fetch annotations from the native annotation store via the `-- Grafana --` data source by setting _Filter by_ to `Tags`.
1. Click the dashboard settings (gear) icon in the dashboard header to open the settings menu.
1. Select **Annotations**.
1. Click **Add annotation query**.
If you've added a query before, the **+ New query** button is displayed.
1. Enter a name for the annotation query.
This name is given to the toggle (checkbox) that will allow you to enable/disable showing annotation events from this query.
1. Select the data source for the annotations.
1. If you don't want to use the annotation query right away, clear the **Enabled** checkbox.
1. If you don't want the annotation query toggle to be displayed in the dashboard, select the **Hidden** checkbox.
1. Select a color for the event markers.
1. Configure the query.
The annotation query options are different for each data source. For information about annotations in a specific data source, refer to the specific [data source]({{< relref "../../../datasources/" >}}) topic.
## Built-in query
After you add an annotation, they will still be visible. This is due to the built-in annotation query that exists on all dashboards. This annotation query will fetch all annotation events that originate from the current dashboard, which are stored in Grafana, and show them on the panel where they were created. This includes alert state history annotations.
To add annotations directly to the dashboard, this query must be enabled.
To confirm if the built-in query is enabled, take the following steps:
1. Click the dashboard settings (gear) icon in the dashboard header to open the dashboard settings menu.
1. Click **Annotations**.
1. Find the **Annotations & Alerts (Built-in)** query.
If it says **Disabled** before the name of the query, then you'll need to click the query name to open it and update the setting.
You can stop annotations from being fetched and drawn by taking the following steps:
1. Click the dashboard settings (gear) icon in the dashboard header to open the settings menu.
1. Click **Annotations**.
1. Find and click the **Annotations & Alerts (Built-in)** query to open it.
1. Click the **Enabled** toggle to turn it off.
When you copy a dashboard using the **Save As** feature it will get a new dashboard id, so annotations created on source dashboard will no longer be visible on the copy. You can still show them if you add a new **Annotation Query** and filter by tags. However, this only works if the annotations on the source dashboard had tags to filter by.
### Filter queries by tag
You can create new queries to fetch annotations from the built-in annotation query using the `-- Grafana --` data source by setting _Filter by_ to `Tags`.
Grafana v8.1 and later versions also support typeahead of existing tags, provide at least one tag.
For example, create an annotation query name `outages` and specify a tag `outage`. This query will show all annotations (from any dashboard or via API) with the `outage` tag. If multiple tags are defined in an annotation query, then Grafana will only show annotations matching all the tags. To modify the behavior, enable `Match any`, and Grafana will show annotations that contain any one of the tags you provided.
In Grafana v5.3+ it's possible to use template variables in the tag query. So if you have a dashboard showing stats for different services and a template variable that dictates which services to show, you can now use the same template variable in your annotation query to only show annotations for those services.
You can also use template variables in the tag query. This means if you have a dashboard showing stats for different services and a template variable that dictates which services to show, you can use the same template variable in your annotation query to only show annotations for those services.
Specify a name for the annotation query. This name is given to the toggle (checkbox) that will allow
you to enable/disable showing annotation events from this query. For example you might have two
annotation queries named `Deploys` and `Outages`. The toggle will allow you to decide what annotations
to show.
### Annotation query details
The annotation query options are different for each data source. For information about annotations in a specific data source, refer to the specific [data source]({{< relref "../../../datasources/" >}}) topic.
@@ -65,7 +65,7 @@ The query parameter `var-adhoc=key|=|value` applies the ad hoc filter configured
### Example
See [https://play.grafana.org/d/000000002/influxdb-templated?orgId=1&var-datacenter=America&var-host=All&var-summarize=1m&var-adhoc=datacenter%7C%3D%7CAmerica] - this passes the ad hoc filter variable `adhoc` with the filter value `datacenter = America`.
[This example in Grafana Play](https://play.grafana.org/d/000000002/influxdb-templated?orgId=1&var-datacenter=America&var-host=All&var-summarize=1m&var-adhoc=datacenter%7C%3D%7CAmerica) passes the ad hoc filter variable `adhoc` with the filter value `datacenter = America`.
- Edit general dashboard properties, including time settings
- Add annotation queries
@@ -31,7 +31,7 @@ Adjust dashboard time settings when you want to change the dashboard timezone, t
1. On the **Dashboard settings** page, click **General**.
1. Navigate to the **Time Options** section.
1. Specify time settings according to the following descriptions.
1. Specify time settings as follows.
- **Timezone:** Specify the local time zone of the service or system that you are monitoring. This can be helpful when monitoring a system or service that operates across several time zones.
- **Default:** Grafana uses the default selected time zone for the user profile, team, or organization. If no time zone is specified for the user profile, a team the user is a member of, or the organization, then Grafana uses the local browser time.
@@ -62,7 +62,7 @@ the dashboard. These dropdowns make it easy to change the data being displayed i
For more information about variables, refer to [Variables]({{< relref "../../variables/" >}}).
1. On the **Dashboard settings** page, click **Variable** in the left side section menu and then the **Add variable** button.
1. In the **General** section, the the name of the variable. This is the name that you will later use in queries.
1. In the **General** section, the name of the variable. This is the name that you will later use in queries.
1. Select a variable **Type**.
> **Note:** The variable type you select impacts which fields you populate on the page.
@@ -74,7 +74,7 @@ For more information about variables, refer to [Variables]({{< relref "../../var
Dashboard links enable you to place links to other dashboards and web sites directly below the dashboard header. Links provide for easy navigation to other, related dashboards and content.
1. On the **Dashboard settings** page, click **Links** in the left side section menu and then the **Add link** button.
1. Enter title and and in the **Type** field, select **Dashboard** or **Link**.
1. Enter title and in the **Type** field, select **Dashboard** or **Link**.
1. To add a dashboard link:
a. Add an optional tag. Tags are useful creating a dynamic dropdown of dashboards that all have a specific tag.
| **collapse** | whether timepicker is collapsed or not |
| **enable** | whether timepicker is enabled or not |
| **notice** | TODO |
| **now** | TODO |
| **refresh_intervals** | TODO |
| **status** | TODO |
| **type** | TODO |
| **notice** | |
| **now** | |
| **refresh_intervals** | |
| **status** | |
| **type** | |
### templating
@@ -236,6 +236,6 @@ Usage of the above mentioned fields in the templating section is explained below
| **name** | name of variable |
| **options** | array of variable text/value pairs available for selection on dashboard |
| **query** | data source query used to fetch values for a variable |
| **refresh** | TODO |
| **regex** | TODO |
| **refresh** | |
| **regex** | |
| **type** | type of variable, i.e. `custom`, `query` or `interval` |
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.