Commit Graph

535 Commits

Author SHA1 Message Date
Renato Costa
83311049ad fix: create dashboard in legacy storage within transaction (#114808)
fix: create dashboard within transaction
2025-12-09 10:16:33 -05:00
Seunghun Shin
55b94e6df6 Alerting: Add expression type information to webhook valueString (#112312)
* Alerting: Add expression type to webhook valueString
- Add Type field to NumberValueCapture struct
- Implement AlertQuery.GetExpressionType() method
- Update valueString format to include type information

* Alerting: Add expression type to webhook valueString
- Fix tests

* Alerting: Add expression type to webhook valueString
- Update default annotations in notifier templates to include type field

* Alerting: Add expression type to webhook valueString
- Add type='math' to webhook and email test expectations
2025-12-02 22:03:17 +01:00
Tito Lins
c29ed31c7a alerting: set model refID if missing/mismatch (#114441) 2025-11-26 17:59:22 +01:00
Ezequiel Victorero
da374527f2 ShortURL: K8s Implement custom authorizer (#114192) 2025-11-25 16:34:10 -03:00
alerting-team[bot]
53c39ccda3 Alerting: Update alerting module to 3befd25883e0d17673e5590cc5c5702bbc031b16 (#114062)
* [create-pull-request] automated change

* fix module path for alerting notify test receivers

---------

Co-authored-by: moustafab <27738648+moustafab@users.noreply.github.com>
Co-authored-by: Moustafa Baiou <moustafa.baiou@grafana.com>
2025-11-19 21:24:08 +00:00
Dave Henderson
7264803016 chore(deps): Switch to maintained gopkg.in/yaml fork (#114131)
Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
2025-11-19 15:20:32 -05:00
Alexander Akhmetov
633c9a9cb0 Alerting: Add rule_limit parameter to the list rules API (#114055) 2025-11-18 15:56:40 +01:00
Will Browne
9818822e87 Plugins: Fix flaky backend tests (#113945)
* fix flaky tests

* tidy
2025-11-14 15:09:12 +00:00
Gareth
4e050267c7 decouple the opentsdb data source from core (#113588)
* enable linting rules for opentsdb

* remove core imports

* update plugin.json

* write backend standalone files

* remove frontend core imports

* add yarn workspace

* remove core import for the plugin

* update grafana dependency

* update package.json

* add jest config
2025-11-12 22:33:17 +09:00
Stephanie Hingtgen
ea90bdff9c Dashboard: Fix editor specific permissions in /api (#113292) 2025-10-31 09:03:35 -05:00
Ryan McKinley
bea45a94f0 Correlations: Add legacy storage (#112038) 2025-10-16 21:13:39 +03:00
Yuri Tseretyan
d0f79ee60d Alerting: Update alerting module + refactor (#111761)
* update alerting module
* replace compat with ones from alerting
* update type references Receiver and Integration to *Status
* update route in provisioning test that is invalid after recent change
* use right type for LINE ingtegration
2025-10-03 10:37:49 -04:00
Zoltán Bedi
7055a879ba PostgreSQL: Decouple plugin (#111620) 2025-10-02 14:12:47 +02:00
Andreas Christou
ed7163a26f Graphite: Backend querying improvements (#111549) 2025-10-01 15:04:21 +02:00
Yuri Tseretyan
b8f23eacd4 Alerting: Migrate to integration schema (#111643)
* update tests to assert against snapshot
* remove channel_config package replaced by schemas from alerting module
* update  references to use new schema
2025-09-26 09:31:50 -04:00
Yuri Tseretyan
c36b2ae191 Alerting: v0 schema for integrations (mimir) (#110908)
* generate schema for mimir integrations from schema on front-end
* review and fix the settings
* Update GetAvailableNotifiersV2 to return mimir as v0
* add version argument to GetSecretKeysForContactPointType
* update TestGetSecretKeysForContactPointType to include v0
* add type alias field to contain alternate types that different from Grafana's
* add support for msteamsv2
* update ConfigForIntegrationType to look for alternate type
* update IntegrationConfigFromType to use new result of ConfigForIntegrationType
* add reference to parent plugin to NotifierPluginVersion to allow getting plugin type by it's alias
* add tests to ensure consistency
* make API response stable
* add tests against snapshot + omit optional fields
2025-09-17 09:25:56 -04:00
Andreas Christou
d3c0980c84 Graphite: Decouple from core Grafana (#110294)
* Add lint rules

* Backend decoupling

- Add standalone files
- Add graphite query type
- Add logger to Service
- Create logger in the ProvideService method
- Use a pointer for the HTTP client provider
- Update logger usage everywhere
- Update tracer type
- Replace simplejson with json
- Add dummy CallResource and CheckHealth methods
- Update tests

* Update ConfigEditor imports

* Update types imports

* Update datasource

- Switch to using semver package
- Update imports

* Update store imports

* Update helper imports and notification creation

* Update context import

* Update version numbers and logic

* Copy array_move from core

* Test updates

* Add required files and update plugin.json

* Update core references and packages

* Remove commented code

* Update wire

* Lint

* Fix import

* Copy null type

* More lint

* Update snapshot

* Add tests

* Review

* Fix packages
2025-09-10 18:48:29 +01:00
Moustafa Baiou
ca8324e62a Alerting: Add support for alpha rules apis in legacy storage
Rules created in the new api makes the rule have no group in the database, but the rule is returned in the old group api with a sentinel group name formatted with the rule uid for compatiblity with the old api.
This makes the UI continue to work with the rules without a group, and the ruler will continue to work with the rules without a group.

Rules are not allowed to be created in the provisioning api with a NoGroup sentinel mask, but NoGroup rules can be manipulated through both the new and old apis.

Co-authored-by: William Wernert <william.wernert@grafana.com>
2025-09-10 09:30:56 -04:00
Peter Štibraný
c32650e9d8 Replace remaining calls to testing.Short where possible. (#110765)
* Replace remaining calls to testing.Short where possible.
* Update style guide.
* Revert change in TestAlertmanager_ExtraDedupStage, as it doesn't work.
* Make TestAlertRulePostExport into integration test.
2025-09-09 08:16:12 +00:00
Peter Štibraný
7fd9ab9481 Replace check for integration tests. (#110707)
* Replace check for integration tests.
* Revert changes in pkg/tsdb/mysql packages.
* Fix formatting of few tests.
2025-09-08 15:49:49 +02:00
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