Commit Graph

10725 Commits

Author SHA1 Message Date
grafana-delivery-bot[bot]
d7b7e47f6c [v10.0.x] Tracing: supply Grafana build version (#70489)
Tracing: supply Grafana build version (#69733)

* tracing: supply Grafana build version

Not etcd client version.

* go mod tidy

(cherry picked from commit c45ff94806)

Co-authored-by: Bryan Boreham <bjboreham@gmail.com>
2023-06-22 12:12:48 +03:00
Matthew Jacobson
c364c8dc0b [v10.0.x] Alerting: Fix unique violation when updating rule group with title chains/cycles (#70467)
* Alerting: Fix TestIntegration_GetAlertRulesForScheduling to make sure rules are created in different org (#69088)

make sure rules are created in different org

(cherry picked from commit b57ef1f2c7)

* Alerting: Fix flaky TestIntegrationUpdateAlertRules (#69106)

Prevents duplicate alert rule ids and 0 value for BaseInterval and IntervalSeconds

(cherry picked from commit 97ae6ae6ef)

* Alerting: Fix unique violation when updating rule group with title chains/cycles (#67868)

* Alerting: Fix unique violation when updating rule group with title chains/cycles

The uniqueness constraint for titles within an org+folder is enforced on every update within a transaction instead of on commit (deferred constraint). This means that there could be a set of updates that will throw a unique constraint violation in an intermediate step even though the final state is valid. For example, a chain of updates RuleA -> RuleB -> RuleC could fail if not executed in the correct order, or a swap of titles RuleA <-> RuleB cannot be executed in any order without violating the constraint.

The exact solution to this is complex and requires determining directed paths and cycles in the update graph, adding in temporary updates to break cycles, and then executing the updates in reverse topological order (see first commit in PR if curious).

This is not implemented here.

Instead, we choose a simpler solution that works in all cases but might perform more updates than necessary. This simpler solution makes a determination of whether an intermediate collision could occur and if so, adds a temporary title on all updated rules to break any cycles and remove the need for specific ordering.

In addition, we make sure diffs are executed in the following order: DELETES, UPDATES, INSERTS.

(cherry picked from commit 0c688190f7)

* Linting

---------

Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
2023-06-21 14:38:38 -04:00
grafana-delivery-bot[bot]
dbd7fe1cc7 [v10.0.x] Alerting: Add debug logs when saving instances is finished (#70449)
Alerting: Add debug logs when saving instances is finished (#70447)

(cherry picked from commit 8a13ee3cd4)

Co-authored-by: George Robinson <george.robinson@grafana.com>
2023-06-21 14:17:52 +01:00
Grot (@grafanabot)
a8c52947ae [v10.0.x] Alerting: Add debug logs for EndsAt timestamp (#70366)
Alerting: Add debug logs for EndsAt timestamp (#70336)

This commit adds debug logs for previous_ends_at and next_ends_at
to state.go to help us debug issues where alerts are resolved in
Alertmanager due to expiration. This change is in response to a
support escalation where this information was needed but unavailable.

(cherry picked from commit 815e98ed95)

Co-authored-by: George Robinson <george.robinson@grafana.com>
2023-06-20 12:25:42 +03:00
Jean-Philippe Quéméner
080c56b128 [v10.0.x] Alerting: Rewrite range to instant queries if possible (#70289) 2023-06-19 09:12:45 +02:00
Grot (@grafanabot)
91ef2045bc Plugins: Wrap original check health error (#70227)
Plugins: Wrap original check health error (#69944)

Fixes #69765

(cherry picked from commit 62ee1fa05a)

Co-authored-by: Kousik Mitra <kousikmitra12@gmail.com>
2023-06-16 11:47:07 +02:00
Grot (@grafanabot)
225f6f8298 [v10.0.x] PublicDashboards: Add support for recorded queries used in Mixed ds (#70160) 2023-06-15 17:27:18 +00:00
Grot (@grafanabot)
411a7a9cf7 [v10.0.x] Alerting: Add matchers metrics to Alertmanager (#70125)
Alerting: Add matchers metrics to Alertmanager (#69855)

(cherry picked from commit f085e99d3c)

Co-authored-by: George Robinson <george.robinson@grafana.com>
2023-06-15 09:37:54 +01:00
Dimitris Sotirakis
c7315074b2 [v10.0.x] CI: Add CI check for what's new link (#70046) (#70123)
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
2023-06-15 09:44:50 +03:00
Grot (@grafanabot)
f60097b5e8 [v10.0.x] Bug: Fix build-frontend* config checks (#70078)
Bug: Fix `build-frontend*` config checks (#70076)

* Fix frontend config checks

* Exclude test tag events

(cherry picked from commit 5a36fa5f8a)

Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
2023-06-15 09:09:10 +03:00
Grot (@grafanabot)
d55bee35df [v10.0.x] NPM packages: Fail build-frontend-packages step if package.json and input tag differ (#70038)
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)

Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
2023-06-14 10:11:30 +03:00
Selene
f06f812509 [v10.0.x] Chore: Hacky first pass on generating composable kinds within grafana/schema (#69904)
* Chore: Hacky first pass on generating composable kinds within grafana/schema (#64723)

* Super hacky first pass on gen types

* First sketchy pass at generated compo kinds in TS, grok-style

* Merge fix

* Create jenny for MajorsOrX for plugins

* Re-generate files with imports

* Delete invalid generated file

* Fix cue

* Update go.mod

* Update schemas

* Fix go-imports

* Regenerate cue files

---------

Co-authored-by: spinillos <selenepinillos@gmail.com>
(cherry picked from commit 09895c26b6)

# Conflicts:
#	go.mod
#	go.sum

* make gen-cue

---------

Co-authored-by: sam boyer <sdboyer@grafana.com>
2023-06-12 13:53:11 +03:00
Selene
f3c0bc0749 [v10.0.x] kindsys: Adapt to new PanelCfg schema interface (#69892)
kindsys: Adapt to new PanelCfg schema interface (#65297)

* kindsys: Adapt to new PanelCfg schema interface

* building locally

* Remove Panel prefix in cue files

* Regenerate

* Update imports

* fixup! Merge branch 'remove-panel-prefix' into sdboyer/redundant-panelcfg-prefixes

* Fix formatting

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Tania B <yalyna.ts@gmail.com>
(cherry picked from commit 33fd83f7e3)

# Conflicts:
#	docs/sources/developers/kinds/core/dashboard/schema-reference.md
#	docs/sources/developers/kinds/core/folder/schema-reference.md
#	kinds/dashboard/dashboard_kind.cue
#	packages/grafana-schema/src/raw/dashboard/x/dashboard_types.gen.ts
#	pkg/kinds/dashboard/dashboard_spec_gen.go
#	pkg/kinds/folder/folder_status_gen.go

Co-authored-by: sam boyer <sdboyer@grafana.com>
2023-06-12 06:30:00 -04:00
Grot (@grafanabot)
4184cd09f4 [v10.0.x] Alerting: Add image URI annotation only when there's an image (#69858)
* Alerting: Add image URI annotation only when there's an image (#69825)

* Alerting: Add image URI annotation only when there's an image

* fix function name (changed on main branch)

(cherry picked from commit ff3e028a85)

* Update compat_test.go

---------

Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>
2023-06-09 12:34:00 -03:00
Grot (@grafanabot)
2c7f295cf4 [v10.0.x] Service accounts: API key migration refactoring to parse as json object of the results (#69776)
Service accounts: API key migration refactoring to parse as json object of the results (#69771)

refactoring to parse as json object of the results

(cherry picked from commit 5dceb5dff3)

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
2023-06-09 11:21:08 +02:00
Grot (@grafanabot)
c90c8d88dc [v10.0.x] CloudMonitoring: Improve parsing of GCM labels (#69812)
CloudMonitoring: Improve parsing of GCM labels (#69800)

Update parsing of GCM labels

- Include parsing of metadata labels

(cherry picked from commit 9fc1de62d5)

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
2023-06-08 19:41:21 +03:00
Alexander Zobnin
5dacbb97e0 [v10.0.x] Authentication UI: Enable by default (#69803) (#69810)
Authentication UI: Enable by default (#69803)

(cherry picked from commit 4e1f69d83f)
2023-06-08 17:23:02 +01:00
Grot (@grafanabot)
0cdb85af0b [v10.0.x] Alerting: Change text on cloud AM email addresses for contact points (#68180)
Alerting: Change text on cloud AM email addresses for contact points (#68143)

(cherry picked from commit e1ff434917)

Co-authored-by: Virginia Cepeda <virginia.cepeda@grafana.com>
2023-06-08 09:43:02 +00:00
Grot (@grafanabot)
665430bafb [v10.0.x] Service accounts: UI migration results (#69760)
Service accounts: UI migration results (#68789)

* ui migration WIP

* merge

* migration tests for api

* revert chagnes to align with main

* revert chagnes to align with main

* revert chagnes to align with main

* remove unused code and comments

* revert gen files

* retry logic inplace

* fix a any

* fixed types

* migraiton results now show only result if no failures

* review comments

* wording to make it more actionable

* add migraiton summary text onyl for failed apikeys

* fixed wording and added a close button to the modal

* made the button close the modal

* moved state into component

* fix based on review, naming and removed unused code

* service account migration state optional

* making migration result undefined

* showing total and migrated numbers for a successful migration

* fix payload const to take the payload

(cherry picked from commit 081f59feba)

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
2023-06-08 11:37:28 +02:00
Grot (@grafanabot)
85f514d6cc [v10.0.x] Docker: Add ARM64 architecture for Docker, for PRs (#69715)
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:29:58 +03:00
Grot (@grafanabot)
45694ea55b [v10.0.x] CloudMonitoring: Remove excess logs (#69682)
CloudMonitoring: Remove excess logs (#69576)

Remove excess logs

(cherry picked from commit f7dd7c5ad8)

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
2023-06-07 10:49:36 +01:00
Ivan Ortega Alba
781a531137 Schema: Improve Dashboard kind docs and remove deprecated props (#69652)
Backport: Schema: Improve Dashboard kind docs and remove deprecated props (#69359)

Removes unused properties:
  * `FieldColorModeId.PaletteSaturated`: It doesn't exist and it is not a valid palette.
  * `VariableModel.rootStateKey`: It is not persisted in the DB, so it shouldn't be in the schema. It is a property only used in the frontend to store the Redux store key.
  * `VariableModel.error`: It is not persisted in the DB, so it shouldn't be in the schema. It is a property only used in the frontend to store fetching errors.
  * `Panel.thresholds`: old property only existing in previous versions of the dashboard schema.
  * `Panel.timeRegions`: old property only existing in previous versions of the dashboard schema.

(cherry picked from commit 819041c732)
2023-06-06 20:22:46 +03:00
Grot (@grafanabot)
02411bc29f [v10.0.x] Dashboards: Variables - Improve slow template variable loading due same variable loaded multiple times on time range change (#69641)
Co-authored-by: Alexa V <239999+axelavargas@users.noreply.github.com>
2023-06-06 16:23:04 +03:00
Grot (@grafanabot)
2b8a416c51 [v10.0.x] Prevent crash while executing concurrent mixed queries (#878)
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:29:33 +02:00
Grot (@grafanabot)
242f4e04c0 [v10.0.x] Require alert.notifications:write permissions to test receivers and templates (#866)
Require alert.notifications:write permissions to test receivers and templates (#865)

(cherry picked from commit 3c21ab70075256d4ba8e4fbfdcb15f5a394161fa)

Co-authored-by: George Robinson <george.robinson@grafana.com>
2023-06-06 13:29:32 +02:00
Grot (@grafanabot)
6aee75291a [v10.0.x] Alerting: Add heuristics back to datasource healthchecks (#69541)
This commit adds heuristics back to datasource healthchecks as
it was removed in #66198. The healthcheck for Prometheus datasources
also returns the kind (Prometheus or Mimir) and a boolean if the
ruler is enabled or disabled.
2023-06-05 11:11:58 +01:00
Grot (@grafanabot)
778d9690d2 [v10.0.x] Util: Fix panic when generating UIDs concurrently (#69538)
Util: Fix panic when generating UIDs concurrently (#69476)

(cherry picked from commit fe2103bfc8)

Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>
2023-06-05 11:35:48 +02:00
Matthew Jacobson
0a6e80c6cf [v10.0.x] Alerting: Fix provisioned templates being ignored by alertmanager (#69488)
Alerting: Fix provisioned templates being ignored by alertmanager (#69485)

* Alerting: Fix provisioned templates being ignored by alertmanager

Template provisioning sets the template in cfg.TemplateFiles while a recent change
made it so that alertmanager reads cfg.AlertmanagerConfig.Templates instead.

This change fixes the issue on both ends, by having provisioning set boths fields and
reverts the change on the alertmanager side so that it uses cfg.TemplateFiles.

(cherry picked from commit c16f1f5e99)
2023-06-02 16:13:48 -04:00
Grot (@grafanabot)
cdfff3e10a [v10.0.x] Fix plugin metric (#69372)
Fix plugin metric (#69368)

(cherry picked from commit b59533e526)

Co-authored-by: Ludovic Viaud <ludovic.viaud@gmail.com>
2023-06-01 16:00:51 +02:00
Ivan Ortega Alba
6f11409f79 [v10.0.x] Improve Dashboards schema docs (#68904) (#69254)
Improve Dashboards schema docs (#68904)

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
Co-authored-by: Alexandra Vargas <alexa1866@gmail.com>
Co-authored-by: Ezequiel Victorero <ezequiel.victorero@grafana.com>
(cherry picked from commit cb83861630)
2023-05-30 14:52:24 +02:00
Grot (@grafanabot)
a81452b437 [v10.0.x] SQLStore: Align SQLite IsUniqueConstraintViolation() with other backend implementations (#69227)
SQLStore: Align SQLite IsUniqueConstraintViolation() with other backend implementations (#69224)

* Add integration test for primary key and unique constrain violation

* Align SQLite IsUniqueConstraintViolation implementation with other backends

(cherry picked from commit 74e87ccbbd)

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2023-05-29 17:55:35 +03:00
Yuri Tseretyan
ed0089bcb8 Alerting: Update alerting module to to 20230524181453-a8e75e4dfdda (#69011)
* update alerting to 20230524181453-a8e75e4dfdda
* fix integration tests
2023-05-26 09:27:33 -04:00
Grot (@grafanabot)
082b7c9d44 [v10.0.x] GoogleAPI: Add retries functionallity to GoogleAPI calls (#69144)
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 13:10:55 +03:00
Grot (@grafanabot)
0b9cb47dd7 [v10.0.x] Alerting: Migrate unknown NoData\Error settings to the default (#69010)
Alerting: Migrate unknown NoData\Error settings to the default (#68403)

* use default execution if legacy is not known

* update docs

* Update docs/sources/alerting/migrating-alerts/migrating-legacy-alerts.md

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* Update docs/sources/alerting/migrating-alerts/migrating-legacy-alerts.md

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

---------

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
(cherry picked from commit 3af95bebe1)

Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
2023-05-25 11:56:24 -04:00
Grot (@grafanabot)
085adb57ce [v10.0.x] Alerting: Fix provenance guard checks for Alertmanager configuration to not cause panic when compared nested objects (#69094)
Alerting: Fix provenance guard checks for Alertmanager configuration to not cause panic when compared nested objects (#69009)

* fix current settings parsed as new
* replace map comparison with cmp.Diff and log the diff

(cherry picked from commit e00260465b)

Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
2023-05-25 18:56:01 +03:00
Grot (@grafanabot)
e5153d7bf3 [v10.0.x] Auth: Fix visibility of the Invite button on /admin/users page (#69067)
Auth: Fix visibility of the Invite button on /admin/users page (#68991)

* Fix for invite button visibility

* Align test

(cherry picked from commit df4db412cb)

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
2023-05-25 16:34:27 +02:00
Grot (@grafanabot)
95726f1530 [v10.0.x] Alerting: Add support for Alert State History Loki primary (#69077)
Alerting: Add support for Alert State History Loki primary (#69065)

add support for multiple ash targets with loki as primary

(cherry picked from commit 73681a251e)

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2023-05-25 14:00:33 +00:00
Grot (@grafanabot)
0946897262 [v10.0.x] Plugins: Correct the usage of mutex for gRPC plugin implementation (#68609)
Plugins: Correct the usage of mutex for gRPC plugin implementation (#68555)

correct usage of mutex

(cherry picked from commit bb6ec1470d)

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2023-05-24 12:18:59 +00:00
Dimitris Sotirakis
d73bf1838e [v10.0.x] G10: Replace beta with preview references (#68347) (#68950)
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 10:14:43 +02:00
Andreas Christou
b160f1a92a [v10.0.x] AzureMonitor: Support multi-resource aliases and subscription aliases (#68823)
AzureMonitor: Support multi-resource aliases and subscription aliases (#68648)

Update legend aliases

- Add subscription response type
- Update AzureMonitorQuery type
- Update docs
- Update tests
- Add function to retrieve subscription display name if not present

(cherry picked from commit bca8428f63)
2023-05-23 10:05:59 -06:00
Grot (@grafanabot)
defce65315 [v10.0.x] Azure Monitor: Fix bug with top value so more than 10 resources can be shown (#68725)
Azure Monitor: Fix bug with top value so more than 10 resources can be shown  (#68333)

(cherry picked from commit dfc2ac284b)

Co-authored-by: Alyssa Bull <58453566+alyssabull@users.noreply.github.com>
2023-05-23 13:07:45 +01:00
Grot (@grafanabot)
dba7dcb99d [v10.0.x] Docker: Add mode label when building docker images (#68871)
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:52:38 +02:00
Grot (@grafanabot)
dd4419568d [v10.0.x] Prometheus: Update schema with legendFormat and intervalFactor (#68835)
Prometheus: Update schema with legendFormat and intervalFactor (#68687)

add legendFormat and intervalFactor to the schema

(cherry picked from commit 670c987409)

Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
2023-05-22 16:41:01 +02:00
Grot (@grafanabot)
5a6e6624e0 [v10.0.x] AnonymousAuth: Fix concurrent read-write crash (#68803)
AnonymousAuth: Fix concurrent read-write crash (#68637)

clone http req before tagging

(cherry picked from commit 05e71d4c6b)

Co-authored-by: Jo <joao.guerreiro@grafana.com>
Co-authored-by: jguer <me@jguer.space>
2023-05-22 16:40:33 +02:00
Grot (@grafanabot)
d62f2989a8 [v10.0.x] Datagrid: Hide from panel list if toggle disabled (#68818)
Datagrid: Hide from panel list if toggle disabled (#68482)

Hide datagrid from panel list if ff disabled

(cherry picked from commit 6dbadf614b)

Co-authored-by: Victor Marin <36818606+mdvictor@users.noreply.github.com>
2023-05-22 15:46:24 +02:00
Grot (@grafanabot)
d0b45d87fe [v10.0.x] Docs: Fix feature toggle docs generation (#68797)
Docs: Fix feature toggle docs generation (#68733)

(cherry picked from commit a7cec6dd03)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2023-05-22 14:22:41 +02:00
Grot (@grafanabot)
1e9f73df62 [v10.0.x] Chore: Ignore unique constrain failure when creating the main organization (#68674)
Chore: Ignore unique constrain failure when creating the main organization (#68644)

Chore: Ignore unique constrain failure when creatin the main organization
(cherry picked from commit 633b7875e7)

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2023-05-18 10:40:39 +02:00
Grot (@grafanabot)
21e2ac6d8a [v10.0.x] Elasticsearch: Handle no-index case in backend mode (#68629)
Elasticsearch: Handle no-index case in backend mode (#68534)

* elastic: backend migration: fix no-index case

* improved code

(cherry picked from commit fcef387151)

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2023-05-17 13:39:07 +00:00
Ivana Huckova
3c1b5dda40 [v10.0.x] Elasticsearch: Fix passing of limit and datalinks to logs data frame (#68626)
* Elasticsearch: Fix passing of limit and datalinks to logs data frame (#68554)

* Elasticsearch: Fix passing of limit and datalinks to logs data frame

* Update public/app/core/logsModel.ts

Co-authored-by: François Massot <francois.massot@gmail.com>

---------

Co-authored-by: François Massot <francois.massot@gmail.com>
(cherry picked from commit dbbbc46351)

* Add missing comment
2023-05-17 15:34:13 +02:00
Grot (@grafanabot)
e2fbb6ef97 [v10.0.x] Remove no-data source screen (#68623)
Dashboards: Remove no-data source screen (#68574)

* Dashboards: Remove non-ds configured landing page

* Remove `datasourceOnboarding` feature toggle

(cherry picked from commit 1505a188eb)

Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>
2023-05-17 15:51:31 +03:00