Commit Graph

8817 Commits

Author SHA1 Message Date
Moustafa Baiou 0d2ee90ff1 Alerting: Fix copying of recording rule fields
Recording rule fields were not being copied correctly when duplicating an alert rule. This manifests as missing `TargetDataSourceUID` fields from the `Record` part of the rule when rules in a group are re-ordered.

Added some additional tests to ensure we cover the generation of recording rules in tests and fixed the copying logic to ensure all fields are copied correctly.

(cherry picked from commit c73b3ccf6e)
2025-09-03 10:00:22 -04:00
grafana-delivery-bot[bot] 3bc640a6bb [release-12.0.4] CloudMigrations: Report on prem event with grafana version (#109331)
CloudMigrations: Report on prem event with grafana version (#104515)

* grafana version in on prem event report

* store grafana version in cloud migration service

(cherry picked from commit ee99433c65)

Co-authored-by: Dana Axinte <53751979+dana-axinte@users.noreply.github.com>
2025-08-07 14:33:47 +01:00
Stephanie Hingtgen b296a51d0d [release-12.0.3] Dashboard: Fix history retrieval for uids that end in - (#107081) 2025-06-24 15:47:12 +03:00
Alexander Akhmetov 037fe5dfe9 [release-12.0.3] Alerting: Maintain endsAt for missing alert instances that are not stale yet (#107078)
Alerting: Maintain endsAt for missing alert instances that are not stale yet (#107011)
2025-06-24 11:56:48 +02:00
Alexander Akhmetov 3de18b7281 [release-12.0.3] Alerting: Resend alerts for states that are missing in the eval results (#107077)
* Alerting: Resend alerts for states that are missing in the eval results (#105965)

What is this feature?

This PR fixes the MissingSeriesEvalsToResolve behavior when it's set to more than 4 evaluation intervals.

Why do we need this feature?

The MissingSeriesEvalsToResolve setting was not working correctly due to alerts being auto-resolved by Alertmanager after 4 evaluation intervals (via the endsAt field).

Before we had deleteStaleStatesFromCache method that was returning only stale states that had to be resolved. Non-stale states for which the current evaluation does not have a series never had endsAt updated and were never resend to the Alertmanager, so they were automatically resolved after 4 evaluations regardless of the setting.

The new processMissingSeriesStates returns state for each missing series on every evaluation, and resolves the stale ones. This guarantees that alerts without series still alert for the configured number of evaluations.

* Remove FiredAt field
2025-06-24 11:26:15 +02:00
grafana-delivery-bot[bot] a4b56e7583 [release-12.0.3] CloudMigrations: Skip default contact point from snapshot (#106886)
CloudMigrations: Skip default contact point from snapshot (#106600)

* CloudMigrations: Skip default contact point from snapshot

* Update cloud-migration-assistant.md

* Update cloud-migration-assistant.md

---------


(cherry picked from commit a65743e41d)

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
Co-authored-by: Jacob Valdez <jacob.valdez@grafana.com>
2025-06-18 13:03:30 +02:00
grafana-delivery-bot[bot] 2dc0628b3d [release-12.0.3] CloudMigrations: Add Mute Timings as dependency for Notification Policies (#106884)
CloudMigrations: Add Mute Timings as dependency for Notification Policies (#106751)

(cherry picked from commit db845ed8de)

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
2025-06-18 13:02:55 +02:00
github-actions[bot] 60ecc8481c apply security patch: release-12.0.2/438-202505231907.patch 2025-06-17 16:25:12 -05:00
Josh Hunt 03e074dc23 [release-12.0.2] Provisioning: Move OSS provisioning to Run step (#106674)
Provisioning: Move OSS provisioning to Run step (#105428)

* Provisioning: Move OSS provisioning to Run step



---------


(cherry picked from commit 1435eedbc4)

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
Co-authored-by: maicon <maiconscosta@gmail.com>
2025-06-13 07:03:44 +01:00
Josh Hunt d7f26a5b8c [release-12.0.2] Run Init Provisioners at Server Initialization (#106646)
Run Init Provisioners at Server Initialization (#105080)

* Run Init Provisioners at Server Initialization



---------


(cherry picked from commit 82bbbf1a98)

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
Co-authored-by: maicon <maiconscosta@gmail.com>
2025-06-12 21:32:29 +01:00
grafana-delivery-bot[bot] 100068fdb2 [release-12.0.2] CloudMigrations: Omit autoincremented id for alert snapshots (#106639)
CloudMigrations: Omit autoincremented id for alert snapshots (#106598)

If you tried to migrate alerts from two differente sources/on-prem instances,
the autoincremented numeric id would be the same, and since we were creating
the resource in cloud with that same id (the API accepts it), it would
return an error "conflicting alert rule found" because that id is the primary key on the table.

We simply omit the numeric id now and let the API for the cloud instance generate it.

(cherry picked from commit a1f2693fd8)

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
2025-06-12 17:18:41 +02:00
Matheus Macabu 25b41aabd5 [release-12.0.2] Chore: Address linting issues to unblock CI (#106610)
Chore: Address linting issues to unblock CI
2025-06-12 16:01:28 +02:00
Matheus Macabu 5739be39a4 [release-12.0.2] Dependencies: Bump Go to v1.24.4 (#106565)
* Dependencies: Bump Go to v1.24.4

* Chore: Fix feature flags template for docs gen

(cherry picked from commit cfee3b01df)

---------

Co-authored-by: Tania B. <10127682+undef1nd@users.noreply.github.com>
2025-06-11 18:34:48 +02:00
grafana-delivery-bot[bot] f593454e54 [release-12.0.2] Alerting: Provisioning API returns 403 on quota exceeded for rule group PUT (#106477)
Alerting: Provisioning API returns 403 on quota exceeded for rule group PUT (#106409)

(cherry picked from commit 1df888c517)

Co-authored-by: Vadim Stepanov <vstpme@gmail.com>
2025-06-10 15:27:54 +01:00
grafana-delivery-bot[bot] c3ffd59702 [release-12.0.2] Org: Fix org deletion (#106461)
Org: Fix org deletion (#106193)

(cherry picked from commit 5303a1cc7e)

Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
2025-06-10 03:53:34 +02:00
Alexander Akhmetov c53915cb87 [release-12.0.2] Alerting: Fix group-level labels and query_offset in the import API (#106392)
Alerting: Fix group-level labels and query_offset in the import API (#106379)

What is this feature?

Fixes a bug when group-level query_offset and labels parameters are ignored and not saved

Why do we need this feature?

In the import API Prometheus YAML rule definitions are supported:

groups:
  - name: group-1
    interval: 1m
    query_offset: 10m
    labels:
      severity: "warning"
    rules:
      - alert: Alert 0 > 0
        expr: vector(0) > 0

But applying group-level labels and query_offset is broken and they are not saved right now because during the conversion of the API model to PrometheusRuleGroup they aren't saved to the new structure.

(cherry picked from commit f7a52bc04e)
2025-06-06 12:04:17 +02:00
grafana-delivery-bot[bot] 94ee07eebf [release-12.0.2] SCIM: Change SCIM hook registration (#106255)
SCIM: Change SCIM hook registration (#106200)

* Add function to skip provisioning hook

* Rework provisioning hook to PostLoginHook

* Revert back to PostAuthHook and remove unused tests

* Fix tests

(cherry picked from commit 374bd5bec7)

Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>
2025-06-03 12:48:42 +02:00
Alexander Zobnin 6c0b0e8752 [release-12.0.2] RBAC: Dont additionally cache all users permissions (#106147)
RBAC: Don't additionally cache all users permissions (#105607)

* RBAC: Don't additionally cache all users permissions

* remove unused tests

(cherry picked from commit cfba630f5c)
2025-05-28 16:44:50 +02:00
grafana-delivery-bot[bot] 982238b4bd [release-12.0.2] Alerting: Fix $value type when single data source is queried (#106101)
Alerting: Fix $value type when single data source is queried (#106080)

(cherry picked from commit faeddf334a)

Co-authored-by: Alexander Akhmetov <me@alx.cx>
2025-05-27 21:32:21 +02:00
github-actions[bot] 7b2192ec76 apply security patch: release-12.0.1/404-202504151210.patch 2025-05-22 14:48:38 +00:00
Michael Mandrus 2de93c5022 CloudMigrations: Fix issues with snapshot resource limits (#105425) (#105625)
* CloudMigrations: Fix issues with snapshot resource limits (#105425)

* fix bulk inserts

* commit progress so cursor doesn't sabotage me

* add more tests

* get everything working

* rename variable

* update comment

* regen mocks, fix k8s list method maybe

* fix bug with duplicate entries

* lint

* Snapshots: Use slices.Chunk for batching inserts

* remove extra linebreak

---------

Co-authored-by: Matheus Macabu <macabu.matheus@gmail.com>

* fix postgres integration tests

---------

Co-authored-by: Matheus Macabu <macabu.matheus@gmail.com>
2025-05-20 09:02:03 -04:00
linoman bf293c8ab6 Backport 105046 to 12.0.1 (#105337) 2025-05-13 12:29:35 -04:00
linoman 2e6b7bf74a SCIM: Backport 104613 to 12.0.1 (#105332)
Backport 104613 to 12.0.1
2025-05-13 17:15:01 +02:00
Artur Wierzbicki f17e42fb40 [release-12.0.1] Live: logging fix (#105076)
Live: logging fix (#105054)

logg fix

(cherry picked from commit c781b0922e)
2025-05-07 21:51:20 +03:00
Will Browne 5b795ae2e3 [release-12.0.1] Plugins: Fix issue with propagating ID token downstream for RunStream requests (#105002)
Plugins: Fix issue with propagating ID token downstream for RunStream requests (#104833)

fix issue

(cherry picked from commit a5649b6e1d)
2025-05-06 13:33:47 +01:00
Stephanie Hingtgen 3b2165d787 [release-12.0.1] Dashboards: Fix cleanup job (#104824) 2025-05-01 16:51:44 +03:00
Stephanie Hingtgen 6b7bba2b5a [release-12.0.1] Dashboard and Folders: fix version mismatch (#104717)
Folders: Fix version mismatch errors
2025-04-30 03:01:45 +03:00
Stephanie Hingtgen 249bf8ac64 [release-12.0.1] Dashboards and Folders: cleanup timestamps and error codes (#104720)
K8s: Fix timestamps and error codes
2025-04-29 22:44:44 +03:00
Stephanie Hingtgen 7287b4958f [release-12.0.1] Dashboards: add missing folder info to /search (#104718)
Dashboards: add missing folder info to /search
2025-04-29 22:08:52 +03:00
Stephanie Hingtgen 4620dc0b4e [release-12.0.1] App Plugins: Fix dashboard updater (#104583) (#104585) 2025-04-26 01:22:28 +02:00
Stephanie Hingtgen 7dfb628cb4 [release-12.0.1] Provisioning: Remove warning logs for valid usage (#104555) (#104558)
Provisioning: Remove warnings for valid usage (#104555)
2025-04-25 11:18:17 -05:00
Stephanie Hingtgen 745015e74f [release-12.0.1] K8s: Dashboards: Fix provisioned dashboard cleanup (#104504) (#104525)
K8s: Dashboards: Fix provisioned dashboard cleanup (#104504)
2025-04-25 13:41:29 +01:00
Stephanie Hingtgen 123351e3ac [release-12.0.1] Access control: Make sure that user permission cache is cleared after new dashboard and folder creation (#104495)
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
2025-04-24 15:48:04 -05:00
Stephanie Hingtgen ed408985fa [release-12.0.1] K8s: Dashboards: Mark as v1beta1 (#104422)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2025-04-23 19:21:59 +01:00
Stephanie Hingtgen b0d42f432a [release-12.0.1] K8s: Dashboards: Add fine grained access control checks to /apis (#104419)
K8s: Dashboards: Add fine grained access control checks to /apis (#104347)


---------

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
Co-authored-by: Gabriel MABILLE <gabriel.mabille@grafana.com>
Co-authored-by: Marco de Abreu <marco.deabreu@grafana.com>
Co-authored-by: Georges Chaudy <chaudyg@gmail.com>
2025-04-23 18:28:10 +01:00
Stephanie Hingtgen 2e878c4fdc [release 12.0.1] Dashboards: Preserve schema version in /api (#104213) (#104249)
Dashboards: Preserve schema version in /api (#104213)


---------

Co-authored-by: Artur Wierzbicki <artur.wierzbicki@grafana.com>
2025-04-21 18:40:34 -05:00
Stephanie Hingtgen 4d6d46a181 [release 12.0.1] Klog: Prevent response bodies from being logged (#104247) 2025-04-21 23:07:53 +01:00
grafana-delivery-bot[bot] b9ee6bae38 [release-12.0.1] Alerting: Ensure field validators return the proper type (#104243)
Alerting: Ensure field validators return the proper type (#104050)

* Ensure field validators return the proper type

This ensures correct error propagation through services up to
the API layer.

* Move error wrapping up to call site

(cherry picked from commit 820c338414)

Co-authored-by: William Wernert <william.wernert@grafana.com>
2025-04-21 21:17:40 +01:00
Ryan McKinley 0283c98e30 K8s/Folders: Use v1beta1 and app-sdk based spec (#103975) 2025-04-14 23:20:10 +03:00
Alexander Akhmetov acfd998fa6 Alerting: Send resolved notifications immediately for state deleted states (#103996)
What is this feature?

Send resolved notifications not only when an alert state becomes stale (series is missing) and transitions from Alerting to Normal, but also from Error, NoData and Recovering.

Why do we need this feature?

Previously, when an alert state became stale or was deleted, it would transition to Normal but wouldn't trigger resolved notifications to the Alertmanager. This meant we relied on the Alertmanager to send resolved notifications when the alert expires. However, if the Alertmanager state is lost, these resolved notifications would never be sent, leaving users with firing alerts in their notification channels. This PR ensures that any transition from a firing state (Alerting, Error, NoData, Recovering) to Normal triggers a resolved notification.
2025-04-14 21:40:44 +02:00
Ryan McKinley 1d4d7cec41 Chore: update feature toggle stats from git (#103960) 2025-04-14 15:57:41 +03:00
Esteban Beltran 20d8223b6e Chore: Clean up code from pluginsAPIMetrics feature toggle (#103965) 2025-04-14 13:15:06 +01:00
Cory Forseth 2b279efe15 Use team uid for team group actions (#103415)
* use team uid for team group actions

* add constructor for tests; rename vars for clarity

* github told me to do this
2025-04-14 06:40:55 -05:00
Carl Bergquist ed65c99e54 Scopes: Adds feature toggle used by grafana-enterprise (#103870)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2025-04-14 09:42:16 +02:00
ismail simsek 3013332e41 Prometheus: Remove prometheusRunQueriesInParallel feature toggle (#103824)
* remove prometheusRunQueriesInParallel feature toggle

* fix the unit test
2025-04-11 23:11:19 +01:00
William Wernert a5288db624 Alerting: Remove the POST endpoint for the internal Grafana Alertmanager config (#103819)
* Remove POST config for Grafana Alertmanager

* Delete auth + test for removed path

* Alerting: Remove check for `alertingApiServer` toggle in UI (#103805)

* Remove check for alertingApiServer in UI

* Update tests to no longer care about alertingApiServer

* Add contact points handlers now that we use alertingApiServer all the time

* Fix test broken from removing camelCase for UIDs

---------

Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
2025-04-11 17:38:53 -04:00
Nick Richmond 07a225649d MetricsDrilldown: Remove legacy Metrics Drilldown code paths (#103845)
* chore: remove feature toggles

* chore: update labels

* chore: remove `public/app/features/trails` code

* fix: typo

* chore: update betterer results

* chore: update i18n
2025-04-11 16:45:14 -04:00
Dave Henderson a58837f6db Feature Toggles: Stop documenting experimental toggles (#103841)
Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
2025-04-11 16:42:35 -04:00
Michael Mandrus 652c374c4c CloudMigrations: Make table sort case insensitive (#103898)
* case insensitive sort

* fix for all db types

* add comment

* add unit test

* add a TODO to fix later
2025-04-11 20:29:07 +01:00
Marco de Abreu 95f04c79cd Dashboards: Add Dashboard Schema validation (1) (#103662) 2025-04-11 16:52:46 +00:00