Commit Graph

12168 Commits

Author SHA1 Message Date
Ryan McKinley
2c09f969f1
K8s: Add dashboard service (requires dev mode) (#78565) 2024-01-11 01:20:30 +02:00
Matthew Jacobson
afa33f12b2
Alerting: Create alertingQueryOptimization feature flag for alert query optimization (#78932)
* Alerting: Create feature flag for alert query optimization

Adds a feature flag alertingQueryOptimization for an already existing 
functionality: alert query optimization. This feature flag will now be disabled 
by default.
2024-01-10 15:52:58 -05:00
Matthew Jacobson
f365d35cf8
Alerting: Show warning when query optimized (#78751)
* Alerting: Show warning when query optimized

* Use frame.AppendNotices

* Improve warning to include why and a prompt for action
2024-01-10 14:40:00 -05:00
Tania
744c1032ee
Provisioning: Fix dual write of folders (#80140)
* Provisioning: Store folders in folders table

* Solve linting issues

* Remove a comment
2024-01-10 16:48:28 +01:00
Ryan McKinley
6be6724433
K8s/Testdata: Expose testdata in standalone apiserver (#80248) 2024-01-10 17:45:23 +02:00
Ryan McKinley
ee7daeb2a7
APIServer: Move shared code to a utility/helper function (#80261) 2024-01-10 07:30:16 -08:00
Mihai Doarna
772e5993b6
Auth: reload SSO settings for HA setups (#80231)
* reload SSO settings for HA setups

* remove check for grafana HA

* add unit tests

* fetch all sso settings with one sql query

* register background service
2024-01-10 16:01:37 +02:00
Karl Persson
5b3cd9f55b
features: Add feature flag for grafana cloud rbac roles (#80283) 2024-01-10 14:19:01 +01:00
Giuseppe Guerra
b40d3e7487
Plugins: Add enablePluginsTracingByDefault feature flag (#80195)
* Add enablePluginsTracingByDefault feature flag

* Enable tracing for all plugins if enablePluginsTracingByDefault is set

* fix docstrings for IsEnabled and IsEnabledGlobally

* fix tests

* do not use separate feature manager

* add test case

* Revert "fix tests"

This reverts commit 46a2420ed1.

* cleanup

* fix plugin tracing disabled if wrong plugin setting is present

* add test case for enabled on plugin with wrong plugin setting but with enablePluginsTracingByDefault feature flag

* Add RequiresRestart = true to enablePluginsTracingByDefault

* re-generate feature flags

* pr review feedback
2024-01-10 13:25:54 +02:00
Santiago
9e78faa7ba
Alerting: Add metrics to the remote Alertmanager struct (#79835)
* Alerting: Add metrics to the remote Alertmanager struct

* rephrase http_requests_failed description

* make linter happy

* remove unnecessary metrics

* extract timed client to separate package

* use histogram collector from dskit

* remove weaveworks dependency

* capture metrics for all requests to the remote Alertmanager (both clients)

* use the timed client in the MimirAuthRoundTripper

* HTTPRequestsDuration -> HTTPRequestDuration, clean up mimir client factory function

* refactor

* less git diff

* gauge for last readiness check in seconds

* initialize LastReadinesCheck to 0, tweak metric names and descriptions

* add counters for sync attempts/errors

* last config sync and last state sync timestamps (gauges)

* change latency metric name

* metric for remote Alertmanager mode

* code review comments

* move label constants to metrics package
2024-01-10 11:18:24 +01:00
Ryan McKinley
53411eeaa0
K8s: Expose testdata connection as an api-server (dev mode only) (#79726) 2024-01-09 12:26:24 -08:00
Matthew Jacobson
1d4419fbe4
Alerting: Fix NoData & Error alerts not resolving when rule is reset (#80184)
* Alerting: Fix NoData & Error alerts not resolving when rule is reset

On rule reset, when creating the PostableAlerts StateToPostableAlert did not
attach the correct NoData/Error alertname and rulename labels to expire/resolve
the active alerts when the previous cached state was NoData/Error.
2024-01-09 14:47:19 -05:00
Alexander Weaver
542741f748
Alerting: Log scheduler maxAttempts, guard against invalid retry counts, log retry errors (#80234)
* Log maxAttempts, add guard, log retry errors

* fix whitespace

* Initialize evaluator in TestProcessTicks
2024-01-09 13:19:37 -06:00
Ryan McKinley
1caaa56de0
FeatureFlags: Use interface rather than manager (#80000) 2024-01-09 10:38:06 -08:00
Gábor Farkas
ecc667c9a5
postgres: add snapshot tests (#79794)
* postgres: add snapshot tests

* fixed wrong comment

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

---------

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2024-01-09 16:54:21 +02:00
Mihai Doarna
3332562900
Auth: use Empty() for sending empty http responses in SSO Settings API (#80200)
use Empty() for sending empty http response
2024-01-09 15:27:55 +02:00
Giuseppe Guerra
c045a9f395
Plugins: Fix symlinks inside plugins path not being followed (#80205)
* Plugins: Loader: Fix symlinks not followed when loading external plugins

* Add test case
2024-01-09 14:23:03 +01:00
Mihai Doarna
adb7295bab
Auth: Send an empty http response without the json header in SSO Settings API (#80197)
send an empty http response without the json header
2024-01-09 12:14:39 +02:00
Charandas
48612063dd
Grafana app platform: an aggregator cmd and package (#79948) 2024-01-08 22:33:42 +02:00
Ivana Huckova
3dc7cfdc18
Loki: Implement error source (#80143) 2024-01-08 18:32:16 +01:00
Matias Chomicki
cff1ad4922
Logs popover: enabled by default (#80146) 2024-01-08 17:03:39 +01:00
Jo
c3d8c6e0ea
JWT: Fallthrough to fetch keyset in case of cache error (#80081)
fallthrough to fetch keyset in case of cache error. Fixes #67582
2024-01-08 16:02:31 +01:00
colin-stuart
062e772bb2
Auth: Implement the SSO Settings GET endpoint (#79144)
* Return data in camelCase from the OAuth fb strategy

* changes

* wip

* Add defaults for oauth fb strategy

* revert other changes

* basic includeDefaults query param implementation

* basic secret removal and etag implementation

* correct imports

* rebase

* move default settings filter to models

* only replace ClientSecret value if set

* first GetForProvider test & use FNV for ETag to avoid Blocklisted import error

* add tests

* add annotation for the openapi spec & generate spec

* remove TODO

* use IsSecret, improve tests, remove DefaultOAuthSettings

* add comment explaining generateFNVETag

* add error handling for generateFNVETag

* run go generate

* Update pkg/services/ssosettings/api/api.go

Co-authored-by: Mihai Doarna <mihai.doarna@grafana.com>

* move isSecret to service, create GetForProviderWithRedactedSecrets func

* add unit test for GetForProviderWithRedactedSecrets & remove duplicated code

* regen openapi/swagger

* revert dependency bumps

---------

Co-authored-by: Mihaly Gyongyosi <mgyongyosi@users.noreply.github.com>
Co-authored-by: Mihai Doarna <mihai.doarna@grafana.com>
2024-01-08 09:35:14 -05:00
Adam Bannach
505196bcd5
Chore: Remove costManagementUi toggle (#80098)
* chore: remove cost management ff; fallback to adding AM and LVE to apps drawer

* chore: revert fallback app drawer placement
2024-01-08 14:25:11 +00:00
Misi
eae6adf002
Auth: Use cfg.Raw in OAuthStrategy for loading settings (#80136)
Use cfg.Raw in OAuthStrategy, remove unnecessary tests
2024-01-08 15:36:15 +02:00
Joey
81f8c022a0
Pyroscope: Decouple backend from infra imports (#80018)
Decouple backend from infra imports
2024-01-08 13:11:46 +00:00
Will Browne
78ae795e06
Plugins: Fix loading of dist folders (#80015)
* end to end

* tidy

* fix whitespace

* remove unused code

* fix linter

* fix gosec + add sort

* fix test

* apply cr feedback
2024-01-08 11:45:03 +01:00
Nathan Marrs
2ff1e40a7f
chore: Update DataViz feature toggles related to 10.3 release to be public preview (#80109)
Update feature toggles for tooltips / canvas to be public preview
2024-01-05 17:40:11 -08:00
Matthew Jacobson
aa03b8f8a7
Alerting: Guided legacy alerting upgrade dry-run (#80071)
This PR has two steps that together create a functional dry-run capability for the migration.

By enabling the feature flag alertingPreviewUpgrade when on legacy alerting it will:
    a. Allow all Grafana Alerting background services except for the scheduler to start (multiorg alertmanager, state manager, routes, …).
    b. Allow the UI to show Grafana Alerting pages alongside legacy ones (with appropriate in-app warnings that UA is not actually running).
    c. Show a new “Alerting Upgrade” page and register associated /api/v1/upgrade endpoints that will allow the user to upgrade their organization live without restart and present a summary of the upgrade in a table.
2024-01-05 18:19:12 -05:00
Yuri Tseretyan
72182e02a4
Alerting: Mute timing service tests (#79817)
split tests for mute timing service to functions for each method this makes it clear the scope of tests
2024-01-06 00:26:15 +02:00
Arati R
90fb6a0122
Update unified storage readme (#79934)
* Update unified storage readme

Co-authored-by: Dan Cech <dcech@grafana.com>
2024-01-05 23:44:34 +02:00
Yuri Tseretyan
494f36e0bd
Alerting: Update provisioning services that handle Alertmanager configuraiton to access config via storage (#79814)
* extract get and save operations to a alertmanagerConfigStore. this removes duplicated code in service (currently only mute timings) and improves testing
* replace generic errors with errutils one with better messages.
* update provisioning services to use new store

---------

Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
2024-01-05 16:15:18 -05:00
Isabella Siu
8dc04ea63a
AWS Datasources: Enable awsAsyncQueryCaching by default (#80045) 2024-01-05 14:56:30 -05:00
Oscar Kilhed
583b9797af
Transformations: Move moving average, regression analysis and format string transformations to public preview (#80067)
* move transformation features to public preview

* update docs

* Update docs/sources/panels-visualizations/query-transform-data/transform-data/index.md

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>

* Update docs/sources/panels-visualizations/query-transform-data/transform-data/index.md

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>

* Update docs/sources/panels-visualizations/query-transform-data/transform-data/index.md

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>

* fix formating of ffs

---------

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2024-01-05 19:39:02 +01:00
Matthew Jacobson
49891d6a72
Alerting: Add feature flag alertingPreviewUpgrade for migration preview + dry-run (#80036)
* Add feature flag

* Remove from docs for now
2024-01-05 13:31:05 -05:00
Yuri Tseretyan
3a966fc6ca
Alerting: Enable recovery threshold feature by default (#80088) 2024-01-05 12:59:41 -05:00
Alexander Weaver
a8fb01a502
Swap weaveworks/common utilities for equivalents in grafana/dskit (#80051)
* Replace histogram collector and grpc injectors

* Extract request timing utility

* Also vendor test file

* Suppress erroneous linter warn
2024-01-05 10:08:38 -06:00
Agnès Toulet
41eff02d75
Docs: Add table data in PDF (#80059)
* Docs: Add table data in PDF

* fix lint issues

* Switch to public preview

* Apply suggestions from code review

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>

---------

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2024-01-05 15:57:13 +01:00
Julien Duchesne
c7f515b9b2
fix(swagger): POST -> GET method for two access control endpoints (#80082)
Missed those here: https://github.com/grafana/grafana/pull/80053
2024-01-05 09:40:08 -05:00
Julien Duchesne
5e74c19628
fix(swagger): Add new access control endpoints (#80053)
There were a few errors that prevented these endpoints (which are the most up-to-date ones) from being present in the openapi spec:
- The `enterprise` tag excluded the endpoints from being generated
- `okRespoonse` typo
- Invalid templating on the parameters
- Missing parameter structs
2024-01-05 08:12:01 -05:00
Matthew Jacobson
3537c5440f
Alerting: Refactor migration to return pairs of legacy and upgraded structs (#79719)
Some refactoring that will simplify next changes for dry-run PRs. This should be no-op as far as the created ngalert resources and database state, though it does change some logs.

The key change here is to modify migrateOrg to return pairs of legacy struct + ngalert struct instead of actually persisting the alerts and alertmanager config. This will allow us to capture error information during dry-run migration.

It also moves most persistence-related operations such as title deduplication and folder creation to the right before we persist. This will simplify eventual partial migrations (individual alerts, dashboards, channels, ...).

Additionally it changes channel code to deal with PostableGrafanaReceiver instead of PostableApiReceiver (integration instead of contact point).
2024-01-05 05:37:13 -05:00
Mihai Doarna
359b118e6a
Auth: fix camelCase in getFallbackStrategyFor() func (#80061)
fix camelCase in getFallbackStrategyFor() func
2024-01-05 12:25:59 +02:00
Santiago
1f6575e65e
Alerting: Test MOA in remote secondary mode (#79828) 2024-01-05 11:05:27 +01:00
Gábor Farkas
bfb85f27b1
sql: improve sqleng-api, leave sql.DB creation to the plugins (#79672) 2024-01-05 08:37:15 +01:00
Gábor Farkas
8923cc27ce
sql: do not import stacktrace-generator code from core grafana (#79507)
sql: do not import from core grafana
2024-01-05 08:33:46 +01:00
Matthew Jacobson
c18da48e50
Alerting: Separate overlapping legacy and UA alerting routes (#76517)
* Separate overlapping legacy and UA alerting routes

api/alert-notifiers, alerting/list, and alerting/notifications existed in both
legacy and UA.
Rename legacy route paths and nav ids to be independent of UA ones.
2024-01-04 18:01:57 -05:00
Alexander Weaver
90d4704cd7
Alerting: Fix URL timestamp conversion in historian API in annotation mode (#80026)
Fix timestamp conversion when calling annotation store
2024-01-04 12:40:21 -06:00
Yuri Tseretyan
f6a46744a6
Alerting: Support hysteresis command expression (#75189)
Backend: 

* Update the Grafana Alerting engine to provide feedback to HysteresisCommand. The feedback information is stored in state.Manager as a fingerprint of each state. The fingerprint is persisted to the database. Only fingerprints that belong to Pending and Alerting states are considered as "loaded" and provided back to the command.
   - add ResultFingerprint to state.State. It's different from other fingerprints we store in the state because it is calculated from the result labels.
  -  add rule_fingerprint column to alert_instance
   - update alerting evaluator to accept AlertingResultsReader via context, and update scheduler to provide it.
   - add AlertingResultsFromRuleState that implements the new interface in eval package
   - update getExprRequest to patch the hysteresis command.

* Only one "Recovery Threshold" query is allowed to be used in the alert rule and it must be the Condition.


Frontend:

* Add hysteresis option to Threshold in UI. It's called "Recovery Threshold"
* Add test for getUnloadEvaluatorTypeFromCondition
* Hide hysteresis in panel expressions

* Refactor isInvalid and add test for it
* Remove unnecesary React.memo
* Add tests for updateEvaluatorConditions

---------

Co-authored-by: Sonia Aguilar <soniaaguilarpeiron@gmail.com>
2024-01-04 11:47:13 -05:00
Bryan Huhta
e64cb8541f
Pyroscope: Send start/end with profile types query (#77523) 2024-01-04 16:35:47 +01:00
Torkel Ödegaard
f0c38611a2
Scenes: Remove old scenes stuff (#79760)
* Scenes: Remove old scenes stuff

* Fixes

* Fixes

* update
2024-01-04 15:44:41 +01:00