496 Commits

Author SHA1 Message Date
f7eab21f9f Loki: Decouple data source plugin (#107242)
* WIP

* Update yarn.lock

* Align uuid dependency

* Add e2e test and update

* Update cue version

* Fix lint

* Update snapshot test

* Fix test that was importing from coupled module

* Fix lint

* Update public/app/plugins/datasource/loki/package.json

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>

---------

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2025-06-27 15:09:45 +02:00
f8189eece9 Dashboard Imports: Fix creating new library panels (#107219) 2025-06-26 05:23:05 -06:00
b93cde0adb Alerting: Use default identifier for extra configs in Alertmanager API (#107049) 2025-06-26 12:44:49 +02:00
f0fab90072 Loki: Remove lokiSendDashboardPanelNames toggle (#106991) 2025-06-20 10:06:15 +02:00
700c9a857c Alerting: Return extra alertmanager config as a string for mimirtool (#106959) 2025-06-19 01:12:26 +02:00
4b46da9214 Alerting: Hide extra Prometheus configuration secrets (#106916) 2025-06-18 17:01:19 +02:00
426c334973 Alerting: API to create extra Alertmanager configurations (#106904)
What is this feature?

Implements the POST endpoint for deleting imported Mimir Alertmanager configurations:

    POST /api/convert/api/v1/alerts

The API endpoint creates the extra Alertmanager configuration with the provided identifier and matchers.
2025-06-18 15:05:06 +02:00
910eb1dd9e Security: apply patch 428 (#106710)
* declare dingding url as secret

patch raw settings before parsing because DingDing's config parser does not know about secrets

* fix integration test

---------

Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
2025-06-13 15:56:26 +02:00
f7a52bc04e 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.
2025-06-06 11:21:39 +02:00
e256f2d5e2 Alerting: Enable recording rules by default (#105603) 2025-06-02 10:56:05 +02:00
edb0865caa Chore: Ensure we save correct default admin user in integration test DB setup (#105752)
* fix helper + amend tests

* fix import + remove unused var

* remove more users

* remove unused code

* update test comment
2025-05-28 11:25:01 +01:00
c4d3eb1cd0 Remove support for Google Spanner database. (#105846)
* Remove support for Google Spanner database.
2025-05-23 11:35:59 +02:00
c58ac15031 Alerting: Remove grafanaManagedRecordingRules feature flag (#105569) 2025-05-19 12:15:49 +02:00
a32b379177 chore: correct links for jaeger data source (#105475)
* chore: correct links for jaeger data source

* Update plugin.json

* test fix attempt
2025-05-15 16:44:36 +01:00
7d0f73058b api/admin: Reenable AdminApiReencrypt tests, fix enterprise version of the test. (#105462)
* Reenable tests. Fix access to "key" column when using mysql.
2025-05-15 16:25:30 +02:00
ba111e612b Skip TestIntegration_AdminApiReencrypt. (#105454)
* Skip TestIntegration_AdminApiReencrypt and TestIntegration_AdminApiReencrypt_Enterprise.
2025-05-15 11:38:42 +00:00
7268d6c1bc admin api: Fix reencryption of private_key in signing_key table, introduce test for reencryption (#105010)
* Add integration test for reencrypting secrets.
Rotate keys before reencryption.
Test for setting table from enterprise repo.
2025-05-15 09:51:25 +02:00
9fe523b9e6 Alerting: API to pause all alert rules in a folder (#104674) 2025-05-13 17:04:01 +02:00
c17b019ab1 Alerting: Support simplified routing receivers in Prometheus conversion API (#105135)
Adds ability to set notifications settings using the Prometheus conversion API.

The API now supports a new optional header: X-Grafana-Alerting-Notification-Settings which can be used to specify notification settings.

The value of the header is the AlertRuleNotificationSettings structure in JSON:
mimirtool rules load alerts.yaml --extra-headers 'X-Grafana-Alerting-Notification-Settings: {"receiver": "my-webhook", "group_by": ["cluster", "pod"]}'
2025-05-12 22:07:02 +02:00
0ceea29787 Alerting: Remove alertingSimplifiedRouting feature toggle (#104980)
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2025-05-09 16:30:56 +03:00
3e2296acd3 Alerting: Support for active time intervals in notification policies (#104252)
* add active_time_intervals to route model

* update k8s compat layer

* update notification policies service to validate active time intervals

* update integration tests

* update openapi

* add active time interval to model

* update route generator to include active time interval

* Update storage list and rename methods to handle active intervals

* update api model

* update provisioning and export models

* update ui to allow active timing config

* update i18n

* fix snapshots for ui tests

* run prettier

* Alerting: Active time intervals UI naming (#104402)

* update naming in UI

* update naming in the edit page title

* update translations

* update alerting module

---------

Signed-off-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
Co-authored-by: Sonia Aguilar <33540275+soniaAguilarPeiron@users.noreply.github.com>
Co-authored-by: Sonia Aguilar <soniaaguilarpeiron@gmail.com>
2025-05-07 19:19:33 -04:00
109267ab03 Alerting: Remove feature toggle for custom recovery threshold (#104455) 2025-04-24 11:58:17 -04:00
9f07e49cdd Alerting: Add extended definition to prometheus alert rules api (#103320)
* Alerting: Add extended definition to prometheus alert rules api

This adds `isPaused` and `notificationSettings` to the paginated rules api to enable the paginated view of GMA rules.

refactor: make alert rule status and state retrieval extensible

This lets us get status from other sources than the local ruler.

* update swagger spec

* add safety checks in test
2025-04-23 21:14:09 +01:00
fd99b67205 Dashboards: Preserve schema version in /api (#104213)
---------

Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
2025-04-21 10:51:28 -05:00
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
a913c5426d Alerting: Fix flaky TestIntegrationPrometheusRules test (#103886) 2025-04-11 19:50:46 +02:00
9e933882ed Alerting: Webhook Improvements - Templateable Payloads (#103818)
* Template editor syntax highlighting when preview is json-like

* Add new template editor language examples, snippets, and functions

* Use updated NewTemplate function

* Add new fields to webhook notifier

- CustomPayload
- ExtraHeaders

* Documentation

* Update grafana/alerting to in-progress PR (needs updating after merge)

* Fix integration test

* Remove docs reference to .Extra template context

No longer exists, was part of a previous iteration

* make update-workspace

* Update grafana/alerting to actual merged commit
2025-04-11 12:22:51 -04:00
9f9c4b3da3 Alerting: Template preview enhancements (#103817)
API Changes:

- Fixes validation in template CRUD API to be closer to how the running 
  alertmanager will use the template. Should remove some incorrect 
  validation errors.

- Adds some missing default placeholder labels to receiver testing that 
  are used during template testing but missing during receiver testing


Template Preview:

- Replaced basic preview with a readonly CodeEditor for better whitespace 
  and alignment clarity (also adds support for future syntax highlighting 
  in template previews for upcoming webhook payload templates)

Template Selector (Receiver Form):

- Refactored to use same components as Template editor for preview.
- Fixed preview to work with multi-definition templates
- Fixed copy to correctly copy the template contents instead of 
  {{ template "<name>" . }}.

Template Editor:

- Fixed detection of when to display functions vs snippets in multi-line 
  expressions
2025-04-11 09:27:19 -04:00
757be6365a CI: Bump golangci-lint to 2.0.2 (#103572) 2025-04-10 14:42:23 +02:00
53126eb307 Chore: Disable snapshot flag for plugins API test (#103733)
disable snapshot flag for test
2025-04-10 09:57:20 +01:00
babe188e31 Alerting: Fix path for cortex-style Prometheus namespaces conversion endpoint (#103655) 2025-04-09 10:40:22 +02:00
b2f80d4dca Dashboards: Add Dashboard API Validation tests and fix underlying issues (#103502) 2025-04-07 05:44:28 +03:00
bdbe94abc8 Alerting: Remove alertingConversionAPI feature flag (#103380) 2025-04-05 09:27:02 +01:00
f96e4e9ad2 Frontend: Remove Angular (#99760)
* chore(angularsupport): delete feature toggle to disable angular

* feat(angular-support): remove config.angularSupportEnabled

* chore(jest): remove angular from setup file

* chore(angular): delete angular deprecation ui components

* refactor(angular): move migration featureflags into migration notice

* chore(dashboard): remove angular deprecation notices

* chore(annotations): remove angular editor loader

* feat(appwrapper): no more angular app loading

* feat(pluginscatalog): clean up angular plugin warnings and logic

* chore(angular): delete angular app and associated files

* feat(plugins): delete old angular graph plugin

* feat(plugins): delete old angular table panel

* feat(frontend): remove unused appEvent type

* feat(dashboards): clean up angular from panel options and menu

* feat(plugins): remove graph and table-old from built in plugins and delete sdk

* feat(frontend): remove angular related imports in routes and explore graph

* feat(theme): remove angular panel styles from global styles

* chore(i18n): run make i18n-extract

* test(api_plugins_test): refresh snapshot due to deleting old graph and table plugins

* chore(angulardeprecation): delete angular migration notice components and usage

* test(frontend): clean up tests that assert rendering angular deprecation notices

* chore(backend): remove autoMigrateOldPanels feature flag

* chore(config): remove angularSupportEnabled from config preventing loading angular plugins

* chore(graphpanel): remove autoMigrateGraphPanel from feature toggles

* chore(tablepanel): delete autoMigrateTablePanel feature flag

* chore(piechart): delete autoMigratePiechartPanel feature flag

* chore(worldmappanel): remove autoMigrateWorldmapPanel feature toggle

* chore(statpanel): remove autoMigrateStatPanel feature flag

* feat(dashboards): remove automigrate feature flags and always auto migrate angular panels

* test(pluginsintegration): fix failing loader test

* test(frontend): wip: fix failures and skip erroring migration tests

* chore(codeowners): remove deleted angular related files and directories

* test(graphite): remove angular mock from test file

* test(dashboards): skip failing exporter test, remove angularSupportEnabled flags

* test(dashbaord): skip another failing panel menu test

* Tests: fixes pkg/services/pluginsintegration/loader/loader_test.go (#100505)

* Tests: fixes pkg/services/pluginsintegration/plugins_integration_test.go

* Trigger Build

* chore(dashboards): remove angularComponent from getPanelMenu, update test

* feat(dashboards): remove all usage of AngularComponent and getAngularLoader

* chore(betterer): refresh results file

* feat(plugins): remove PluginAngularBadge component and usage

* feat(datasource_srv): remove usage of getLegacyAngularInjector

* feat(queryeditor): delete AngularQueryComponentScope type

* Chore: removes Angular from plugin_loader

* Chore: remove angular from getPlugin

* Chore: fix i18n

* Trigger Build

* Chore: remove more Angular from importPanelPlugin

* Chore: remove search options warning

* Chore: remove and deprecate Angular related

* chore(angular): remove angular dependencies from core and runtime

* chore(runtime): delete angular injector

* chore(data): delete angular scope from event bus

* chore(plugin-catalog): remove code pushing app plugins angular config page

* chore(yarn): refresh lock file

* chore(frontend): remove ng-loader from webpack configs, remove systemjs cjs plugin

* chore(navigation): remove tether-drop cleanup from GrafanaRouter, delete dependency

* chore(runtime): delete AngularLoader

* chore(betterer): refresh results file

* chore(betterer): fix out of sync results file

* feat(query): fix type and import errors in QueryEditorRow

* test(dashboards): delete skipped angular related tests

* Tests: add back tests and fix betterer

* Tests: fix broken test

* Trigger build

* chore(i18n): remove angular deprecation related strings

* test: clean up connections and plugins catalog tests

* chore(betterer): update results file

---------

Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
2025-04-04 11:31:35 +02:00
9c49c601f1 Unistore: Add generation column (#102222) 2025-04-01 20:38:23 +03:00
4cb756c5d1 K8s: Fix error conversion for provisioned dashboards (#103074) 2025-03-31 14:34:54 +01:00
19a52ba35e K8s: Dashboards: Fix multi-org quota (#103073) 2025-03-31 14:34:39 +01:00
dd628903f4 K8s: Enable integration tests on folders and dashboards (#103075)
K8s: Enable e2e tests on folders and dashboards
2025-03-31 04:02:19 -06:00
88d23fe5be Alerting: Remove transitional notifications API endpoints (#102713)
* Remove transitional notifications API endpoints

* Fix openapi spec

* Fix path test

* Remove API tests related to removed endpoints
2025-03-26 12:26:50 -04:00
f49a88ab72 Alerting: Add MissingSeriesEvalsToResolve to the APIs (#102150)
What is this feature?

A follow-up for #101184, adds AlertRule.MissingSeriesEvalsToResolve to the APIs.

missing_series_evals_to_resolve must be specified too and it must be > 0.

POST /api/ruler/grafana/api/v1/rules/{folderUID} works in the following way:

    If missing_series_evals_to_resolve is not sent or null, the rule keeps its existing value
    If missing_series_evals_to_resolve > 0: updates to that value
    If missing_series_evals_to_resolve = 0: resets to default (nil).
    AlertRule.MissingSeriesEvalsToResolve can't be 0, so I used it to reset

In the Provisioning API, the value is just set if present and > 0. Otherwise it's reset:

PUT to /api/v1/provisioning/alert-rules/{UID}:

    If missing_series_evals_to_resolve is nil, it's reset to the default value
    If missing_series_evals_to_resolve > 0, it's updated
2025-03-26 13:34:53 +01:00
5b5f433a26 spanner: Disable running alerting integration tests when using spanner. (#102730)
* Disable running alerting integration tests when using spanner.

* Disable tests for templategroup.
2025-03-26 10:57:55 +01:00
b4758d06a3 Alerting: Support JSON Content-Type in the Prometheus conversion API (#102627)
Alerting: Support content-type: json in conversion API
2025-03-24 14:15:25 +01:00
cbdf2eecab Plugins: Update some links in plugin jsons due of mistakes in previous PR (#102214)
* update some links in plugin jsons update backend tests

* fix the test

* fix the test

* Update public/app/plugins/datasource/azuremonitor/plugin.json

Co-authored-by: David Harris <david.harris@grafana.com>

* more docs links added, fix tests

---------

Co-authored-by: David Harris <david.harris@grafana.com>
2025-03-20 09:25:04 +01:00
e39b17d701 Alerting: Remove constraints for uniqueness of rule title (#102067)
* fix having duplicated names in same group in the UI

---------

Co-authored-by: Sonia Aguilar <soniaaguilarpeiron@gmail.com>
2025-03-18 13:27:44 -04:00
695ac91290 Alerting: Add backend support for keep_firing_for (#100750)
What is this feature?

This PR introduces a new alert rule configuration option, keep_firing_for (Prometheus documentation).

keep_firing_for prevents alerts from resolving immediately after the alert condition returns to normal. Instead, they transition into a "Recovering" state and are not considered resolved by the Alertmanager. Once the recovery period ends (or after the next evaluation if it is bigger than keep_firing_for), the alert transitions to "Normal" if it doesn't start alerting again:

Before                                          

+----------+     +----------+                    
| Alerting |---->|  Normal  |                    
+----------+     +----------+                    

-----
After

+----------+      +------------+     +----------+
| Alerting |----->| Recovering |---->|  Normal  |
+----------+      +------------+     +----------+                                                 

Why do we need this feature?

This feature prevents flapping alerts by adding a recovery period. This helps avoid false resolutions caused by brief alert
2025-03-18 11:24:48 +01:00
309a2eb4e9 Alerting: Allow administrators delete rules permanently via UI (#101974)
* add query parameter to existing APIs to control the permanent deletion of rules
* add GUID to gettable rule
* add new endpoint /ruler/grafana/api/v1/trash/rule/guid/{RuleGUID} to delete rules from trash permanently

---------

Signed-off-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
2025-03-14 22:14:06 +02:00
3f2eb087ea Plugins: Update all core plugins with raise issue and docs links (#101929)
* update all core plugins with raise issue and docs links

* fix plugin loader test, run prettier

* fix test

* update test results for api plugin tests
2025-03-12 14:15:46 +01:00
85b0b47efd Alerting: Allow disabling provenance in the Prometheus conversion API (#101573)
When creating Grafana-managed alerts from Prometheus rule definitions with mimirtool or cortextool, the rules are marked as "provisioned" and are not editable in the Grafana UI. This PR allows changing this by providing an extra header: --extra-header="X-Disable-Provenance=true".

When provenance is disabled, we do not keep the original rule definition in YAML, so it is impossible to read it back using the Prometheus conversion API (mimirtool/cortextool). This is intentional because if we did keep it and the rule was later changed in the UI, its Prometheus YAML definition would no longer reflect the latest version of the alert rule, as it would be unchanged.
2025-03-11 19:53:28 +01:00
7e4beb2074 Alerting: API to return deleted rules (#101429) 2025-03-11 12:40:44 -04:00
b73c59547c Alerting: Re-encrypt existing contact points before get and patch in legacy config API (#101263)
* Test covering Get+Save interaction for newly secret fields

* Alerting: Re-encrypt existing contact points before get and patch
2025-03-07 13:26:48 -05:00