* remove prom metadata endpoint until we have a fix for detecting versions and implementations
* fix linting issue
(cherry picked from commit 7aeb8b4cdf)
Co-authored-by: Brendan O'Handley <brendan.ohandley@grafana.com>
* Parse date with fiscalYearStartMonth in graphite ds
* Use precalculated timeranges
* Always use precalculated values
* Modify test
(cherry picked from commit 5b058d617d)
Co-authored-by: Victor Marin <36818606+mdvictor@users.noreply.github.com>
* API: Fix snapshot responses (#52998)
* API: Fix response status when snapshots are not found
* API: Fix response status when snapshot key is empty
* Apply suggestions from code review
(cherry picked from commit 5fec6cc4f5)
* Update dependency moment to v2.29.4 [SECURITY]
* chore(moment): make sure nested moment deps resolve to moment@2.29.4
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
(cherry picked from commit b4c6efa07b)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* add validation for plugin manifest
* no more semver checking
* undo go.mod changes
* undo go.mod changes
* only validate v2 fields where necessary
* remove manifest version field check
(cherry picked from commit 6d066a7aa8)
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Pushover supports images in notifications since v9.0.2
(cherry picked from commit 9c3f9887fc)
Co-authored-by: Robin Tönniges <development@toenniges.org>
The query inspector was experiencing some error pop-ups due
to errors encountered on metrics datasources configured with multiple
tenants.
e.g., team-a|team-b
This fix suppresses those errors so as to not mislead the user.
(cherry picked from commit 565430f297)
Co-authored-by: Darren Janeczek <38694490+darrenjaneczek@users.noreply.github.com>
* Allow the webhook notifier to support a custom Authorization header
Instead of doing something clever of re-using the existing username/password fields of Basic Authentication - I opted for two diffent fields to match the upstream Alertmanager configuration (that in turn is based of the HTTP Basic authentication).
It'll fail if you have values for both HTTP Basic Authentication and Authorization.
(cherry picked from commit b026f2bc5d)
Co-authored-by: gotjosh <josue.abreu@gmail.com>
* update decrypt secrets function signature and add secrets error handling
* remove a couple instances of unnecessary logging since errors are properly handled now
* add unit test
* fix linting issues
(cherry picked from commit 9aa6ce2a50)
Co-authored-by: Michael Mandrus <41969079+mmandrus@users.noreply.github.com>
* allow setting team managed permissions for service accounts
* Revert "allow setting team managed permissions for service accounts"
This reverts commit 7598626397.
* fix org user removal for OSS
* remove comment
(cherry picked from commit ba76be174f)
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
This commit fixes push notifications for Slack which used to show "This content cannot be displayed". The text field is shown in both the message and the push notification.
(cherry picked from commit 094dfd0d4d)
Co-authored-by: George Robinson <george.robinson@grafana.com>
* Add line break, regenerate, and fix
* Left-align custom text in addition to preserving newlines
(cherry picked from commit 39d7fdbbbc)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
This will be used to reduce write load when the alerting system writes a
large number of events.
(cherry picked from commit a0f96ed4e1)
Co-authored-by: Joe Blubaugh <joe.blubaugh@grafana.com>
* Documentation: Updated links to landing pages for the respective notifiers in alerting
Updated links for listed notifiers to correctly redirect to their landing pages
* Ran prettier
(cherry picked from commit 9a72ebcd99)
Co-authored-by: sunb3am <57086182+sunb3am@users.noreply.github.com>
* fixed hightlighting searchwords
* do not add empty searchWords
(cherry picked from commit a2512dd1c7)
Co-authored-by: Sven Grossmann <Svennergr@gmail.com>
* Loki: Fix incorrect TopK value type in query builder
* Simplify code
* Remove bracket
* Brackets are back
(cherry picked from commit 8fc51932f5)
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
- Includes fix for appropriate selection of system assigned identity when using managed identity credential for Azure Monitor auth
(cherry picked from commit 1c48f443f0)
Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
* WIP: Fix XSS in runbook URL (#378)
(cherry picked from commit f4a8d96a4e1259ea25d9cc702a652f1b819db236)
(cherry picked from commit 337c08507b2b1c78ea470192d34cf611fae4b5da)
(cherry picked from commit 54b36a07406ed4e26ff8e161e50eda5401f504da)
* Update grabpl version
(cherry picked from commit b253e87d730f7b8aabdd0b328c5e7a82547c43b3)
(cherry picked from commit 080d3e46f3fcd61555795b9fe8fd6ee2492b422a)
* Fix: Choose Lookup params per auth module
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
Fix: Prefer pointer to struct in lookup
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
Fix: user email for ldap
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
Fix: Use only login for lookup in LDAP
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
Fix: use user email for ldap
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
fix remaining test
fix nit picks
(cherry picked from commit 1eca4aeed878853743cebcf9790b05dd350c4f83)
(cherry picked from commit 0777d100e9263d08f51dbac71aee0766c8a85a92)
* remove better (broke the pipeline)
Co-authored-by: George Robinson <george.robinson@grafana.com>
Co-authored-by: dsotirakis <sotirakis.dim@gmail.com>
Co-authored-by: jguer <joao.guerreiro@grafana.com>
without setting function map from alertmanager we receive error:
method=PUT path=/api/v1/provisioning/templates/slack.message status=400
level=error msg="invalid object specification: invalid template: template: :1: function \"toUpper\" not defined"
So for validation we should use the same settings as alertmanager do
for templates internally.
(cherry picked from commit b54da68765)
Co-authored-by: Michał Zielonka <michal.zielonka.8001@gmail.com>
This commit fixes a bug where the state did not change from Alerting to Error if the evaluation result returned an error, or from Error to Alerting if evaluations stopped returning errors.
(cherry picked from commit 34d45977ca)
Co-authored-by: George Robinson <george.robinson@grafana.com>
Put the ClickOutsideWrapper further out in the PanelHeader, so it doesn't catch itself when clicking on the panel header above the menu;
co-authored with @glintik
(cherry picked from commit 556f312b00)
* Alerting: Provisioning API respects global rule quota (#52180)
* Inject interface for quota service and create mock
* Check quota and return 403 if limit exceeded
* Implement tests for quota being exceeded
(cherry picked from commit 2d7389c34d)
* backport error check
Co-authored-by: Jean-Philippe Quémémer <jeanphilippe.quemener@grafana.com>
/api/admin/pause-all-alerts only takes effect for legacy alerts. This
change returns a 403 if it's called when legacy alerting is disabled.
Fixes#51729
(cherry picked from commit 0cbc14961a)
Co-authored-by: Joe Blubaugh <joe.blubaugh@grafana.com>
* SQLstore: Fix fetching and deleting an inexistent playlist
xorm's session.Get() does not return an error if the raw does not exist.
It returns a boolean instead.
The playlist `sqlstore.GetPlaylist()` used to check only the error and in case
of inexistent UID didn't return an error.
(cherry picked from commit 4ff0f006dd)
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
* Define query param and regenerate
* Add query struct for contact points
* Filter contact points by name in query
* Document that name filter is optional
(cherry picked from commit 0e066dd5f8)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
* Define route and run codegen
* Wire up HTTP layer
* Update API layer and test fakes
* Implement reset of policy tree
* Implement service layer test and authorization bindings
* API layer testing
* Be more specific when injecting settings
(cherry picked from commit fce283d73e)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
* Rendering: Fix user information when using render key
* fix when render user ID is 0
* update fix
* improve fix
* add comment
(cherry picked from commit ca80865bf1)
Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>
* Ensure resource name is appended to URI
* Add storage account check to ensure default subresource is appended
* Update storage dashboard
* Bump storage version
* Remove ADX StreamingIngestRequestRate panel as the metric is unavailable
* Refactor condition for storage namespaces
* Add more tests for URI builder
* Do not migrate resource URI if resource name or metric definition uses template variables
* Revert change to metricNamespace
(cherry picked from commit 0a6eeaa636)
Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
* Plugins: Register management endpoints only when external managed is also false (#51802)
* Only define plugin install endpoints when catalog enabled
* add external check
(cherry picked from commit 40dff288cd)
* fix test
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Co-authored-by: Will Browne <will.browne@grafana.com>
* copy defaultParams when changing an operation
* add type and name comparison
* removed name check
(cherry picked from commit 663f3fcd2a)
Co-authored-by: Sven Grossmann <Svennergr@gmail.com>
* validate that the mute time intervals exist when updating routing tree
* run lint
* add tests
(cherry picked from commit 4a76436be2)
Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>
* Alerting: validate that the receiver exist when updating routing tree
* rename interface
* add missing file
* change constructor
* fix e2e tests
* only import package once
* add unit test for bug
* wording
* close response body
* Update pkg/services/ngalert/api/tooling/definitions/alertmanager_validation.go
* refactor to remove database roundtrip
(cherry picked from commit e64cde8727)
Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>
* merges library panel content into a single topic
* updates menuTite
* fixes typo
* removed Grafana from task titles
(cherry picked from commit 7eec92988e)
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Chore: Make betterer tests more stable (#51703)
* rewrite eslint test to not care about position of errors
* changing file contents shouldn't require a betterer.results update
* fix up eslint test
* fix the undocumented stories test
* ignore .test.ts files as well
(cherry picked from commit 986b766ca0)
* results...
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* StateTimeline: Try to sort time field
* Sort frame earlier
(cherry picked from commit ebb9025669)
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
A bug introduced by #49259 would crash the annotations view of a panel with a linked alert rule. States are now normalized so crashes won't occur and the base state is used instead.
(cherry picked from commit d63ffa314e)
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
* Chore: some low-hanging type assertion fruit (#51618)
* some low-hanging type assertion fruit
* results
(cherry picked from commit 2a6b32598d)
* results
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* Use point annotation marker for short time range annotations
* Properly align small region marker
(cherry picked from commit d429cac27b)
Co-authored-by: Kyle Cunningham <codeincarnate@users.noreply.github.com>
This commit makes a number of improvements to the image package:
- Improved comments
- Return the correct error when a dashboard does not exist
- Set a timeout in context.Context
(cherry picked from commit fe797dcfdc)
Co-authored-by: George Robinson <george.robinson@grafana.com>
* Chore: split betterer into it's own CI step and allow failures for now (#51543)
* split betterer into it's own CI step and allow failures for now
* Run make drone
Co-authored-by: dsotirakis <dimitrios.sotirakis@grafana.com>
(cherry picked from commit f654152dc8)
* Run make drone
Co-authored-by: dsotirakis <dimitrios.sotirakis@grafana.com>
* on a text panel first interpolate, then markdown, then sanitize;
* update devenv dashboard + e2e tests
* fix typo and undo changes in grafana/data
* handling of config option disableSanitizeHtml more readable when preparing markdown in text panel
* betterer
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
(cherry picked from commit f83f05d6b3)
Co-authored-by: Polina Boneva <13227501+polibb@users.noreply.github.com>
In plugin E2E, changing the default download to enterprise version of grafana.
(cherry picked from commit 5aab8b710b)
Co-authored-by: Sriram <yesoreyeram@gmail.com>
* optional custom description for OpsGenie
* custom title and message, tests
* update changelog
* check for empty / whitespace only strings
* truncate the title to 130 characters if needed
* unnecessary validation removed
* truncate title to 127 characters and add three dots
(cherry picked from commit 9dc7e752b7)
Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>
Improves how we handle symlinks in plugin management.
(cherry picked from commit 04df634ef5)
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
* Plugins: Use a Grafana specific SDK logger implementation for core plugins (#51229)
Upgrade grafana-aws-sdk to v0.10.6
(cherry picked from commit a8eb29f1d7)
* fix go.mod go.sum
* Chore: reintroduce type assertion test + change emitted metric names (#51375)
* reintroduce type assertion test + change emitted metric names
* rename test to better eslint to be more generic
(cherry picked from commit 0124dc8e6b)
* don't use --cache
* update betterer results
* Extend template and generate
* Generate and fix up alertmanager endpoints
* Prometheus routes
* fix up Testing endpoints
* touch up ruler API
* Update provisioning and fix 500
* Drop dead code
* Remove more dead code
* Resolve merge conflicts
(cherry picked from commit 0d9389e1f4)
* Alerting: Don't stop the migration when alert rule tags are invalid
As we migrate we expect the `alertRuleTags` on a dashboard alert to be a JSON object. However, it seems this is not really validated by Grafana and an user can change the format to something else that the JSON parser is not able to marshal into a `map[string]string`.
Let's do a bit better by "attempting" to parse the tags and if we can't we'll simple return an empty map. The data is still there so if the user wishes they can go back, fix the data and attemp the migration again.
(cherry picked from commit 90646e7f41)
* use custom formatCreateLabel in AnnotationEditorForm
* give `TagFilter` it's own formatCreateLabel
* only show TagBadge if the label is a string
(cherry picked from commit be6a878fd6)
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* Chore: Remove global bus variable (#50765)
* Chore: Remove global bus variable
* fix bus in tests
(cherry picked from commit 0b55c41d05)
* fix the imports
* Use nullInsertThreshold and nullToValue in time series
* Allow for undefined timeRange to support certain candlestick uses of prepareGraphableFields
* Make sure null to value doesn't modify initial data
* Do a shallow values copy and avoid Array.push()
* Clean up null to value transformation.
* Add basic tests
* Remove redunant null threshold application flagging
* set nullThresholdApplied flag even when no null inserts were done
* Include nullThresholdApplied in test snapshot
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
(cherry picked from commit 86b785d039)
Co-authored-by: Kyle Cunningham <codeincarnate@users.noreply.github.com>
* Algorithm to fix up receivers
* Extract for tests
* Add tests, fix bug
* Add test which demonstrates how it fixes up broken groups
* Fix package prefix
(cherry picked from commit 9bbfeedadf)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
* use etag header for previews
* use unix millis rather than tz-dependant string
(cherry picked from commit 644503f5e6)
Co-authored-by: Artur Wierzbicki <wierzbicki.artur.94@gmail.com>
* Disable / hide buttons for creating playlist for users with viewer role
* Update tests
* Re-add mock for contextSrv module
(cherry picked from commit 43839dc40b)
Co-authored-by: asymness <asym1999@gmail.com>
* allow hidden queries in case an id is provided
* cleanup test
* name tests properly
(cherry picked from commit fcbe0059c2)
Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
* Move data source management to administration
* Move RBAC to administration
* Move team management up a docs org level
* Combine and rename admin preferences docs
* Move plugin management to administration
* Combine plugin management docs
* Combine API key docs
* Combine service account docs
* Combine server user management docs
* Move datasource management to administration
* Move enterprise licenses to administration
* Move CLI out of admin, update links to admin
* Merge org user management docs
* Restructure to Torkel's plan
* Fix typo
* Weigh admin topics for navigation
* Weigh administration topics and align to Torkel's plan
* Move server user management from server admin to admin/user management
* Move configure docker image to setup guide
* Move the remaining server admin docs to the root admin directory
* Reweight docker config
Backport of 845cebdee2 from main
If SQLite is used and the database is locked temporarily (ex. heavy write-load) during periodic
AM config sync, it was possible for your AM config to be overwritten with the default one.
This fixes that by patching a bug in xorm v0.8.2 which was causing SQLITE_BUSY errors to be ignored
in certain cases.
(cherry picked from commit 8f5912b94c)
Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>
* Bug: Fix delete dashboard snapshot for deleted dashboards
* Fix lint and make it work for all the errors
* Fix lint
(cherry picked from commit 8ab8ce609b)
Co-authored-by: idafurjes <36131195+idafurjes@users.noreply.github.com>
* Pass on request body
* Fix GETs and add tests
* Fix err handling
* Add comments
* Close response body
* Fix lint maybe
* Fix test
(cherry picked from commit 07be95a001)
Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
Earlier we only allowed symlinks in plugins starting with grafana- in zip archives when
installing plugins using the grafana-cli. This changes so that symlinks in zip archives
containing relative links to files in the zip archive are always allowed when installing
plugins. The reasoning behind this is that Grafana per default doesn't load a plugin
that has an invalid plugin signature meaning that any symlink must be included in
the plugin signature manifest.
Co-authored-by: Will Browne <will.browne@grafana.com>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
(cherry picked from commit b47ec36d0d)
* backend/api: refactor PlaylistId to PlaylistUid
* Add org_id to Get and Update playlist functions
Fix migration - no longer pad the uid; fix mysql syntax
The relevant tests are passing using postgres, mysql and the default sqllite backends, but there are a number of other failing tests when using postgres and myself so I'm not entirely confident with those results.
* fix bad query in GetPlaylistItem and add a test that would have caught the mistake in the first place. Reverted the playlist_uid column addition in playlist_item; it became unnecessary after this PR.
Added default value to the new UID column based on PR feedback.
* break this PRs migration into its own function
* Playlists: Update UI to use the updated API
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
(cherry picked from commit a33a023629)
Co-authored-by: Kristin Laemmert <mildwonkey@users.noreply.github.com>
* Docs: Add envelope encryption as breaking change
* Minor improvements
* Apply suggestions from code review
Co-authored-by: Tania <yalyna.ts@gmail.com>
(cherry picked from commit fcf6b29987)
Co-authored-by: Joan López de la Franca Beltran <5459617+joanlopez@users.noreply.github.com>
* OAuth: Redirect to login if no oauth module is found or if module is not
configured
* OAuth: Update test to check for location header
(cherry picked from commit 95a4c4a4d6)
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
* Update documentation now + button functionality has moved
* Updates following comments
(cherry picked from commit 27e3e79661)
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* Prometheus,Loki: Fix showing of duplicated values in dropdown
* Use different more readable solution
* Update
(cherry picked from commit 77bdbe1dea)
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
* WIP
* Loki: Fix running of query patterns
* Remove console.log
* Add test
* Update empty line filter test
(cherry picked from commit 88279dda1c)
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
* Make inheritance permission migration more robust
* Better fix
* Add more tests to the migration
* Add removed test case
* Add test case for empty role in empty org
* Handling the role.ID 0 case with a log
Co-authored-by: Jguer <joao.guerreiro@grafana.com>
Co-authored-by: Jguer <joao.guerreiro@grafana.com>
(cherry picked from commit 307a0d4538)
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
* Use callback form for loadOptions in folder picker
* clean up
* fix other tests
* clarify comment
(cherry picked from commit 32d4f6ac60)
Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
* pass on all headers except for accept headers
* touch up and testing
* add custom header values to resource queries
* remove my picture. oops
* handle gzip responses as well
* fix linting issues
* add my space
* no lint
* removed cookies from being proxied
* clean up and handle errors from io.reader.Close() calls
(cherry picked from commit 49dc9da9c1)
Co-authored-by: Stephanie Closson <srclosson@gmail.com>
* Grafana UI: Put back production build in rollup config (#50575)
(cherry picked from commit 2d1ab27636)
* chore: refresh yarn.lock
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
* TimeSeries: Add an option to set legend width (#49126)
* Add an option to set legend width
* Add width to the cue file
* Use legendStyle
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
(cherry picked from commit a6693ba62f)
* Add migration
Co-authored-by: Ivan Babrou <github@ivan.computer>
* AzureMonitor: tweak experimental-ui after UX discussions.
- move metrics up to resource row
- allow resources field to take an inlineField prop and a labelWidth prop. Eventually once the feature toggle is removed
the inlineField prop will be the only code branch in Field.tsx.
* AzureMonitor: remove devmode req for azureMonitorExperimentalUI flag
* refactor: consolidate logic branch for inline Field
(cherry picked from commit 5df694b924)
Co-authored-by: Adam Simpson <adam@adamsimpson.net>
* logs: track the usage of certain features
* Add report interaction for logs interactions
* mock reportInteraction in test
* mock reportInteraction
Co-authored-by: Ivana Huckova <ivana.huckova@gmail.com>
(cherry picked from commit c412a3b052)
* Alerting: Schedule Alert rules metric tracking
Change the record of metrics from one place to two as an attempt to have a semi-accurate record.
(cherry picked from commit c59938b235)
Co-authored-by: gotjosh <josue.abreu@gmail.com>
* Alerting: decapitalize log lines and use "err" as the key for errors
Found using (logger|log).(Warn|Debug|Info|Error)\([A-Z] and (logger|log).(Warn|Debug|Info|Error)\(.+"error"
(cherry picked from commit 0cde283505)
* refactor(selectoptiontest): move helper function out of grafana/ui so testing-lib isn't in bundle
* test(selectoptionintest): update import location of helper function
* test(amroutes): put back missing selectOptionInTest helper
* test(selectoptionintest): clean up remaining file imports / exports
* test(queryeditor): fix failing import
* refactor(grafana-ui): reuse selectOptionInTest in SelectBase test
(cherry picked from commit ccd75d72f8)
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
* Alerting: Add RBAC actions and role for provisioning API routes (#50459)
* add alert provisioning actions and role
* linter
(cherry picked from commit 54fa04263b)
* Fix cherry-pick conflict in rbac-fixed-basic-role-definitions.md
Co-authored-by: Yuriy Tseretyan <yuriy.tseretyan@grafana.com>
* Docs: update license restrictions
* apply review feedback
* remove initial description of two license types
Clean up tiered licensing copy and keep it all in one deprecated section, refer to old docs if user wants to learn more.
* fix linting issues
* update title
* fix config url
Co-authored-by: Mitch Seaman <mjseaman@users.noreply.github.com>
(cherry picked from commit 3df7ee81f3)
* Updates to all except alert rules
* Return 400 when rules fail to validate, add testinfra
* More sane package aliases
* More package alias renames
* One more bug in contact point validation
* remove unused function
Co-authored-by: Jean-Philippe Quémémer <jeanphilippe.quemener@grafana.com>
Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>
(cherry picked from commit 7dd78fee2c)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
After migrating to unified alerting, users must explicitly allow rolling
back to legacy alerting by setting force_migration = true in config.
This updates the panic message to clarify why that's required and what
the consequences of rolling back will be.
Fixes#50469
(cherry picked from commit 30f035ca34)
Co-authored-by: Joe Blubaugh <joe.blubaugh@grafana.com>
The ng_alert_notification email template did not include templating for
linked or embedded images. This change updates that.
Additionally, this change supports embedding an image for each alert in
an email batch.
Fixes#50315
(cherry picked from commit ecf080825e)
* Dashboard: Fixes random scrolling on time range change
* fix ts issue
* removed logging
(cherry picked from commit fd408652dc)
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
This PR renames the configuration key enabled to capture. This is needed as we already have a configuration key with the name enabled.
Fixes#50328
(cherry picked from commit fd664e4beb)
Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>
* docs: describe cookie handling in backend data source plugins
* adjusted text
(cherry picked from commit 19df6d52b7)
Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
* implement filterQuery to support query.hide
* Fixed - expression ds name in mixed mode
* Execute expression query on blur
* show actual error message when ds return Query data error
(cherry picked from commit a3071b7797)
Co-authored-by: Sriram <yesoreyeram@gmail.com>
* Alerting: remove feature toggle for provisioning API
* remove missed code parts
* remove unused import
* remove empty line
* mark routes as stable
(cherry picked from commit 4b8a4449ed)
Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>
* Add migration
* Migrator: Extend support to rename columns
* Fix getting current key
* Fix column name in migration
* Fix deks reencryption
* Fix caching
* Add back separate caches for byName and byPrefix
* Do not concatenate prefix with uid
* Rename DataKey struc fields
* SQLStore: Add deprecation comments for breaking migrations
* Add comment
* Minor corrections
Co-authored-by: Joan López de la Franca Beltran <joanjan14@gmail.com>
(cherry picked from commit 4f8111e24e)
Co-authored-by: Tania <yalyna.ts@gmail.com>
* Alerting: only delete mute time if not used by route
* add a testcase
* import package only once
* replace apimodels with definitions
(cherry picked from commit 8de4ffe61f)
Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>
* Migrator: Extend support to rename columns
* SQLStore: Add deprecation comments for breaking migrations
(cherry picked from commit 5f1305d280)
Co-authored-by: Joan López de la Franca Beltran <5459617+joanlopez@users.noreply.github.com>
* Hide query history when anonymous user uses Explore
* Show query history to anonymous users when local storage is used
* Fix integration test
(cherry picked from commit 84860ffc96)
* AzureMonitor: add NewDimension component using experimental UI
This new component is exercised by the same unit test file as the current Dimension component.
Also cleans up a few unneeded `await` keywords in the Dimensions test file.
* AzureMonitor: make tweaks based on PR comments.
- I was importing the wrong Field component
- We can use a typeguard to avoid the strange `if`.
(cherry picked from commit 53cb94a2ad)
Co-authored-by: Adam Simpson <adam@adamsimpson.net>
This change adds documentation about how the configuration of Grafana
Alerting affects the performance of the Grafana backend, and how to
control the load that Grafana Alerting generates.
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
(cherry picked from commit 8ad1f4f9be)
* added regex check of labelKeys
- labelKeys should not contain any special characters
- added encoding of labelKeys in the URL
- don't offer autocomplete if label with special characters is detected
* removed additional regex check for labels
(cherry picked from commit d7139e75fb)
Co-authored-by: svennergr <Svennergr@gmail.com>
* update action names
* correctly retrieve teams for signed in user
* remove test
* undo swagger changes
* undo swagger changes pt2
* add migration from old action names to the new ones
* rename from list to read
* linting
* also update alertign actions
* fix migration
(cherry picked from commit 5dbea9996b)
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
The image file upload code as it is now simply doesn't work - it's
missing several important steps in the file upload process. There is
more information in the fixed issue as to the steps required.
After this change, screenshots will still be attached to slack messages
when external image storage is used with Grafana (an S3 bucket, for
example).
Fixes#50056
(cherry picked from commit 9759eeda17)
Co-authored-by: Joe Blubaugh <joe.blubaugh@grafana.com>
* add completeable interface
* add basic labels language
* render monaco editor for label field
* align styling in math expression field
* add unit tests
* fix broken test
* remove unused import
* use theme
* remove comment
* pr feedback
* fix broken imports
* improve test
* make it possible to override code editor styles
* use input styles and align border styles
(cherry picked from commit 467e375fe6)
Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
* Alerting: Remove double quotes from matchers
With #38629 a new Alertmanager configuration object was introduced with `object_matchers`, it was meant to circumvent around the fact that Prometheus label names don't support a set of characters that Grafana needs to support for alerts, silences, matchers, etc. (with a common example being elasticsearch's `.`).
This new object does not include the label of sanitzation or validation that its Prometheus equivalent supports in `matchers` and therefore are semantically not equivalent.
This triggered the problem that when the migration is run, we use `matchers` as the object to populate in configuration for routing policies, but when the UI does its first save this object is transformed to `object_matchers`.
Matchers that were previously running just fine would immediately stop working as soon as the configuration is saved.
This problem surfaced with the introduction of #49952 where we stopped stripping double quotes from matchers (not just regex but _all_ of them).
* Add comment explaining rationale and future removal
Co-authored-by: Alex Weaver <weaver.alex.d@gmail.com>
(cherry picked from commit 1a50b0dbb7)
Co-authored-by: gotjosh <josue.abreu@gmail.com>
* Add multi-value template variable support for log group names
* add test for multi-value template variable for log group names
* add test
(cherry picked from commit dca0453c2e)
Co-authored-by: Kevin Yu <kevinwcyu@users.noreply.github.com>
* changed `onBlur` and `onKeyDown` handling
- `onCommitChange` is only called if `onBlur` or `onKeyDown` are not set
* added `runQueryOnEnter` flag to OperationParamDef
* only run query if `runQueryOnEnter` is configured
* changed `evt.type` check to `keydown`
(cherry picked from commit b355adac6f)
Co-authored-by: svennergr <Svennergr@gmail.com>
* remove /api/tsdb/query
* revert changes to alert rules
* regenerate spec based on 9.0.x
(cherry picked from commit abfc711c53)
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
* Fix normalization of labels
* Move sorting so it actually has an effect
* fix lint error
Co-authored-by: Todd Treece <todd.treece@grafana.com>
(cherry picked from commit d2fefec306)
Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
* Chore: transfer styling to Explore.tsx and convert to Emotion
* feat: create a component and export it
* Chore: replace by new component
* Chore: replace by new component
* Feat: create a story
* Chore: clean up
* Chore: clean up
(cherry picked from commit 94375592c8)
Co-authored-by: Laura <48948963+L-M-K-B@users.noreply.github.com>
GetImages does a `TOKEN IN` query for each token in the argument.
(cherry picked from commit 47a3ddd968)
Co-authored-by: George Robinson <george.robinson@grafana.com>
* Docs: Identify which Grafana editions are relevant to each Enterprise doc (#49207)
* Add section to Ent docs index re: Cloud features
* Add and update notes identifying Enterprise and Cloud features
* Address feedback
(cherry picked from commit 3ecee06630)
* Use ref links for external content (#49786)
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
(cherry picked from commit e82784bff0)
Co-authored-by: Garrett Guillotte <100453168+gguillotte-grafana@users.noreply.github.com>
* Docs: combines all SAML topics into one topic (#49443)
* combines all SAML topics
* resolves merge conflicts
* makes prettier
(cherry picked from commit 8c84d62e3d)
* Fix broken relrefs
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
Makes debugging problems with alert screenshotting easier.
(cherry picked from commit 56f40bd413)
Co-authored-by: Joe Blubaugh <joe.blubaugh@grafana.com>
This commit enables Unified Alerting for open source and enterprise unless disabled in configuration.
(cherry picked from commit 3b7f871bf4)
Co-authored-by: George Robinson <george.robinson@grafana.com>
* AzureMonitor: use @grafana/experimental for LogsQueryEditor
ref #48711
* AzureMonitor: migrate ArgQueryEditor to @grafana/experimental.
Change CodeEditor to 100% instead of 1000px to match LogsQueryEditor.
ref #48713
(cherry picked from commit 6554bbd70f)
Co-authored-by: Adam Simpson <adam@adamsimpson.net>
Tests that file bytes are correctly read from storage when an image is
available without a URL. Tests that not found and success cases are both
handled.
(cherry picked from commit d5a327f43d)
Co-authored-by: Joe Blubaugh <joe.blubaugh@grafana.com>
* Add validator for mute timing and make it provisionable
* Add tests to ensure prometheus validators are running and errors are propagated
* Internal API for manipulating mute timings
* Define and generate API layer
* Wire up generated code
* Implement API handlers
* Tests for golang layer
* Fix reference bug
* Fix linter and auth tests
* Resolve semantic errors and regenerate
* Remove pointless comment
* Extract out provisioning path param keys, simplify
* Expected number of paths
(cherry picked from commit 909ebcf979)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
* chore(typescript): remove sanitize_url.d.ts in favour of npm package types
* chore(toolkit): bump all webpack related deps inline with grafana core
* refactor(toolkit): prefer webpack types and use from imports for bundling
* feat(toolkit): bundle plugins using webpack 5 and babel
* chore(toolkit): but all eslint deps inline with grafana core
* refactor(toolkit): rewrite linting step to use new eslint node api
* chore(toolkit): bump jest dependencies inline with grafana core
* refactor(toolkit): update jest config for jest 27
* fix(toolkit): resolve toolkit if using yarn berry
* docs(toolkit): update instructions for developing with yarn berry
* chore(toolkit): remove yarnlink code as won't work with yarn berry
* chore(toolkit): bump remaining dependencies
* chore(toolkit): remove unused core.start task
* feat(toolkit): use browserlist when building plugins
* chore(toolkit): add browserslist dependency
* refactor(toolkit): resolve style loaders, update postcss options for webpack5
* chore(toolkit): put back grafana/data and grafana/ui
* docs(toolkit): improve instructions for developing toolkit locally
* chore(toolkit): clean up webpack debug and warnings
* chore(input-datasource): remove pnpwebpack plugin and update browserslist to solve failing build
* chore(renovatebot): remove toolkit package.json from ignorePaths
* revert(renovate): put back toolkit package.json in ignorePaths
* feat(toolkit): introduce babel plugins
* refactor(toolkit): remove runtime automatic from preset-react for earlier versions of react
* refactor(toolkit): add missing fallbacks to webpack config
* fix(toolkit): remove spaces from copy webpack glob so files are copied
* refactor(toolkit): fix up babel typescript support and copy browserlist on build
* chore(yarn): refresh lock file
* revert(toolkit): remove browsers list so plugins compile to ES5
* revert(toolkit): remove copying .browserslistrc
(cherry picked from commit f4353bbbc4)
* Add feature tracking for query history
* Fix unit tests
* Update event names
(cherry picked from commit e0adb41e80)
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
* Preferences: Fix PUT for Navbar and Query History
* Update linting
* Fix linting
* Use models defined in preference package in preferences
* Remove white space
* Revert "Use models defined in preference package in preferences"
This reverts commit 6f7aa9f8d3.
(cherry picked from commit e25a49ff49)
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
* build(webpack): move CopyUniconsPlugin into own file
* chore(webpack): delete unused blobUrl and compile loaders
* build(webpack): prefer contenthash over fullhash for longer caching
* build(webpack): set optimization.moduleIds named only in dev
* build(webpack): introduce HTMLWebpackCSSChunks so templates can access theme css by name
* feat: inject css files with contenthash in html templates
* revert(error-template): remove ContentDeliveryURL from CSS href
* refactor(index-template): update grafanaBootData.themePaths
* chore(webpack): add typescript annotations for CopyUniconsPlugin
(cherry picked from commit 78bef7a26a)
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Adds three functions:
`withStoredImages` iterates over a list of models.Alerts, extracting a stored image's data from storage, if available, and executing a user-provided function.
`withStoredImage` does this for an image attached to a specific alert.
`openImage` finds and opens an image file on disk.
Moves `store.Image` to `models.Image`
Simplifies `channels.ImageStore` interface and updates notifiers that use it to use the simpler methods.
Updates all pkg/alert/notifier/channels to use withStoredImage routines.
(cherry picked from commit 9e8efaa459)
Co-authored-by: Joe Blubaugh <joe.blubaugh@grafana.com>
* Lots of changes, including new topic, also fixed all alerting relrefs
* Push stashed change.
* Updated content to reflect that Grafana alerting is enabled during upgrade.
* Fix typo
* Update docs/sources/alerting/migrating-alerts/_index.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Checkin changes.
* Updates from Chris's review.
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
(cherry picked from commit b5d48d217a)
Replaces the regexp with calls to strings.ReplaceAll and strings.Fields
for simplicity and improved performance.
Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
(cherry picked from commit 1f85101787)
Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
* initial commit
* Add to index list
* Improvements to intro section
* missing plural
* Minor fixes
* Some more changes.
* Updated image links
* Hide section "InfluxDB: Support for browser access mode removed
* Checkin more changes
* More changes.
* Fixed more image links
* Last batch of changes
* Fixed a few typos and ran prettier.
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
* Modify the annotation support api
* Migrate annotation editor component
* Update public/app/features/annotations/standardAnnotationSupport.ts
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* Move the escape hatches out of the public API
* Fix props transforms
* Break import cycle
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
(cherry picked from commit 4124294011)
Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
* grant data source reader to all users when running oss or enterprise
without license
* fix asserts in alerting tests
* add oss licensing service for test setup
* fix tests to pass in enterprise
* lint
* fix tests
* set setting.IsEnterprise flag for tests
Co-authored-by: Yuriy Tseretyan <yuriy.tseretyan@grafana.com>
(cherry picked from commit 1796a1d277)
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
* Pass current org id to UsersTable
* Mock contextSrv and update snapshot
(cherry picked from commit ef6b53ed23)
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
This fixes the issues that when a panel has multiple queries this throws an exception if source is not part of the current frame
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
(cherry picked from commit eab806620c)
Co-authored-by: Ward Bekker <ward@wardbekker.com>
* If GroupMemver.Read.All permissions is not configured return no groups
* fix log
(cherry picked from commit 624f8ef40d)
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
* Add IsServiceAccount to query
* test for excluding service accounts in query
* align test
* test update
* added logging
* should fix tests
* moved test to bottom
* add back setup function
* Remove IsServiceAccount from query
Instead use false for is_service_account
and when the time comes to implement service accounts
for team. we deal with it
* missed teamtest
* formatting
* Cleanup and show loading for service/span name
* Method rename
* Simplify logic for getting options
* Simplify logic for setting/getting value
* Move getTags to own async
* Update tests
* Promise all
* Update const name
* Support for documenting stable vs unstable alerting routes
* empty commit, restart drone
* Touch-up references in root makefile and drop trailing escape newline
* Rebase and regenerate
* Extend README with docs for this change
* switch saved items to starred items
* hook up redux properly
* Better query + hook up DashList
* update initial state so it's never undefined
* update GetDashboard call
* use new star service
* add scroll + maxwidth to navbar hover menu, sort starred items alphabetically
* increase height, revert changes to CustomScrollbar
* ellipsis!
* update starred dashboard name in navtree
* sort after renaming
* limit to first 50 starred dashboards found
* chore: replace handmade FakeDashboardService with generated mock
Maintaining a handcrafted FakeDashboardService is not sustainable now that we are in the process of moving the dashboard-related functions out of sqlstore.
* remove dialect global variable
If an image token is present in an alert instance, the email notifier will attempt to find a public URL for the image token. If found, it will add that to the email as the `ImageLink` field. If only local file data is available, the notifier will attach the file to the outgoing email using the `EmbeddedImage` field.
Adds an array of image_urls to the OpsGenie details field in a message, if image urls are available.
```json
{
"message": "Alert with Images!",
"details": {
"image_urls": ["http://www.example.com"]
}
}
```
If there are screenshot images with URLs, they will be attached to the
Microsoft teams notification in the first sections, as a slice of image
objects.
* Search: created ManageDashboardNew to integrate new search
* hide pseudo folders in ManageDashboardNew
* ManageDashboardNew - Fix overflow table
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* Load Rich History when the container is opened
* Store rich history for each pane separately
* Do not update currently opened query history when an item is added
It's impossible to figure out if the item should be added or not, because filters are applied in the backend. We don't want to replicate that filtering logic in frontend. One way to make it work could be by refreshing both panes.
* Test starring and deleting query history items when both panes are open
* Remove e2e dependency on ExploreId
* Fix unit test
* Assert exact queries
* Simplify test
* Fix e2e tests
* Fix toolbar a11y
* Reload the history after an item is added
* Fix unit test
* Remove references to Explore from generic PageToolbar component
* Update test name
* Fix test assertion
* Add issue item to TODO
* Improve test assertion
* Simplify test setup
* Move query history settings to persistence layer
* Fix test import
* Fix unit test
* Fix unit test
* Test local storage settings API
* Code formatting
* Fix linting errors
* Add an integration test
* Add missing aria role
* Fix a11y issues
* Fix a11y issues
* Use divs instead of ul/li
Otherwis,e pa11y-ci reports the error below claiming there are no children with role=tab:
Certain ARIA roles must contain particular children
(https://dequeuniversity.com/rules/axe/4.3/aria-required-children?application=axeAPI)
(#reactRoot > div > main > div:nth-child(3) > div > div:nth-child(1) > div >
div:nth-child(1) > div > div > nav > div:nth-child(2) > ul)
<ul class="css-af3vye" role="tablist"><li class="css-1ciwanz"><a href...</ul>
* Clean up settings tab
* Remove redundant aria label
* Remove redundant container
* Clean up test assertions
* Move filtering to persistence layer
* Move filtering to persistence layer
* Simplify applying filters
* Split applying filters and reloading the history
* Debounce updating filters
* Update tests
* Fix waiting for debounced results
* Clear results when switching tabs
* Improve test coverage
* Update docs
* Revert extra handling for uid (will be added when we introduce remote storage)
* Create basic plan
* Rename query history toggle
* Add list of supported features and add ds name to RichHistoryQuery object
* Clean up
Removed planned items will be addressed in upcoming prs (filtering and pagination)
* Handle data source filters
* Simplify DTO conversion
* Clean up
* Fix betterer conflicts
* Fix imports
* Fix imports
* Post-merge fixes
* Use config instead of a feature flag
* Use config instead of a feature flag
* Update converter tests
* Add tests for RichHistoryRemoteStorage
* Simplify test setup
* Simplify assertion
* Add e2e test for query history
* Remove duplicated entry
* Fix unit tests
* Improve readability
* Remove unnecessary casting
* Mock backend in integration tests
* Remove unnecessary casting
* Fix integration test
* Update betterer results
* Fix unit tests
* Simplify testing with DataSourceSrv
* Fix sorting and add to/from filtering
* Basic pagination
* Show load more only if there are items to load
* Post-merge fixes
* Change initial page limit to 100
* Fix unit tests
* Fix linting errors
* Test pagination
* Fix query migration
* Fix unit tests
* Fix prettier
* Remove full stop
* Do not show number of queries with partial results to avoid confusion
* Show number of displayed results when partial results are shown
* Add prefixed API key gen.
* Retrieve API Key by hash
* Handle prefixed API keys for login
* Add placeholder key generator
* fix spelling
* add get by hash sqlstore test
* reformat query
* quote usage of reserved keyword key
* use constant
* improve error handling and pre-select key type
Co-authored-by: Victor Cinaglia <victor@grafana.com>
* nits
Co-authored-by: Victor Cinaglia <victor@grafana.com>
* Add database migrations
* Use short uids as data key ids
* Add support for manual data key rotation
* Fix duplicated mutex unlocks
* Fix migration
* Manage current data keys per name
* Adjust key re-encryption and test
* Modify rename column migration for MySQL compatibility
* Refactor secrets manager and data keys cache
* Multiple o11y adjustments
* Fix stats query
* Apply suggestions from code review
Co-authored-by: Tania <yalyna.ts@gmail.com>
* Fix linter
* Docs: Rotate data encryption keys API endpoint
Co-authored-by: Tania <yalyna.ts@gmail.com>
This change adds a field to state.State and models.AlertInstance
that indicate the "Reason" that an instance has its current state. This
helps us account for cases where the state is "Normal" but the
underlying evaluation returned "NoData" or "Error", for example.
Fixes#42606
Signed-off-by: Joe Blubaugh <joe.blubaugh@grafana.com>
This change extracts screenshot data from alert messages via a private annotation `__alertScreenshotToken__` and attaches a URL to a Slack message or uploads the data to an image upload endpoint if needed.
This change also implements a few foundational functions for use in other notifiers.
The State Manager will now take screenshots when an alert instance
switches to an Alerting or Resolved state.
Signed-off-by: Joe Blubaugh joe.blubaugh@grafana.com
This commit adds a pkg/services/screenshot package for taking and uploading screenshots of Grafana dashboards. It supports taking screenshots of both dashboards and individual panels within a dashboard, using the rendering service.
The screenshot package has the following services, most of which can be composed:
BrowserScreenshotService (Takes screenshots with headless Chrome)
CachableScreenshotService (Caches screenshots taken with another service such as BrowserScreenshotService)
NoopScreenshotService (A no-op screenshot service for tests)
SingleFlightScreenshotService (Prevents duplicate screenshots when taking screenshots of the same dashboard or panel in parallel)
ScreenshotUnavailableService (A screenshot service that returns ErrScreenshotsUnavailable)
UploadingScreenshotService (A screenshot service that uploads taken screenshots)
The screenshot package does not support wire dependency injection yet. ngalert constructs its own version of the service. See https://github.com/grafana/grafana/issues/49296
This PR also adds an ImageScreenshotService to ngAlert. This is used to take screenshots with a screenshotservice and then store their location reference for use by alert instances and notifiers.
* Add coremodelValidation feature flag
* coremodels: use stubs when feature flag is off
* api: validate dashboards on save
* Need pointer receiver for FeatureManager
* Update dashboard Go model
* Align doc comments
* Include CoremodelRegistry in test
* Wedge coremodel in on all test cases, ugh
* Ugh fix comment again
* Update pkg/framework/coremodel/staticregistry/provide.go
Co-authored-by: Artur Wierzbicki <wierzbicki.artur.94@gmail.com>
* Update Thema (and its deps) for better errs
* omg whitespace
Co-authored-by: Artur Wierzbicki <wierzbicki.artur.94@gmail.com>
* rewrote `CopyIcon` to an functional component
- fixed missing `CopyIcon` on `KeyValuesTable`
* added fixed height of `30px` to `KeyValuesTable` to fix overlapping
* removed unused CopyIcon snapshot
* KeyValuesTable: moved `30px` height from `tr` to `td` to fix vertical alignment
Makes `pkg/web` only accept handles from the following set:
```go
handlerStd = func(http.ResponseWriter, *http.Request)
handlerStdCtx = func(http.ResponseWriter, *http.Request, *web.Context)
handlerStdReqCtx = func(http.ResponseWriter, *http.Request, *models.ReqContext)
handlerReqCtx = func(*models.ReqContext)
handlerReqCtxRes = func(*models.ReqContext) Response
handlerCtx = func(*web.Context)
```
This is a first step to reducing above set to only `http.Handler`.
---
Due to a cyclic import situation between `pkg/models` and `pkg/web`, parts of this PR were put into `pkg/api/response`, even though they definitely do not belong there. This however is _temporary_ until we untangle `models.ReqContext`.
* Update query editor to fix auto time-grain selection
* Update new query editor to fix auto time-grain selection
* Remove log and fix lint issues
* Add test for useMetricMetadata
- Add necessary types
* More test updates
- Update old dataHooks test
- Ensure query changes
Co-authored-by: Kevin Yu <kevinwcyu@users.noreply.github.com>
Co-authored-by: Andres Martinez Gotor <andres.mgotor@gmail.com>
Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
* Moved annotation and labels topic to fundamentals and added label matching to the same section
* Cosmetic updates to "How label matching works topic"
* Few more changes to annotations and label section. Also added stem sentence to silences topics.
* Fixed one more broken relref.
* Update docs/sources/alerting/fundamentals/_index.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* remove angular code
* format annotation on backend
* format time with time type instead of string
* update annotation query tests
* update get alignment data function
* update annotation query editor
* add annotation query editor test
* update struct
* add tests
* remove extracted function
* remove non-null assertion
* remove stray commented out console.log
* fix jest haste map warning
* add alignment period
* add AnnotationMetricQuery type
* Update dependency node-fetch to v3
* add node-fetch to the renovate ignore list as it's esm only at the moment
* revert back to 2.6.7
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* introduce a fallback handler that checks that role is Viewer.
* update UI nav links to allow alerting tabs for anonymous user
* update rule api to check for Viewer role instead of SignedIn when RBAC is disabled
* Load Rich History when the container is opened
* Store rich history for each pane separately
* Do not update currently opened query history when an item is added
It's impossible to figure out if the item should be added or not, because filters are applied in the backend. We don't want to replicate that filtering logic in frontend. One way to make it work could be by refreshing both panes.
* Test starring and deleting query history items when both panes are open
* Remove e2e dependency on ExploreId
* Fix unit test
* Assert exact queries
* Simplify test
* Fix e2e tests
* Fix toolbar a11y
* Reload the history after an item is added
* Fix unit test
* Remove references to Explore from generic PageToolbar component
* Update test name
* Fix test assertion
* Add issue item to TODO
* Improve test assertion
* Simplify test setup
* Move query history settings to persistence layer
* Fix test import
* Fix unit test
* Fix unit test
* Test local storage settings API
* Code formatting
* Fix linting errors
* Add an integration test
* Add missing aria role
* Fix a11y issues
* Fix a11y issues
* Use divs instead of ul/li
Otherwis,e pa11y-ci reports the error below claiming there are no children with role=tab:
Certain ARIA roles must contain particular children
(https://dequeuniversity.com/rules/axe/4.3/aria-required-children?application=axeAPI)
(#reactRoot > div > main > div:nth-child(3) > div > div:nth-child(1) > div >
div:nth-child(1) > div > div > nav > div:nth-child(2) > ul)
<ul class="css-af3vye" role="tablist"><li class="css-1ciwanz"><a href...</ul>
* Clean up settings tab
* Remove redundant aria label
* Remove redundant container
* Clean up test assertions
* Move filtering to persistence layer
* Move filtering to persistence layer
* Simplify applying filters
* Split applying filters and reloading the history
* Debounce updating filters
* Update tests
* Fix waiting for debounced results
* Clear results when switching tabs
* Improve test coverage
* Update docs
* Revert extra handling for uid (will be added when we introduce remote storage)
* Create basic plan
* Rename query history toggle
* Add list of supported features and add ds name to RichHistoryQuery object
* Clean up
Removed planned items will be addressed in upcoming prs (filtering and pagination)
* Handle data source filters
* Simplify DTO conversion
* Clean up
* Fix betterer conflicts
* Fix imports
* Fix imports
* Post-merge fixes
* Use config instead of a feature flag
* Use config instead of a feature flag
* Update converter tests
* Add tests for RichHistoryRemoteStorage
* Simplify test setup
* Simplify assertion
* Add e2e test for query history
* Remove duplicated entry
* Fix unit tests
* Improve readability
* Remove unnecessary casting
* Mock backend in integration tests
* Remove unnecessary casting
* Fix integration test
* Update betterer results
* Fix unit tests
* Simplify testing with DataSourceSrv
* Fix sorting and add to/from filtering
* Add migration for local storage query history
* Test query history migration
* Simplify testing DataSourceSettings
* Skip redundant migrations
* Revert error logging test
* Fix tests
* Update betterer results
* Change notification message after migration
* Ensure previous request is canceled when getting search results
* Add loading message when results are being loaded
* Show info message only if local storage is enabled
* Fix unit test
* Post-merge fixes
* Fix intergration tests
* Fix incorrect filtering
* Login: Fix mismatching label on user auth_module
* Login: ensure previous auth was set to differing
* Login: ensure only one entry of auth is updated
* compare both entries
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
* remove noop
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
* convert SpanBarRow tests to RTL
* remove comments
* Update packages/jaeger-ui-components/src/TraceTimelineViewer/SpanBarRow.test.js
Co-authored-by: Ashley Harrison <ashharrison90@gmail.com>
* Update packages/jaeger-ui-components/src/TraceTimelineViewer/SpanBarRow.test.js
Co-authored-by: Ashley Harrison <ashharrison90@gmail.com>
* fix and replace
* fix last test
Co-authored-by: Ashley Harrison <ashharrison90@gmail.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* Rename tests
* Change test names
* Change metrics from map to slice
* Add test for one output, multiple MetricDataResults
* Rename test input file
* Use map instead of iterating over the response metrics
* Rename variable
* move partial data set to query row response
* remove not used label field
* remove incorrect placeholder
Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
adds toggle to make a dashboard public
* config struct for public dashboard config
* api endpoints for public dashboard configuration
* ui for toggling public dashboard on and off
* load public dashboard config on share modal
Co-authored-by: Owen Smallwood <owen.smallwood@grafana.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
* rename folder to match package name
* backend/sqlstore: move GetDashboard into DashboardService
This is a stepping-stone commit which copies the GetDashboard function - which lets us remove the sqlstore from the interfaces in dashboards - without changing any other callers.
* checkpoint: moving GetDashboard calls into dashboard service
* finish refactoring api tests for dashboardService.GetDashboard
* Refactor: Add UID endpoint for dashboard versions and restore
* Fix: User dashID instead of dash.id
* 💩
* Move apiCmd error handling outside of dashUID check
* fix the panic in test
* Fix handler and update docs
Co-authored-by: Kat Yang <yangkb09@users.noreply.github.com>
* Docs: add deprecated warning to restore and version docs
* Fix hyperlink text
* Add swagger endpoints for restore and versions
* Add deprecated tag on swagger for both endpoints
* Fix: Update access control to be dashboards
* Return UID in response; Update docs to reflect this; Implement Ying suggestion
* Update docs/sources/http_api/dashboard_versions.md
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
* Update pkg/models/dashboard_version.go
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
* Update pkg/models/dashboard_version.go
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
* Update query to refer to DashboardUID
Co-authored-by: Ying WANG <ying.wang@grafana.com>
Co-authored-by: Sofia Papagiannaki <sofia@grafana.com>
Co-authored-by: Kat Yang <yangkb09@users.noreply.github.com>
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
* AccessControl: Enforce user check when enterprise accesscontrol is on
* Update the test not to fail enterprise build
* Adding a log as suggested by Kalle
Co-authored-by: Kalle Persson <kalle.persson@grafana.com>
* Update log message
Co-authored-by: Kalle Persson <kalle.persson@grafana.com>
* AccessControl: Document basic roles simplifying
* Add sample file for provisioning v2
* WIP
* Update provisioning example from docs
* Fix wrong permission in docs
* Nits on about-rbas.md
* Manage rbac roles
* Nit.
* Nit.
* Rephrase
* Comment
* Add version to the role
* Update role
* Update role
* Spell
* Final touch on about-rbac
* Add basic role UID mapping about-rbac
* Team assignments
* assign rbac roles
* move for more info
* enable rbac and provisioning
* spell
* plan rbac rollout strategy
* Cover factory reset
* remove builtin assignment permissions from docs
* to -> from
* Custom role actions scopes
* spell
* Update docs/sources/enterprise/access-control/about-rbac.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/enterprise/access-control/about-rbac.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/enterprise/access-control/assign-rbac-roles.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/enterprise/access-control/assign-rbac-roles.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/enterprise/access-control/assign-rbac-roles.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/enterprise/access-control/plan-rbac-rollout-strategy.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/enterprise/access-control/plan-rbac-rollout-strategy.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/enterprise/access-control/manage-rbac-roles.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/enterprise/access-control/custom-role-actions-scopes.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/enterprise/access-control/custom-role-actions-scopes.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/enterprise/access-control/enable-rbac-and-provisioning.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/enterprise/access-control/manage-rbac-roles.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/enterprise/access-control/manage-rbac-roles.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/enterprise/access-control/manage-rbac-roles.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/enterprise/access-control/manage-rbac-roles.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/enterprise/access-control/manage-rbac-roles.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/enterprise/access-control/manage-rbac-roles.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/enterprise/access-control/manage-rbac-roles.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/enterprise/access-control/manage-rbac-roles.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/enterprise/access-control/manage-rbac-roles.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/enterprise/access-control/manage-rbac-roles.md
* Update docs/sources/enterprise/access-control/manage-rbac-roles.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Remove factory as much as possible
* Update docs/sources/enterprise/access-control/plan-rbac-rollout-strategy.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/enterprise/access-control/plan-rbac-rollout-strategy.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Have -> Must
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Have -> Must
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Replace factory by hard reset
* Replace LINK
* Update docs/sources/enterprise/access-control/about-rbac.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Suggestion on example descriptions
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Update docs/sources/enterprise/access-control/manage-rbac-roles.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Remove comment on permissions escalate
* Prettier.
* add a sentence to explain the type:escalate
* add a sentence to explain the type:escalate
* Rephrase
* Remove TODOs as discussed with jguer
Co-authored-by: Jguer <joao.guerreiro@grafana.com>
* Implement vardan's suggestion to have only one mapping:
Co-authored-by: Vardan Torosyan <vardants@gmail.com>
* Document that you cannot delete basic roles
Co-authored-by: Vardan Torosyan <vardants@gmail.com>
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Co-authored-by: Jguer <joao.guerreiro@grafana.com>
Co-authored-by: Vardan Torosyan <vardants@gmail.com>
* Change default of style to dark
* Separate cursor into standalone def
* Docs on timepicker and templating fields
Also add what appear to be timepicker-related fields
* Separate out AnnotationQuery definition
* Add memberNames for DashboardCursorSync
* Add sketch of VariableModel for templating field
Also changes label field from frontend from null to optional.
* Use constraints to enforce non-empty panel type
Negation (!="") was breaking openapi exporter
* Add types and fields for links
* Remove panelVersion fields
These weren't right anyway, and they revealed a bug in the CUE openapi
generator
* Remove null label value from test
* Narrow type and set bounds on month field
* Adapt Go dashboard schema to lineage changes
* Load Rich History when the container is opened
* Store rich history for each pane separately
* Do not update currently opened query history when an item is added
It's impossible to figure out if the item should be added or not, because filters are applied in the backend. We don't want to replicate that filtering logic in frontend. One way to make it work could be by refreshing both panes.
* Test starring and deleting query history items when both panes are open
* Remove e2e dependency on ExploreId
* Fix unit test
* Assert exact queries
* Simplify test
* Fix e2e tests
* Fix toolbar a11y
* Reload the history after an item is added
* Fix unit test
* Remove references to Explore from generic PageToolbar component
* Update test name
* Fix test assertion
* Add issue item to TODO
* Improve test assertion
* Simplify test setup
* Move query history settings to persistence layer
* Fix test import
* Fix unit test
* Fix unit test
* Test local storage settings API
* Code formatting
* Fix linting errors
* Add an integration test
* Add missing aria role
* Fix a11y issues
* Fix a11y issues
* Use divs instead of ul/li
Otherwis,e pa11y-ci reports the error below claiming there are no children with role=tab:
Certain ARIA roles must contain particular children
(https://dequeuniversity.com/rules/axe/4.3/aria-required-children?application=axeAPI)
(#reactRoot > div > main > div:nth-child(3) > div > div:nth-child(1) > div >
div:nth-child(1) > div > div > nav > div:nth-child(2) > ul)
<ul class="css-af3vye" role="tablist"><li class="css-1ciwanz"><a href...</ul>
* Clean up settings tab
* Remove redundant aria label
* Remove redundant container
* Clean up test assertions
* Move filtering to persistence layer
* Move filtering to persistence layer
* Simplify applying filters
* Split applying filters and reloading the history
* Debounce updating filters
* Update tests
* Fix waiting for debounced results
* Clear results when switching tabs
* Improve test coverage
* Update docs
* Revert extra handling for uid (will be added when we introduce remote storage)
* Create basic plan
* Rename query history toggle
* Add list of supported features and add ds name to RichHistoryQuery object
* Clean up
Removed planned items will be addressed in upcoming prs (filtering and pagination)
* Handle data source filters
* Simplify DTO conversion
* Clean up
* Fix betterer conflicts
* Fix imports
* Fix imports
* Post-merge fixes
* Use config instead of a feature flag
* Use config instead of a feature flag
* Update converter tests
* Add tests for RichHistoryRemoteStorage
* Simplify test setup
* Simplify assertion
* Add e2e test for query history
* Remove duplicated entry
* Fix unit tests
* Improve readability
* Remove unnecessary casting
* Mock backend in integration tests
* Remove unnecessary casting
* Fix integration test
* Update betterer results
* Fix unit tests
* Simplify testing with DataSourceSrv
* Fix sorting and add to/from filtering
* Simplify testing DataSourceSettings
* Update betterer results
* Ensure previous request is canceled when getting search results
* Add loading message when results are being loaded
* Show info message only if local storage is enabled
* Fix unit test
* Reuse sort order options
* Reuse sort order options
* Fix footer spacing
* Refactor: Add UID endpoint for get dashboard version
* Add initial docs language
* Add new endpoint in swagger
* Change access control to dashboards
* Add parameters to swagger endpoint
* Return UID in response; Update docs to reflect this; Implement Ying suggestion
* Update docs/sources/http_api/dashboard_versions.md
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
* Update pkg/api/api.go
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
* Update pkg/models/dashboard_version.go
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
* Rename UID to DashboardUID for clarity; use dashUID in method
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
This will help the UX team create issues for their work faster. That way we can be more open about our work and help both Grafanistas and community members see what we're doing.
* create AlertGroupKey structure
* update PrometheusSrv.
- extract creation of RuleGroup to a separate method. Use group key for grouping
* update RuleSrv
- update calculateChanges to use groupKey
- authorize to use groupkey
* #45498: add String util to ListResponse for better UX
* #45498: refactor db_filestorage FS API backend - use path_hash in DB schema
* #45498: enable DB backend fs api tests
* #45498: add comment
* #45498: enable Storage feature flag during integration tests
* remove fmt.println
* #45498: reduce sizes of hash columns
* separate conditions
* #45498: make it easy to ignore backends when running fs api integration tests
* #45498: quote `key` column name
* #45498: reduce path_hash size
* #45498: verify `/{orgId}/{storageName}/` prefix convention in integration tests
* #45498: add etag to the sql table
* #45498: add etag to the sql table
* remove feature flag check (storage isn't dev-mode only)
* add cacheControl and content disposition
* add comments
* add path_hash comment
* explicitly set `path` column collation in `file` table for postgres
* Drone: add enterprise-init-downstream step
* fixes
* Add OSS_PULL_REQUEST env variable for downstream builds
* sign Drone config
* Update .drone.yml
* use test grabpl
* test without init step
* fix downstream branch
* unknown branch test
* use drone-downstream test image
* revert latest changes
* update Drone and add GH workflow
* fix PR number
* Run Enterprise PR check only on PRs targeting main or release branch
* update repository dispatch action
* remove test data
* update grabpl version
* Add RBAC section to settings
* Default to RBAC enabled settings to true
* Update tests to respect RBAC
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
* Only require create and permissions for new data source page
* Let users with permissions to create data sources list non-core plugins
* Keep the admin check as fallback when using rbac as well
* feat: migrate Azure Metrics Query Editor Field to experimental UI
* feat: ensure tests pass with experimental feature flag enabled
* feat: avoid duplicate unit tests for experimental MetricsQueryEditor
* Transformation: Added variance and standard deviation for sample and population. Modified mean calculation approach
* Transformation: Removed existing mean calculation
* Transformation: Added testcases for variance and Standard deviation
* Update docs/sources/panels/calculation-types.md
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
* Add support for multiselect
- Add filters param to Dimensions
- Update existing tests
- Add MultiSelect component
- Add helper function to determine valid options
- Update labels hook to account for custom values
- Update go type
- Add function to build valid filters string
* Additional go tests
- Ensure query targets are built correctly
* Update DimensionFields frontend test
- Corrently rerender components
- Additional test for multiple labels selection
- Better selection of options in react-select components
* Fix lint issue
* Reset filters when operator or dimension changes
* Terminology
* Update test
* Add backend migration
- Update types (deprecate Filter field)
- Add migration logic
- Update tests
- Update dimension filters buliding
* Add migration test code
* Simplify some logic
* Add frontend deprecation notice
* Add frontend migration logic and migration tests
* Update setting of filter values
* Update DimensionFields test
* Fix linting issues
* PR comment updates
- Remove unnecessary if/else condition
- Don't set filter default value as queries should be migrated
- Add comment explaining why sw operator only accepts one value
- Remove unnecessary test for merging of old and new filters
* Nit on terminology
Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
* Rename migrations for clarity
Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
Unlike dashboard queries, alerting queries were not correctly applying
custom headers to datasource queries. This change mimics the dashboard
query code to apply custom headers.
Fixes#44460
Signed-off-by: Joe Blubaugh <joe.blubaugh@grafana.com>
* Remove What's new reference.
* Moved messaging templates to under contact points. fixed broken relrefs.
* Fixed some more reflrefs
* Fixed a few more broken relrefs and adjusted weight
* Remove banner when missing permissions to list users
* For OSS allow users to list other users if they have permissions to
write either team, dashboard or folder permissions
* Generate API for writing templates
* Persist templates app logic layer
* Validate templates
* Extract logic, make set and delete methods
* Drop post route for templates
* Fix response details, wire up remainder of API
* Authorize routes
* Mirror some existing tests on new APIs
* Generate mock for prov store
* Wire up prov store mock, add tests using it
* Cover cases for both storage paths
* Add happy path tests and fix bugs if file contains no template section
* Normalize template content with define statement
* Tests for deletion
* Fix linter error
* Move provenance field to DTO
* empty commit
* ID to name
* Fix in auth too
* Add explicit cuetsy annotations to all models.cue
* Update to first cuetsy release
* Clean up cuetsify a bit; remove unification
* Update changes to news codegen output
* reduce the usage of access control flag further by removing it from SQL store methods
* fixing tests
* fix another test
* linting
* remove AC feature toggle use from API keys
* remove unneeded function
* Elasticsearch: Remove support for versions after their EOL
* Update docs
* Remove old versions from config
* Update pkg/tsdb/elasticsearch/elasticsearch.go
Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
* Fix tests
* Fix typecheck errors
Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
* Chore: transfer three tests to testing-library
* Chore: transfer last test to testing-library
* chore: add suggestion from code review
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
* converter: remove __name__ customization because Loki does not do that
Loki does not handle __name__ in a special way.
for Prometheus, the caller can implement the formatting
by themselves
* converter: change labels-formatting
the labels.String() method does not handle strange values well
* loki: backend: use streaming-json parser
* more idiomatic code
Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
* simpler row-length check
* simpler code
* fixed converter/prom tests
Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
* allow SSR
* fix rollup commonjs default flag changed breaking in SSR
* revert wrong change
* avoid using dynamic imports
* fix test
* allow icon load in packaged version
* fix SelectBase to run on SSR
* add extra check for fixing tests
* revert wrong change
* allow SSR
* revert wrong change
* don't include emotion in the bundle
* fix wrong merge changes
* remove unneeded icon change
* use forked version of uplot
* remove unneeded bundle exceptions
* fix typescript issues
* update to latest uplot
* converter: remove __name__ customization because Loki does not do that
Loki does not handle __name__ in a special way.
for Prometheus, the caller can implement the formatting
by themselves
* converter: change labels-formatting
the labels.String() method does not handle strange values well
* loki: backend: use streaming-json parser
* more idiomatic code
Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
* simpler row-length check
* simpler code
Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
* feat: add feature toggle azureMonitorExperimentalUI
Add QueryHeader which adds an experimental header to AzureMonitor. This work is documented in #44432.
* Docs: Add developer documentation for localisation
* touch up docs
* more assertive
* add example for variable names
* Add naming conventions
* Rewrite 'what lingui does' section
* Initial commit
* Moved files, ad fixed broken relrefs.
* Fixed other broken relrefs
* More changes.
* Fixing broken relrefs
* More changes.
* Fixed last of the broken links
* More re-org.
* Added aliases and some weight adjustments
* More aliases.
* Fix fundamentals topic.
* Fixed remaining metadata issues
* Ran prettier
* GraphNG: Fix thresholds by color not following data update
* Refactor dynamicSeriesColor to time series
* avoid exposing frames on builder
rely on seriesIdx & cached alignedFrame to grab field
handle dynamic fill recoloring
only recolor when not in a special gradient mode
* bail when opacity = 0
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
* Panel
* Support tempo dash variables
* Support tempo explore variables
* Only show span links for explore
* Cleanup
* Added tests
* apply variables to search
* Tests for search variables
* Handling no data
* Interpolation and tests
* TracesPanel tests
* More tests
* Fix for backend test
* Manager integration test fix
* Traces doc and updated visualizations index doc
* Logs for this span
* Search, scrollToTop, other improvements
* Refactor to extract common code
* Removed TopOfViewRefType optional
* Remove topOfViewRef optional
* Removed another optional and fixed tests
* Test
* Only show search bar if trace
* Support traces panel in add to dashboard
* Self review
* Update betterer
* Linter fixes
* Updated traces doc
* Ahh, moved the for more info too
* Updated betterer.results
* Added new icon
* Updated expectedListResp.json
* feature toggles
* return HTTP 207 from ds/query
* add ft check
* add API test
* add 207 check for qr
* change to OR
* revert check
* add explicit toggle check for cloudwatch
* remove unused import
* remove from defaults.ini
* add status codes to md and update swagger
* new fangled http api tests pattern
* update swagger
* Update docs/sources/http_api/data_source.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* add missing word and reformat
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Query history: Clean up stale history after 14 days
* Add unstarring sleanup
* Add wraapping
* Update sql for mysql database
* Update
* Remove fmt.Print
* Refactor and simplify solution
* Update pkg/services/queryhistory/database.go
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
* Adjust SQL to limit number of deleted queries
* Add limit enforcmenet to cleanup
* Change limit
* Update
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
* convert Slider tests to RTL
* slight update
* don't need to check they're in the document
* Update packages/grafana-ui/src/components/Slider/Slider.test.tsx
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
* check below minimum value as well
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
* add response type text to graphite datasource http options to return full list of functions
* add comment for adding response type text to call to graphite /functions endpoint
* Add tests for invalid and valid JSON mocking backendSrv fromFetch
* remove unnecessary code from tests
* remove extra logic for graphite /functions endpoint returning {} #46681
* add graphite functions list logic back in to see why alert test broke
* fix conflict message
* fix conflicts
* fix issues with rebase, add responseType text back in, remove extra graphite functions list logic checks
* add email for license/cla check
* Logs: Add pagination range to prevent pagination from skipping entries
* Revert "Logs: Add pagination range to prevent pagination from skipping entries"
This reverts commit 2e7a6b3870.
* Refactor
* Update
* Fix secure json data reset on datasource update
* Update fillWithSecureJSONData to use DecryptedValues
* Remove unecessary conversion
* Move fillWithSecureJsonData logic to datasource service
* Add sanity check for nil secure json data
* refactor: replace uses of checked prop for <Switch> with value prop
* fix: remove spaces from ids
The ID format is stated as follows([source][1]):
> ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]),
hyphens ("-"), underscores ("_"), colons (":"), and periods (".").
Since `QueryHeaderSwitch` is used in two places I created a new variable that replaces spaces with a dash in the label.
[1]: https://www.w3.org/TR/html401/types.html#type-name
* fix: allow Switch in AlertingSettings to be focused by keyboard
* fix: allow Switch in PromSettings to be focused by keyboard
Fixes#46472
Co-authored-by: Elfo404 <me@giordanoricci.com>
* replace dashboardid with dashboardUID in annotation API
* add some tests
* modify some docs and add uid into get endpoint
* rebase with main
* add map for avoiding too much retrieve on dashboards
* Get golang to find an open port for us
* Update pkg/tests/api/alerting/api_notification_channel_test.go
Co-authored-by: gotjosh <josue.abreu@gmail.com>
* Fix merge
Co-authored-by: gotjosh <josue.abreu@gmail.com>
* Allow dimension operator selection
- Add dimension operators and function to update the operator in the query
- Add logic to ensure the same dimension cannot be selected multiple times (Azure restriction)
- Add selection component
* Update backend logic to default operation and filter to eq '*'
- This must be done as the ne and sw operators do not work with the wildcard filter
* Add tests on dimension operators
* Correct placement of 'and' when building query
* Add comment and simplify filtering logic
* Allow multiSelect for eq and ne operators
- Pass PanelData to DimensionFields component
- Add logic to retrieve labels from PanelData
- Add MultiSelect component for relevant operators
- Update frontend types to allow filter to be an array of strings
- Update backend types to allow filter to be an array of strings
- Update filter string building
* Improve setting of labels
* Update go tests
* Update frontend tests
- Add panelData mock (to be expanded later)
- Update null check in DimensionFields
* Allow custom value and set default
* Add frontend test and fix lint issues
* Improved handling of options for sw operator
* Remove changes related to multiselect
* Add check on refId to ensure dimension labels are correct for query
* Extract custom hook for setting dimension labels
* Add documentation around Azure Monitor metrics dimensions
* Update MetricQueryEditor tests
- Add missing data prop
* Correctly set field values
* Add additional expect for onQueryChange
* Correctly set operators
- Simplify onFilterInputChange
* Ensure no duplicate filters appear
* Ensure that filters are displayed correctly for saved queries
* Update dimension filter test
* Include additional test around changing dimension labels
* Pass panel data through new metrics query editor
* Move ApiKeyDTO to dtos package
* Add access control filter to api keys
* pass user in GetApiKeysQuery
* Add api key metadata to DTO
* Remove scope all requirement from get api keys endpoint
* Handle api key access control metadata in frondend
* Filter search options in Tempo
* Tests for filtering search options in Tempo
* Filter search options in Jaeger
* Tests for filtering search options in Jaeger
* Self review
* Fuzzy search
* loki: backend: better dataframe field names
* loki: backend: add dataframe-type to metric dataframes
* loki: backend: only add stats to the first metric dataframe
* AzureAd Oauth: Fix strictMode to reject users without an assigned role
Signed-off-by: kyschouv <kyschouv@microsoft.com>
* AzureAd OAuth: Add test for strictMode auth when no role claims are returned
Signed-off-by: kyschouv <kyschouv@microsoft.com>
* Template service
* Add GET routes and implement them
* Generate mock for persist layer
* Unit tests for reading templates
* Set up composition root and get integration tests working
* Fix prealloc issue
* Extract setup boilerplate
* Update AuthorizationTest
* Rebase and resolve
* Fix linter error
* #45498: add rbac support in searchv2
* to revert: fix dependency cycle
* Revert "to revert: fix dependency cycle"
This reverts commit 1ffbee73ec.
* added a TODO for caching user permissions
* add orgId to `getDashboardReadFilter`
* use orgId from signedInUser
* goimport
* provide public getter for config template variable regex
* add code comment
* Add documentation on assertion_name_mapping templates
* Add missing piece of SAML documentation while I'm in here.
* Update docs/sources/enterprise/saml/configure-saml.md
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
* Add a bit more documentation on error handling.
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
* move upload to http
* use storage from grafanads
* rever gomod changes
* fix test
* wip
* add upload func
* update upload func
* writing to uploads
* edit response from service
* use dropzone for UI
* modify response struct in service
* better read file
* set content type for svg
* restrict file types upload
* add test and clean up errors
* pass test
* fix backend lint errors
* limit type of files on FE
* add TODO for after merge
* rebase with storage changes
* comment out unused function
* update UI to not have 2 uploads
* only call upload on select
* use utils function to find * in path
* show preview on drag over
* not allowing upload of svg
* add preview to upload tab
* no console.log
* resolve conflicts
* refactor log line
* fix failing BE test
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Artur Wierzbicki <artur.wierzbicki@grafana.com>
* Load Rich History when the container is opened
* Store rich history for each pane separately
* Do not update currently opened query history when an item is added
It's impossible to figure out if the item should be added or not, because filters are applied in the backend. We don't want to replicate that filtering logic in frontend. One way to make it work could be by refreshing both panes.
* Test starring and deleting query history items when both panes are open
* Remove e2e dependency on ExploreId
* Fix unit test
* Assert exact queries
* Simplify test
* Fix e2e tests
* Fix toolbar a11y
* Reload the history after an item is added
* Fix unit test
* Remove references to Explore from generic PageToolbar component
* Update test name
* Fix test assertion
* Add issue item to TODO
* Improve test assertion
* Simplify test setup
* Move query history settings to persistence layer
* Fix test import
* Fix unit test
* Fix unit test
* Test local storage settings API
* Code formatting
* Fix linting errors
* Add an integration test
* Add missing aria role
* Fix a11y issues
* Fix a11y issues
* Use divs instead of ul/li
Otherwis,e pa11y-ci reports the error below claiming there are no children with role=tab:
Certain ARIA roles must contain particular children
(https://dequeuniversity.com/rules/axe/4.3/aria-required-children?application=axeAPI)
(#reactRoot > div > main > div:nth-child(3) > div > div:nth-child(1) > div >
div:nth-child(1) > div > div > nav > div:nth-child(2) > ul)
<ul class="css-af3vye" role="tablist"><li class="css-1ciwanz"><a href...</ul>
* Clean up settings tab
* Remove redundant aria label
* Remove redundant container
* Clean up test assertions
* Move filtering to persistence layer
* Move filtering to persistence layer
* Simplify applying filters
* Split applying filters and reloading the history
* Debounce updating filters
* Update tests
* Fix waiting for debounced results
* Clear results when switching tabs
* Improve test coverage
* Update docs
* Revert extra handling for uid (will be added when we introduce remote storage)
* Fix betterer conflicts
* Fix imports
* Fix imports
* Simplify test setup
* Simplify assertion
* Improve readability
* Remove unnecessary casting
* Mock backend in integration tests
* #45498: add entity events table
* #45498: add entity events service
* #45498: hook up entity events service to http server
* #45498: use `dashboards.id` rather than `uid` and `org_id` in grn
* Update pkg/services/entityevents/service.go
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* #45498: move entityeventsservice to services/store
* #45498: add null check
* #45498: rename
* #45498: fix comment
* #45498: switch grn back to uid
* Search: listen for updates (#47719)
* #45498: wire entity event service with searchv2
* load last event id before building index for org 1
* fix service init in integration tests
* depend on required subset of event store methods
* Update pkg/services/sqlstore/migrations/entity_events_mig.go
Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
* #45498: pointer receiver
* #45498: mockery!
* #45498: add entity events service to background services
* dashboard query pagination, allow queries while re-indexing
* log level cleanups, use rlock, add comments
* fix lint, check feature toggle in search v2 service
* use unix time for event created column
* add missing changes for created column
* fix integration tests init
* log re-index execution times on info level
* #45498: fix entityEventsService tests
* #45498: save events on dashboard delete
* use camel case for log labels
* formatting
* #45498: rename grn to entityid
* #45498: add `IsDisabled` to entityEventsService
* #45498: remove feature flag from migration
* better context usage, fix capacity, comments/cleanups
* replace print with logger
* Revert "#45498: remove feature flag from migration"
This reverts commit ed23968898.
* revert:revert:revert conditional feature flag
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
Invalid PostableSilences could be passed to the Alerting API - if they
are passed all the way down into the alertmanager data layer, they can
cause a panic. This change adds validation to avoid a panic in the
alertmanager.
* Alerting: Create fewer contact points on migration
Previously a new contact point was created for every unique combination
of channels attached to any legacy alert. This was very hard to maintain,
requiring modifications in every generated contact point.
This change deduplicates the generated contact points to a more
reasonable state. There should now only be one contact point per legacy
channel, and we attached multiple contact points to a route by nesting
them. The sole exception to this is if there were multiple default
legacy channels, in which case we create a redundant contact point
containing all of them used only in the root policy. This allows for a
much simpler notification policy structure.
Co-authored-by: gotjosh <josue.abreu@gmail.com>
* Bind command palette specific overrides and reset when no longer relevant
* Use original global escape instead of resetting the whole keybinding profile
* AzureMonitor: build azure portal deep link with resource uri
* extract resource name from the metrics api query
* extract func for getting resource name from metrics url
* add additional valid characters to regex
* Initial commit
* Added some refinement to the alerting HA topics.
* Update docs/sources/administration/set-up-for-high-availability.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Updates from Chris's review. Also fixed a couple of broken relrefs
* Ran prettier
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Add test for decrypted values on datasource service
* Add debug log when fail to parse secure json fields
* Fix minor import issue
* Refactor encJson to json and simplejson to sjson on tests
* CloudWatch: prevent log groups from being removed on query change.
Previously when a query was changed the existing log groups for that query were "dropped". The fix is to combine the
new query with the existing query object in memory to preserve the log groups.
fixes#33626
* CloudWatch: fix typos in runWithRetry documentation
* chore: fix eslint issue
* wip: Implement kvstore for secrets
* wip: Refactor kvstore for secrets
* wip: Add format key function to secrets kvstore sql
* wip: Add migration for secrets kvstore
* Remove unused Key field from secrets kvstore
* Remove secret values from debug logs
* Integrate unified secrets with datasources
* Fix minor issues and tests for kvstore
* Create test service helper for secret store
* Remove encryption tests from datasources
* Move secret operations after datasources
* Fix datasource proxy tests
* Fix legacy data tests
* Add Name to all delete data source commands
* Implement decryption cache on sql secret store
* Fix minor issue with cache and tests
* Use secret type on secret store datasource operations
* Add comments to make create and update clear
* Rename itemFound variable to isFound
* Improve secret deletion and cache management
* Add base64 encoding to sql secret store
* Move secret retrieval to decrypted values function
* Refactor decrypt secure json data functions
* Fix expr tests
* Fix datasource tests
* Fix plugin proxy tests
* Fix query tests
* Fix metrics api tests
* Remove unused fake secrets service from query tests
* Add rename function to secret store
* Add check for error renaming secret
* Remove bus from tests to fix merge conflicts
* Add background secrets migration to datasources
* Get datasource secure json fields from secrets
* Move migration to secret store
* Revert "Move migration to secret store"
This reverts commit 7c3f872072.
* Add secret service to datasource service on tests
* Fix datasource tests
* Remove merge conflict on wire
* Add ctx to data source http transport on prometheus stats collector
* Add ctx to data source http transport on stats collector test
* Move tab height and horizontal drawer height to themable variables so they can be referred to. Add a default height to tabbed container so it can set an explicit height. Add overflow: scroll to inspector content
* Use height variable that changes on resize
* Use css to set height
* remove not used code:
- remove offset in ticket because it is not used
- remove unused ticker and scheduler methods
* use duration for interval
* add metrics grafana_alerting_ticker_last_consumed_tick_timestamp_seconds, grafana_alerting_ticker_next_tick_timestamp_seconds, grafana_alerting_ticker_interval_seconds
* Test composition simplification from last PR
* Policies use proper API model everywhere
* Expose policy provenance in API, miss some dep injection
* Complete injection
* fix args
* Tests for provenance value
* Extract test helpers so tests are very readable
* Single source adapter struct that was copied in 3 places
* Drop redundant test
* Resolve merge conflicts on changelog
* Attach nav item menus to a portal that's a sibling of the chevron to prevent incorrect stacking
* add scrollbar to navbar
* Make clickable area of grafana logo full size
* hide vertical track as well
* initial attempt at a scroll overlay
* fix indentation
* Extract into a separate component
* Add arrows
* fix unit tests
* Fix imports in new component
* add comment
* Attach nav item menus to a portal that's a sibling of the chevron to prevent incorrect stacking
* add scrollbar to navbar
* Make clickable area of grafana logo full size
* hide vertical track as well
* prettier...
* Attach nav item menus to a portal that's a sibling of the chevron to prevent incorrect stacking
* Make sure hover menus size correctly
* refactor into separate component
* Fix focus behaviour
* fix test again...
* Add feature flag and scaffodling
* start adding actions
* WIP
* move action files
* Start adding styles
* Fix implementation based on feedback
* Add more hackathon code back to command palette
* Cleanup
* Cleanup unused service files for simple MVP pass
* Move type def to library
* WIP
* Move provider to proper place to pick up other routes’ actions
* Build actions off navbar, add explore actions
* Work around undefined typescript stuff
* Fix based on feedback
* close palette on ESC
* Fix based on PR feedback pt 1
* Move styles to classes
* Move another inline style to a class
* Enable command palette by default
* change around async hook structure
* Add simple feature tracking
* Code cleanup, and be sure the command is accurate
* Change to only render if there are actions, and only add actions once past login
* Fix Date picker content when pane is splitted (#46900). Show narrow(mobile) content version.
* Change from boolean to value override and use it in calendar styles. Change calendar modal to be in center of screen.
* Be sure width division only happens on split view
Co-authored-by: Kristina Durivage <kristina.durivage@grafana.com>
* Updates queryResponse tests to include new cachedResponse bool
* Adds cachedResponse bool to QueryResponse
* Adds tests to assert the correct query counts (totalQueries and cachedQueries) are dispatched for data-requests
* Adds totalQueries and cachedQueries counts to the data-request events
* Adds new metrics and their descriptions to docs
* uses more descriptive variable name
* changes naming
* removes hyphen in docs
* extracts calculations to own lines prior to assignment
* Replace sequential IDs with UID for dashboard permossion
* Add back endpoint with id
* Rename parameter from dashboarUid->uid and add swagger definitions for endpoints
* Generate swagger json
* Add deprecated to swagger and docs
* Add deprecated comment in the api.go
* Add model for POST body
* Fix model post body for endpoint
* Generate spec with enterprise
* Docs: Remove 'Reference' prefix from all reference topic filenames: Per issue #46818, prefixing reference topics with "Reference" can damage usability. Remove the prefix from filenames.
* Docs: Remove "Reference:" prefix from titles and ToC headings: Per issue #46818, prefixing reference topics with "Reference" can damage usability. Remove the prefix from titles and ToC headings. H1s retain the prefix to emphasize the nature of the doc without affecting the docs' discoverability.
* Docs: Move Transformation functions reference alongside Transformation docs
* Docs: Update links to reference docs in Transformation docs
* Docs: Update links to reference docs in Panels docs
* Docs: Update links to query options reference across docs
* Docs: Update links to standard field definitions reference across docs
* Docs: Update links to calculation types reference across docs
* Docs: Update links to transformation functions reference across docs
* Docs: Rename apply transformation doc filename to add transformation
* Docs: Rename apply transformation doc to add transformation
* Docs: Update links to add transformation doc across docs
* Docs: Update relrefs in Transformation functions reference
* Implement preference service
* Adjust wire.go
* Fix integration test user
* Fix api pref tests
* Fix a11y error
Co-authored-by: Alexandra Vargas <alexa1866@gmail.com>
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
* Update dependency @testing-library/user-event to v14.1.1
* make this test more consistent
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* Update dependency @testing-library/user-event to v14
* everything is async...
* everything is async pt.2
* Fix cascader tests
* hack the yarn.lock file to remove the old version of @testing-library/dom
* some more fixes!
* MOAR FIXES
* more fixes
* remove a bunch of places where we're wrapping in act()
* down to 7 failing tests...
* Fix arrow tests
* Fix rest of NavBarItem tests
* Fix last tests
* Use {Enter} instead of {enter}
* Revert "Use {Enter} instead of {enter}"
This reverts commit e72453bb52.
* remove some unused act imports
* Fix LibraryPanelsSearch tests
* more stable test
* More consistent test...
Co-authored-by: Renovate Bot <bot@renovateapp.com>
* Add basic and managed prefixes to avoid magic strings
For now let's stick with grafana_builtins
add function isBasic to RoleDTO
add function isBasic to Role
Co-authored-by: Jguer <joao.guerreiro@grafana.com>
* Add team store to wire
Co-authored-by: Jguer <joao.guerreiro@grafana.com>
Co-authored-by: Jguer <joao.guerreiro@grafana.com>
* Alerting: Add integration test for AddDashAlertMigration
* Add more targeted test cases
* Apply suggestions from code review
Co-authored-by: gotjosh <josue.abreu@gmail.com>
* Reorganize file and improve comments
* Replace custom sort+trim with go-cmp
* Add test for AddDashAlertMigration
* Rename test cases to standard format
* Apply suggestions from code review
Co-authored-by: gotjosh <josue.abreu@gmail.com>
* Remove test-only snapshots of PostableUserConfig et al.
* Organize imports
* Fix linting
Co-authored-by: gotjosh <josue.abreu@gmail.com>
* Additional logic to handle quoted values
* Simple test with quoted values that include spaces
* Update test description
* Updating logic to account for nested quotes
- Adding additional test for nested quotes
* Strip out line breaks and carriage returns pre-processing
* Fix typo in test result
* Update key-value logic to avoid regexp
- Minor changes to account for null values
* Correct escaping on test
* Additional tests
- Test for null values
- Test for nested separator characters
- Update quoting
Before this change, notifications generated by the Grafana Alertmanager
pointed to '/alerting/:ruleID/edit'. This change instead points them to
the view path '/alerting/grafana/:ruleID/view'. The view page has a
better UX, including timeseries display. It's also where many alert
state improvements will land in the next few versions of Grafana.
Fixes#45301
Signed-off-by: Joe Blubaugh <joe.blubaugh@grafana.com>
* migrate old query to new query
* remove new prefixed data fetchers
* fix lint
* add test cases for v7 and v8 query versions
* add mock ids in test
* add clarifying comment
* add types for azure monitor api data fetchers
* add additional comment to explain the types
* Update API Keys UI to adjust based on users permissions
Since API Keys support now RBAC we need to ensure that UI
is adjusted based on the user permissions.
* Applying PR suggestions
* secureFields and secureSettings
* revert channelIndex
* readd lost code
* use specific return
* register secure fields and use not hard coded index
* fix for determineReadOnly
* fix lint error
* fix test suite
Co-authored-by: gillesdemey <gilles.de.mey@gmail.com>
* Remove makefile (it's not used anymore)
* Directly download and install nodejs package
The Packages file for deb.nodesource.com/node_16.x doesn't list older
versions, so only the most recent version of nodejs is available. We
don't want to require every update to the build container to have to
update nodejs if a never version is available, so I manually download
the deb and install it with dpkg.
* Update Go version
* Update lib.star
* Generate new .drone.yml
PR #47674 attempted to sort a read-only managed async array. This change
moves the sort logic to the fetch code so sort happens once on fetch, to
a mutable array, rather than trying on each render for an immutable
array.
Signed-off-by: Joe Blubaugh <joe.blubaugh@grafana.com>
* Cloudwatch: add test to ensure RunQuery is fired onBlur of LogQuery
Also remove the `onBlur` prop for the `QueryField` in `LogsQueryField` since `QueryField` is configured to re-run
queries `onBlur` by default.
Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>
Co-authored-by: Isabella Siu <isabella.siu@grafana.com>
Co-authored-by: Adam Simpson <adam@adamsimpson.net>
This change sorts the State History list returned by the backend by the
id in addition to the timeEnd and time fields by which it is
already sorted. This results in a stable view of the State History
table.
Fixes#45873
Signed-off-by: Joe Blubaugh <joe.blubaugh@grafana.com>
* coremodel: finish string -> object datasource ref
Seems we missed updating a couple of the datasource references from
strings to objects.
* cue fmt
* Also fix dashboard in scuemata dashboard schema
* Update devenv/dev-dashboards/panel-graph/graph-ng-stacking2.json
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* Docs: Addition of more prominent link to docker conf
Saw a comment on Reddit indicating a lack of information - docs were available, just a little hard to find.
Added a note pointing our community to where they might find docker image configuration help.
* Update docs/sources/installation/docker.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* WIP
* fix: bug for saving name did not remove edit
* refactor: better error msg
* Display the column Roles even when user can't see the role picker
* Remove spaces when building the search query request
* Disable Edit button and fix token addition and deletion
* Fix the error message text
Co-authored-by: Vardan Torosyan <vardants@gmail.com>
* Copy over most of coremodel from intent-api branch
* Fix import paths
* Fix incorrect provider name
* Add root compgen file, fixup componentroot.yaml
* go mod tidy
* Remove compgen for now
* Add dashboard coremodel
* Remove datasource coremodel, for now
* Tweak comments on dashboard struct model
* devenv: add dashboard testing directly
* Fixup dashboard schema for openness, heatmap
* Update Thema to tip
* Fix wire/registry references
* Fix hclog version
* Refactor GET am config to be extensible
* Extract post config route
* Fix tests
* Remove temporary duplication
* Fix broken test due to layer shift
* Fix duplicated error message
* Properly return 400 on config rejection
* Revert weird half method extraction
* Move things to notifier package and avoid redundant interface
* Simplify documentation
* Split encryption service and depend on minimal abstractions
* Properly initialize things all the way up to the composition root
* Encryption -> Crypto
* Address misc feedback
* Missing docstring
* Few more simple polish improvements
* Unify on MultiOrgAlertmanager. Discover bug in existing test
* Fix rebase conflicts
* Misc feedback, renames, docs
* Access crypto hanging off MultiOrgAlertmanager rather than having a separate API to initialize
* use common traceID context value for opentracing and opentelemetry
* support sampled trace IDs as well
* inject traceID into NormalResponse on errors
* Finally the test passed
* fix the test
* fix linter
* change the function parameter
Co-authored-by: Ying WANG <ying.wang@grafana.com>
* Split preference store
* Chore: Add tests to pref
* Fix preference in wire
* Rename and adjust
* Add pref service test
* Rename methods, add tests
* Rename Preferences to Preference, names IDs correctly
* Fix lint
* Refactor Save
* Refactor upsert
Add new logic for QueryHistory
Rename some fields according to go naming conventions
Refactore tests
* Roll back ID that breaks tests
* Rename Id to ID in UpdatePreferenceQuery
* Use preference as a model to modify store
* Move pref store fakes to pref test file
* Add integration tag for store tests
* Adjust test
Co-authored-by: yangkb09 <yangkb09@gmail.com>
* Alerting: unwrap upsert into insert and update function
* add changelog entry
* remove changelog entry
* rename upsertrule to updaterule
* use directly alertrule model for inserts
* add test for updating a rule with a conflicting name
* Show query errors under each query row
* Testing a more plain error box
* Font size
* Make it green
* Nit UI
* Slight simplification of condition
* New design
* Update
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
* Loki: Use expr as state for visual editor
* Loki: Use query with line filter as default for visual editor
* Refactor based on feedback
* fix background for query text row
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
* Performance: Create separate div for portal root to limit reflow -> recalc style
* refactoring
* NoData: Use field config No value option as text when display no data message
* Use PanelDataErrorView in TabelPanel
* Add PanelDataErrorView to PieChart
* Updated
* Add endpoint for migration
* Check for createdAt
* Query history: Remove returning of dtos
* Query history: Fix CreatedAt
* Refactor based on suggestions
* Insert into table in batches
* OK notifications using previous evaluation data
* copy rule.EvalMatches to avoid changes to the underlying array
* test cases added/modified
* delete trailing newline
* fix double newline in go import
* add change to the changelog
* specify that this only affects legacy alerting (changelog)
* use current eval data instead of prev eval data
* create evalMatch just once
* code comments, renamings, getTemplateMatches() function
* changelog and docs updated
* refactoring: saml docs
* refactoring: relreferences
* adding error as presented in issue
* refactor: update sentence
* refactor: more relref fixes that was missing
* refactor: more relref fixes that was missing
* Apply suggestions from code review
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* refactor: move saml with okta
* fix: spell and small corrections
* add: enterprise tag
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* forbid setting role higher than user's role
* change response code
* can assign API key permissions to non-admin users
* add: assign viewer role directly upon creation
* refactor: add AddSATcommand infavor of AddAPIkey
* refactor: frontend fixes for ServiceAccountToken
Co-authored-by: eleijonmarck <eric.leijonmarck@gmail.com>
* Add permission check to the find route, add query not accessible warning for the view page
* Hide grafana or mimir rule buttons depending on user's permissions
* Add grafana and cloud read rules checking on the alert rules list view
* Improve missing data source handling, refactor edit and remove permissions handling
* Add tests for rule edit permissions
* PR feedback
* Explore: no data message
display no data text when query executed succesfully but no data was
returned
* Explore: 'no-data' display logic and styling fix
* pipeline trigger
* Revert "pipeline trigger"
This reverts commit f08d246ba767e66344ad252577523f391832ec18.
* Add more parameters for when to show no data
* Change check to use frame length
Co-authored-by: Kristina Durivage <kristina.durivage@grafana.com>
* Load Rich History when the container is opened
* Store rich history for each pane separately
* Do not update currently opened query history when an item is added
It's impossible to figure out if the item should be added or not, because filters are applied in the backend. We don't want to replicate that filtering logic in frontend. One way to make it work could be by refreshing both panes.
* Test starring and deleting query history items when both panes are open
* Remove e2e dependency on ExploreId
* Fix unit test
* Assert exact queries
* Simplify test
* Fix e2e tests
* Fix toolbar a11y
* Reload the history after an item is added
* Fix unit test
* Remove references to Explore from generic PageToolbar component
* Update test name
* Fix test assertion
* Add issue item to TODO
* Improve test assertion
* Simplify test setup
* Move query history settings to persistence layer
* Fix test import
* Fix unit test
* Fix unit test
* Test local storage settings API
* Code formatting
* Fix linting errors
* Add an integration test
* Add missing aria role
* Fix a11y issues
* Fix a11y issues
* Use divs instead of ul/li
Otherwis,e pa11y-ci reports the error below claiming there are no children with role=tab:
Certain ARIA roles must contain particular children
(https://dequeuniversity.com/rules/axe/4.3/aria-required-children?application=axeAPI)
(#reactRoot > div > main > div:nth-child(3) > div > div:nth-child(1) > div >
div:nth-child(1) > div > div > nav > div:nth-child(2) > ul)
<ul class="css-af3vye" role="tablist"><li class="css-1ciwanz"><a href...</ul>
* Clean up settings tab
* Remove redundant aria label
* Remove redundant container
* Clean up test assertions
* Move count_values from function to aggregation
* Fix typos
* Fix loki operations
* Fix error that change the aggregation variant on blur
* Fix loki ops
* Nav: Show overlay icons based on allowed list
* user essentials mob! 🔱
* Navigation: clean up and use new backend prop to show plus icons and
improve visual styling
* Nav: Fix top padding
* refactor to not use showIconInNavbar in NavBarMenuItem
* remove a missed bit
* refactor icon into const
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
* Select: Expose AsyncSelectProps interface
* DashboardPicker: Add a generic DashboardPicker component
* Dashboard Service: improve types
* Explore: allow saving explore state in a new panel in an existing dashboard
* Handle saving provisioned dashboards error
* Improve test coverage
* simplify test setup
* Strip base path from url when redirecting to a dashboard
* Keep existing variables when saving to an existing dashboard
* group assertions in test
* SearchCard: handle undefined in meta.updated
* Change required error message
* Add to dashboard alternative
* Add to existing is working
* Add to dashboard form
* remove default add-panel when creating a dashboard from explore
* types cleanup
* remove unneeded BE change
* simplify selector
* Add explore2Dashboard feature toggle
* add tests
* Small refactor & add tests
* small DashboardPicker improvements
* use partial from lodash
* Better error handling
* improve tests & disable button when there are no queries
* rename addPanelToDashboard function
* remove localStorage item if opening tab fails
* UI touchups & tracking
* Fix tests & remove close reporting
* remove echologger debug
* fix adding a panel to an existing dashboard
* Enable explore2Dashboard by default and add docs
* Ensure each panel in dashboards has a valid ID
* force CI restart
Co-authored-by: Elfo404 <me@giordanoricci.com>
* AccessControl: Make the built-in role definitions public
* Add context to RegisterFixedRoles
Co-authored-by: Jguer <joao.guerreiro@grafana.com>
* Making BuiltInRolesWithParents public to the AccessControl package
Co-authored-by: Jguer <joao.guerreiro@grafana.com>
Co-authored-by: Jguer <joao.guerreiro@grafana.com>
* Explore/Logs: Clarify phrasing of newline escape fix tooltip
Rewrite the tooltip for the smart feature in PR #31352 that
replaces incorrectly escaped newlines in log lines.
- Clarify the functionality of the feature to emphasize its
interactivity.
- Remove language suggesting that the feature is experimental,
when we intended to suggest reviewing the results manually for
correctness.
* Docs: Document escape newlines feature
Describe and provide steps for using the "Escape newlines" feature
in Explore added in PR #31352.
* Rewrite topic lead to clarify conditional behavior
* Describe reversion of replacements as a standalone task
Reverting the replacements is a separate action, so it should have
its own task. This also describes the option's transformation and
tightens the task language.
* Remove Grafana 7 version qualifier
* Clarify escape sequence detection lede on task
Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>
* Clarify "Remove escaping" state change
Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>
* Clarify confidence of tooltip content
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
This change makes it explicit in the UI that a notification policy with no matching labels matches all alerts that it processes. There are visual changes in both the Notification Policy editor, and in the Notification Policy table where matching columns are shown.
It's valid to have a notification policy with no label matchers attached. Such a policy matches all alerts sent to it. It's a common stumbling block for users. Where are all my alerts going?
Co-authored-by: gillesdemey <gilles.de.mey@gmail.com>
* add check for access to rule's data source in GET APIs
* use more general method GetAlertRules instead of GetNamespaceAlertRules.
* remove unused GetNamespaceAlertRules.
Tests:
* create a method to generate permissions for rules
* extract method to create RuleSrv
* add tests for RouteGetNamespaceRulesConfig
* chore: remove all remaining uses of golang.org/x/net/context
This PR finishes the work started in #47532, replacing all calls to that package with the stdlib context and using http.NewRequestWithContext to include the context where necessary.
Bonus: small formatting fixes to goimports in these files.
closes#44178
* tweak: use context.Background in favor of TODO for tests
* add feature toggle with new format
* fix some comments ❤️
* Update pkg/infra/log/term/terminal_logger.go
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
* move validation at the beginning of method
* remove usage of GetOrgRuleGroups because it is not necessary. All information is already available in memory.
* remove unused method
* pass in user to attribute scope resolver
* add SQL filter to annotation listing
* check annotation FGAC permissions before exposing them for commenting
* remove the requirement to be able to list all annotations from annotation listing endpoint
* adding tests for annotation listing
* remove changes that got moved to a different PR
* unused var
* Update pkg/services/sqlstore/annotation.go
Co-authored-by: Ezequiel Victorero <evictorero@gmail.com>
* remove unneeded check
* remove unneeded check
* undo accidental change
* undo accidental change
* doc update
* move tests
* redo the approach for passing the user in for scope resolution
* accidental change
* cleanup
* error handling
Co-authored-by: Ezequiel Victorero <evictorero@gmail.com>
For a proxied request, e.g. Grafana's datasource or plugin proxy:
If the request is cancelled, e.g. from the browser, the HTTP status code is
now 499 Client closed request instead of 502 Bad gateway.
If the request times out, e.g. takes longer time than allowed, the HTTP status
code is now 504 Gateway timeout instead of 502 Bad gateway.
This also means that request metrics and logs will get their status codes
adjusted according to above.
Fixes#46337Fixes#46338
* wip: new metrics query editor
* prepend subscriptions to url path
* remove duplicated setQueryValue file
* add tests for new metrics query editor
* wip start extracting resource field into a shared component
* fix query editor test
* fix up backend tests
* move azure monitor specific getters to azure_monitor_datasource
* use existing useAsyncState hook
* extract useAsyncState into separate file
* add datahooks tests
* extract resource field component
* cleanup
* clarify variable names
* remove logs query specific resource field component
* add url_builder test
* add azure_monitor_datasources tests
* address comments
* add types
* pass resourceUri to resource field component
* add test to check we reset the query fields when changing resources
* Remove specific stats from usage stats service
* Create statscollector service
* refactor
* Update and move tests
Mostly equivalent tests to before, but they've been divided over the two
services and removed the behavior driven legacy from GoConvey to
reduce the complexity of the tests.
* Collect featuremgmr metrics (copied over from #47407)
I removed the metrics registration from the feature manager in the merge
and re-add them in this commit. Separated to make things easier to
review.
* Apply FGAC on the alert rules list page
* Add tests for edit, delete and silence buttons
* Unify access-control helpers
* Fix import
* Add route permissions for alert groups, unify access control helpers
* Improve buttons with data source explore permission
* Fix test
* loki: use single dataframe-format for both live and normal queries
* better comment
* better function-name
* simplified code
* logs_model: added test
This test of silence cleanup was flaky because of its use of real wall
time. In CI environments with slow execution, delays could cause the
test to fail. This change mitigates the problem by increasing the end time of
silences in the test.
After Prometheus merges this PR: https://github.com/prometheus/alertmanager/pull/2867
we can make the test fully deterministic by using a fake clock.
Fixes#47470
Signed-off-by: Joe Blubaugh <joe.blubaugh@grafana.com>
* Alerting: Introduce an internal changelog
Please note that this is not intented to replace Grafana's "add to changelog" label. It is _mostly_ for internal consumption of the Alerting team that owns this part of Grafana.
* Fix markdown formatting
* Fix changelog entry
* DOCS: Update Query variable section
Add that the terms query expects a keyword field type. Updated the field names to remove the @ symbol that could mislead a user into thinking that is part of the query. I left one query example using the field name only and one using the fieldname.keyword syntax. Both are valid depending on the field mapping in the index.
* Update docs/sources/datasources/elasticsearch.md
Co-authored-by: Giordano Ricci <me@giordanoricci.com>
* Update docs/sources/datasources/elasticsearch.md
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
* Update docs/sources/datasources/elasticsearch.md
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
Co-authored-by: Giordano Ricci <me@giordanoricci.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
* add FGAC actions for silences table
* redirect users without permissions
* add permissions checks to routes
* add fgac to notifications and contact points
* fgac for notification policies
* fix mute timing authorization
* use consistent naming for checking grafana alertmanager
* tests for fgac in contact points and notification policies
* bump up timeout on rule editor test
* use new permissions util
* break out route evaluation into util
* Remove test timeout
* Change permissions for the alert-notifiers endpoint
* Use signed in handler for alert-notifiers when unified alerting enabled
Co-authored-by: Konrad Lalik <konrad.lalik@grafana.com>
* navigation: implement proper mobile menu
* Update public/app/core/components/NavBar/Next/NavBarMenu.tsx
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
* animation feedback
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
And $__interval_ms too
These docs were added in PR #13148 over 3 years ago, but since then the
content has moved without the links being updated to match.
2022-04-06 08:54:31 -04:00
5634 changed files with 236518 additions and 90326 deletions
description:Create an issue for delivering wireframes, mockups or other design solutions.
title:"UX: "
labels:["type/ux"]
body:
- type:textarea
id:background
attributes:
label:"Background / Why we're doing this"
description:Describe the problem and background of the issue. This could include research insights that inform the design changes, unmet user needs, or other usability issues.
placeholder:Add UI improvements to make Grafana Alerting alert creation easier based on usability test results.
validations:
required:true
- type:dropdown
attributes:
label:Is there existing research for this?
description:Please link research results or insights in the Background section if you have any. If no research was conducted, you might want to consider usability testing your design later.
options:[
"Yes, I have linked it",
"No research yet"
]
validations:
required:true
- type:textarea
id:problems-or-tasks
attributes:
label:Problems or tasks
description:Describe problems the new design should solve or tasks the user needs to complete.
placeholder:
value:|
- A problem we're trying to solve
- A task the user needs to accomplish
- …
validations:
required:false
- type:textarea
attributes:
label:Deliverables
description:Add a checklist of deliverables here. You can later add links to each deliverable.
- **Access Control:** Allow org admins to invite new users to their organization. [#52904](https://github.com/grafana/grafana/pull/52904), [@IevaVasiljeva](https://github.com/IevaVasiljeva)
### Bug fixes
- **Grafana/toolkit:** Fix incorrect image and font generation for plugin builds. [#52927](https://github.com/grafana/grafana/pull/52927), [@academo](https://github.com/academo)
- **Prometheus:** Fix adding of multiple values for regex operator. [#52978](https://github.com/grafana/grafana/pull/52978), [@ivanahuckova](https://github.com/ivanahuckova)
- **Access control:** Show dashboard settings to users who can edit dashboard. [#52535](https://github.com/grafana/grafana/pull/52535), [@grafanabot](https://github.com/grafanabot)
- **Alerting:** Allow the webhook notifier to support a custom Authorization header. [#52515](https://github.com/grafana/grafana/pull/52515), [@gotjosh](https://github.com/gotjosh)
- **Chore:** Upgrade to Go version 1.17.12. [#52523](https://github.com/grafana/grafana/pull/52523), [@sakjur](https://github.com/sakjur)
- **Prometheus:** Don't show errors from unsuccessful API checks like rules or exemplar checks. [#52193](https://github.com/grafana/grafana/pull/52193), [@darrenjaneczek](https://github.com/darrenjaneczek)
### Bug fixes
- **Access control:** Allow organisation admins to add existing users to org (#51668). [#52553](https://github.com/grafana/grafana/pull/52553), [@vtorosyan](https://github.com/vtorosyan)
- **Apps:** Fixes navigation between different app plugin pages. [#52571](https://github.com/grafana/grafana/pull/52571), [@torkelo](https://github.com/torkelo)
- **Cloudwatch:** Upgrade grafana-aws-sdk to fix auth issue with secret keys. [#52420](https://github.com/grafana/grafana/pull/52420), [@sarahzinger](https://github.com/sarahzinger)
- **Grafana/toolkit:** Fix incorrect image and font generation for plugin builds. [#52661](https://github.com/grafana/grafana/pull/52661), [@academo](https://github.com/academo)
- **Loki:** Fix `show context` not working in some occasions. [#52458](https://github.com/grafana/grafana/pull/52458), [@svennergr](https://github.com/svennergr)
- **RBAC:** Fix permissions on dashboards and folders created by anonymous users. [#52615](https://github.com/grafana/grafana/pull/52615), [@gamab](https://github.com/gamab)
<!-- 9.0.5 END -->
<!-- 9.0.4 START -->
# 9.0.4 (2022-07-20)
### Features and enhancements
- **Browse/Search:** Make browser back work properly when visiting Browse or search. [#52271](https://github.com/grafana/grafana/pull/52271), [@torkelo](https://github.com/torkelo)
- **Loki:** Improve handling of empty responses. [#52397](https://github.com/grafana/grafana/pull/52397), [@gabor](https://github.com/gabor)
- **Plugins:** Always validate root URL if specified in signature manfiest. [#52332](https://github.com/grafana/grafana/pull/52332), [@wbrowne](https://github.com/wbrowne)
- **Preferences:** Get home dashboard from teams. [#52225](https://github.com/grafana/grafana/pull/52225), [@sakjur](https://github.com/sakjur)
- **SQLStore:** Support Upserting multiple rows. [#52228](https://github.com/grafana/grafana/pull/52228), [@joeblubaugh](https://github.com/joeblubaugh)
- **Traces:** Add more template variables in Tempo & Zipkin. [#52306](https://github.com/grafana/grafana/pull/52306), [@joey-grafana](https://github.com/joey-grafana)
- **Alerting:** Preserve new-lines from custom email templates in rendered email. [#52253](https://github.com/grafana/grafana/pull/52253), [@alexweav](https://github.com/alexweav)
- **Insights:** Fix dashboard and data source insights pages. (Enterprise)
- **Log:** Fix text logging for unsupported types. [#51306](https://github.com/grafana/grafana/pull/51306), [@papagian](https://github.com/papagian)
- **Loki:** Fix incorrect TopK value type in query builder. [#52226](https://github.com/grafana/grafana/pull/52226), [@ivanahuckova](https://github.com/ivanahuckova)
- **Access control:** Allow organisation admins to add existing users to org. [#51668](https://github.com/grafana/grafana/pull/51668), [@IevaVasiljeva](https://github.com/IevaVasiljeva)
- **Alerting:** Add method to provisioning API for obtaining a group and its rules. [#51761](https://github.com/grafana/grafana/pull/51761), [@alexweav](https://github.com/alexweav)
- **Alerting:** Add method to provisioning API for obtaining a group and its rules. [#51398](https://github.com/grafana/grafana/pull/51398), [@alexweav](https://github.com/alexweav)
- **Alerting:** Allow filtering of contact points by name. [#51933](https://github.com/grafana/grafana/pull/51933), [@alexweav](https://github.com/alexweav)
- **Alerting:** Disable /api/admin/pause-all-alerts with Unified Alerting. [#51895](https://github.com/grafana/grafana/pull/51895), [@joeblubaugh](https://github.com/joeblubaugh)
- **Analytics:** Add total queries and cached queries in usage insights logs. (Enterprise)
- **Annotations:** Use point marker for short time range annotations. [#51520](https://github.com/grafana/grafana/pull/51520), [@codeincarnate](https://github.com/codeincarnate)
- **AzureMonitor:** Update UI to experimental package. [#52123](https://github.com/grafana/grafana/pull/52123), [@asimpson](https://github.com/asimpson)
- **AzureMonitor:** Update resource and namespace metadata. [#52030](https://github.com/grafana/grafana/pull/52030), [@despian](https://github.com/despian)
- **CloudWatch:** Remove simplejson in favor of 'encoding/json'. [#51062](https://github.com/grafana/grafana/pull/51062), [@asimpson](https://github.com/asimpson)
- **DashboardRow:** Collapse shortcut prevent to move the collapsed rows. [#51589](https://github.com/grafana/grafana/pull/51589), [@ivanortegaalba](https://github.com/ivanortegaalba)
- **Insights:** Add dashboard UID to exported logs. (Enterprise)
- **Navigation:** Highlight active nav item when Grafana is served from subpath. [#51767](https://github.com/grafana/grafana/pull/51767), [@kianelbo](https://github.com/kianelbo)
- **Plugins:** InfluxDB datasource - set epoch query param value as "ms". [#51651](https://github.com/grafana/grafana/pull/51651), [@itsmylife](https://github.com/itsmylife)
- **Plugins:** InfluxDB update time range query. [#51833](https://github.com/grafana/grafana/pull/51833), [@itsmylife](https://github.com/itsmylife)
- **StateTimeline:** Try to sort time field. [#51569](https://github.com/grafana/grafana/pull/51569), [@zoltanbedi](https://github.com/zoltanbedi)
### Bug fixes
- **API:** Do not validate/save legacy alerts when saving a dashboard if legacy alerting is disabled. [#51883](https://github.com/grafana/grafana/pull/51883), [@papagian](https://github.com/papagian)
- **Alerting:** Add method to reset notification policy tree back to the default. [#51934](https://github.com/grafana/grafana/pull/51934), [@alexweav](https://github.com/alexweav)
- **Alerting:** Fix Teams notifier not failing on 200 response with error. [#52254](https://github.com/grafana/grafana/pull/52254), [@JacobsonMT](https://github.com/JacobsonMT)
- **Alerting:** Fix bug where state did not change between Alerting and Error. [#52204](https://github.com/grafana/grafana/pull/52204), [@grobinson-grafana](https://github.com/grobinson-grafana)
- **Alerting:** Fix consistency errors in OpenAPI documentation. [#51935](https://github.com/grafana/grafana/pull/51935), [@alexweav](https://github.com/alexweav)
- **Alerting:** Fix normalization of alert states for panel annotations. [#51637](https://github.com/grafana/grafana/pull/51637), [@gillesdemey](https://github.com/gillesdemey)
- **Alerting:** Provisioning API respects global rule quota. [#52180](https://github.com/grafana/grafana/pull/52180), [@alexweav](https://github.com/alexweav)
- **Loki:** Fix error when changing operations with different parameters. [#51779](https://github.com/grafana/grafana/pull/51779), [@svennergr](https://github.com/svennergr)
- **Loki:** Fix suggesting of correct operations in query builder. [#52034](https://github.com/grafana/grafana/pull/52034), [@ivanahuckova](https://github.com/ivanahuckova)
- **SQLstore:** Fix fetching an inexistent playlist. [#51962](https://github.com/grafana/grafana/pull/51962), [@papagian](https://github.com/papagian)
- **Security:** Fixes for CVE-2022-31107 and CVE-2022-31097. [#52279](https://github.com/grafana/grafana/pull/52279), [@kminehart](https://github.com/kminehart)
- **Snapshots:** Fix deleting external snapshots when using RBAC. [#51897](https://github.com/grafana/grafana/pull/51897), [@idafurjes](https://github.com/idafurjes)
- **Table:** Fix scrollbar being hidden by pagination. [#51501](https://github.com/grafana/grafana/pull/51501), [@zoltanbedi](https://github.com/zoltanbedi)
- **Templating:** Changing between variables with the same name now correctly triggers a dashboard refresh. [#51490](https://github.com/grafana/grafana/pull/51490), [@ashharrison90](https://github.com/ashharrison90)
- **Time series panel:** Fix an issue with stacks being not complete due to the incorrect data frame length. [#51910](https://github.com/grafana/grafana/pull/51910), [@dprokop](https://github.com/dprokop)
- **[v9.0.x] Snapshots:** Fix deleting external snapshots when using RBAC (#51897). [#51904](https://github.com/grafana/grafana/pull/51904), [@idafurjes](https://github.com/idafurjes)
<!-- 9.0.3 END -->
<!-- 9.0.2 START -->
# 9.0.2 (2022-06-28)
### Features and enhancements
- **Alerting:** Add support for images in Pushover alerts. [#51372](https://github.com/grafana/grafana/pull/51372), [@grobinson-grafana](https://github.com/grobinson-grafana)
- **Alerting:** Don't stop the migration when alert rule tags are invalid. [#51253](https://github.com/grafana/grafana/pull/51253), [@gotjosh](https://github.com/gotjosh)
- **Alerting:** Don't stop the migration when alert rule tags are invalid (…. [#51341](https://github.com/grafana/grafana/pull/51341), [@gotjosh](https://github.com/gotjosh)
- **Alerting:** Skip the default data source if incompatible. [#51452](https://github.com/grafana/grafana/pull/51452), [@gillesdemey](https://github.com/gillesdemey)
- **AzureMonitor:** Parse non-fatal errors for Logs. [#51320](https://github.com/grafana/grafana/pull/51320), [@andresmgot](https://github.com/andresmgot)
- **Plugins:** Improved handling of symlinks. [#51324](https://github.com/grafana/grafana/pull/51324), [@marefr](https://github.com/marefr)
### Bug fixes
- **Alerting:** Code-gen parsing of URL parameters and fix related bugs. [#51353](https://github.com/grafana/grafana/pull/51353), [@alexweav](https://github.com/alexweav)
- **Alerting:** Code-gen parsing of URL parameters and fix related bugs. [#50731](https://github.com/grafana/grafana/pull/50731), [@alexweav](https://github.com/alexweav)
- **Dashboards:** Fixes issue with the initial panel layout counting as an unsaved change. [#51315](https://github.com/grafana/grafana/pull/51315), [@JoaoSilvaGrafana](https://github.com/JoaoSilvaGrafana)
- **Plugins:** Use a Grafana specific SDK logger implementation for core plugins. [#51229](https://github.com/grafana/grafana/pull/51229), [@marefr](https://github.com/marefr)
- **Search:** Fix pagination in the new search page. [#51366](https://github.com/grafana/grafana/pull/51366), [@ArturWierzbicki](https://github.com/ArturWierzbicki)
<!-- 9.0.2 END -->
<!-- 9.0.1 START -->
# 9.0.1 (2022-06-21)
### Features and enhancements
- **Alerting:** Add support for image annotation in Alertmanager alerts. [#50686](https://github.com/grafana/grafana/pull/50686), [@grobinson-grafana](https://github.com/grobinson-grafana)
- **Alerting:** Add support for images in SensuGo alerts. [#50718](https://github.com/grafana/grafana/pull/50718), [@grobinson-grafana](https://github.com/grobinson-grafana)
- **Alerting:** Add support for images in Threema alerts. [#50734](https://github.com/grafana/grafana/pull/50734), [@grobinson-grafana](https://github.com/grobinson-grafana)
- **Alerting:** Adds Mimir to Alertmanager data source implementation. [#50943](https://github.com/grafana/grafana/pull/50943), [@gillesdemey](https://github.com/gillesdemey)
- **Alerting:** Invalid setting of enabled for unified alerting should return error. [#49876](https://github.com/grafana/grafana/pull/49876), [@grobinson-grafana](https://github.com/grobinson-grafana)
- **AzureMonitor:** Clean namespace when changing the resource. [#50311](https://github.com/grafana/grafana/pull/50311), [@andresmgot](https://github.com/andresmgot)
- **AzureMonitor:** Update supported namespaces and filter resources by the right type. [#50788](https://github.com/grafana/grafana/pull/50788), [@andresmgot](https://github.com/andresmgot)
- **CLI:** Allow relative symlinks in zip archives when installing plugins. [#50537](https://github.com/grafana/grafana/pull/50537), [@marefr](https://github.com/marefr)
- **Dashboard:** Don't show unsaved changes modal for automatic schema changes. [#50822](https://github.com/grafana/grafana/pull/50822), [@torkelo](https://github.com/torkelo)
- **Dashboard:** Unsaved changes warning should not trigger when only pluginVersion has changed. [#50677](https://github.com/grafana/grafana/pull/50677), [@torkelo](https://github.com/torkelo)
- **Geomap:** Support showing tooltip content on click (not just hover). [#50985](https://github.com/grafana/grafana/pull/50985), [@ryantxu](https://github.com/ryantxu)
- **Heatmap:** Remove alpha flag from new heatmap panel. [#50733](https://github.com/grafana/grafana/pull/50733), [@ryantxu](https://github.com/ryantxu)
- **Instrumentation:** Define handlers for requests that are not handled with named handlers. [#50613](https://github.com/grafana/grafana/pull/50613), [@bergquist](https://github.com/bergquist)
- **Logs:** Handle backend-mode errors in histogram. [#50535](https://github.com/grafana/grafana/pull/50535), [@gabor](https://github.com/gabor)
- **Loki:** Do not show histogram for instant queries. [#50711](https://github.com/grafana/grafana/pull/50711), [@gabor](https://github.com/gabor)
- **Loki:** Handle data source configs with path in the url. [#50971](https://github.com/grafana/grafana/pull/50971), [@gabor](https://github.com/gabor)
- **Loki:** Handle invalid query type values. [#50755](https://github.com/grafana/grafana/pull/50755), [@gabor](https://github.com/gabor)
- **OAuth:** Redirect to login if no oauth module is found or if module is not configured. [#50661](https://github.com/grafana/grafana/pull/50661), [@kalleep](https://github.com/kalleep)
- **OptionsUI:** Move internal options editors out of @grafana/ui. [#50739](https://github.com/grafana/grafana/pull/50739), [@ryantxu](https://github.com/ryantxu)
- **Prometheus:** Don't show undefined for step in collapsed options in query editor when value is "auto". [#50511](https://github.com/grafana/grafana/pull/50511), [@aocenas](https://github.com/aocenas)
- **Prometheus:** Show query patterns in all editor modes for Prometheus and Loki. [#50263](https://github.com/grafana/grafana/pull/50263), [@ivanahuckova](https://github.com/ivanahuckova)
- **Tempo:** Add link to Tempo Search with node service selected. [#49776](https://github.com/grafana/grafana/pull/49776), [@joey-grafana](https://github.com/joey-grafana)
- **Time Series Panel:** Add Null Filling and "No Value" Support. [#50907](https://github.com/grafana/grafana/pull/50907), [@codeincarnate](https://github.com/codeincarnate)
- **TimeSeries:** Add an option to set legend width. [#49126](https://github.com/grafana/grafana/pull/49126), [@bobrik](https://github.com/bobrik)
- **Timeseries:** Improve cursor Y sync behavior. [#50740](https://github.com/grafana/grafana/pull/50740), [@ryantxu](https://github.com/ryantxu)
- **Traces:** Do not use red in span colors as this looks like an error. [#50074](https://github.com/grafana/grafana/pull/50074), [@joey-grafana](https://github.com/joey-grafana)
### Bug fixes
- **Alerting:** Fix AM config overwrite when SQLite db is locked during sync. [#50951](https://github.com/grafana/grafana/pull/50951), [@JacobsonMT](https://github.com/JacobsonMT)
- **Alerting:** Fix removal of notification policy without labels matchers. [#50678](https://github.com/grafana/grafana/pull/50678), [@konrad147](https://github.com/konrad147)
- **CloudWatch:** Allow hidden queries to be executed in case an ID is provided. [#50987](https://github.com/grafana/grafana/pull/50987), [@sunker](https://github.com/sunker)
- **Dashboard:** Prevent non-repeating panels being dropped from repeated rows when collapsed/expanded. [#50764](https://github.com/grafana/grafana/pull/50764), [@ashharrison90](https://github.com/ashharrison90)
- **Dashboards:** Fix folder picker not showing correct results when typing too fast. [#50303](https://github.com/grafana/grafana/pull/50303), [@joshhunt](https://github.com/joshhunt)
- **Datasource:** Prevent panic when proxying for non-existing data source. [#50667](https://github.com/grafana/grafana/pull/50667), [@wbrowne](https://github.com/wbrowne)
- **Explore:** Fix log context scroll to bottom. [#50600](https://github.com/grafana/grafana/pull/50600), [@ivanahuckova](https://github.com/ivanahuckova)
- **Explore:** Revert "Remove support for compact format URLs (#49350)". [#50873](https://github.com/grafana/grafana/pull/50873), [@gelicia](https://github.com/gelicia)
- **Expressions:** Fixes dashboard schema migration issue that casued Expression datasource to be set on panel level. [#50945](https://github.com/grafana/grafana/pull/50945), [@torkelo](https://github.com/torkelo)
- **Formatting:** Fixes valueFormats for a value of 0. [#50719](https://github.com/grafana/grafana/pull/50719), [@JoaoSilvaGrafana](https://github.com/JoaoSilvaGrafana)
- **GrafanaData:** Fix week start for non-English browsers. [#50582](https://github.com/grafana/grafana/pull/50582), [@AgnesToulet](https://github.com/AgnesToulet)
- **LibraryPanel:** Resizing a library panel to 6x3 no longer crashes the dashboard on startup. [#50400](https://github.com/grafana/grafana/pull/50400), [@ashharrison90](https://github.com/ashharrison90)
- **LogRow:** Fix placement of icon. [#51010](https://github.com/grafana/grafana/pull/51010), [@ivanahuckova](https://github.com/ivanahuckova)
- **Loki:** Fix bug in labels framing. [#51015](https://github.com/grafana/grafana/pull/51015), [@gabor](https://github.com/gabor)
- **Loki:** Fix issues with using query patterns. [#50414](https://github.com/grafana/grafana/pull/50414), [@ivanahuckova](https://github.com/ivanahuckova)
- **Loki:** Fix showing of duplicated label values in dropdown in query builder. [#50680](https://github.com/grafana/grafana/pull/50680), [@ivanahuckova](https://github.com/ivanahuckova)
- **Panels:** Fixes issue with showing 'Cannot visualize data' when query returned 0 rows. [#50485](https://github.com/grafana/grafana/pull/50485), [@torkelo](https://github.com/torkelo)
- **Playlists:** Disable Create Playlist buttons for users with viewer role. [#50840](https://github.com/grafana/grafana/pull/50840), [@asymness](https://github.com/asymness)
- **Plugins:** Fix typo in plugin data frames documentation. [#50554](https://github.com/grafana/grafana/pull/50554), [@osisoft-mbishop](https://github.com/osisoft-mbishop)
- **Prometheus:** Fix body not being included in resource calls if they are POST. [#50833](https://github.com/grafana/grafana/pull/50833), [@aocenas](https://github.com/aocenas)
- **RolePicker:** Fix submenu position on horizontal space overflow. [#50769](https://github.com/grafana/grafana/pull/50769), [@Clarity-89](https://github.com/Clarity-89)
- **Tracing:** Fix trace links in traces panel. [#50028](https://github.com/grafana/grafana/pull/50028), [@connorlindsey](https://github.com/connorlindsey)
### Deprecations
Support for compact Explore URLs is deprecated and will be removed in a future release. Until then, when navigating to Explore using the deprecated format the URLs are automatically converted. If you have existing links pointing to Explore update them using the format generated by Explore upon navigation.
You can identify a compact URL by its format. Compact URLs have the left (and optionally right) url parameter as an array of strings, for example `&left=["now-1h","now"...]`. The standard explore URLs follow a key/value pattern, for example `&left={"datasource":"test"...}`. Please be sure to check your dashboards for any hardcoded links to Explore and update them to the standard URL pattern. Issue [#50873](https://github.com/grafana/grafana/issues/50873)
<!-- 9.0.1 END -->
<!-- 9.0.0 START -->
# 9.0.0 (2022-06-10)
### Features and enhancements
- **API:** Add GET /api/annotations/:annotationId endpoint. [#47739](https://github.com/grafana/grafana/pull/47739), [@scottbock](https://github.com/scottbock)
- **API:** Add endpoint for updating a data source by its UID. [#49396](https://github.com/grafana/grafana/pull/49396), [@papagian](https://github.com/papagian)
- **AccessControl:** Add enterprise only setting for rbac permission cache. [#49006](https://github.com/grafana/grafana/pull/49006), [@kalleep](https://github.com/kalleep)
- **Alerting:** Add Image URLs to Microsoft Teams notifier. [#49385](https://github.com/grafana/grafana/pull/49385), [@joeblubaugh](https://github.com/joeblubaugh)
- **Alerting:** Add RBAC actions and role for provisioning API routes. [#50459](https://github.com/grafana/grafana/pull/50459), [@yuri-tceretian](https://github.com/yuri-tceretian)
- **Alerting:** Add Screenshot URLs to Pagerduty Notifier. [#49377](https://github.com/grafana/grafana/pull/49377), [@joeblubaugh](https://github.com/joeblubaugh)
- **Alerting:** Add a "Reason" to Alert Instances to show underlying cause of state. [#49259](https://github.com/grafana/grafana/pull/49259), [@joeblubaugh](https://github.com/joeblubaugh)
- **Alerting:** Add a general screenshot service and alerting-specific image service. [#49293](https://github.com/grafana/grafana/pull/49293), [@joeblubaugh](https://github.com/joeblubaugh)
- **Alerting:** Add image url or file attachment to email notifications. [#49381](https://github.com/grafana/grafana/pull/49381), [@joeblubaugh](https://github.com/joeblubaugh)
- **Alerting:** Add image_urls to OpsGenie notification details. [#49379](https://github.com/grafana/grafana/pull/49379), [@joeblubaugh](https://github.com/joeblubaugh)
- **Alerting:** Attach image URL to alerts in Webhook notifier format. [#49378](https://github.com/grafana/grafana/pull/49378), [@joeblubaugh](https://github.com/joeblubaugh)
- **Alerting:** Attach image URLs or upload files to Discord notifications. [#49439](https://github.com/grafana/grafana/pull/49439), [@alexweav](https://github.com/alexweav)
- **Alerting:** Attach image URLs to Google Chat notifications. [#49445](https://github.com/grafana/grafana/pull/49445), [@alexweav](https://github.com/alexweav)
- **Alerting:** Attach screenshot data to Unified Alerting notifications. [#49374](https://github.com/grafana/grafana/pull/49374), [@joeblubaugh](https://github.com/joeblubaugh)
- **Alerting:** Create folder for alerting when start from the scratch. [#48866](https://github.com/grafana/grafana/pull/48866), [@yuri-tceretian](https://github.com/yuri-tceretian)
- **Alerting:** Modify alertmanager endpoints for proxying using the datasource UID. [#47978](https://github.com/grafana/grafana/pull/47978), [@papagian](https://github.com/papagian)
- **Alerting:** Modify endpoint for testing a datasource rule using the UID. [#48070](https://github.com/grafana/grafana/pull/48070), [@papagian](https://github.com/papagian)
- **Alerting:** Modify prometheus endpoints for proxying using the datasource UID. [#48052](https://github.com/grafana/grafana/pull/48052), [@papagian](https://github.com/papagian)
- **Alerting:** State Manager takes screenshots. [#49338](https://github.com/grafana/grafana/pull/49338), [@joeblubaugh](https://github.com/joeblubaugh)
- **Alerting:** Use UID scope for folders authorization. [#48970](https://github.com/grafana/grafana/pull/48970), [@yuri-tceretian](https://github.com/yuri-tceretian)
- **Alerting:** modify ruler endpoints for proxying using the datasource UID. [#48046](https://github.com/grafana/grafana/pull/48046), [@papagian](https://github.com/papagian)
- **Angular:** Adds back two angular directives that are still used by remaining angular bits and plugins. [#50380](https://github.com/grafana/grafana/pull/50380), [@torkelo](https://github.com/torkelo)
- **AzureMonitor:** Add support for selecting multiple options when using the equals and not equals dimension filters. [#48650](https://github.com/grafana/grafana/pull/48650), [@aangelisc](https://github.com/aangelisc)
- **Chore:** Upgrade typescript to 4.6.4. [#49016](https://github.com/grafana/grafana/pull/49016), [@kaydelaney](https://github.com/kaydelaney)
- **Cloud Monitoring:** Use new annotation API. [#49026](https://github.com/grafana/grafana/pull/49026), [@kevinwcyu](https://github.com/kevinwcyu)
- **CloudMonitoring:** Allow to set a custom value or disable graph_period. [#48646](https://github.com/grafana/grafana/pull/48646), [@andresmgot](https://github.com/andresmgot)
- **CloudWatch:** Enable support for dynamic labels with migrated alias patterns. [#49173](https://github.com/grafana/grafana/pull/49173), [@sunker](https://github.com/sunker)
- **Cloudwatch:** Pass label in deep link. [#49160](https://github.com/grafana/grafana/pull/49160), [@sunker](https://github.com/sunker)
- **Cloudwatch:** Use new annotation API. [#48102](https://github.com/grafana/grafana/pull/48102), [@sunker](https://github.com/sunker)
- **Dashboard:** Validate dashboards against schema on save. [#48252](https://github.com/grafana/grafana/pull/48252), [@sdboyer](https://github.com/sdboyer)
- **DashboardPickerByID:** Add option to exclude dashboards. [#49211](https://github.com/grafana/grafana/pull/49211), [@Clarity-89](https://github.com/Clarity-89)
- **Dashboards:** Display values of 0 with the configured decimal places. [#48155](https://github.com/grafana/grafana/pull/48155), [@wx1322](https://github.com/wx1322)
- **Data:** Remove deprecated types and functions from valueMappings. [#50035](https://github.com/grafana/grafana/pull/50035), [@kaydelaney](https://github.com/kaydelaney)
- **Elasticsearch:** Remove support for versions after their end of the life (<7.10.0). [#48715](https://github.com/grafana/grafana/pull/48715), [@ivanahuckova](https://github.com/ivanahuckova)
- **Encryption:** Add support for multiple data keys per day. [#47765](https://github.com/grafana/grafana/pull/47765), [@joanlopez](https://github.com/joanlopez)
- **Encryption:** Enable envelope encryption by default. [#49301](https://github.com/grafana/grafana/pull/49301), [@joanlopez](https://github.com/joanlopez)
- **Explore:** Remove support for legacy, compact format URLs. [#49350](https://github.com/grafana/grafana/pull/49350), [@gelicia](https://github.com/gelicia)
- **Explore:** Skip Angular error handling when Angular support is disabled. [#49311](https://github.com/grafana/grafana/pull/49311), [@ifrost](https://github.com/ifrost)
- **Explore:** simplify support for multiple query editors. [#48701](https://github.com/grafana/grafana/pull/48701), [@Elfo404](https://github.com/Elfo404)
- **FeatureToggles:** Support changing feature toggles with URL parameters. [#50275](https://github.com/grafana/grafana/pull/50275), [@ryantxu](https://github.com/ryantxu)
- **FileUpload:** Make component accessible by keyboard navigation. [#47497](https://github.com/grafana/grafana/pull/47497), [@tolzhabayev](https://github.com/tolzhabayev)
- **Formatting:** Make SI number formats more robust. [#50117](https://github.com/grafana/grafana/pull/50117), [@kaydelaney](https://github.com/kaydelaney)
- **Graph:** Deprecate Graph (old) and make it no longer a visualization option for new panels. [#48034](https://github.com/grafana/grafana/pull/48034), [@torkelo](https://github.com/torkelo)
- **IconButton:** IconButtons are now correctly aligned in Safari. [#48759](https://github.com/grafana/grafana/pull/48759), [@ashharrison90](https://github.com/ashharrison90)
- **Logger:** Enable new logging format by default. [#47584](https://github.com/grafana/grafana/pull/47584), [@ying-jeanne](https://github.com/ying-jeanne)
- **Loki:** Add more query patterns. [#50248](https://github.com/grafana/grafana/pull/50248), [@ivanahuckova](https://github.com/ivanahuckova)
- **Loki:** Enable new visual query builder by default. [#48346](https://github.com/grafana/grafana/pull/48346), [@ivanahuckova](https://github.com/ivanahuckova)
- **Loki:** use the same dataframe-format for both live and normal queries. [#47153](https://github.com/grafana/grafana/pull/47153), [@gabor](https://github.com/gabor)
- **OAuth:** Make allowed email domain case insensitive. [#49252](https://github.com/grafana/grafana/pull/49252), [@Jguer](https://github.com/Jguer)
- **Panels:** Use the No value option when showing the no data message. [#47675](https://github.com/grafana/grafana/pull/47675), [@torkelo](https://github.com/torkelo)
- **Plugins:** Remove plugin list panel. [#46914](https://github.com/grafana/grafana/pull/46914), [@tolzhabayev](https://github.com/tolzhabayev)
- **Query History:** Enable new query history by default. [#49407](https://github.com/grafana/grafana/pull/49407), [@ifrost](https://github.com/ifrost)
- **QueryEditorRow:** Show query errors next to query in a consistent way across Grafana. [#47613](https://github.com/grafana/grafana/pull/47613), [@torkelo](https://github.com/torkelo)
- **SAML:** Implement Name Templates for assertion_attribute_name option. [#48022](https://github.com/grafana/grafana/pull/48022), [@mmandrus](https://github.com/mmandrus)
- **Service accounts:** Do not display service accounts assigned to team. [#48995](https://github.com/grafana/grafana/pull/48995), [@eleijonmarck](https://github.com/eleijonmarck)
- **Settings:** Use Grafana Azure SDK to pass Azure env vars for external plugins. [#48954](https://github.com/grafana/grafana/pull/48954), [@kostrse](https://github.com/kostrse)
- **Shortcuts:** Add shortcut to show shortcuts to the list of shortcuts. [#48395](https://github.com/grafana/grafana/pull/48395), [@ivanahuckova](https://github.com/ivanahuckova)
- **Traces Panel:** Add new Traces Panel visualization. [#47534](https://github.com/grafana/grafana/pull/47534), [@joey-grafana](https://github.com/joey-grafana)
- **Traces:** Filter by service/span name and operation in Tempo and Jaeger. [#48209](https://github.com/grafana/grafana/pull/48209), [@joey-grafana](https://github.com/joey-grafana)
- **Transformations:** Allow more complex regex expressions in `Rename by regex`. [#48179](https://github.com/grafana/grafana/pull/48179), [@ashharrison90](https://github.com/ashharrison90)
- **grafana/ui:** Add default type="button" to <Button>. [#48183](https://github.com/grafana/grafana/pull/48183), [@axelavargas](https://github.com/axelavargas)
- **AzureMonitor:** Fix auto-selection of time-grain for metrics. [#49278](https://github.com/grafana/grafana/pull/49278), [@aangelisc](https://github.com/aangelisc)
- **DataSources:** Fixes issue with expressions not being queried. [#50446](https://github.com/grafana/grafana/pull/50446), [@JoaoSilvaGrafana](https://github.com/JoaoSilvaGrafana)
- **GraphNG:** Fix thresholds by color not following data update. [#48571](https://github.com/grafana/grafana/pull/48571), [@zoltanbedi](https://github.com/zoltanbedi)
- **Login:** Fix mismatching label on auth_module in user list. [#49177](https://github.com/grafana/grafana/pull/49177), [@Jguer](https://github.com/Jguer)
- **Playlists:** Save button now correctly creates a new playlist. [#50381](https://github.com/grafana/grafana/pull/50381), [@ashharrison90](https://github.com/ashharrison90)
- **RBAC:** Fix migrations running in the wrong order causing inheritance problem in enterprise. [#50452](https://github.com/grafana/grafana/pull/50452), [@gamab](https://github.com/gamab)
- **RBAC:** Fix migrations running into the wrong order. (Enterprise)
- **ServiceAccounts:** Add identifiable token prefix to service account tokens. [#49011](https://github.com/grafana/grafana/pull/49011), [@Jguer](https://github.com/Jguer)
- **Traces:** Fix missing CopyButton on KeyValueTables and overlapping of panels. [#49271](https://github.com/grafana/grafana/pull/49271), [@svennergr](https://github.com/svennergr)
### Breaking changes
The `@grafana/ui` package helper function `selectOptionInTest` used in frontend tests has been removed as it caused testing libraries to be bundled in the production code of Grafana. If you were using this helper function in your tests please update your code accordingly:
Removed deprecated `checkHealth` prop from the `@grafana/e2e``addDataSource` config. Previously this value defaulted to `false`, and has not been used in end-to-end tests since Grafana 8.0.3. Issue [#50296](https://github.com/grafana/grafana/issues/50296)
Removes the deprecated `LegacyBaseMap`, `LegacyValueMapping`, `LegacyValueMap`, and `LegacyRangeMap` types, and `getMappedValue` function from grafana-data. Migration is as follows:
This change fixes a bug in Grafana where intermittent failure of database, network between Grafana and the database, or error in querying the database would cause all alert rules to be unscheduled in Grafana. Following this change scheduled alert rules are not updated unless the query is successful.
The `get_alert_rules_duration_seconds` metric has been renamed to `schedule_query_alert_rules_duration_seconds`. Issue [#49874](https://github.com/grafana/grafana/issues/49874)
- Any secret (data sources credential, alert manager credential, etc, etc) created or modified with Grafana v9.0 won't be decryptable from any previous version (by default) because the way encrypted secrets are stored into the database has changed. Although secrets created or modified with previous versions will still be decryptable by Grafana v9.0.
- If required, although generally discouraged, the `disableEnvelopeEncryption` feature toggle can be enabled to keep envelope encryption disabled once updating to Grafana v9.0.
- In case of need to rollback to an earlier version of Grafana (i.e. Grafana v8.x) for any reason, after being created or modified any secret with Grafana v9.0, the `envelopeEncryption` feature toggle will need to be enabled to keep backwards compatibility (only from `v8.3.x` a bit unstable, from `8.5.x` stable).
- As a final attempt to deal with issues related with the aforementioned situations, the `grafana-cli admin secrets-migration rollback` command has been designed to move back all the Grafana secrets encrypted with envelope encryption to legacy encryption. So, after running that command it should be safe to disable envelope encryption and/or roll back to a previous version of Grafana.
- Alternatively or complementarily to all the points above, backing up the Grafana database before updating could be a good idea to prevent disasters (although the risk of getting some secrets corrupted only applies to those updates/created with after updating to Grafana v9.0). Issue [#49301](https://github.com/grafana/grafana/issues/49301)
- According to the dynamic labels documentation, you can use up to five dynamic values per label. There’s currently no such restriction in the alias pattern system, so if more than 5 patterns are being used the GetMetricData API will return an error.
- Dynamic labels only allow ${LABEL} to be used once per query. There’s no such restriction in the alias pattern system, so in case more than 1 is being used the GetMetricData API will return an error.
- When no alias is provided by the user, Grafana will no longer fallback with custom rules for naming the legend.
- In case a search expression is being used and no data is returned, Grafana will no longer expand dimension values, for instance when using a multi-valued template variable or star wildcard `*` in the dimension value field. Ref https://github.com/grafana/grafana/issues/20729
- Time series might be displayed in a different order. Using for example the dynamic label `${PROP('MetricName')}`, might have the consequence that the time series are returned in a different order compared to when the alias pattern `{{metric}}` is used
In Elasticsearch, browser access mode was deprecated in grafana 7.4.0 and removed in 9.0.0. If you used this mode, please switch to server access mode on the datasource configuration page. Issue [#49014](https://github.com/grafana/grafana/issues/49014)
Environment variables passed from Grafana to external Azure plugins have been renamed:
-`AZURE_CLOUD` renamed to `GFAZPL_AZURE_CLOUD`
-`AZURE_MANAGED_IDENTITY_ENABLED` renamed to `GFAZPL_MANAGED_IDENTITY_ENABLED`
-`AZURE_MANAGED_IDENTITY_CLIENT_ID` renamed to `GFAZPL_MANAGED_IDENTITY_CLIENT_ID`
There are no known plugins which were relying on these variables. Moving forward plugins should read Azure settings only via Grafana Azure SDK which properly handles old and new environment variables. Issue [#48954](https://github.com/grafana/grafana/issues/48954)
Removes support for for ElasticSearch versions after their end-of-life, currently versions < 7.10.0. To continue to use ElasticSearch data source, upgrade ElasticSearch to version 7.10.0+.
Application Insights and Insight Analytics queries in Azure Monitor were deprecated in Grafana 8.0 and finally removed in 9.0. Deprecated queries will no longer be executed. Please refer to the [documentation](https://grafana.com/docs/grafana/latest/datasources/azuremonitor/deprecated-application-insights/) for more information about this change.
**grafana/ui: Button now specifies a default type="button"**
The `Button` component provided by @grafana/ui now specifies a default `type="button"` when no type is provided. In previous versions, if the attribute was not specified for buttons associated with a `<form>` the default value was `submit` per the [specification](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type)
You can preserve the old behavior by explicitly setting the type attribute: `<Button type="submit" />`
The `Rename by regex` transformation has been improved to allow global patterns of the form `/<stringToReplace>/g`. Depending on the regex match used, this may cause some transformations to behave slightly differently. You can guarantee the same behaviour as before by wrapping the `match` string in forward slashes (`/`), e.g. `(.*)` would become `/(.*)/` Issue [#48179](https://github.com/grafana/grafana/issues/48179)
`<Select />` menus will now portal to the document body by default. This is to give more consistent behaviour when positioning and overlaying. If you were setting `menuShouldPortal={true}` before you can safely remove that prop and behaviour will be the same. If you weren't explicitly setting that prop, there should be no visible changes in behaviour but your tests may need updating. Please see the original PR (https://github.com/grafana/grafana/pull/36398) for migration guides. If you were setting `menuShouldPortal={false}` this will continue to prevent the menu from portalling.
Grafana alerting endpoint prefixed with `api/v1/rule/test` that tests a rule against a Corte/Loki data source now expects the data source UID as a path parameter instead of the data source numeric identifier. Issue [#48070](https://github.com/grafana/grafana/issues/48070)
Grafana alerting endpoints prefixed with `api/prometheus/` that proxy requests to a Cortex/Loki data source now expect the data source UID as a path parameter instead of the data source numeric identifier. Issue [#48052](https://github.com/grafana/grafana/issues/48052)
Grafana alerting endpoints prefixed with `api/ruler/` that proxy requests to a Cortex/Loki data source now expect the data source UID as a path parameter instead of the data source numeric identifier. Issue [#48046](https://github.com/grafana/grafana/issues/48046)
Grafana alerting endpoints prefixed with `api/alertmanager/` that proxy requests to an Alertmanager now expect the data source UID as a path parameter instead of the data source numeric identifier. Issue [#47978](https://github.com/grafana/grafana/issues/47978)
The format of log messages have been updated, `lvl` is now `level` and `eror`and `dbug` has been replaced with `error` and `debug`. The precision of timestamps has been increased. To smooth the transition, it is possible to opt-out of the new log format by enabling the feature toggle `oldlog`. This option will be removed in a future minor release. Issue [#47584](https://github.com/grafana/grafana/issues/47584)
In the Loki data source, the dataframe format used to represent Loki logs-data has been changed to a more efficient format. The query-result is represented by a single dataframe with a "labels" column, instead of the separate dataframes for every labels-value. When displaying such data in explore, or in a logs-panel in the dashboard will continue to work without changes, but if the data was loaded into a different dashboard-panel, or Transforms were used, adjustments may be necessary. For example, if you used the "labels to fields" transformation with the logs data, please switch to the "extract fields" transformation. Issue [#47153](https://github.com/grafana/grafana/issues/47153)
### Deprecations
`setExploreQueryField`, `setExploreMetricsQueryField` and `setExploreLogsQueryField` are now deprecated and will be removed in a future release. If you need to set a different query editor for Explore, conditionally render based on `props.app` in your regular query editor. Please refer to https://grafana.com/docs/grafana/latest/developers/plugins/add-support-for-explore-queries/ for more information.
- **Chore:** Remove react-testing-lib from bundles. [#50442](https://github.com/grafana/grafana/pull/50442), [@jackw](https://github.com/jackw)
- **Select:** Portal menu by default. [#48176](https://github.com/grafana/grafana/pull/48176), [@ashharrison90](https://github.com/ashharrison90)
<!-- 9.0.0 END -->
<!-- 9.0.0-beta3 START -->
# 9.0.0-beta3 (2022-06-06)
### Features and enhancements
- **Alerting:** Add provenance guard to config api. [#50147](https://github.com/grafana/grafana/pull/50147), [@JohnnyQQQQ](https://github.com/JohnnyQQQQ)
- **Alerting:** Make folder filter clearable in Alert list panel. [#50093](https://github.com/grafana/grafana/pull/50093), [@peterholmberg](https://github.com/peterholmberg)
- **Alerting:** Provisioning API - Alert rules. [#47930](https://github.com/grafana/grafana/pull/47930), [@JohnnyQQQQ](https://github.com/JohnnyQQQQ)
- **Datasource:** Remove support for unencrypted passwords. [#49987](https://github.com/grafana/grafana/pull/49987), [@marefr](https://github.com/marefr)
- **Dependencies:** Update to Golang version `1.17.11`. [#50253](https://github.com/grafana/grafana/pull/50253), [@dsotirakis](https://github.com/dsotirakis)
- **Loki:** Run query when pressing Enter on line-filters. [#49913](https://github.com/grafana/grafana/pull/49913), [@svennergr](https://github.com/svennergr)
- **Metrics:** Remove support for using summaries instead of histogram for HTTP instrumentation. [#49985](https://github.com/grafana/grafana/pull/49985), [@bergquist](https://github.com/bergquist)
- **Plugins:** Support headers field for check health. [#49930](https://github.com/grafana/grafana/pull/49930), [@marefr](https://github.com/marefr)
- **Prometheus/Loki:** Add raw query and syntax highlight in explain mode. [#50070](https://github.com/grafana/grafana/pull/50070), [@aocenas](https://github.com/aocenas)
- **Prometheus:** Migrate metadata queries to use resource calls. [#49921](https://github.com/grafana/grafana/pull/49921), [@srclosson](https://github.com/srclosson)
- **RBAC:** Make RBAC action names more consistent. [#49730](https://github.com/grafana/grafana/pull/49730), [@IevaVasiljeva](https://github.com/IevaVasiljeva)
- **RBAC:** Make RBAC action names more consistent. (Enterprise)
- **Settings:** Sunset non-duration based login lifetime config. [#49944](https://github.com/grafana/grafana/pull/49944), [@sakjur](https://github.com/sakjur)
- **[9.0.x] Alerting:** Update alert rule diff to not see difference between nil and empty map. [#50198](https://github.com/grafana/grafana/pull/50198), [@yuri-tceretian](https://github.com/yuri-tceretian)
### Bug fixes
- **Alerting:** Fix alert list panel showing firing alerts with no instances. [#50069](https://github.com/grafana/grafana/pull/50069), [@gillesdemey](https://github.com/gillesdemey)
- **Alerting:** Remove double quotes from matchers. [#50046](https://github.com/grafana/grafana/pull/50046), [@alexweav](https://github.com/alexweav)
- **Alerting:** Use correct permission scope for external AM updates. [#50159](https://github.com/grafana/grafana/pull/50159), [@gillesdemey](https://github.com/gillesdemey)
- **Datasource:** Fix allowed cookies to be forwarded as header to backend datasources. [#49541](https://github.com/grafana/grafana/pull/49541), [@marefr](https://github.com/marefr)
- **Loki:** Fix uncaught errors if `labelKey` contains special characters. [#49887](https://github.com/grafana/grafana/pull/49887), [@svennergr](https://github.com/svennergr)
- **Prometheus:** Fix aligning of labels of exemplars after backend migration. [#49924](https://github.com/grafana/grafana/pull/49924), [@aocenas](https://github.com/aocenas)
- **SharePDF:** Fix repeated datasource variables in PDF. (Enterprise)
- **State Timeline:** Fix Null Value Filling and Value Transformation. [#50054](https://github.com/grafana/grafana/pull/50054), [@codeincarnate](https://github.com/codeincarnate)
- **Usage stats:** Divide collection into multiple functions to isolate failures. [#49928](https://github.com/grafana/grafana/pull/49928), [@sakjur](https://github.com/sakjur)
### Breaking changes
Removes support for storing/using datasource `password` and `basicAuthPassword` unencrypted which was [deprecated in Grafana v8.1.0](https://grafana.com/docs/grafana/latest/installation/upgrading/#use-of-unencrypted-passwords-for-data-sources-no-longer-supported). Please use `secureJsonData.password` and `secureJsonData.basicAuthPassword`. Issue [#49987](https://github.com/grafana/grafana/issues/49987)
Removes the option to instrument HTTP request in Grafana using summaries instead of histograms. Issue [#49985](https://github.com/grafana/grafana/issues/49985)
Removes support for deprecated dataproxy.max_idle_connections_per_host setting. Please use max_idle_connections instead. Issue [#49948](https://github.com/grafana/grafana/issues/49948)
Removes the deprecated `getFormStyles` function from grafana-ui.
Prefer using `GrafanaTheme2` and the `useStyles2` hook. Issue [#49945](https://github.com/grafana/grafana/issues/49945)
The configuration options `auth.login_maximum_inactive_lifetime_days` and `auth.login_maximum_lifetime_days` were deprecated in Grafana v7.2.0 and have now been removed. Use `login_maximum_inactive_lifetime_duration` and `login_maximum_lifetime_duration` to customize the maximum lifetime of a login session. Issue [#49944](https://github.com/grafana/grafana/issues/49944)
Removed the deprecated `isFocused` and `isInvalid` props from the `InlineLabel` component. These props haven't done anything for a while, so migration is just a matter of removing the props. Issue [#49929](https://github.com/grafana/grafana/issues/49929)
Removed the deprecated `onColorChange` prop from `ColorPicker`. Moving forward the `onChange` prop should be used. Issue [#49923](https://github.com/grafana/grafana/issues/49923)
`/api/tsdb/query` API has been removed. Use [/api/ds/query](https://grafana.com/docs/grafana/latest/http_api/data_source/#query-a-data-source) instead.
`onClipboardCopy` and `onClipboardError` APIs have been changed such that the callback's argument is just the text that's been copied rather than the old `ClipboardEvent` interface.
- `users.teams:read` -> replaced by `users.read` + `teams:read`
We've added a migration from the old action names to the new names and have updated our documentation. But you will have to update any scripts and provisioning files that are using the old action names. Issue [#49730](https://github.com/grafana/grafana/issues/49730)
The following RBAC action renames have been carried out:
We've added a migration from the old action names to the new names and have updated our documentation. But you will have to update any scripts and provisioning files that are using the old action names. Issue [#3372](https://github.com/grafana/grafana/issues/3372)
- **Alerting:** Enable Unified Alerting for open source and enterprise. [#49834](https://github.com/grafana/grafana/pull/49834), [@grobinson-grafana](https://github.com/grobinson-grafana)
- **Alerting:** Make alertmanager datasource stable. [#49485](https://github.com/grafana/grafana/pull/49485), [@gillesdemey](https://github.com/gillesdemey)
- **Angular:** Remove deprecated angular modal support and libs. [#49781](https://github.com/grafana/grafana/pull/49781), [@torkelo](https://github.com/torkelo)
- **ValueMapping:** Add support for regex replacement over multiple lines. [#49607](https://github.com/grafana/grafana/pull/49607), [@ashharrison90](https://github.com/ashharrison90)
### Bug fixes
- **Accessibility:** Pressing escape in a Modal or DashboardSettings correctly closes the overlay. [#49500](https://github.com/grafana/grafana/pull/49500), [@ashharrison90](https://github.com/ashharrison90)
- **BackendSrv:** Throw an error when fetching an invalid JSON. [#47493](https://github.com/grafana/grafana/pull/47493), [@leventebalogh](https://github.com/leventebalogh)
- **Loki:** Fix unwrap parsing in query builder. [#49732](https://github.com/grafana/grafana/pull/49732), [@ivanahuckova](https://github.com/ivanahuckova)
- **Navigation:** Position hamburger menu correctly in mobile view. [#49603](https://github.com/grafana/grafana/pull/49603), [@ashharrison90](https://github.com/ashharrison90)
- **PanelEditor:** Fixes issue with Table view and multi data frames. [#49854](https://github.com/grafana/grafana/pull/49854), [@JoaoSilvaGrafana](https://github.com/JoaoSilvaGrafana)
- **Preferences:** Fix updating of preferences for Navbar and Query History. [#49677](https://github.com/grafana/grafana/pull/49677), [@ivanahuckova](https://github.com/ivanahuckova)
- **TimeRange:** Fixes issue when zooming out on a timerange with timespan 0. [#49622](https://github.com/grafana/grafana/pull/49622), [@JoaoSilvaGrafana](https://github.com/JoaoSilvaGrafana)
- **Variables:** Fixes DS variables not being correctly used in panel queries. [#49323](https://github.com/grafana/grafana/pull/49323), [@JoaoSilvaGrafana](https://github.com/JoaoSilvaGrafana)
### Breaking changes
Drop support for deprecated setting ldap_sync_ttl under [auth.proxy]
Only sync_ttl will work from now on Issue [#49902](https://github.com/grafana/grafana/issues/49902)
Removes support for deprecated `heading` and `description` props. Moving forward, the `Card.Heading` and `Card.Description` components should be used. Issue [#49885](https://github.com/grafana/grafana/issues/49885)
Removes the deprecated `link` variant from the `Button` component.
To migrate, replace any usage of `variant="link"` with `fill="text"`. Issue [#49843](https://github.com/grafana/grafana/issues/49843)
Removes the deprecated `surface` prop from the `IconButton` component. This prop hasn't actually done anything for a while, so it should be safe to just remove any instances of its usage.
Removes the deprecated `TextDisplayOptions` export from `@grafana/data` in favor of `VizTextDisplayOptions` from `@grafana/schema`. To migrate, just replace usage of `TextDisplayOptions` with `VizTextDisplayOptions`. Issue [#49705](https://github.com/grafana/grafana/issues/49705)
Removed support for the deprecated `getColorForTheme(color: string, theme: GrafanaTheme)` function in favor of the
`theme.visualization.getColorByName(color: string)` method. The output of this method is identical to the removed function, so migration should just be a matter of rewriting calls of `getColorForTheme(myColor, myTheme)` to `myTheme.visualization.getColorByName(myColor)`.
In the Prometheus data source, for consistency and performance reasons, we changed how we represent `NaN` (not a number) values received from Prometheus. In the past versions, we converted these to `null` in the frontend (for dashboard and explore), and kept as `NaN` in the alerting path. Starting with this version, we will always keep it as `NaN`. This change should be mostly invisible for the users. Issue [#49475](https://github.com/grafana/grafana/issues/49475)
Plugins using custom Webpack configs could potentially break due to the changes between webpack@4 and webpack@5. Please refer to the [official migration guide](https://webpack.js.org/migrate/5/) for assistance.
Webpack 5 does not include polyfills for node.js core modules by default (e.g. `buffer`, `stream`, `os`). This can result in failed builds for plugins. If polyfills are required it is recommended to create a custom webpack config in the root of the plugin repo and add the required fallbacks:
- If the response has the `"Content-Type: application/json"` header, OR
- If the backendSrv options ([`BackendSrvRequest`](https://github.com/grafana/grafana/blob/e237ff20a996c7313632b2e28f38032012f0e340/packages/grafana-runtime/src/services/backendSrv.ts#L8)) specify the response as JSON: `{ responseType: 'json' }`
**How does it work after this change?**
- In case it is recognised as a JSON response and the response is empty, it returns an empty object `{}`
- In case it is recognised as a JSON response and it has formatting errors, it throws an error
**How to migrate?**
Make sure to handle possible errors on the callsite where using `backendSrv.fetch()` (or any other `backendSrv` methods). Issue [#47493](https://github.com/grafana/grafana/issues/47493)
- **Fix:** Prevent automatic parsing of string data types to numbers. [#46035](https://github.com/grafana/grafana/pull/46035), [@joshhunt](https://github.com/joshhunt)
- **Prometheus:** Fix inconsistent labels in exemplars resulting in marshal json error. [#46135](https://github.com/grafana/grafana/pull/46135), [@hanjm](https://github.com/hanjm)
### Breaking changes
In the Loki data source, for consistency and performance reasons, we changed how we represent `NaN` (not a number) values received from Loki. In the past versions, we converted these to `null` in the frontend (for dashboard and explore), and kept as `NaN` in the alerting path. Starting with this version, we will always keep it as `NaN`. This change should be mostly invisible for the users. Issue [#45389](https://github.com/grafana/grafana/issues/45389)
The dependency to [grafana/aws-sdk](https://github.com/grafana/grafana-aws-sdk-react) is moved from [grafana/ui](https://github.com/grafana/grafana/blob/main/packages/grafana-ui/package.json) to the plugin. This means that any plugin that use SIGV4 auth need to pass a SIGV4 editor component as a prop to the `DataSourceHttpSettings` component. Issue [#43559](https://github.com/grafana/grafana/issues/43559)
<!-- 9.0.0-beta1 END -->
<!-- 8.5.4 START -->
# 8.5.4 (2022-05-30)
### Features and enhancements
- **Alerting:** Remove disabled flag for data source when migrating alerts. [#48559](https://github.com/grafana/grafana/pull/48559), [@yuri-tceretian](https://github.com/yuri-tceretian)
- **Alerting:** Show notification tab of legacy alerting only to editor. [#49624](https://github.com/grafana/grafana/pull/49624), [@yuri-tceretian](https://github.com/yuri-tceretian)
- **Alerting:** Update migration to migrate only alerts that belong to existing org\dashboard. [#49192](https://github.com/grafana/grafana/pull/49192), [@yuri-tceretian](https://github.com/yuri-tceretian)
- **AzureMonitor:** Do not quote variables when a custom "All" variable option is used. [#49428](https://github.com/grafana/grafana/pull/49428), [@andresmgot](https://github.com/andresmgot)
- **Cloudwatch:** Add support for new AWS/RDS EBS\* metrics. [#48798](https://github.com/grafana/grafana/pull/48798), [@szymonpk](https://github.com/szymonpk)
- **InfluxDB:** Use backend for influxDB by default via feature toggle. [#48453](https://github.com/grafana/grafana/pull/48453), [@yesoreyeram](https://github.com/yesoreyeram)
- **Legend:** Use correct unit for percent and count calculations. [#49004](https://github.com/grafana/grafana/pull/49004), [@dprokop](https://github.com/dprokop)
- **LokI:** use millisecond steps in Grafana 8.5.x. [#48630](https://github.com/grafana/grafana/pull/48630), [@gabor](https://github.com/gabor)
- **Plugins:** Introduce HTTP 207 Multi Status response to api/ds/query. [#48550](https://github.com/grafana/grafana/pull/48550), [@wbrowne](https://github.com/wbrowne)
- **Reporting:** Improve PDF file size using grid layout. (Enterprise)
- **Transformations:** Add an All Unique Values Reducer. [#48653](https://github.com/grafana/grafana/pull/48653), [@josiahg](https://github.com/josiahg)
- **Transformers:** avoid error when the ExtractFields source field is missing. [#49368](https://github.com/grafana/grafana/pull/49368), [@wardbekker](https://github.com/wardbekker)
- **[v8.5.x] Alerting:** Update migration to migrate only alerts that belong to existing org\dashboard. [#49199](https://github.com/grafana/grafana/pull/49199), [@grafanabot](https://github.com/grafanabot)
- **[v8.5.x] Reporting:** Improve PDF file size using grid layout. (Enterprise)
- **Alerting:** Apply Custom Headers to datasource queries. [#47860](https://github.com/grafana/grafana/pull/47860), [@joeblubaugh](https://github.com/joeblubaugh)
- **Alerting:** Fix RBAC actions for notification policies. [#49185](https://github.com/grafana/grafana/pull/49185), [@yuri-tceretian](https://github.com/yuri-tceretian)
- **Alerting:** Fix access to alerts for viewer with editor permissions when RBAC is disabled. [#49270](https://github.com/grafana/grafana/pull/49270), [@yuri-tceretian](https://github.com/yuri-tceretian)
- **Alerting:** Fix anonymous access to alerting. [#49203](https://github.com/grafana/grafana/pull/49203), [@yuri-tceretian](https://github.com/yuri-tceretian)
- **Alerting:** correctly show all alerts in a folder. [#48684](https://github.com/grafana/grafana/pull/48684), [@gillesdemey](https://github.com/gillesdemey)
- **DashboardExport:** Fix exporting and importing dashboards where query data source ended up as incorrect. [#48410](https://github.com/grafana/grafana/pull/48410), [@torkelo](https://github.com/torkelo)
- **FileUpload:** clicking the `Upload file` button now opens the modal correctly. [#48766](https://github.com/grafana/grafana/pull/48766), [@ashharrison90](https://github.com/ashharrison90)
- **GrafanaUI:** Fix color of links in error Tooltips in light theme. [#49327](https://github.com/grafana/grafana/pull/49327), [@joshhunt](https://github.com/joshhunt)
- **LibraryPanels:** Fix library panels not connecting properly in imported dashboards. [#49161](https://github.com/grafana/grafana/pull/49161), [@joshhunt](https://github.com/joshhunt)
- **Loki:** Improve unpack parser handling. [#49074](https://github.com/grafana/grafana/pull/49074), [@gabor](https://github.com/gabor)
- **RolePicker:** Fix menu position on smaller screens. [#48429](https://github.com/grafana/grafana/pull/48429), [@Clarity-89](https://github.com/Clarity-89)
- **TimeRange:** Fixes updating time range from url and browser history. [#48657](https://github.com/grafana/grafana/pull/48657), [@torkelo](https://github.com/torkelo)
- **Timeseries:** Fix outside range stale state. [#49633](https://github.com/grafana/grafana/pull/49633), [@ryantxu](https://github.com/ryantxu)
- **Tooltip:** Fix links not legible in Tooltips when using light theme. [#48748](https://github.com/grafana/grafana/pull/48748), [@joshhunt](https://github.com/joshhunt)
- **Tooltip:** Sort decimals using standard numeric compare. [#49084](https://github.com/grafana/grafana/pull/49084), [@dprokop](https://github.com/dprokop)
- **Variables:** Fixes issue with data source variables not updating queries with variable. [#49478](https://github.com/grafana/grafana/pull/49478), [@torkelo](https://github.com/torkelo)
- **[v8.5.x] Alerting:** Fix access to alerts for viewer with editor permissions when RBAC is disabled. [#49427](https://github.com/grafana/grafana/pull/49427), [@konrad147](https://github.com/konrad147)
- **[v8.5.x] Alerting:** Fix anonymous access to alerting. [#49268](https://github.com/grafana/grafana/pull/49268), [@yuri-tceretian](https://github.com/yuri-tceretian)
### Breaking changes
For a data source query made via /api/ds/query :
- If the `DatasourceQueryMultiStatus` feature is enabled and
- The data source response has an error set as part of the `DataResponse`, the resulting HTTP status code is now `207 Multi Status` instead of `400 Bad gateway`
- If the `DatasourceQueryMultiStatus` feature is **not** enabled and
- The data source response has an error set as part of the `DataResponse`, the resulting HTTP status code is `400 Bad Request` (no breaking change)
- **Alerting:** Add safeguard for migrations that might cause dataloss. [#48526](https://github.com/grafana/grafana/pull/48526), [@JohnnyQQQQ](https://github.com/JohnnyQQQQ)
- **AzureMonitor:** Add support for not equals and startsWith operators when creating Azure Metrics dimension filters. [#48077](https://github.com/grafana/grafana/pull/48077), [@aangelisc](https://github.com/aangelisc)
- **Traces:** Filter by service/span name and operation in Tempo and Jaeger. [#48209](https://github.com/grafana/grafana/pull/48209), [@joey-grafana](https://github.com/joey-grafana)
### Bug fixes
- **AzureAd Oauth:** Fix strictMode to reject users without an assigned role. [#48474](https://github.com/grafana/grafana/pull/48474), [@kyschouv](https://github.com/kyschouv)
- **CloudWatch:** Fix variable query tag migration. [#48587](https://github.com/grafana/grafana/pull/48587), [@iwysiu](https://github.com/iwysiu)
- **Azure Monitor:** Fix space character encoding for metrics query link to Azure Portal. [#48139](https://github.com/grafana/grafana/pull/48139), [@kevinwcyu](https://github.com/kevinwcyu)
- **CloudWatch:** Prevent log groups from being removed on query change. [#47994](https://github.com/grafana/grafana/pull/47994), [@asimpson](https://github.com/asimpson)
- **Cloudwatch:** Fix template variables in variable queries. [#48140](https://github.com/grafana/grafana/pull/48140), [@iwysiu](https://github.com/iwysiu)
- **Explore:** Prevent direct access to explore if disabled via feature toggle. [#47714](https://github.com/grafana/grafana/pull/47714), [@Elfo404](https://github.com/Elfo404)
- **InfluxDB:** Fixes invalid no data alerts. [#48295](https://github.com/grafana/grafana/pull/48295), [@yesoreyeram](https://github.com/yesoreyeram)
- **Navigation:** Prevent navbar briefly showing on login. [#47968](https://github.com/grafana/grafana/pull/47968), [@ashharrison90](https://github.com/ashharrison90)
- **Plugins Catalog:** Fix styling of hyperlinks. [#48196](https://github.com/grafana/grafana/pull/48196), [@marefr](https://github.com/marefr)
- **TimeSeries:** Properly stack series with missing datapoints. [#48321](https://github.com/grafana/grafana/pull/48321), [@leeoniya](https://github.com/leeoniya)
- **Alerting:** Add resolved count to notification title when both firing and resolved present. [#46697](https://github.com/grafana/grafana/pull/46697), [@JacobsonMT](https://github.com/JacobsonMT)
- **Alerting:** Alert rule should wait For duration when execution error state is Alerting. [#47052](https://github.com/grafana/grafana/pull/47052), [@grobinson-grafana](https://github.com/grobinson-grafana)
- **Alerting:** Classic conditions can now display multiple values. [#46971](https://github.com/grafana/grafana/pull/46971), [@gotjosh](https://github.com/gotjosh)
- **Alerting:** Display query from grafana-managed alert rules on `/api/v1/rules`. [#45969](https://github.com/grafana/grafana/pull/45969), [@gotjosh](https://github.com/gotjosh)
- **Alerting:** Enhance support for arbitrary group names in managed alerts. [#47785](https://github.com/grafana/grafana/pull/47785), [@gillesdemey](https://github.com/gillesdemey)
- **Alerting:** add field for custom slack endpoint. [#45751](https://github.com/grafana/grafana/pull/45751), [@nathanrodman](https://github.com/nathanrodman)
- **Azure Monitor :** Adding json formatting of error messages in Panel Header Corner and Inspect Error Tab. [#44877](https://github.com/grafana/grafana/pull/44877), [@yaelleC](https://github.com/yaelleC)
- **Azure Monitor:** Add 2 more Curated Dashboards for VM Insights. [#45187](https://github.com/grafana/grafana/pull/45187), [@jcolladokuri](https://github.com/jcolladokuri)
- **CloudWatch:** Handle new error codes for MetricInsights. [#47033](https://github.com/grafana/grafana/pull/47033), [@Gabrielopesantos](https://github.com/Gabrielopesantos)
- **Dashboards:** show changes in save dialog. [#46557](https://github.com/grafana/grafana/pull/46557), [@ryantxu](https://github.com/ryantxu)
- **DataSource:** Default data source is no longer a persisted state but just the default data source for new panels. [#45132](https://github.com/grafana/grafana/pull/45132), [@torkelo](https://github.com/torkelo)
- **DataSourcePlugin API:** Allow queries import when changing data source type. [#47435](https://github.com/grafana/grafana/pull/47435), [@dprokop](https://github.com/dprokop)
- **Explore:** Remove return to panel button. [#45018](https://github.com/grafana/grafana/pull/45018), [@gelicia](https://github.com/gelicia)
- **Explore:** allow users to save Explore state to a new panel in a new dashboard. [#45148](https://github.com/grafana/grafana/pull/45148), [@Elfo404](https://github.com/Elfo404)
- **Instrumentation:** Proxy status code correction and various improvements. [#47473](https://github.com/grafana/grafana/pull/47473), [@marefr](https://github.com/marefr)
- **NewsPanel:** Add support for Atom feeds. [#45390](https://github.com/grafana/grafana/pull/45390), [@kaydelaney](https://github.com/kaydelaney)
- **Plugins:** Add deprecation notice for /api/tsdb/query endpoint. [#45238](https://github.com/grafana/grafana/pull/45238), [@wbrowne](https://github.com/wbrowne)
- **Plugins:** Adding support for traceID field to accept variables. [#45559](https://github.com/grafana/grafana/pull/45559), [@vinisdl](https://github.com/vinisdl)
- **PostgreSQL:** \_\_unixEpochGroup to support arithmetic expression as argument. [#46764](https://github.com/grafana/grafana/pull/46764), [@s0nik42](https://github.com/s0nik42)
- **Profile/Help:** Expose option to disable profile section and help menu. [#46308](https://github.com/grafana/grafana/pull/46308), [@cameronwaterman](https://github.com/cameronwaterman)
- **Prometheus:** Enable new visual query builder by default. [#46634](https://github.com/grafana/grafana/pull/46634), [@torkelo](https://github.com/torkelo)
- **SAML:** Allow disabling of SAML signups. [#47481](https://github.com/grafana/grafana/pull/47481), [@mmandrus](https://github.com/mmandrus)
- **SAML:** Allow disabling of SAML signups. (Enterprise)
- **Table:** New pagination option. [#45732](https://github.com/grafana/grafana/pull/45732), [@zoltanbedi](https://github.com/zoltanbedi)
- **Tempo / Trace Viewer:** Support Span Links in Trace Viewer. [#45632](https://github.com/grafana/grafana/pull/45632), [@Shachi16](https://github.com/Shachi16)
- **Tempo:** Download span references in data inspector. [#47074](https://github.com/grafana/grafana/pull/47074), [@connorlindsey](https://github.com/connorlindsey)
- **Tempo:** Separate trace to logs and loki search datasource config. [#46655](https://github.com/grafana/grafana/pull/46655), [@connorlindsey](https://github.com/connorlindsey)
- **Trace View:** Show number of child spans. [#44393](https://github.com/grafana/grafana/pull/44393), [@tharun208](https://github.com/tharun208)
- **Transformations:** Support escaped characters in key-value pair parsing. [#47901](https://github.com/grafana/grafana/pull/47901), [@aangelisc](https://github.com/aangelisc)
### Bug fixes
- **Azure Monitor:** Bug Fix for incorrect variable cascading for template variables. [#47478](https://github.com/grafana/grafana/pull/47478), [@jcolladokuri](https://github.com/jcolladokuri)
- **CloudWatch:** List all metrics properly in SQL autocomplete. [#45898](https://github.com/grafana/grafana/pull/45898), [@sunker](https://github.com/sunker)
- **CloudWatch:** Run query on blur in logs query field. [#47454](https://github.com/grafana/grafana/pull/47454), [@fridgepoet](https://github.com/fridgepoet)
- **Dashboard:** Template variables are now correctly persisted when clicking breadcrumb links. [#46790](https://github.com/grafana/grafana/pull/46790), [@ashharrison90](https://github.com/ashharrison90)
- **DashboardPage:** Remember scroll position when coming back panel edit / view panel. [#47639](https://github.com/grafana/grafana/pull/47639), [@torkelo](https://github.com/torkelo)
- **Panel Edit:** Options search now works correctly when a logarithmic scale option is set. [#47927](https://github.com/grafana/grafana/pull/47927), [@ashharrison90](https://github.com/ashharrison90)
- **Postgres:** Return tables with hyphenated schemes. [#45754](https://github.com/grafana/grafana/pull/45754), [@zuchka](https://github.com/zuchka)
- **Table panel:** Fix horizontal scrolling when pagination is enabled. [#47776](https://github.com/grafana/grafana/pull/47776), [@dprokop](https://github.com/dprokop)
- **Variables:** Ensure variables in query params are correctly recognised. [#47049](https://github.com/grafana/grafana/pull/47049), [@ashharrison90](https://github.com/ashharrison90)
- **Visualizations:** Stack negative-valued series downwards. [#47373](https://github.com/grafana/grafana/pull/47373), [@leeoniya](https://github.com/leeoniya)
### Breaking changes
For a proxied request, e.g. Grafana's datasource or plugin proxy:
- If the request is cancelled, e.g. from the browser/by the client, the HTTP status code is now `499 Client closed request` instead of `502 Bad gateway`
- If the request times out, e.g. takes longer time than allowed, the HTTP status code is now `504 Gateway timeout` instead of `502 Bad gateway`. Issue [#47473](https://github.com/grafana/grafana/issues/47473)
The change in behavior is that negative-valued series are now stacked downwards from 0 (in their own stacks), rather than downwards from the top of the positive stacks. We now automatically group stacks by Draw style, Line interpolation, and Bar alignment, making it impossible to stack bars on top of lines, or smooth lines on top of stepped lines. Issue [#47373](https://github.com/grafana/grafana/issues/47373)
The meaning of the default data source has now changed from being a persisted property in a panel. Before when you selected the default data source for a panel and later changed the default data source to another data source it would change all panels who were configured to use the default data source. From now on the default data source is just the default for new panels and changing the default will not impact any currently saved dashboards. Issue [#45132](https://github.com/grafana/grafana/issues/45132)
The Tooltip component provided by `@grafana/ui` is no longer automatically interactive (that is you can hover onto it and click a link or select text). It will from now on by default close automatically when you mouse out from the trigger element. To make tooltips behave like before set the new `interactive` property to true.
`/api/tsdb/query` API has been deprecated and will be removed in a future release. Use [/api/ds/query](https://grafana.com/docs/grafana/latest/http_api/data_source/#query-a-data-source) instead. Issue [#45238](https://github.com/grafana/grafana/issues/45238)
### Plugin development fixes & changes
- **Card:** Increase clickable area when meta items are present. [#47935](https://github.com/grafana/grafana/pull/47935), [@ashharrison90](https://github.com/ashharrison90)
- **Loki:** Fix operator description propup from being shortened. [#46575](https://github.com/grafana/grafana/pull/46575), [@glintik](https://github.com/glintik)
- **Tooltips:** Make tooltips non interactive by default. [#45053](https://github.com/grafana/grafana/pull/45053), [@torkelo](https://github.com/torkelo)
<!-- 8.5.0 END -->
<!-- 8.5.0-beta1 START -->
# 8.5.0-beta1 (2022-04-06)
### Features and enhancements
- Add config option to enable/disable reporting. (Enterprise)
- **Alerting:** Accurately set value for prom-compatible APIs. [#47216](https://github.com/grafana/grafana/pull/47216), [@gotjosh](https://github.com/gotjosh)
- **Alerting:** Provisioning API - Notification Policies. [#46755](https://github.com/grafana/grafana/pull/46755), [@alexweav](https://github.com/alexweav)
- **Alerting:** Notification URL points to alert view page instead of alert edit page. [#47752](https://github.com/grafana/grafana/pull/47752), [@joeblubaugh](https://github.com/joeblubaugh)
- **Analytics:** Enable grafana and plugin update checks to be operated independently. [#46352](https://github.com/grafana/grafana/pull/46352), [@wbrowne](https://github.com/wbrowne)
- **Azure Monitor:** Add support for multiple template variables in resource picker. [#46215](https://github.com/grafana/grafana/pull/46215), [@sarahzinger](https://github.com/sarahzinger)
- **Caching:** Add separate TTL for resources cache. (Enterprise)
- **Caching:** add support for TLS configuration for Redis Cluster. (Enterprise)
- **NewsPanel:** Remove Use Proxy option and update documentation with recommendations. [#47189](https://github.com/grafana/grafana/pull/47189), [@joshhunt](https://github.com/joshhunt)
- **OAuth:** Sync GitHub OAuth user name to Grafana if it's set. [#45438](https://github.com/grafana/grafana/pull/45438), [@pallxk](https://github.com/pallxk)
### Bug fixes
- **Plugins:** Fix Default Nav URL for dashboard includes. [#47143](https://github.com/grafana/grafana/pull/47143), [@wbrowne](https://github.com/wbrowne)
### Breaking changes
When user is using Github OAuth, GitHub login is showed as both Grafana login and name. Now the GitHub name is showed as Grafana name, and GitHub login is showed as Grafana Login. Issue [#45438](https://github.com/grafana/grafana/issues/45438)
The meaning of the default data source has now changed from being a persisted property in a panel. Before when you selected the default data source for a panel and later changed the default data source to another data source it would change all panels who were configured to use the default data source. From now on the default data source is just the default for new panels and changing the default will not impact any currently saved dashboards. Issue [#45132](https://github.com/grafana/grafana/issues/45132)
- **Histogram Panel:** Take decimal into consideration. [#47330](https://github.com/grafana/grafana/pull/47330), [@mdvictor](https://github.com/mdvictor)
- **TimeSeries:** Sort tooltip values based on raw values. [#46738](https://github.com/grafana/grafana/pull/46738), [@dprokop](https://github.com/dprokop)
### Bug fixes
- **API:** Include userId, orgId, uname in request logging middleware. [#47183](https://github.com/grafana/grafana/pull/47183), [@marefr](https://github.com/marefr)
- **Security:** Fixes CVE-2022-24812. For more information, see our [blog](https://grafana.com/blog/2022/04/12/grafana-enterprise-8.4.6-released-with-high-severity-security-fix/)
<!-- 8.4.6 END -->
<!-- 8.4.5 START -->
# 8.4.5 (2022-03-31)
@@ -395,7 +1337,7 @@ The access mode "browser" is deprecated in the following data sources and will b
### Features and enhancements
- **AccessControl:** Apply fine-grained access control to licensing. (Enterprise)
- **AccessControl:** Apply role-based access control to licensing. (Enterprise)
- **Alerting:** Add UI for contact point testing with custom annotations and labels. [#40491](https://github.com/grafana/grafana/pull/40491), [@nathanrodman](https://github.com/nathanrodman)
- **Alerting:** Make alert state indicator in panel header work with Grafana 8 alerts. [#38713](https://github.com/grafana/grafana/pull/38713), [@domasx2](https://github.com/domasx2)
- **Alerting:** Option for Discord notifier to use webhook name. [#40463](https://github.com/grafana/grafana/pull/40463), [@Skyebold](https://github.com/Skyebold)
@@ -4372,3 +5314,4 @@ repo on July 1st. Make sure you have switched to the new repo by then. The new r
- **Dashboard**: Panel property `minSpan` replaced by `maxPerRow`. Dashboard migration will automatically migrate all dashboard panels using the `minSpan` property to the new `maxPerRow` property [#12991](https://github.com/grafana/grafana/pull/12991)
For older release notes, refer to the [CHANGELOG_ARCHIVE.md](https://github.com/grafana/grafana/blob/master/CHANGELOG_ARCHIVE.md)
# Path to where grafana can store temp files, sessions, and the sqlite3 db (if that is used)
@@ -122,7 +125,7 @@ path = grafana.db
# For "sqlite3" only. cache mode setting used for connecting to the database
cache_mode=private
# For "mysql" only if lockingMigration feature toggle is set. How many seconds to wait before failing to lock the database for the migrations, default is 0.
# For "mysql" only if migrationLocking feature toggle is set. How many seconds to wait before failing to lock the database for the migrations, default is 0.
locking_attempt_timeout_sec=0
#################################### Cache server #############################
# Enable the legacy alerting sub-system and interface. If Unified Alerting is already enabled and you try to go back to legacy alerting, all data that is part of Unified Alerting will be deleted. When this configuration section and flag are not defined, the state is defined at runtime. See the documentation for more details.
@@ -910,7 +938,7 @@ enabled = true
#################################### Query History #############################
# Path to where grafana can store temp files, sessions, and the sqlite3 db (if that is used)
@@ -123,7 +126,7 @@
# For "sqlite3" only. cache mode setting used for connecting to the database. (private, shared)
;cache_mode = private
# For "mysql" only if lockingMigration feature toggle is set. How many seconds to wait before failing to lock the database for the migrations, default is 0.
# For "mysql" only if migrationLocking feature toggle is set. How many seconds to wait before failing to lock the database for the migrations, default is 0.
;locking_attempt_timeout_sec = 0
################################### Data sources #########################
@@ -230,6 +233,9 @@
# Rudderstack Config url, optional, used by Rudderstack SDK to fetch source config
;rudderstack_config_url =
# Controls if the UI contains any links to user feedback forms
@@ -117,11 +117,14 @@ If you're unsure, see the existing [changelog](https://github.com/grafana/grafan
### Pull request titles
The pull request title should be formatted according to `<Area>: <Summary>` (Both "Area" and "Summary" should start with a capital letter).
The Grafana team _squashes_ all commits into one when we accept a pull request. The title of the pull request becomes the subject line of the squashed commit message. We still encourage contributors to write informative commit messages, as they becomes a part of the Git commit body.
We use the pull request title when we generate change logs for releases. As such, we strive to make the title as informative as possible.
Make sure that the title for your pull request uses the same format as the subject line in the commit message.
**Example:**
`Docs: Change url to URL in all documentation files`
@@ -136,17 +136,23 @@ Running the backend tests on Windows currently needs some tweaking, so use the b
go run build.go test
```
### Run PostgreSQL and MySQL integration tests
### Run SQLLite, PostgreSQL and MySQL integration tests
To run PostgreSQL and MySQL integration tests locally, you need to start the docker blocks for MySQL and/or PostgreSQLtest data sources by running `make devenv sources=mysql_tests,postgres_tests`. When your test data sources are running, you can execute integration tests by running:
By default, Grafana runs SQLite to run tests with SQLite.
```bash
go test -covermode=atomic -tags=integration ./pkg/...
```
To run PostgreSQL and MySQL integration tests locally, start the Docker blocks for MySQL and/or PostgreSQL test data sources by running `make devenv sources=mysql_tests,postgres_tests`. When your test data sources are running, you can execute integration tests by running:
```bash
GRAFANA_TEST_DB=mysql go test -covermode=atomic -tags=integration ./pkg/...
```
and/or
```
```bash
GRAFANA_TEST_DB=postgres go test -covermode=atomic -tags=integration ./pkg/...
Grafana uses the [LinguiJS](https://github.com/lingui/js-lingui) framework for managing translating phrases in the Grafana frontend.
## tl;dr
- Use `<Trans id="search-results.panel-link">Go to {panel.title}</Trans>` in code to add a translatable phrase
- Translations are stored in .po files in `public/locales/{locale}/messages.po`
- If a particular phrase is not available in the a language then it will fall back to English
## How to add a new translation phrase
1. Use one of `@lingui/macro`'s React components with the `id`, ensuring it conforms to the guidelines below, with the default english translation. e.g.
```jsx
import{Trans}from@lingui/macro
constSearchTitle=({term})=>(
<Transid="search-page.results-title">
Resultsfor{term}
</Trans>
);
```
Prefer using the JSX components (compared to the plain javascript functions, see below) where possible for phrases. Many props can (and probably should) be changed to accept the `React.ReactNode` instead of `string` for phrases put into the DOM.
Note that Lingui must be able to statically analyse the code to extract the phrase, so the `id` can not be dynamic. e.g. the following will not work:
2. Upon reload, the default English phrase will appear on the page.
3. Before submitting your PR, run the `yarn i18n:extract` command to extract the messages you added into the `messages.po` file and make them available for translation.
## How translations work in Grafana
Grafana uses the [LinguiJS](https://github.com/lingui/js-lingui) framework for managing translating phrases in the Grafana frontend. It:
- Marks up phrases within our code for extraction
- Extracts phrases into messages catalogues for translating in external systems
- "Compiles" the catalogues to a format that can be used in the website
- Manages the user's locale and putting the translated phrases in the UI
### Phrase ID naming convention
We set explicit IDs for phrases to make it easier to identify phrases out of context, and to track where they're used. IDs follow a naming scheme that includes _where_ the phrase is used. The exception is the rare case of single reoccuring words like "Cancel", but default to using a feature/phrase specific phrase.
Message IDs are made of _up to_ three segments in the format `feature.area.phrase`. For example:
-`dashboard.header.refresh-label`
-`explore.toolbar.share-tooltip`
For components used all over the site, use just two segments:
-`footer.update`
-`navigation.home`
### Top-level provider
In [AppWrapper.tsx](/public/app/AppWrapper.tsx) the app is wrapped with `I18nProvider` from `public/app/core/localisation.tsx` where the Lingui instance is created with the user's preferred locale. This sets the appropriate context and allows any component from `@lingui/macro` to use the translations for the user's preferred locale.
### Message format
Lingui uses the [ICU MessageFormat](https://unicode-org.github.io/icu/userguide/format_parse/messages/) for the phrases in the .po catalogues. ICU has special syntax especially for describing plurals across multiple languages. For more details see the [Lingui docs](https://lingui.js.org/ref/message-format.html).
### Plain JS usage
See [Lingui Docs](https://lingui.js.org/ref/macro.html#t) for more details.
Sometimes you may need to translate a string cannot be represented in JSX, such as `placeholder` props. Use the `t` macro for this.
While the `t` macro can technically be used outside of React functions (e.g, in actions/reducers), aim to keep all UI phrases within the React UI functions.
## Examples
See the [Lingui docs](https://lingui.js.org/ref/macro.html#usage) for more details.
### Basic usage
For fixed phrases:
```jsx
import{Trans}from'@lingui/macro';
<Transid="page.greeting">Hellouser!</Trans>;
```
You can include variables, just like regular JSX. Prefer using "simple" variables to make the extracted phrase easier to read for translators
// Instead, put the JSX inside the phrase directly
constuserName=user.name;
<Transid="page.greeting">
Hello<strong>{userName}</strong>!
</Trans>;
```
### React components and HTML tags
Both HTML tags and React components can be included in a phase. The Lingui macro will replace them with placeholder tags for the translators
```js
import{Trans}from"@lingui/macro"
constrandomVariable="variable"
<Transid="page.explainer">
Click<button>here</button> to <a href="https://grafana.com">learn more.</a>
</Trans>
// ↓ is transformed by macros into ↓
<Trans
id="page.explainer"
defaults="Click<0>here</0>to<1>learnmore</1>"
components={[
<button/>,
<Text/>
]}
/>
// ↓ is in the messages.po file like ↓
msgid"page.explainer"
msgstr"Click <0>here</0> to <1>learn more</1>"
```
### Plurals
See the [Lingui docs](https://lingui.js.org/ref/macro.html#id1) for more details.
Plurals require special handling to make sure they can be translating according to the rules of each locale (which may be more complex that you think!). Use the `<Plural />` component and specify the plural forms for the default language (English). The message will be extracted into a form where translators can extend it with rules for other locales.
```js
import{Plural}from"@lingui/macro"
<Plural
id="sharing.shared-with"
value={sharedCount}
none="Not shared with anyone"
one="Shared with one person"
other="Shared with # people"
/>
// ↓ is transformed by macros into ↓
<Trans
id="example.plurals"
values={{sharedCount}}
defaults="{sharedCount, plural, none {Not shared with anyone}, one {Shared with one person}, other {Shared with # people}"
/>
// sharedCount = 0 -> Not shared with anyone
// sharedCount = 1 -> Shared with one person
// sharedCount = 3 -> Shared with # people
```
### Date and time
[Lingui has functions](https://lingui.js.org/ref/core.html#I18n.date) to format dates and times according to the convention to the user's preferred locale, based on the browser [Intl.DateTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) API. However, as displaying dates and times is fundamental to Grafana, guidelines have not been established for this yet.
## Documentation
[Grafana's documentation](https://grafana.com/docs/grafana/latest/) is not yet open for translation and should be authored in American English only.
@@ -27,10 +27,15 @@ Before you can merge a pull request, it must have a review approval, and all the
### Format the pull request title
The pull request title should be formatted according to `<Area>: <Summary>`. Keep the summary short and understandable for the community as a whole.
The pull request title should be formatted according to `<Area>: <Summary>` (Both "Area" and "Summary" should start with a capital letter).
Keep the summary short and understandable for the community as a whole.
All commits in a pull request are squashed when merged and the pull request title will be the default subject line of the squashed commit message. It's also used for [changelog/release notes](#include-in-changelog-and-release-notes).
**Example:**
`Docs: Change url to URL in all documentation files`
See [formatting guidelines](create-pull-request.md#formatting-guidelines) for more information.
### Assign a milestone
@@ -43,11 +48,31 @@ This makes it easier to track what changes go into a certain release. Without th
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.
Exactly what changes should be added to the changelog is hard to answer but some general guidance would be any change that you think would be interesting for the community as a whole. Use your best judgement and/or ask other maintainers for advice.
There's a GitHub action available in the repository named [Update changelog](https://github.com/grafana/grafana/blob/main/.github/workflows/update-changelog.yml) that can manually be triggered to re-generate the changelog and release notes for any release.
To include a pull request in the changelog/release notes the general rule of thumb is that a milestone should be assigned and labeled with `add to changelog`.
Exactly what changes should be added to the changelog is hard to answer but here's some general guidance:
- Include any bug fix in general.
- Include any change that you think would be interesting for the community as a whole.
- Skip larger features divided in multiple pull requests since they might go into the release blog post/What's New article.
- Use your best judgement and/or ask other maintainers for advice.
- Including a change in error rather than skipping one that should have been there is better.
- Always keep [Format the pull request title](#format-the-pull-request-title) in mind.
An active decision to include change in changelog/release notes needs to be taken for every pull request. There's a pull request check named **Changelog Check** that will enforce this. By adding/removing labels on the pull request or updating the pull request title/description the check will be re-evaluated.
#### Skip changelog
If you don't want to include your change in changelog/release notes you need to add a label named **no-changelog** to the pull request.
#### Include in changelog/release notes
To include a pull request in the changelog/release notes you need to add a label named `add to changelog` to the pull request. Then additional validation rules is checked:
- Title need to be formatted according to [Format the pull request title](#format-the-pull-request-title)
- Description needs to include a breaking change notice if change is labeled to be a breaking change, see Breaking changes below for more information.
Not complying with above rules can make the **Changelog Check** fail with validation errors.
The changelog/release notes are divided into sections and here's a description of how you make a pull request show up in a certain section.
description: This section contains information about API keys in Grafana
keywords:
- API keys
- Service accounts
menuTitle: API keys
title: API keys
weight: 700
---
# API keys
An API key is a randomly generated string that external systems use to interact with Grafana HTTP APIs.
When you create an API key, you specify a **Role** that determines the permissions associated with the API key. Role permissions control that actions the API key can perform on Grafana resources.
> **Note:** If you use Grafana v8.5 or newer, use service accounts instead of API keys. For more information, refer to [Service accounts]({{< relref "../service-accounts/" >}}).
{{< section >}}
## Create an API key
Create an API key when you want to manage your computed workload with a user.
This topic shows you how to create an API key using the Grafana UI. You can also create an API key using the Grafana HTTP API. For more information about creating API keys via the API, refer to [Create API key via API]({{< relref "../../developers/http_api/create-api-tokens-for-org/#how-to-create-a-new-organization-and-an-api-token" >}}).
### Before you begin:
- Ensure you have permission to create and edit API keys. For more information about permissions, refer to [About users and permissions]({{< relref "../roles-and-permissions/#" >}}).
**To create an API key:**
1. Sign in to Grafana, hover your cursor over **Configuration** (the gear icon), and click **API Keys**.
1. Click **New API key**.
1. Enter a unique name for the key.
1. In the **Role** field, select one of the following access levels you want to assign to the key.
- **Admin**: Enables a user to use APIs at the broadest, most powerful administrative level.
- **Editor** or **Viewer** to limit the key's users to those levels of power.
1. In the **Time to live** field, specify how long you want the key to be valid.
- The maximum length of time is 30 days (one month). You enter a number and a letter. Valid letters include `s` for seconds,`m` for minutes, `h` for hours, `d `for days, `w` for weeks, and `M `for month. For example, `12h` is 12 hours and `1M` is 1 month (30 days).
- If you are unsure about how long an API key should be valid, we recommend that you choose a short duration, such as a few hours. This approach limits the risk of having API keys that are valid for a long time.
1. Click **Add**.
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.