Commit Graph

12154 Commits

Author SHA1 Message Date
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
Agnès Toulet
1cec6195f1
Rendering: Fix plugin initialization (#80013) 2024-01-04 11:30:01 +01:00
Jo
5ae3249c36
Auth: Hide forgot password if grafana auth is disabled (#79895)
* hide forgot password if grafana auth is disabled

* fix test
2024-01-04 10:46:55 +01:00
Torkel Ödegaard
e924627659
Frontend: Reload the browser when backend configuration/assets change (#79057)
* Detect frontend asset changes

* Update

* merge main

* Frontend: Detect new assets / versions / config changes (#79258)

* avoid first check

* Updates and add tests

* Update

* Update

* Updated code

* refine

* use context

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2024-01-04 08:00:07 +01:00
Andreas Christou
dd77ff6bcd
Plugins: Externalise Azure Monitor data source (#79545)
* Set up frontend linting for Azure

- Fix final frontend import
- Fix other lint issues

* Add Azure Monitor to backend linting

* Remove featuremgmt dependency

* Add intervalv2 to list of disallowed imports

* Remove config dependency

- Replace with function from azure-sdk

* Remove util dependency

* Duplicate interval functionality from core

* Add required backend wrappers

* Update frontend

* Add testing helper

* Add missing package

* Bump minimum grafana dependency

* Fix dependency

* Regen cue

* Fix lint

* Update expected response file

* Update import and dependency
2024-01-03 19:20:22 +00:00
Mihai Doarna
c219a19f97
Auth: Add missing 404 status code from the SSO Settings delete endpoint (#79982)
add missing 404 status code from sso settings delete endpoint
2024-01-03 16:05:11 +02:00
Giuseppe Guerra
b1c7aa269b
Dependencies: Bump github.com/grafana/grafana-plugin-sdk-go from v0.197.0 to v0.198.0 (#79928)
* chore: Bump google.golang.org/grpc from 1.59.0 to 1.60.1

* Bump google.golang.org/protobuf to v1.32.0

* Fix make protobuf failing with latest protoc and protoc-gen-go

* Re-generate protobuf files

* Re-generate protobuf files

* Bump grafana-plugin-sdk-go

* go mod tidy
2024-01-03 13:36:44 +02:00
Joey
00bc13e37c
Pyroscope: Remove unnecessary import and logic (#79568)
* Remove unecessary import and logic

* Update test
2024-01-03 11:25:38 +00:00
Mihai Doarna
ade91e5038
Auth: Implement the SSO Settings update endpoint (#79676)
* merge with system settings before storing them in the db

* add base for validating sso settings

* add unit tests for sso settings validation

* call Reload() from sso service upsert()

* remove actual validation because it was moved in a separate pr

* use constant to fix lint error

* check if provider is configurable in service Upsert() method

* add unit tests for update provider settings api method

* fix lint error
2024-01-03 13:04:35 +02:00
Mihai Doarna
6465d87afd
Auth: Add basic validation for SSO settings (#79696)
* add basic validation for sso settings

* remove validation for the client secret
2024-01-03 10:02:03 +02:00
Leon Sorokin
fb79be4a43
Transformations: Add frame source picker to allow transforming annotations (#77842)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2024-01-02 23:33:31 -06:00
Drew Slobodnjak
2502fe4d19
Canvas: Add Pan and Zoom (#76705)
* Canvas: Add Zoom

* Scale selecto components based on zoom state

* Fix pan by reverting to 3.1.0 for zoom-pan

* Update to latest library that fixes pan regression

* Add mini map to canvas pan zoom

* Fix selecto and anchors on hover

* Update naming to be more clear

* Switch back to contentComponent

* Apply transformScale to drag and resize

* Update connection source and target scaling

* Add option to display mini map

* Update yarn lock

* Revert "Update yarn lock"

This reverts commit 3d1dd65d57.

* Set yarn lock to main

* Revert "Set yarn lock to main"

This reverts commit 64bc50557e.

* Update to Yarn 4

* Add react-zoom-pan-pinch

* Update react-zoom-pan checksum

* Revert changes to json files

* Remove last line of api merged

* Remove last lines of all impacted jsons

* Update home json

* Update coordinate calc function to include scale

* Fix types in coordinate calc function

* Fix util calculation for transform

* Fix arrow anchor shift behavior

* Fix scale offset when adding elements during zoom

* Fix drag of selected group during zoom

* Add feature flag for canvas pan zoom

* Revert "Add feature flag for canvas pan zoom"

This reverts commit b026e31d8d.

* Regenerate feature flag after merge

* Apply feature flag to enable pan zoom wrappers

* Add mini map toggle behind feature flag

* Simplify minimap behavior

* Update feature flag registry

* Set minimap to false by default

* fix gen-cue

* Set toggles gen to main

Add blank line to toggle gen csv

* Add canvas pan zoom to csv

* Remove old comment

* Change ref parameter to be more descriptive

* Rename visibleFun to be more descriptive

* Consolidate transformScale transformRef in util

* Remove non-null assertion on connection parentRect

* Consolidate parentRect null coalescing into object

* Remove minimap and change toggle

* Add controls inline help for pan and zoom

* Clean up mouse events

* Pull scale out of ref and isolate transform

* Remove transform ref from scene div

* Fix context menu visible behavior

* Fix connections and update util functions

* Move transform component instance to util

* fix backend test

* minor updates

* Clean up connections / fix minor bug where offset of arrow wasn't being calculated correctly

* missed connection code cleanup

* cleanup scene code a bit more

* actually fix backend test

* move eslint disable line closer to actual issue

---------

Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
2024-01-02 11:52:21 -08:00
Ryan McKinley
c598306523
K8s: Enable api-server by default (#79942) 2024-01-02 09:54:57 -08:00
Serge Zaitsev
4f70586ead
Chore: Remove mssql driver from xorm (#79930)
remove mssql driver from xorm
2024-01-02 17:11:35 +01:00
Fabrizio
7746250367
Parca: Add standalone building configuration (#79896)
* Parca: Decouple frontend

* Parca: decouple backend

* Parca: add standalone build process

* Regenerate cue files

* Fix import

* Trigger CI

* Fix test

* Trigger CI

* Trigger CI
2024-01-02 16:36:57 +01:00