Commit Graph

515 Commits

Author SHA1 Message Date
Yuri Tseretyan
1e0aaa29af Alerting: Comprehensive payload for Alertmanager convert API tests (#110485)
* do not remove global config
* create more comprehensive payload for mimir alertmanager testing
2025-09-03 12:11:55 -04:00
Kristina
1c587a983f Correlations: Add better handling to correlation type and update documentation (#109922)
* Add better type handling when correlation is created from provisioning and fix documentation

* add external example

* change error when deprecated key is used
2025-08-26 10:14:05 -05:00
Alexander Akhmetov
b4ff398865 Alerting: Fix folder permissions for Editor role in Prometheus import (#109977)
Alerting: Fix folder permisisons for Editor role in Prometheus import
2025-08-22 13:15:53 +02:00
Alexander Akhmetov
17444fdc0d Alerting: Add keepFiringFor and missing_series_evals_to_resolve to file provisioning (#109699) 2025-08-14 22:19:43 +02:00
Alexander Akhmetov
e165a490b4 Alerting: Return merged extra configurations in the API (#109636) 2025-08-14 07:46:12 +02:00
Sofia Papagiannaki
402572c580 Add ConfigProvider and modify quota.Service to use it (#109395)
* Add config provider and integrate with wire setup

* Refactor quota service to use config provider for configuration management

* Enhance OSSConfigProvider to include logging and update ProvideService to return an error. Refactor server initialization to handle potential errors from config provider. Remove unnecessary wire binding for OSSConfigProvider.

* Update CODEOWNERS to include the configprovider package under the grafana-backend-services-squad.

* Refactor quota service initialization to include context in multiple service providers. Update tests and service implementations to ensure proper context handling during service creation.
2025-08-12 09:42:10 +03:00
Moustafa Baiou
16f8359d35 Alerting: Update Alert Rule to use int64 for MissingSeriesEvalsToResolve (#109306) 2025-08-06 21:45:48 -04:00
Stephanie Hingtgen
6b86277ecf Nested folders: Remove feature flag (#109212) 2025-08-06 10:07:23 +03:00
Ezequiel Victorero
006ea8e1b9 ShortURL: Fix tests and small refactor (#108871) 2025-07-30 10:31:11 -03:00
Stephanie Hingtgen
1f025fe1a3 K8s: Remove kubernetesClientDashboardsFolders feature flag (#108626) 2025-07-29 16:52:57 -05:00
Stephanie Hingtgen
1716173f71 Alerting: Move some tests to full integration tests (#108747)
* Alerting: Move some tests to full integration tests

* add back two error handling tests

* imports

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2025-07-29 12:15:26 +00:00
Stephanie Hingtgen
39b9700048 Folders: Move to integration tests (#108733) 2025-07-29 09:57:44 +00:00
Stephanie Hingtgen
fe906dfc1e Dashboards: Move to integration tests (#108734) 2025-07-29 09:52:27 +02:00
Stephanie Hingtgen
caa75b1d94 Public dashboards: move to integration tests (#108735) 2025-07-28 17:14:09 +00:00
Stephanie Hingtgen
f41570a6f7 Annotations: Move to integration tests (#108736) 2025-07-28 11:37:17 -05:00
Alex Spencer
2dd655a50d Correlations: Fix flaky test (#108618)
* chore: fix flaky test

* chore: remove assert in equal, use require instead

* chore: skip flaky test
2025-07-28 09:14:30 -07:00
Serge Zaitsev
a95fb3a37c Chore: Omit integration tests if short test flag is passed (#108777)
* omit integration tests if short test flag is passed

* Update pkg/services/ngalert/models/receivers_test.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* Update pkg/tests/api/alerting/api_ruler_test.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* Update pkg/tests/api/alerting/api_ruler_test.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* Update pkg/tests/api/alerting/api_ruler_test.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* Update pkg/tests/api/alerting/api_ruler_test.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* Update pkg/tests/api/alerting/api_ruler_test.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* Update pkg/services/ngalert/models/receivers_test.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* Update pkg/cmd/grafana-cli/commands/datamigrations/to_unified_storage_test.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* Update pkg/services/ngalert/models/receivers_test.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* fix the rest

* false positive

---------

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
2025-07-28 13:38:54 +02:00
Will Browne
1e0fd825eb Plugins: Simplify assetpath logic (#107876)
* simplify assetpath logic

* fix tests
2025-07-09 15:48:52 +01:00
Alexander Akhmetov
b483a04aec Alerting: Send merged configuration to the remote alertmanager (#107004) 2025-07-02 21:35:24 +02:00
Ivana Huckova
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
Stephanie Hingtgen
f8189eece9 Dashboard Imports: Fix creating new library panels (#107219) 2025-06-26 05:23:05 -06:00
Alexander Akhmetov
b93cde0adb Alerting: Use default identifier for extra configs in Alertmanager API (#107049) 2025-06-26 12:44:49 +02:00
Ivana Huckova
f0fab90072 Loki: Remove lokiSendDashboardPanelNames toggle (#106991) 2025-06-20 10:06:15 +02:00
Alexander Akhmetov
700c9a857c Alerting: Return extra alertmanager config as a string for mimirtool (#106959) 2025-06-19 01:12:26 +02:00
Alexander Akhmetov
4b46da9214 Alerting: Hide extra Prometheus configuration secrets (#106916) 2025-06-18 17:01:19 +02:00
Alexander Akhmetov
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
Kevin Minehart
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
Alexander Akhmetov
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
Alexander Akhmetov
e256f2d5e2 Alerting: Enable recording rules by default (#105603) 2025-06-02 10:56:05 +02:00
Will Browne
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
Peter Štibraný
c4d3eb1cd0 Remove support for Google Spanner database. (#105846)
* Remove support for Google Spanner database.
2025-05-23 11:35:59 +02:00
Alexander Akhmetov
c58ac15031 Alerting: Remove grafanaManagedRecordingRules feature flag (#105569) 2025-05-19 12:15:49 +02:00
David Harris
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
Peter Štibraný
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
Peter Štibraný
ba111e612b Skip TestIntegration_AdminApiReencrypt. (#105454)
* Skip TestIntegration_AdminApiReencrypt and TestIntegration_AdminApiReencrypt_Enterprise.
2025-05-15 11:38:42 +00:00
Peter Štibraný
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
Alexander Akhmetov
9fe523b9e6 Alerting: API to pause all alert rules in a folder (#104674) 2025-05-13 17:04:01 +02:00
Alexander Akhmetov
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
Sonia Aguilar
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
Yuri Tseretyan
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
Gilles De Mey
109267ab03 Alerting: Remove feature toggle for custom recovery threshold (#104455) 2025-04-24 11:58:17 -04:00
Moustafa Baiou
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
Artur Wierzbicki
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
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
Alexander Akhmetov
a913c5426d Alerting: Fix flaky TestIntegrationPrometheusRules test (#103886) 2025-04-11 19:50:46 +02:00
Matthew Jacobson
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
Matthew Jacobson
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
Mariell Hoversholm
757be6365a CI: Bump golangci-lint to 2.0.2 (#103572) 2025-04-10 14:42:23 +02:00
Will Browne
53126eb307 Chore: Disable snapshot flag for plugins API test (#103733)
disable snapshot flag for test
2025-04-10 09:57:20 +01:00
Alexander Akhmetov
babe188e31 Alerting: Fix path for cortex-style Prometheus namespaces conversion endpoint (#103655) 2025-04-09 10:40:22 +02:00