Commit Graph

10120 Commits

Author SHA1 Message Date
Jean-Philippe Quéméner
670291e8a8 [v9.4.x] fix(alerting): fallback to dashboard to get the full targets PART5 (#78406) 2023-11-20 18:48:15 +01:00
Jean-Philippe Quéméner
7299e24f6e [v9.4.x] fix(alerting): fallback to dashboard to get the full targets PART4 (#78277) 2023-11-16 15:43:22 +01:00
Jean-Philippe Quéméner
974850e81a [v9.4.x] fix(alerting): fallback to dashboard to get the full targets PART 3 (#78240)
[v9.4.x] fix(alerting): fallback to dashboard to get the full targets PART3
2023-11-16 10:37:35 +01:00
Jean-Philippe Quéméner
d5bdc3e90d [v9.4.x] fix(alerting): fallback to dashboard to get the full targets… (#77779)
[v9.4.x] fix(alerting): fallback to dashboard to get the full targets PART2
2023-11-07 12:07:21 +01:00
Jean-Philippe Quéméner
bf2e034e49 [v9.4.x] fix(alerting): fallback to dashboard to get the full targets (#77693)
* [v9.4.x] fix(alerting): fallback to dashboard to get the full targets

* fix unit test

* fix more tests

* fix go lint
2023-11-06 14:06:59 +01:00
Matthew Jacobson
087cf5a877 [v9.4.x] Alerting: During legacy migration do not create one silence per rule (#77642)
* Alerting: During legacy migration do not create one silence per rule

During legacy migration every migrated rule is given a label rule_uid=<uid>.
This is used to silence migrated alerts if they were:

- Paused in legacy alerting.
- Had Error state set to keep last state.
- Had NoData state set to keep last state.

This can potentially create a large amount of silences and a high cardinality
label. Both of these scenarios have poor outcomes for CPU load and latency in
unified alerting.

Instead, this change opts to create one or more of three labels on each
migrated alert rule as well as three silence rules:

- migration_paused = true
- migration_keep_last_state_error = true
- migration_keep_last_state_nodata = true

 This will drastically reduce the number of created silence rules in most cases
 as well as not create the potentially high cardinalty label `rule_uid`.
2023-11-03 15:12:52 -04:00
grafana-delivery-bot[bot]
a6610343c9 [v9.4.x] Alerting: Fix state manager to not keep datasource_uid and ref_id labels in state after Error (#77392)
* Alerting: Fix state manager to not keep datasource_uid and ref_id labels in state after Error (#72216)

(cherry picked from commit 78fc3bcdf4)

* user QueryError

---------

Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
2023-11-03 12:05:36 -04:00
Guilherme Caulada
2b54a169b2 [v9.4.x] CI: Update CI/CD tooling and pipelines from main (#76881)
* CI: Update CI/CD tooling and pipelines from main (#76814)

* CI: Update CI/CD tooling and pipelines from main

* Update Makefile

* Comment out validate_openapi_spec_step

* Update broken frontend tests

* Fix validate-npm-packages regex to work without suffix

* Fix cypress image version

(cherry picked from commit 03ecb1db39)

* Fix path for ./pkg/kindsys/report.go on Makefile

* Re-add ./pkg/cmd/grafana-cli/runner to make gen-go
2023-10-20 12:19:18 -03:00
Horst Gutmann
f6b68f9bf4 [v9.4.x] Building: Remove dependency to urw-fonts in RPM packages (#76223)
Building: Remove dependency to urw-fonts in RPM packages (#76198)

(cherry picked from commit 1355660313)
2023-10-10 09:51:52 +03:00
Horst Gutmann
78ec819807 [v9.4.x] Chore: Upgrade Alpine base image to 3.18.3 (#74996)
Chore: Upgrade Alpine base image to 3.18.3 (#74984)

(cherry picked from commit 85abf2bebd)
2023-09-18 13:28:43 +03:00
Yuri Tseretyan
6d1747ff16 [v9.4.x] SSE: Fix DSNode to not panic when response has empty response (#74870)
Fix DSNode to not panic when response has empty response (#74866)
2023-09-13 15:17:07 -04:00
Ieva
c37cebb26f [v9.4.x] Search: Improvements for starred dashboard search (#74662)
* fix merge conflicts

* fix test
2023-09-11 16:54:51 +03:00
ismail simsek
aa758499ea [v9.4.x] Prometheus: Handle the response with different field key order (#74623)
Prometheus: Handle the response with different field key order (#74567)

* Handle the response with different field key order

* More unit tests to cover edge cases

* Cover more edge cases

* make it simpler

* Better test inputs

(cherry picked from commit 3107459e57)
2023-09-11 13:41:29 +02:00
Yuri Tseretyan
82ac2432d4 SSE: DSNode to update result with names to make each value identifiable by labels (only Graphite and TestData) (#74615)
SSE: DSNode to update result with names to make each value identifiable by labels (only Graphite and TestData) (#73642)

* SSE: DSNode to update result with names to make each value identifiable by labels (only Graphite and TestData) (#71246)

* introduce a function checkIfSeriesNeedToBeFixed to scan all value fields in the response and provide a function that updates Series so they can be uniquely identifiable. Only Graphite and TestData are checked.

* update `DSNode.Execute` to run this function and provide it to WideToMany
* update WideToMany to run the fix function if it is not nil
2023-09-08 15:04:24 -04:00
Gabriel MABILLE
49d3cf745f [v9.4.x] LDAP: Fix user disabling (#74318)
* [LDAP] Disable removed users on login (#74016)

* manual backport of #74016 on legacy code

* LDAP: Fix active sync with large quantities of users (#73834)

* Fix authenticate user test
2023-09-04 16:14:20 +02:00
grafana-delivery-bot[bot]
b347249fa9 [v9.4.x] CI: Improve error handling in gcloud copy operations (#73536)
CI: Improve error handling in gcloud copy operations (#73474)

(cherry picked from commit 220ea869be)

Co-authored-by: Horst Gutmann <horst.gutmann@grafana.com>
2023-08-21 09:26:20 +03:00
grafana-delivery-bot[bot]
a9bae1ad62 [v9.4.x] Grafana versioning: Remove pre suffix from Grafana version (#73364)
Grafana versioning: Remove `pre` suffix from Grafana version (#73357)

* Remove pre suffix from version

* Fix tests

(cherry picked from commit 0aba319ea0)

Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
2023-08-17 11:29:10 +03:00
Dimitris Sotirakis
c6634f3780 [v9.4.x] Bug: Compare semver digits for frontend packages config (#71906)
Bug: Compare `semver` digits for frontend packages config (#71829)

* Compare semver digits

* Fix lint

(cherry picked from commit 5f8ace33fb)

# Conflicts:
#	pkg/build/frontend/config_test.go
2023-07-19 10:21:47 +03:00
grafana-delivery-bot[bot]
98d339bc12 [v9.4.x] Plugins: Only configure plugin proxy transport once (#71740)
Plugins: Only configure plugin proxy transport once (#71735)

only configure plugin proxy transport once

(cherry picked from commit b59ca7fb22)

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2023-07-17 14:54:03 +03:00
grafana-delivery-bot[bot]
6ab231d61d [v9.4.x] Prometheus: Version detect bug (#71242)
Prometheus: Version detect bug (#71198)

* remove redundant request copy in backend, add more versions to semver lists

(cherry picked from commit 7dc071f46b)

Co-authored-by: Galen Kistler <109082771+gtk-grafana@users.noreply.github.com>
2023-07-07 14:21:31 -05:00
Ieva
5829fdd399 Auth: Remove Email Lookup from oauth integrations 9.4 (#896)
backport https://github.com/grafana/grafana-private-mirror/pull/894 to 9.4.x
2023-06-23 08:58:42 +02:00
Dimitris Sotirakis
c251570039 [v9.4.x] Bug: Fix build-frontend* config checks (#70076) (#70118)
Bug: Fix `build-frontend*` config checks (#70076)

* Fix frontend config checks

* Exclude test tag events

(cherry picked from commit 5a36fa5f8a)

# Conflicts:
#	pkg/build/cmd/buildfrontendpackages.go
2023-06-15 09:44:30 +03:00
Dimitris Sotirakis
c1cddece45 [v9.4.x] CI: Add CI check for what's new link (#70046) (#70121)
CI: Add CI check for `what's new` link (#70046)

* Add whatsnewchecker

* Add whatsnewchecker_test

* Small fixes

* Add step in CI

* Fix lint

* Fix starlark

* t.Cleanup instead of separate func

* Skip check for test tags

(cherry picked from commit 91272ee4f9)

# Conflicts:
#	.drone.yml
#	scripts/drone/events/release.star
2023-06-15 09:43:55 +03:00
Dimitris Sotirakis
9117cec064 [v9.4.x] NPM packages: Fail build-frontend-packages step if package.json and input tag differ (#70011) (#70041)
* NPM packages: Fail `build-frontend-packages` step if `package.json` and input tag differ (#70011)

* Fail if package.json version is different than the tag

* Add tests

* Update message

* Small refactoring

* Fix lint

(cherry picked from commit a6b524fd56)

* Bump urfave/cli/v2

* go mod tidy
2023-06-14 12:42:05 +03:00
Grot (@grafanabot)
8c42bef420 [v9.4.x] Docker: Add ARM64 architecture for Docker, for PRs (#69713)
Docker: Add ARM64 architecture for Docker, for PRs (#68295)

* Add ARM64 architecture for Docker

* Add arm64 variants

(cherry picked from commit bbd83cbaeb)

Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
2023-06-07 17:35:23 +03:00
Grot (@grafanabot)
8faf41ff7f [v9.4.x] Prevent crash while executing concurrent mixed queries (#876)
Prevent crash while executing concurrent mixed queries (#874)

limit parallel query execution to 1 at a time

(cherry picked from commit 96579a60e19e2a9f2d6bdaeba64e0e702211eb73)

Co-authored-by: Michael Mandrus <41969079+mmandrus@users.noreply.github.com>
2023-06-06 13:27:09 +02:00
George Robinson
f30c03c281 [v9.4.x] Require alert.notifications:write permissions to test receivers and templates (#868)
Require alert.notifications:write permissions to test receivers and templates (#865)

(cherry picked from commit 3c21ab70075256d4ba8e4fbfdcb15f5a394161fa)
2023-06-06 13:27:08 +02:00
Grot (@grafanabot)
e6ed9908e3 [v9.4.x] GoogleAPI: Add retries functionallity to GoogleAPI calls (#69142)
GoogleAPI: Add retries functionallity to GoogleAPI calls (#69129)

* Add retryer to GoogleAPI calls

* Add comment

(cherry picked from commit 515270f5fd)

Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
2023-05-26 10:21:16 +00:00
Dimitris Sotirakis
324ba5c62b [v9.4.x] G10: Replace beta with preview references (#68347) (#68948)
G10: Replace `beta` with `preview` references (#68347)

* Update references

* Update grabpl to v3.0.38

(cherry picked from commit 7e816d010c)

# Conflicts:
#	.drone.yml
2023-05-24 02:21:50 -07:00
Dimitris Sotirakis
81d4d8f228 [v9.4.x] Remove code to publish to RPM and deb repos (#61786) (#68952)
Remove code to publish to RPM and deb repos (#61786)

This was replaced here: https://github.com/grafana/grafana/pull/53553 and it's no longer used

(cherry picked from commit a190e03133)

Co-authored-by: Julien Duchesne <julien.duchesne@grafana.com>
2023-05-24 10:49:30 +02:00
Grot (@grafanabot)
c794e68ea2 [v9.4.x] Docker: Add mode label when building docker images (#68868)
Docker: Add `mode` label when building docker images (#68865)

Add mode label when building docker image

(cherry picked from commit bad570ee86)

Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
2023-05-23 10:56:06 +02:00
Grot (@grafanabot)
4d944081bc [v9.4.x] Utils: Reimplement util.GetRandomString to avoid modulo bias (#66969)
Utils: Reimplement util.GetRandomString to avoid modulo bias (#64481)

* reimplement GetRandomString, add tests that results are unbiased

(cherry picked from commit 7e765c870a)

Co-authored-by: Dan Cech <dcech@grafana.com>
2023-05-22 14:55:20 -04:00
Grot (@grafanabot)
0fb2bd25d3 [v9.4.x] Revert: Allow editors to access GET /datasources (#68653)
Revert: Allow editors to access GET /datasources (#68632)

Revert "Allow editors to access GET /datasources"

This reverts commit 5a830c43c0.

(cherry picked from commit 6a2bcba078)

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
2023-05-17 19:18:07 +01:00
Ivan Ortega Alba
c0ca04e9a3 [v9.4.x] Dashboards: Remove no-datasource screen (#68574) (#68646)
Dashboards: Remove no-datasource screen (#68574)

* Dashboards: Remove non-ds configured landing page

* Remove `datasourceOnboarding` feature toggle

(cherry picked from commit 1505a188eb)
2023-05-17 19:26:52 +03:00
Andreas Christou
c8077a982e [v9.4.x] AzureMonitor: Fix Log Analytics portal links (#65482) (#68523)
AzureMonitor: Fix Log Analytics portal links (#65482)

* Fix and update Log Analytics portal links

- Build portal URL in backend
- Correctly set multiple resource value
- Move AddConfigLinks util function
- Add necessary types
- Remove unused functions

* Fix lint issue

* Remove unused cache variable

(cherry picked from commit e27cb67776)

# Conflicts:
#	.betterer.results
2023-05-16 17:12:01 +00:00
ismail simsek
fb9429b1f7 [v9.4.x] Prometheus: Fix fallback http method when no http method specified in jsonData (#68434)
Prometheus: Fix fallback http method when no http method specified in jsonData (#65229)

Use POST as default if no http method specified in jsonData

(cherry picked from commit 959349d191)
2023-05-14 15:52:31 +02:00
Grot (@grafanabot)
f5da579af9 [v9.4.x] Alerting: Migration to not fail if alert_configuration table is not empty (#68404)
Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
2023-05-12 22:30:27 +03:00
Adam Simpson
126426e15e AzureMonitor: Correct series name accounting for dimensions (#67050) (#68033)
Correct displayName accounting for dimensions

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
2023-05-09 13:06:36 +00:00
Grot (@grafanabot)
bcdc8cd5ab [v9.4.x] AzureMonitor: Fix logs query multi-resource and timespan values (#67931)
AzureMonitor: Fix logs query multi-resource and timespan values (#67914)

* Update TimeGrain interface methods

- Make them util functions because it's simpler

* Update logs ds to appropiately set resources and timespan

* Set timespan using RCF times

* Update tests

(cherry picked from commit 9d16718acc)

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
2023-05-05 20:19:04 +03:00
Grot (@grafanabot)
885057c4d2 [v9.4.x] Grafana Cloud: Put cloud artifacts to */release dir (#67530)
Grafana Cloud: Put cloud artifacts to `*/release` dir (#66168)

Put cloud artifacts to */release dir

(cherry picked from commit a2634495e5)

Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
2023-04-28 18:23:20 +03:00
Grot (@grafanabot)
8f169dc42d [v9.4.x] Grafana Cloud: Add VariantLinuxAmd64 in build variants (#67527)
Grafana Cloud: Add `VariantLinuxAmd64` in build variants (#66167)

Add VariantLinuxAmd64 in build variants

(cherry picked from commit 8dd87a79f7)

Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
2023-04-28 18:22:13 +03:00
Horst Gutmann
6d1b00c745 AuthJWT: Fix JWT query param leak (CVE-2023-1387) [9.4.x] (#823)
* fix JWT query param leak

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
Co-authored-by: Kalle Persson <kalle.persson@grafana.com>
(cherry picked from commit 9e205a0)

* skip broken test

(cherry picked from commit 58e235a)
2023-04-27 14:36:34 +03:00
Grot (@grafanabot)
44c3c5f269 [v9.4.x] Alerting: Fix misleading status code in provisioning API (#67357)
Alerting: Fix misleading status code in provisioning API (#67331)

Fixes #66249

(cherry picked from commit dfc99cdd19)

Co-authored-by: Uwe Sommerlatt <uwe.sommerlatt@gmail.com>
2023-04-27 11:41:38 +03:00
Grot (@grafanabot)
ffe711cb14 [v9.4.x] Expressions/threshold: Fix incorrect thresholds args length (#66925)
Expressions/threshold: Fix incorrect thresholds args length (#66859)

(cherry picked from commit 350de3f3bf)

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2023-04-20 13:16:54 +02:00
Grot (@grafanabot)
b4d141ed1c [v9.4.x] Alerting: Update migration to put alerts to the default folder if dashboard folder is missing (#66593)
Alerting: Update migration to put alerts to the default folder if dashboard folder is missing (#65577)

* extract function

* use context logger

* put alert to general folder if folder is missing

* move folderHelper init

* add test

* Update pkg/services/sqlstore/migrations/ualert/ualert.go

Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>

---------

Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>
(cherry picked from commit 7b2f44762e)

Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
2023-04-15 08:08:57 +02:00
Grot (@grafanabot)
d6785c9223 [v9.4.x] Google Cloud Monitoring: Fix project variable (#66602)
Google Cloud Monitoring: Fix project variable (#66524)

Google Cloud Monitoring: fix project variable

Also fix typo found while debugging

(cherry picked from commit 02951e8a26)

Co-authored-by: Adam Simpson <adam@adamsimpson.net>
2023-04-14 15:29:30 +00:00
Grot (@grafanabot)
cd8cd0f246 [v9.4.x] Auth: Remove the session cookie only if it's invalid or revoked (#66430)
Auth: Remove the session cookie only if it's invalid or revoked (#65984)

Remove the cookie if it's invalid or revoked

(cherry picked from commit 4cac95d1c2)

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
2023-04-13 09:53:31 +02:00
Grot (@grafanabot)
edae149230 [v9.4.x] AccessControl: Allow editors to access GET /api/datasources (#66375)
AccessControl: Allow editors to access GET /api/datasources (#66343)

Allow editors to access GET /datasources

(cherry picked from commit 2c21090931)

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
2023-04-12 15:55:33 +02:00
Dimitris Sotirakis
0366e6f469 [v9.4.x] CI: Split /bin/build artifacts * subcommand (#66005) (#66344)
CI: Split `/bin/build artifacts *` subcommand (#66005)

* Split go files

* Modify publishartifacts.go

* Split main

* FIXME: Temp add GCSCopy to gcloud/storage

* Fix lint

* Exported flags

* Update starlark - make drone

* Further backend lint fixes

* Add fallback_test.go

* Fix go imports order

* make drone

* Remove GCSCopy from static assets

* Remove GCSCopy from storybook

* Fix lint

* Remove GCSCopy

* Remove success logline

* drone yaml cleanup

* Add artifacts-editions flag

* Fix starlark

* Add default sting slice in artifacts packages command

(cherry picked from commit 24d348f804)

# Conflicts:
#	.drone.yml
2023-04-12 12:36:33 +03:00
Eric Leijonmarck
d37fa06f05 [v9.4.x] Auth: Fix orgrole picker disabled if isSynced user (#65553)
Auth: Fix orgrole picker disabled if isSynced user (#64033)

* fix: disable orgrolepicker if externaluser is synced

* add disable to role picker

* just took me 2 hours to center the icon

* wip

* fix: check externallySyncedUser for API call

* remove check from store

* add: tests

* refactor authproxy and made tests run

* add: feature toggle

* set feature toggle for tests

* add: IsProviderEnabled

* refactor: featuretoggle name

* IsProviderEnabled tests

* add specific tests for isProviderEnabled

* fix: org_user tests

* add: owner to featuretoggle

* add missing authlabels

* remove fmt

* feature toggle

* change config

* add test for a different authmodule

* test refactor

* gen feature toggle again

* fix basic auth user able to change the org role

* test for basic auth role

* make err.base to error

* lowered lvl of log and input mesg

(cherry picked from commit 3cd952b8ba)
2023-04-05 09:55:43 +01:00