f42d0b9beb
[v8.3.x] Sync security changes ( #45067 )
...
* "Release: Updated versions in package to 8.3.5"
* [v8.3.x] Fix for CVE-2022-21702 (#225 )
Fix for CVE-2022-21702
* Update yarn.lock for 8.3.5
* resolve conflicts
(cherry picked from commit bb38cfcba4b4f824060ff385d858c63f50b72d74)
* csrf checks for v8.3.5 (#234 )
* Fix lint
* Cherry pick e2e test server changes
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com >
Co-authored-by: Kevin Minehart <kmineh0151@gmail.com >
Co-authored-by: Serge Zaitsev <serge.zaitsev@grafana.com >
2022-02-08 15:35:38 +01:00
Grot (@grafanabot)
9464ffa86b
Fix Discord Webhook URL for invalid template ( #44763 ) ( #44772 )
...
This commit fixes an issue where an invalid template for Discord would change the Webhook URL to "" and cause "unsupported protocol scheme" errors.
2022-02-02 14:48:27 +01:00
Konrad Lalik
60a25b4022
Alerting: Split legacy and unified routing configuration ( #44641 ) ( #44757 )
...
* Disable add alert menu entry for legacy alerting
* Split legacy and unified routing configuration
* Fix fallback routes configuration
(cherry picked from commit 69e4796504 )
2022-02-02 11:37:06 +01:00
Andrej Ocenas
30d5482a48
Prometheus: Fix some of the alerting queries that use reduce/math operation ( #44380 ) ( #44672 )
...
* Prometheus: Dont fill response with nulls for alerting queries
* Refactor based on reviews
(cherry picked from commit 780591cc12 )
2022-01-31 13:51:30 -05:00
Grot (@grafanabot) and George Robinson
8343e79f3e
Add metrics to ngalert scheduler ( #44602 ) ( #44670 )
...
This pull request adds metrics to the ngalert scheduler so we can see how long it takes to evaluate a tick.
(cherry picked from commit 5e2280ceee )
Co-authored-by: George Robinson <george.robinson@grafana.com >
2022-01-31 17:40:19 +00:00
Will Browne
ac8f1b5b6b
[v8.3.x] Plugins: Refactor Grafana and Plugin version update checkers ( #44662 )
...
* 44529
* fix test
2022-01-31 16:49:29 +01:00
Karl Persson
cdcbf64b67
quote reserved keyword ( #43652 ) ( #44649 )
...
(cherry picked from commit 2425828a0b )
2022-01-31 13:24:29 +01:00
Grot (@grafanabot) and Tania B
872727e745
Chore: Remove unused AWS KMS provider's token setting ( #44531 ) ( #44548 )
...
(cherry picked from commit 1a9c293984 )
Co-authored-by: Tania B <yalyna.ts@gmail.com >
2022-01-27 16:30:57 +01:00
Grot (@grafanabot) and Mitsuhiro Tanda
7c9c60b853
Cloud Monitoring: Reduce request size when listing labels ( #44365 ) ( #44473 )
...
(cherry picked from commit d1083b9597 )
Co-authored-by: Mitsuhiro Tanda <mitsuhiro.tanda@gmail.com >
2022-01-26 12:18:30 +01:00
Grot (@grafanabot) and Jean-Philippe Quéméner
42668a5e89
Alerting: recognize Cortex datasources correctly in the frontend ( #44316 ) ( #44325 )
...
* Alerting: always use msg field for user facing errors
* fix: revert front-end Cortex detection
Co-authored-by: gillesdemey <gilles.de.mey@gmail.com >
(cherry picked from commit 8ee3f59cd4 )
Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com >
2022-01-21 16:03:55 +01:00
Armand Grillet and Yuriy Tseretyan
c335538765
Create only one folder per dashboard with ACL ( #44317 )
...
Co-authored-by: Yuriy Tseretyan <yuriy.tseretyan@grafana.com >
2022-01-21 14:59:18 +01:00
Dimitris Sotirakis and Kevin Minehart
d3756d38ee
[v8.3.x] GetUserInfo: return an error if no user was found ( #211 ) ( #44166 )
...
* return an error if no user was found
* update condition
(cherry picked from commit ec87405543fe8032a0c2769d3ec97536b7a749ef)
Co-authored-by: Kevin Minehart <kmineh0151@gmail.com >
2022-01-18 16:53:03 +01:00
Grot (@grafanabot) and Piotr Jamróz
410d9a96cf
Elastic: Allow using long/int as date field for alerts ( #44027 ) ( #44115 )
...
* Use integers for time range filter
Previously it was passed as a string which is automatically converted by Elastic to a number only if the field type is "date". For other types (e.g. "long") such conversion doesn't work. In theory "date" could be passed as a formatted string but we don't use it this way and always pass it as a number so it is safe to always pass numbers, not strings.
* Fix time_series_query_test
* Retrigger build
(cherry picked from commit 9fb8339f87 )
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com >
2022-01-17 16:19:50 +01:00
Grot (@grafanabot) and Ivana Huckova
4ed62247f0
Prometheus: Fix interpolation of $__rate_interval variable ( #44035 ) ( #44114 )
...
* Name fields based on targets length
* Remove rounding in rate interval variable replacing
* Refactor and fix edge case when interval and time duration would be rate interval
* Add tests
* Remove , from test
* Revert "Name fields based on targets length"
This reverts commit 5dcb34a765 .
(cherry picked from commit e704110f74 )
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com >
2022-01-17 15:44:56 +01:00
Grot (@grafanabot) and J Guerreiro
16a8902593
Usage stats: Count API keys ( #42883 ) ( #44025 )
...
* Stats: add api key count to usage stats
* Chore: correctly capitalize struct member
(cherry picked from commit a1b8b5d123 )
Co-authored-by: J Guerreiro <joao.guerreiro@grafana.com >
2022-01-14 10:28:02 +01:00
Grot (@grafanabot) and Gábor Farkas
37bb5f17f2
prometheus: fix auto-inserting null-timestamps at the end ( #44022 ) ( #44024 )
...
(cherry picked from commit bedc5cccaa )
Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com >
2022-01-14 10:05:58 +01:00
Grot (@grafanabot) and Gábor Farkas
c76acbadd6
Prometheus: add tests covering the prometheus-response to dataframes conversion ( #43892 ) ( #44023 )
...
* prometheus: add tests covering prometheus_response to grafana_dataframes
* fixed variable name
* added comment
* removed not-helping function call
(cherry picked from commit 4a88b8f66c )
Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com >
2022-01-14 09:47:08 +01:00
Grot (@grafanabot) and Victor Marin
5bd12321ca
Postgres/MySQL/MSSQL: Cancel in-flight SQL query if user cancels query in grafana ( #43890 ) ( #43965 )
...
(cherry picked from commit f881fd1637 )
Co-authored-by: Victor Marin <36818606+mdvictor@users.noreply.github.com >
2022-01-12 15:43:21 +01:00
Travis Patterson
c45313a268
Propagate all headers ( #43812 ) ( #43922 )
...
* Propagate all headers
* stable header order
(cherry picked from commit 9eb82f9fff )
2022-01-11 14:39:52 -07:00
Travis Patterson
d3d3e99a3f
Forward oauth tokens after prometheus datasource migration ( #43686 ) ( #43818 )
...
* create the prom client
* implement lru cache of prometheus clients based on auth headers
* linter
(cherry picked from commit 20b3b2a448 )
2022-01-07 19:25:13 +01:00
Alexander Weaver
926bfee34a
Alerting: Allow customization of Google chat message ( #43568 ) ( #43723 )
...
* Allow customizable googlechat message via optional setting
* Add optional message field in googlechat contact point configurator
* Fix strange error message on send if template fails to fully evaluate
* Elevate template evaluation failure logs to Warn level
* Extract default.title template embed from all channels to shared constant
(cherry picked from commit fd583a0e3b )
2022-01-05 11:33:20 -06:00
Grot (@grafanabot) and Ivana Huckova
f7dabc4287
Prometheus: Fill missing steps with null values ( #43622 ) ( #43701 )
...
* Prometheus: Add empty points when data points missing
* Remove newline
* Add comments
* Improve/Fix test
* Remove unused variable
(cherry picked from commit d7d6c10664 )
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com >
2022-01-05 11:55:04 +01:00
Grot (@grafanabot) and Gilles De Mey
07fe2404cc
fix: pass OrgId to alertNotification model ( #43678 ) ( #43695 )
...
fixes #43214
(cherry picked from commit 837925390f )
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com >
2022-01-05 10:34:46 +01:00
Grot (@grafanabot) and Ryan McKinley
2af71f339c
Import: fix dashboard imports with expressions ( #43630 ) ( #43680 )
...
(cherry picked from commit b09d498484 )
Co-authored-by: Ryan McKinley <ryantxu@gmail.com >
2022-01-04 10:09:41 -08:00
Joan López de la Franca Beltran
27e65a5a10
Encryption: Increase context timeout on flaky test ( #43553 ) ( #43574 )
...
(cherry picked from commit 80e0dd74d2 )
2021-12-29 10:43:22 +01:00
Joan López de la Franca Beltran
40bee1a534
Encryption: Fix DEKs cache ( #43129 ) ( #43551 )
...
* Encryption: Fix DEKs cache
* Clarify tests
(cherry picked from commit 83bc445d3e )
2021-12-29 10:18:47 +01:00
Grot (@grafanabot) and Marcus Efraimsson
a36706f226
Plugins: Set backend metadata property for core plugins ( #43349 ) ( #43475 )
...
Ref #42648
Ref #42781
(cherry picked from commit 7d3bdb6d1b )
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com >
2021-12-22 18:15:33 +01:00
Grot (@grafanabot) and Jean-Philippe Quéméner
96c0d1e6eb
Alerting: fix gosec warning that is not valid ( #43425 ) ( #43442 )
...
(cherry picked from commit ffc72aa255 )
Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com >
2021-12-21 20:22:08 +01:00
Grot (@grafanabot) and Gábor Farkas
55d5c6ba16
prometheus: respect the http-method data source setting ( #42753 ) ( #43341 )
...
* prometheus: respect the http-method data source setting
* removed forgotten if-true section
* refactored json-check
(cherry picked from commit 1879a6855e )
Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com >
2021-12-20 11:43:39 +01:00
Grot (@grafanabot) and Yuriy Tseretyan
5c9c5f2f61
Alerting: make alert rule routine evaluation control be thread-safe ( #41220 ) ( #43243 )
...
* change registry.delete to return deleted struct
* use pointer to alertRuleInfo instead copying.
* do not access evaluation channel when routine is stopped
* remove stopCh and use context cancellation
* do not return ctx.Err when channel is cancelled because it cancels all other routines
* make alertRuleInfo fields and functions package private
(cherry picked from commit 1a762083d7 )
Co-authored-by: Yuriy Tseretyan <tceretian@gmail.com >
2021-12-16 15:48:53 -05:00
Grot (@grafanabot) and Jean-Philippe Quéméner
b78aca6e23
Alerting: log errors happening in the API on server side ( #43192 ) ( #43205 )
...
* Alerting: log errors happening in the API on server side
* adapt tests to reflect changed payload
(cherry picked from commit b605340668 )
Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com >
2021-12-16 14:02:49 +01:00
Grot (@grafanabot) and Gilles De Mey
20222bada0
Alerting: use HTML-safe characters for the default template ( #43148 ) ( #43170 )
...
(cherry picked from commit cbbbb505b4 )
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com >
2021-12-15 18:13:11 +01:00
Grot (@grafanabot) and Yuriy Tseretyan
ef1a9ef126
Populate missing UID of provisioned data source only for new records ( #42999 ) ( #43061 )
...
* defer updating empty UID to insert command
* change logging to use the command
(cherry picked from commit 35b0067650 )
Co-authored-by: Yuriy Tseretyan <tceretian@gmail.com >
2021-12-15 11:40:11 +00:00
Grot (@grafanabot) and gotjosh
89607fbdb3
Alerting: Fix Annotation Creation when the alerting state changes ( #42479 ) ( #43113 )
...
* Fix Annotation creation
- Remove validation of panelID, now annotations are created irrespective on whether they're attached to a panel or not.
- Alwasy attach the annotation to an AlertID
* Fix annotation creation
* fix tests
(cherry picked from commit 357e9ed1ea )
Co-authored-by: gotjosh <josue@grafana.com >
2021-12-14 17:56:43 +00:00
Grot (@grafanabot) and Yuriy Tseretyan
e76d898f22
Alerting: fix sqlstore.GetFolderByTitle to search for folder ( #42898 ) ( #43059 )
...
* a test to reproduce the bug
(cherry picked from commit b63595b47f )
Co-authored-by: Yuriy Tseretyan <tceretian@gmail.com >
2021-12-13 15:49:58 -05:00
Grot (@grafanabot) and Torkel Ödegaard
3ac0aaae80
AppPlugins: Support app plugins with only default nav ( #43016 ) ( #43028 )
...
(cherry picked from commit 0e88f5db85 )
Co-authored-by: Torkel Ödegaard <torkel@grafana.org >
2021-12-13 14:22:53 +01:00
Grot (@grafanabot) and Marcus Efraimsson
361ad74acf
Backport fix ( #42979 ) ( #42984 )
...
* fixes
(cherry picked from commit a2c386915ce11b9422f4af8ae181eaa1a22bc5c3)
(cherry picked from commit 06706efbbe )
* fix regex
(cherry picked from commit a259213a3badc9618e969f2c8db0a0143f00faee)
(cherry picked from commit 1d7105c095 )
* lint (#42970 )
(cherry picked from commit afb9e8e5f3 )
Co-authored-by: Will Browne <will.browne@grafana.com >
Co-authored-by: malcolmholmes <42545407+malcolmholmes@users.noreply.github.com >
(cherry picked from commit d6ec6f8ad2 )
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com >
2021-12-10 16:30:18 +01:00
Grot (@grafanabot) and Carl Bergquist
2f9153c95e
Macaron: Prevent WriteHeader invalid HTTP status code panic ( #42973 ) ( #42974 )
...
(cherry picked from commit 92005159c89f848ab8b8435e0c8751599e2e8aff)
Co-authored-by: Todd Treece <todd.treece@grafana.com >
(cherry picked from commit f9481527de )
Co-authored-by: Carl Bergquist <carl.bergquist@gmail.com >
2021-12-10 14:14:47 +01:00
Grot (@grafanabot) and Ivana Huckova
8ebb8887bc
Prometheus: Interpolate curly brackets syntax variable ( #42927 ) ( #42929 )
...
(cherry picked from commit 2655be61b6 )
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com >
2021-12-09 14:51:23 +01:00
Grot (@grafanabot) and Joan López de la Franca Beltran
e8f1d6db44
Store 'alertmanager_configuration' as JSON string instead of raw bytes ( #42443 ) ( #42602 )
...
(cherry picked from commit 5183cc4dc4 )
Co-authored-by: Joan López de la Franca Beltran <5459617+joanlopez@users.noreply.github.com >
2021-12-09 11:44:16 +01:00
Grot (@grafanabot) and Isabella Siu
a1d4846f7f
CloudMonitor: Iterate over pageToken for resources ( #42546 ) ( #42833 )
...
(cherry picked from commit a2ad0a0fb6 )
Co-authored-by: Isabella Siu <sakurablossom@blueblueworld.com >
2021-12-09 11:38:07 +01:00
6aafac7e60
[v8.3.x] Security: Fix directory traversal issue ( #42838 )
...
* security: fix dir traversal issue
* Improve comments and error message.
* Fix lint
Co-authored-by: Kyle Brandt <kyle@grafana.com >
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com >
2021-12-07 19:37:30 +02:00
Grot (@grafanabot) and Ivana Huckova
294739328a
Prometheus: Fix passing of custom params when running queries ( #42728 ) ( #42748 )
...
* Prometheus: Fix passing of custom params
* Remove prints
(cherry picked from commit 21fe78302b )
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com >
2021-12-05 16:45:18 +01:00
Grot (@grafanabot) and gotjosh
ffde9fcfcf
Fix flaky tests in several notifiers ( #42668 ) ( #42734 )
...
* Fix flaky tests in several notifiers
- Non-mocked time in sensu go tests
- Close server in Slack tests
- Use a mutex for writing responses in the fake slack server
* Remove mutex at the fake slack server
(cherry picked from commit bdab1d1f1f )
Co-authored-by: gotjosh <josue@grafana.com >
2021-12-03 17:03:48 +00:00
Grot (@grafanabot) and George Robinson
482d99ab0e
Alerting: Add Ref ID to DatasourceNoData and DatasourceError alerts ( #42630 ) ( #42729 )
...
(cherry picked from commit c932dc959c )
Co-authored-by: George Robinson <george.robinson@grafana.com >
2021-12-03 11:10:08 +01:00
Grot (@grafanabot) and Marcus Efraimsson
3e7d7f55c6
Chore: Fix flaky serverlock integration test ( #42633 ) ( #42639 )
...
(cherry picked from commit 54fa7b57fe )
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com >
2021-12-02 13:08:06 +01:00
Grot (@grafanabot) and Yuriy Tseretyan
189f7ca327
Alerting: Update alert rule migration to use expanded queries ( #42493 ) ( #42568 )
...
* move targetData to target
* use constants instead of literals.
* Update comments and add tests
Co-authored-by: gotjosh <josue.abreu@gmail.com >
(cherry picked from commit 9139f61105 )
Co-authored-by: Yuriy Tseretyan <tceretian@gmail.com >
2021-12-01 14:19:00 +00:00
Grot (@grafanabot) and gotjosh
4a001c87ee
Alerting: Fix panic while proxying 4xx responses of requests to cortex/loki ( #42570 ) ( #42584 )
...
Fixes a panic that would ocurr as we proxy 4xx responses. When this happens and the content type of the response is JSON we try to check if the response has a "message" key. Then, we assume that the key will contain a value of string but we don't take into account that this value can potentially be `null`.
This adds a type assertion check to to this assumption so that we can keep the original JSON body as the response if we're unable to extract an `message`.
(cherry picked from commit 5b64c4f684 )
Co-authored-by: gotjosh <josue@grafana.com >
2021-12-01 14:18:37 +00:00
Grot (@grafanabot) and ying-jeanne
9d6491be4f
fix error code for delete folder ( #42470 ) ( #42519 )
...
(cherry picked from commit e13e6a7bd7 )
Co-authored-by: ying-jeanne <74549700+ying-jeanne@users.noreply.github.com >
2021-11-30 14:21:31 +01:00
Grot (@grafanabot) and Joan López de la Franca Beltran
892d9a2258
Settings: Fix handling ( #42497 ) ( #42511 )
...
* Settings: Fix handling
(cherry picked from commit 690ffdff56 )
Co-authored-by: Joan López de la Franca Beltran <5459617+joanlopez@users.noreply.github.com >
2021-11-30 11:48:32 +01:00