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>
* 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>
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>
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
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>
* 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>
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>
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>
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>
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>
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)
Prevent crash while executing concurrent mixed queries (#874)
limit parallel query execution to 1 at a time
(cherry picked from commit 96579a60e19e2a9f2d6bdaeba64e0e702211eb73)
Co-authored-by: Michael Mandrus <41969079+mmandrus@users.noreply.github.com>
Require alert.notifications:write permissions to test receivers and templates (#865)
(cherry picked from commit 3c21ab70075256d4ba8e4fbfdcb15f5a394161fa)
Co-authored-by: George Robinson <george.robinson@grafana.com>
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.
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)
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>
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>
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>
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>
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>
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)
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>
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>
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>
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>
* 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