Commit Graph

13095 Commits

Author SHA1 Message Date
Alexander Zobnin
3127566a20
Access control: Use ResolveIdentity() for authorizing in org (#85549)
* Access control: Use ResolveIdentity() for authorizing in org

* Fix tests

* Fix middleware tests

* Use ResolveIdentity in HasGlobalAccess() function

* remove makeTmpUser

* Cleanup

* Fix linter errors

* Fix test build

* Remove GetUserPermissionsInOrg()
2024-04-10 12:42:13 +02:00
Karl Persson
ebb4bb859e
Authn: allow ResolveIdentity to authenticate in "global" scope (#85835)
* Authn: allow ResolveIdentity to authenticate in "global" scope

* Use constant
2024-04-10 11:53:45 +02:00
Karl Persson
fd870702c7
Chore: Remove unused function TryRotateToken (#85836)
* Chore: Remove unused function

* remove unused function
2024-04-10 11:15:43 +02:00
Tristan
8f5839fe8f
CloudWatch: Add additional Glue metrics (#85798) 2024-04-09 19:31:39 +00:00
Darren Janeczek
66c0fd4dcc
chore: update datatrails feature flag and enable (#85508)
* chore: update datatrails feature flag and enable

* fix: rename `datatrails` feature flag to `exploreMetrics`
2024-04-09 14:15:18 -04:00
Matthew Jacobson
f79dd7c7f9
Alerting: Persist silence state immediately on Create/Delete (#84705)
* Alerting: Persist silence state immediately on Create/Delete

Persists the silence state to the kvstore immediately instead of waiting for the
 next maintenance run. This is used after Create/Delete to prevent silences from
 being lost when a new Alertmanager is started before the state has persisted.
 This can happen, for example, in a rolling deployment scenario.

* Fix test that requires real data

* Don't error if silence state persist fails, maintenance will correct
2024-04-09 13:39:34 -04:00
Todd Treece
72472e5eb7
K8s: Add slog wrapper (#84680) 2024-04-09 18:39:25 +03:00
Leonor Oliveira
518d3341d5
Add Get method in dual writer (#85589)
* Add Get method in dual writer

* Update pkg/apiserver/rest/dualwriter_mode3.go

Co-authored-by: Dan Cech <dcech@grafana.com>

* Actually run the tests

* no need for t.Run()

* Update pkg/apiserver/rest/dualwriter_mode3.go

Co-authored-by: Dan Cech <dcech@grafana.com>

* Update pkg/apiserver/rest/dualwriter_mode3.go

Co-authored-by: Dan Cech <dcech@grafana.com>

* Update pkg/apiserver/rest/dualwriter_test.go

Co-authored-by: Dan Cech <dcech@grafana.com>

* Log improvements

* Fix method name

---------

Co-authored-by: Dan Cech <dcech@grafana.com>
2024-04-09 16:08:20 +02:00
Will Browne
698436aa29
Plugins: Update to latest go plugin sdk (v0.221.0) (#85796)
* update plugin sdk

* fix indirect
2024-04-09 15:06:05 +02:00
idafurjes
5c4a2de59b
Add FolderUID for library elements (#83819)
* Revert "Revert "Add FolderUID for library elements" (#83776)"

This reverts commit 0dfdb2ae47.

* Fix bug, dashboard id and library element fodler_id are the corresponding values
Dashboard table hold both dahboards and tables
2024-04-09 12:27:43 +02:00
Santiago
2e7cc68394
Alerting: Remove CleanUp method from the Alertmanager (#85650)
Alerting: Remove Cleanup method from the Alertmanager
2024-04-09 12:13:27 +02:00
Leonor Oliveira
8d75dcec04
Add better logging to the dual writer (#85594)
* Make Legacy a public field

* Remove duplicated Create method

* Add logger to dualwriter

* Use klog

* Add comment about selecting the dual writer

* Update pkg/apiserver/rest/dualwriter_mode1.go

Co-authored-by: Arati R. <33031346+suntala@users.noreply.github.com>

* Update pkg/apiserver/rest/dualwriter_mode2.go

Co-authored-by: Arati R. <33031346+suntala@users.noreply.github.com>

* Update pkg/apiserver/rest/dualwriter_mode3.go

Co-authored-by: Arati R. <33031346+suntala@users.noreply.github.com>

* Update pkg/apiserver/rest/dualwriter_mode3.go

Co-authored-by: Arati R. <33031346+suntala@users.noreply.github.com>

* Update pkg/apiserver/rest/dualwriter_mode2.go

Co-authored-by: Arati R. <33031346+suntala@users.noreply.github.com>

* Create error var

* Lint

---------

Co-authored-by: Arati R. <33031346+suntala@users.noreply.github.com>
2024-04-09 10:54:09 +02:00
Misi
4c12d77b98
Util: Support parsing and splitting strings enclosed in quotes in util.SplitString (#85735)
* Support parsing string enclosed in quotation marks in util.SplitString

* Support mixed formats of string list
2024-04-09 10:35:57 +02:00
Gábor Farkas
8a15ed42ae
PostgreSQL: Fix the verify-ca mode (#85530)
postgres: fix the verify-ca problem
2024-04-09 08:39:45 +02:00
Yuri Tseretyan
509691b416
Alerting: Introduce authorization logic for operations on silences (#85418)
* extract genericService from RuleService just to reuse it later
* implement silence service

---------

Co-authored-by: William Wernert <william.wernert@grafana.com>
Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>
2024-04-08 18:02:28 -04:00
Dan Cech
5dfe4cf407
Storage: Watch tests (#85496)
* basic watch tests working

* refactor to read previous event within poller

* add watch test files

* cleanup

* watch tests passing

* debug cleanup

* special handling for canceled context

* cleanup

* fix wire

* fix sqlite_sequence cleanup issue

* move watch tests to integration, wait for provisioned dashboards

* handle context deadline exceeded and eof errors

* add comment about sleep
2024-04-08 11:42:12 -04:00
Gábor Farkas
ccd13bf08e
postgres: add tests to handle multiple statements in the same query (#85523)
* postgres: add tests to handle multiple statements in the same query

* better test explanation
2024-04-08 16:56:23 +02:00
owensmallwood
37d39de36d
Storage Api: Add metrics (#85316)
* Storage server runs own instrumentation server if its the sole target. Starts adding some sample metrics for now.

* adds metric for failed optimistic locks

* refactors metrics registration to own method on service for testability. Adds tests.

* Register sql storage server metrics from within the service

* fixes test

* troubleshooting drone test failures. Maybe timing when starting instrumentation server?

* Waits until instrumentation server has started. Updates tests.

* defer wont get called unless theres an error. removing.

* wait for instrumentation server to be running

* linter - close res body

* use port 3000 for metrics and removes test metric inc() call

* fixes test - updates port

* refactors module server to provide an instrumentation server module when there is no ALL or CORE target provided and running as single target

* make instrumentation server a dependency of all modules that do not run their own http server

* adds module server test

* adds tests for instrumentation service and removes old tests that aren't needed

* ignore error in test

* uses helper to start and run service

* when running wait on ctx done or http server err

* wait for http server

* removes println

* updates module server test to be integration test

* require no error in goroutine

* skips integration test when GRAFANA_TEST_DB not defined

* move http server start into start, verify returned content

* make test error when run fails

* try waiting longer and see if drone tests pass

* update integration test mysql creds to match drone

* go back to only waiting half second

* debug log drone mysql connection string

* use same db connection config as drone

* try using same hostname as drone

* cant use localhost as mysql hostname in drone tests. Need to parse it from the cfg db connection string

---------

Co-authored-by: Dan Cech <dcech@grafana.com>
2024-04-08 08:35:01 -06:00
Dan Cech
9c46e71d5a
Storage: Support continue at specified resource version (#84868)
* support continue at specified resource version

* detect whether list continue pages need to use entity_history, remove BatchRead, expand selectQuery helper

* refactor continue token handling

* fix tests, increase history chunk size

* lint fix
2024-04-08 09:57:02 -04:00
kgeckhart
5aa56c9380
CloudWatch: Add a Performance Insights and other missing metrics to aws/rds (#85680) 2024-04-08 14:00:28 +02:00
Santiago
6a75a8f354
Alerting: Update grafana/alerting and use Upsert for creating silences (#85676)
* Alerting: Update grafana/alerting and use Upsert for creating silences

* go.work.sum

* change error message in tests for silences (save -> upsert)
2024-04-08 11:46:14 +02:00
Mikel Vuka
724517dc40
Provisioning: datasources auto deletion (#83034) 2024-04-08 11:45:39 +02:00
Karl Persson
46ee87a0fc
Authn: Ignore context.Canceled errors when logging auth errors (#85707)
Ignore context.Canceled errors when logging auth errors
2024-04-08 10:25:24 +02:00
Sofia Papagiannaki
88be09420c
Chore: Fix test to retry fetching provisioned dashboard until is in place (#85408)
Retry fetching provisioned dashboard until is in place
2024-04-08 10:47:34 +03:00
Leonard Gram
1332d8ba24
Cloudmigration: Sets the runID correctly when saving (#85661)
Sets the runID correctly instead of setting it to the same as the migration id.
2024-04-05 18:03:45 +02:00
Isabella Siu
58f32150c2
CloudWatch: Improve metric label parsing (#84835) 2024-04-05 11:57:56 -04:00
Alexander Weaver
03114e7602
Alerting: Return better error for invalid time range on alert queries (#85611)
* Return better error for invalid time range

* drop comment
2024-04-05 09:20:21 -05:00
Misi
8796d2d307
Auth: Convert SetDefaultOrgHook to PostLoginHook (#85649)
* Convert SetDefaultOrgHook to PostLoginHook
2024-04-05 16:03:51 +02:00
Alexander Weaver
734d0111cb
Alerting: Export pure function to convert query results to alert results (#85393)
Exported pure function to convert query results to alert results
2024-04-05 08:57:31 -05:00
Karl Persson
b1fc0861f1
AuthN: reset email verified on email change (#85643)
* AuthN: reset email verified on email change

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
2024-04-05 14:19:12 +02:00
Santiago
c7573bb0f7
Alerting: Make retention period configurable for the notification log (#85605)
* Alerting: Make retention period configurable for the notification log

* update sample.ini

* fix outdated comment (on disk -> kvstore)

* skip checking cyclomatic complexity for ReadUnifiedAlertingSettings
2024-04-05 12:25:43 +02:00
Karl Persson
ba41954854
Email: trigger email verification flow (#85587)
* Add email and email_verified to id token if identity is a user

* Add endpoint to trigger email verification for user

* Add function to clear stored id tokens and use it when email verification is completed
2024-04-05 12:05:46 +02:00
kay delaney
6a53864f7a
LibraryPanelRBAC: Fix issue with importing dashboards containing library panels (#83980) 2024-04-05 10:11:02 +01:00
Josh Hunt
5ce8b60878
E2C: Resources table refactor (#85585)
* E2C: Resources table refactor

* update swagger spec with enums

* use native resource item type, rather than our mock type

* unit tests for resources table

* update spec
2024-04-05 10:08:42 +01:00
Nick Richmond
559fab9dc6
Prometheus: Fuzzy search for metric names in Code Mode (#85396)
* perf: limit metric names in Code Mode suggestions

* feat: configurable metric names limit

* feat: code mode autocomplete info/disclaimer

* chore: put new functionality behind new feature toggle

* refactor: avoid type assertions

* refactor: avoid explicit `any`

refactor: type guards

* refactor: type guards

* chore: add testdata results

* fix: add missing feature toggle guard

* perf: prefer array access to `Array.prototype.at`

* test: add missing config override

* test: refactor for brevity & clarity

* perf: avoid unnecessary mapping

* chore: undo testdata changes

* fix: use correct limit; perf optimizations

* refactor: avoid unnecessary `async`s

* types: simplify

* test: add missing tests

* fix: avoid hardcoding

* test: update mock path

* docs: fix typo

style: remove formatting artifact

style: remove formatting artifact

style: remove formatting artifact

* fix: event scope regression

* style: refactor for clarity

* refactor: prefer `useCallback` to in-effect handler

* refactor: simplify & broaden `filter`

* refactor: rename file to keep with conventions

* chore: mirror Prometheus package changes in app

* refactor: prefer no `@ts-ignore`

* chore: update betterer results

* docs: use type in TSDoc `@link` without `@ts-ignore`

* test: add missing provider

* test: fix jest mock path

* fix: display disclaimer in empty input case
2024-04-04 23:38:23 +03:00
Alexander Weaver
623ee3a2be
Alerting: Only append /alertmanager when sending alerts to mimir targets if not already present (#85543)
Don't append alertmanager if not present
2024-04-04 11:58:41 -05:00
Dave Henderson
5687243d0b
Feature Flags: use FeatureToggles interface where possible (#85131)
* Feature Flags: use FeatureToggles interface where possible

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

* Replace TestFeatureToggles with existing WithFeatures

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

---------

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
2024-04-04 12:22:31 -04:00
Serge Zaitsev
faa1244518
Chore: Replace sqlstore with db interface (#85366)
* replace sqlstore with db interface in a few packages

* remove from stats

* remove sqlstore in admin test

* remove sqlstore from api plugin tests

* fix another createUser

* remove sqlstore in publicdashboards

* remove sqlstore from orgs

* clean up orguser test

* more clean up in sso

* clean up service accounts

* further cleanup

* more cleanup in accesscontrol

* last cleanup in accesscontrol

* clean up teams

* more removals

* split cfg from db in testenv

* few remaining fixes

* fix test with bus

* pass cfg for testing inside db as an option

* set query retries when no opts provided

* revert golden test data

* rebase and rollback
2024-04-04 15:04:47 +02:00
Arati R
2232fe033b
Storage: Add mode-specific dual writers (#85551)
* Set up skeleton dual writers for each mode
* Add Create functionality to each of the mode-specific DualWriters
* Add switch for selecting DualWriter
2024-04-04 14:02:51 +02:00
Dominik Prokop
32b6ef9d15
Feature toggle to add filter and group by variables to all new dashboards by default (#85531)
* Add feature toggle

* Add filters and group by variables by default to all new dashboards

* Nits

* Tests

* Rename feature toggle to newDashboardWithFiltersAndGroupBy
2024-04-04 13:25:21 +02:00
Leonor Oliveira
01afca9d99
Add setup and spies for the dual writer (#85568)
* Add setup and spy client for dual writer

* Get rid of reset method
2024-04-04 11:46:16 +02:00
Karl Persson
504870f10a
Auth: Decouple client and hook registration (#85084) 2024-04-04 09:33:00 +02:00
Marcus Efraimsson
bdc492b96c
Chore: Upgrade grafana-plugin-sdk-go (#85562) 2024-04-04 08:07:29 +03:00
Todd Treece
c01531dc79
K8s: Use tracing handler from component-base (#85560) 2024-04-04 00:39:09 +03:00
Tristan
77133ac9c1
CloudWatch: Fix SageMaker MBP namespace typo (#85557) 2024-04-03 15:50:09 -04:00
Michael Mandrus
ddf5fbe591
CMS: Update permissions required to use endpoints (#85555)
* try different perms

* fix compile issue

* remove ac dependency

* remove dependency
2024-04-03 22:43:48 +03:00
Josh Hunt
aad79c9400
E2C: Start connecting on-prem to real apis (#85527)
* E2C: Start connecting on-prem to real apis

* actually run the migration

* show resources

* basic dashboards resources

* show dashboard title

* remove console logs

* cleanup 1

* i18n

* disconnect

* i18n

* restore type

* use fixed format

* fix
2024-04-03 13:47:02 -04:00
William Wernert
cad8190a91
Alerting/Annotations: Return nothing from historian store if filtering by tags and matchAny is false (#85488)
* Return nothing from historian store if filtering by tag
2024-04-03 13:01:13 -04:00
Leonard Gram
a457ab3192
Cloudmigration: decode json data (#85548)
* decode get

* decode bytes

* response

* .

* linter

* quick fixes

---------

Co-authored-by: Michael Mandrus <michael.mandrus@grafana.com>
2024-04-03 18:47:49 +02:00
Jean-Philippe Quéméner
7cfd470c91
fix(alerting): only expose metrics if executing alerts (#85512) 2024-04-03 17:18:02 +02:00
Josh Hunt
e08b5bd456
E2C: Fix Swagger spec for createMigration post body (#85525)
* E2C: Fix Swagger spec for CreateCloudMigration post body

* actually, don't rename that type
2024-04-03 11:59:50 +00:00
idafurjes
b885da09da
CloudMigrations: Implement migrations API (#85348)
* Implement run migration endpoint

* Refactor RunMigration method into separate methods

* Save migration runs fix lint

* Minor changes

* Refactor how to use cms endpoint

* fix interface

* complete merge

* add individual items

* adds tracing to getMigration

* linter

* updated swagger definition with the latest changes

* CloudMigrations: Implement core API handlers for cloud migrations and migration runs (#85407)

* implement delete

* add auth token encryption

* implement token validation

* call token validation during migration creation

* implement get migration status

* implement list migration runs

* fix bug

* finish parse domain func

* fix urls

* fix typo

* fix encoding and decoding

* remove double decryption

* add missing slash

* fix id returned by create function

* inject missing services

* finish implementing (as far as I can tell right now) data migration and response handling

* comment out broken test, needs a rewrite

* add a few final touches

* get dashboard migration to work properly

* changed runMigration to a POST

* swagger

* swagger

* swagger

---------

Co-authored-by: Michael Mandrus <michael.mandrus@grafana.com>
Co-authored-by: Leonard Gram <leo@xlson.com>
Co-authored-by: Michael Mandrus <41969079+mmandrus@users.noreply.github.com>
2024-04-03 13:36:13 +02:00
Ieva
beb15d938b
RBAC: Fix access checks for interactions with RBAC roles in hosted Grafana (#85485)
* don't check global permissions for cloud instances

* linting
2024-04-03 11:44:16 +01:00
Gábor Farkas
8159e1db3a
Revert "Postgres: Switch the datasource plugin from lib/pq to pgx (#8… (#85509)
Revert "Postgres: Switch the datasource plugin from lib/pq to pgx (#83768)"

This reverts commit ecd6de826a.
2024-04-03 11:02:22 +02:00
Andres Martinez Gotor
9c7237891c
Plugins: Expose ExternalService in request config (#85187) 2024-04-03 09:22:34 +02:00
Leon Sorokin
1522499c4a
VizTooltips: Remove remaining old bits (#85500)
Co-authored-by: Adela Almasan <adela.almasan@grafana.com>
2024-04-02 19:32:01 -05:00
Marcus Efraimsson
c9ab4e3a9e
DS apiserver: Fix resource path (#85494) 2024-04-02 20:09:18 +02:00
Jo
5340a6e548
Auth: Extended JWT client for OBO and Service Authentication (#83814)
* reenable ext-jwt-client

* fixup settings struct

* add user and service auth

* lint up

* add user auth to grafana ext

* fixes

* Populate token permissions

Co-authored-by: jguer <joao.guerreiro@grafana.com>

* fix tests

* fix lint

* small prealloc

* small prealloc

* use special namespace for access policies

* fix access policy auth

* fix tests

* fix uncalled settings expander

* add feature toggle

* small feedback fixes

* rename entitlements to permissions

* add authlibn

* allow viewing the signed in user info for non user namespace

* fix invalid namespacedID

* use authlib as verifier for tokens

* Update pkg/services/authn/clients/ext_jwt.go

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>

* Update pkg/services/authn/clients/ext_jwt_test.go

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>

* fix parameter names

* change asserts to normal package

* add rule for assert

* fix ownerships

* Local diff

* test and lint

* Fix test

* Fix ac test

* Fix pluginproxy test

* Revert testdata changes

* Force revert on test data

---------

Co-authored-by: gamab <gabriel.mabille@grafana.com>
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2024-04-02 17:45:15 +02:00
Will Browne
257cc98062
Datasources: Remove unused functions (#85473)
* cleanup unused funcs

* remove more stuff
2024-04-02 16:19:52 +02:00
linoman
147154d2ea
Remove AuthConfigUIAdminAccess (#85452)
* Remove AuthConfigUIAdminAccess
2024-04-02 15:02:28 +02:00
Leonard Gram
4e89267603
Cloudmigration: swagger for the cloudmigration api (#85255)
* swagger for create token

* tried to fix errors

* update swagger annotations

* update swagger annotations

* update api GetMigrationList to return the *Response directly

* clean up previous commit

---------

Co-authored-by: joshhunt <josh@trtr.co>
2024-04-02 13:57:42 +02:00
Andres Martinez Gotor
d2ca95d304
Update plugin SDK to v0.219.0 (#85438) 2024-04-02 10:22:24 +02:00
Will Browne
22fe7b067c
Plugins: Set correct PDC config values for proxy requests (#85412)
pass appropriate values
2024-03-29 20:17:05 +02:00
Ryan McKinley
dd6c8732b3
Scopes: Add basic integration tests (#85351)
Co-authored-by: Kyle Brandt <kyle@grafana.com>
2024-03-29 16:12:28 +02:00
Leonard Gram
383ebb2bc4
Cloudmigration: create migration (#85386)
* Cloudmigration: create migration

* fix drone build

* lint fix

* fix unit test

---------

Co-authored-by: Michael Mandrus <michael.mandrus@grafana.com>
2024-03-29 01:55:27 +01:00
Tristan
58b583f0c5
AWS DataSource: Fix namespaces in sagemaker metrics (#85357) 2024-03-28 22:11:11 +02:00
Michael Mandrus
5a5f76ae0a
CloudMigrations: Add instance metadata to auth token (#85381)
* update how tokens are passed around

* rename structs
2024-03-28 15:02:54 -04:00
Charandas
0f1151964c
K8s: standalone authenticator that allows a type of downstream forwarding (#85130) 2024-03-28 20:52:28 +02:00
Carl Bergquist
a71dfe806a
Scopes: Create binding per relationship (#85332)
scopes: create binding per relationship

Signed-off-by: bergquist <carl.bergquist@gmail.com>
2024-03-28 13:22:21 -04:00
linoman
e4250a72db
JWT: Find login and email claims with JMESPATH (#85305)
* add function to static function to static service

* find email and login claims with jmespath

* rename configuration files

* Replace JWTClaims struct for map

* check for subclaims error
2024-03-28 17:25:26 +01:00
Karl Persson
73e426b081
User: email verification completion (#85259)
* TempUser: Include InvitedById in TempUserDTO

* Extract email verfication completion flow to service
2024-03-28 16:05:33 +01:00
lean.dev
5b147d0847
CloudMigration: Add service to list all migrations (#85308) 2024-03-28 08:50:31 -03:00
Karl Persson
5dd98a0fd5
RBAC: handle partially resolved scopes (#85323)
* RBAC: handle partially resolved scopes

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2024-03-28 10:08:07 +01:00
Will Browne
1a0ac381eb
Plugins: Send PDC file paths and contents for backwards compatibility (#85287)
* send paths and contents

* go work sync
2024-03-27 18:19:11 +01:00
Kyle Brandt
136f8e6f0c
Scopes: Add Filtering for ScopeDashoardBinding and Update Prometheus for ScopeFilterOperator Changes (#85284) 2024-03-27 11:39:55 -04:00
Dan Cech
ef26fe95dc
Storage: GuaranteedUpdate fix & other improvements (#85206)
make GuaranteedUpdate work when ignoring not found errors, increase poll frequency, fix Delete
2024-03-27 10:38:49 -04:00
Karl Persson
152cb47692
AuthN: Add IsAuthenticatedBy to identity interface and replace checks (#85262)
Add IsAuthenticatedBy to identity interface and replace checks
2024-03-27 15:22:13 +01:00
Will Browne
cd912367b3
Plugins: Pass PDC info as file paths (#85239)
* pass filepaths

* fix test
2024-03-27 15:21:05 +01:00
Kyle Brandt
fe209fdf7c
Revert "Scopes: Add more BE filtering (field selectors) (#85169)" (#85264)
This reverts commit 222f93794d.
2024-03-27 15:47:48 +02:00
Kyle Brandt
222f93794d
Scopes: Add more BE filtering (field selectors) (#85169) 2024-03-27 13:10:49 +00:00
Kyle Brandt
d71266b8af
QueryLibrary: Use default variable values in render (#84678) 2024-03-27 08:48:08 -04:00
Pablo
ace1cd6301
CloudWatch : Add missing AWS/ES metrics (#85210)
Adding missing ES metrics
2024-03-26 16:37:07 -04:00
Sven Grossmann
e284812796
Applinks: Adds grafana-lokiexplore-app to Explore -> Logs section (#85200) 2024-03-26 22:18:17 +02:00
ismail simsek
fec7765111
Chore: InfluxQL stream parser improvements (#85041)
* don't iterate over first column as it is a time column already

* don't iterate over first column as it was handled earlier

* add more flexibility to run the commands

* Update pkg/tsdb/influxdb/influxql/converter/converter.go

Co-authored-by: Nick Richmond <5732000+NWRichmond@users.noreply.github.com>

---------

Co-authored-by: Nick Richmond <5732000+NWRichmond@users.noreply.github.com>
2024-03-26 19:25:03 +02:00
Sven Grossmann
c80b31a0d4
Loki: Remove API restrictions on resource calls (#85191)
Loki: Remove API restrictions
2024-03-26 18:15:35 +01:00
Benoit Tigeot
6f38ac6615
Alerting: Reduce set of fields that could trigger alert state change (#83496)
We want to avoid too much change of alert state based on change on
alert's fields. For that we ignore some fields from the diff.
2024-03-26 12:35:30 -04:00
Julien Duchesne
2188516a21
Alerting: Fix receiver inheritance when provisioning a notification policy (#82007)
Terraform Issue: grafana/terraform-provider-grafana#1007
Nested routes should be allowed to inherit the contact point from the root (or direct parent) route but this fails in the provisioning API (it works in the UI)
2024-03-26 12:31:59 -04:00
Jo
da40158fed
Auth: Improve org role sync debugging (#85146)
add login to the context of the logger
2024-03-26 17:22:10 +01:00
Carl Bergquist
b214b07695
Scopes: Name relationship objects *binding (#84955)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
Co-authored-by: Bogdan Matei <bogdan.matei@grafana.com>
2024-03-26 15:52:12 +01:00
Ryan McKinley
e5cf863973
Prometheus: Create jsonschema spec (#85077) 2024-03-26 16:36:39 +03:00
Andreas Christou
19159a89a2
SQLEngine: Use debug method instead of custom implementation (#85118)
Use debug method instead of custom implementation
2024-03-26 11:27:07 +00:00
Sven Grossmann
9a8ae3c932
Loki: Support custom X-Query-Tags header (#85123)
* Loki: Support custom `X-Query-Tags` header

* add comment
2024-03-26 13:08:09 +02:00
Alexander Zobnin
02606be3ed
Access control: Improve annotation delete performance (#85068)
* Access control: Improve annotation delete performance

* simplify query string

* Refactor

* remove unnecessary join
2024-03-26 11:50:51 +01:00
Karl Persson
2f5e3023c2
IDFowrarding: ignore logging context canceled errors (#85141) 2024-03-26 11:36:44 +01:00
Sofia Papagiannaki
5ebf2d08f6
Provisioning: Fix regression when dashboardProvisioner is accessed before being initialised (#85011)
* Provisioning: Fix regression when dashboardProvisioner is accessed before being initialized

* Set dashboard provisioner in the provider
2024-03-26 12:32:56 +02:00
Gábor Farkas
3b7ee3a56b
MySQL: snapshot tests (#84846)
mysql: add snapshot tests
2024-03-26 10:24:33 +01:00
Gábor Farkas
c835022861
postgres: improved tests (#84677)
* postgres: tests: better test aligning time-series results

* postgres: add snapshot test for a backward-compat code
2024-03-26 10:22:58 +01:00
Jo
7649d93d17
AuthProxy: Fix missing session for ldap auth proxy users (#85090)
fix missing session for ldap auth proxy users
2024-03-26 09:24:24 +01:00
Ryan McKinley
4cda34ff7d
Expressions: Create json schema for query types (#84032) 2024-03-26 06:58:56 +02:00
Todd Treece
dfe61db7a5
Scopes: Add type filter (#84866)
Co-authored-by: Kyle Brandt <kyle@grafana.com>
2024-03-25 16:45:32 -04:00
Gabriel MABILLE
5e48804364
RBAC: Fix slow user permission search query on MySQL (#85058)
* Bench testing search user perm

* Add BenchmarkSearchUsersPermissions_1K_1K

* Clarify benchmark searches by action prefix

* Make MySQL more efficient

* Move all filter options

* Expand after assignments union

* update comments
2024-03-25 19:11:17 +01:00
Ieva
df40e13333
Public dashboards: fix public dashboard permissions so that annotations are displayed (#85091)
* fix public dashboard anonymous user permissions so they include the new annotation permissions

* test fix
2024-03-25 17:42:40 +00:00
Charandas
dd7d4e2656
K8s: replace a noop certKey content func with actual if available (#84524) 2024-03-25 10:12:55 -07:00
Mihai Doarna
fad6dc4db1
SSO: fix reloading settings when a provider contains empty settings (#85102)
* fix reloading settings when a provider contains empty settings

* do not increment reloadFailures if settings are empty
2024-03-25 19:12:19 +02:00
ismail simsek
92f5a0305c
Chore: Define promlib depguard rules (#85082)
* define promlib depguard rules

* add comment

* test: break linting on purpose

* fix linting

* simple change to trigger backend linting/build in CI pipeline
2024-03-25 17:32:56 +01:00
Bruno
a2e21eac8c
Cloud migrations: create endpoint to create an access token (#84690)
* fix merge conflicts

* make token expiration configurable
2024-03-25 12:43:28 -03:00
Charandas
e237b89fe7
K8s: skip invalid items in GetList when not invoked as part of SendInitialEvents (#85050) 2024-03-25 07:50:14 -07:00
Marcus Efraimsson
8f12fb94f9
Plugins: Factory for instantiating core plugin (#85047) 2024-03-25 15:41:26 +01:00
ismail simsek
6137c4e0a6
Chore: Bump golangci-lint v1.57.1 (#84998)
* bump golangci-lint v1.57.1

* update setting

* remove goconst

* fix linting issues

* prettier

* fix G601

* go mod tidy
go work sync
2024-03-25 15:28:24 +01:00
Ryan McKinley
e6fa367d02
k8s/query+ds: catch query errors, fix datasourceProvider and expose prometheus (#85071) 2024-03-25 17:22:34 +03:00
Karl Persson
2f3a01f79f
OAuth: Make sub claim required for generic oauth behind feature toggle (#85065)
* Add feature toggle for sub claims requirement

* OAuth: require valid auth id

* Fix feature toggle description
2024-03-25 14:22:24 +01:00
idafurjes
e2f155f9f7
Grafana: define the api for the grafana cloudmigration api (not the csm api) (#84430)
* Add cloud migration endpoints

* Built auth into creating a migration.

* Added more detail to the migration result model

* goimports

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

Co-authored-by: lean.dev <34773040+leandro-deveikis@users.noreply.github.com>

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

Co-authored-by: lean.dev <34773040+leandro-deveikis@users.noreply.github.com>

---------

Co-authored-by: Leonard Gram <leo@xlson.com>
Co-authored-by: lean.dev <34773040+leandro-deveikis@users.noreply.github.com>
2024-03-25 13:30:47 +01:00
Serge Zaitsev
4d4c06b480
Chore: Vendor wire into pkg/build (#84637)
* vendor latest wire into pkg/build

* use vendored wire in builds

* fix wire import path

* remove wire from bingo

* also support google/wire import

* make prettier happy

* change package in tess

* add debug walk for drone

* add wire_gen in tests

* remove debug walk

* restore imports
2024-03-25 11:23:27 +01:00
linoman
fc205db466
samlsettings: api integration (#84300)
* add strategy and tests

* use settings provider service and remove multiple providers strategy

* Move SAML strategy to ssosettings service

* Update codeowners file

* reload from settings provider

* add saml as configurable provider

* Add new SAML strategy

* rename old saml settings interface

* update saml string references

* use OSS license

* validate saml provider depends on license for List

* add tests for list rendering including saml

* change the licensing validation to service init

* replace service struct for provider
2024-03-25 10:54:45 +01:00
Karl Persson
c33bc819bc
SigningKeys: Add added_at when creating new signing key (#85060) 2024-03-25 09:58:40 +01:00
Ryan McKinley
713970d00a
SQLStore: Cleanup migrationLocking (#85054) 2024-03-25 10:09:15 +03:00
Charandas
3c42a2efd2
K8s: file storage - add sync around resource version (RV) management (#84694) 2024-03-23 23:58:48 -07:00
Brendan O'Handley
d084595211
Prometheus: Use frontend package in Prometheus DS with a feature toggle (#84397)
* add feature toggle usePrometheusFrontendPackage

* add feature toggle logic to Prometheus module

* use config editor with package and remove configOverhaul feature toggle

* update betterer because we will be removing other files as we replace with files from @grafana/prometheus

* fix exemplar ds picker selector

* add more description to ts-ignore

* remove go.work.sum change

* copy go.work.sum from main

* update go.work.sum after talking with ismail

* put back the promlib entry

---------

Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
2024-03-22 19:47:53 -05:00
Matthew Jacobson
0c3c5c5607
Alerting: Stop persisting silences and nflog to disk (#84706)
With this change, we no longer need to persist silence/nflog states to disk in addition to the kvstore
2024-03-23 00:37:33 +02:00
Yuri Tseretyan
48de8657c9
Alerting: Editor role can access all provisioning API (#85022) 2024-03-23 00:14:15 +02:00
Yuri Tseretyan
b9abb8cabb
Alerting: Update provisioning API to support regular permissions (#77007)
* allow users with regular actions access provisioning API paths
* update methods that read rules
skip new authorization logic if user CanReadAllRules to avoid performance impact on file-provisioning
update all methods to accept identity.Requester that contains all permissions and is required by access control.

* create deltas for single rul e 

* update modify methods
skip new authorization logic if user CanWriteAllRules to avoid performance impact on file-provisioning
update all methods to accept identity.Requester that contains all permissions and is required by access control.

* implement RuleAccessControlService in provisioning

* update file provisioning user to have all permissions to bypass authz

* update provisioning API to return errutil errors correctly

---------

Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
2024-03-22 15:37:10 -04:00
Sofia Papagiannaki
33b653534e
SQLStore: Enable migration locking by default (#84983)
* Introduce new configuration for migration locking

* Remove feature toggle

* Fix test and turn it into an integration

* Fix docs
2024-03-22 21:22:29 +02:00
Matthew Jacobson
980b9a62c6
Alerting: Enable simplified routing FF by default (#84856) 2024-03-22 13:45:20 -04:00
Ezequiel Victorero
c57c033522
Snapshots: Viewers can not create a Snapshot (#84952) 2024-03-22 14:31:01 -03:00
ismail simsek
629a8808e0
Chore: Bump promlib v0.0.4 (#84882)
* Update the readme

* bump promlib v0.0.3

* update

* update

* use promlib v0.0.4
2024-03-22 18:28:22 +01:00
Tristan
78c6c7fef4
CloudWatch: Add additional AWS/SageMaker metrics (#85009)
add additional AWS/SageMaker metrics for customer
2024-03-22 10:14:21 -07:00
Yuri Tseretyan
e138ae3eb9
Alerting: Improve openAPI specification and docs for export endpoints (#85008) 2024-03-22 18:25:27 +02:00
Timur Olzhabayev
e9db9106c1
Chore: Disable angular support by default (#84738)
* Flipping angular support to disabled by default
2024-03-22 17:09:53 +01:00
Kyle Brandt
86a2a1a19b
Prometheus: remove scope dependency (#84991)
* Prometheus: remove scope dependency
temp workaround

* depguard

* comment

* remove rules since they need a newer version of golangci-lint

---------

Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
2024-03-22 16:52:42 +01:00
Eric Leijonmarck
2f7fd729ef
Auth: Enable case insensitive logins/emails by default (#84840)
* wip

* wip

* wip

* wip postgres tests
2024-03-22 16:45:18 +01:00
Leon Sorokin
d7fa99e2df
XYChart: Refactor to new model (behind feature toggle) (#82499)
Co-authored-by: drew08t <drew08@gmail.com>
Co-authored-by: Ihor Yeromin <yeryomin.igor@gmail.com>
2024-03-22 10:44:37 -05:00
chalapat
65c0669f01
Server: Reload TLS certs without a server restart (#83589)
* server: reload of grafana server certs when renewed without restart.

Signed-off-by: Rao, B V Chalapathi <b_v_chalapathi.rao@nokia.com>

* server: reload of grafana server certs when renewed without restart.

Signed-off-by: Rao, B V Chalapathi <b_v_chalapathi.rao@nokia.com>

* Update http_server.go

* Update docs/sources/setup-grafana/configure-grafana/_index.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update http_server.go

Address the comments

* Update docs/sources/setup-grafana/configure-grafana/_index.md

Co-authored-by: Dan Cech <dan@aussiedan.com>

* Update http_server.go

Align the spaces

* Update http_server.go

* Update http_server.go

* Update pkg/api/http_server.go

Co-authored-by: Dan Cech <dan@aussiedan.com>

---------

Signed-off-by: Rao, B V Chalapathi <b_v_chalapathi.rao@nokia.com>
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Co-authored-by: Dan Cech <dan@aussiedan.com>
2024-03-22 17:13:22 +02:00
Juan Cabanas
8d4ca72f2a
PublicDashboards: Scene migration (#84409) 2024-03-22 11:48:21 -03:00
Eric Leijonmarck
bb792ff540
Auth: Remove oauth skip org role sync (#84972)
* remove oauth wide skip org role sync

* we are warning from config

* set it to false

* removed from config ini files and updated docs
2024-03-22 15:34:05 +01:00
Jean-Philippe Quéméner
f2c7023fe6
fix(alerting): use uid and not rand() in tests for title (#85001) 2024-03-22 16:26:09 +02:00
Santiago
a2facbecd4
Alerting: Implement ApplyConfig for remote primary mode (forked AM) (#84811)
* Alerting: Implement ApplyConfig for remote primary mode (forked AM)

* add TODO for saving the config hash in other config-related methods

* fix bad method receiver name (m -> am)

* tests

* add mutex

* remove sync loop
2024-03-22 15:17:41 +01:00
Sofia Papagiannaki
369cb5b6eb
Usage stats: Fix concurrency issue (#84993)
* Usage stats: Fix concurrency issue
2024-03-22 15:52:59 +02:00
Karl Persson
f5692f06a5
FeatureToggles: Remove unused feature flag (#84988)
Remove unused flag
2024-03-22 14:30:58 +01:00
Serge Zaitsev
df2d0574c1
Chore: Enable nestedFolders by default (#84631)
* Enable nestedFolders by default

* Make nestedFolders GA

Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com>

* regenerate files

* also update docs

* skip failing test

---------

Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com>
2024-03-22 14:13:43 +01:00
Will Browne
b765c21d4c
Plugins: Pass PDC file contents in requests (#84783)
* Plugins: Pass PDC file contents in requests

* go mod tidy

* undo go.mod changes

* fix linter

* fix tests

* undo unnecessary changes

* update dep

* join with comma

* update naming

* bump SDK
2024-03-22 13:52:24 +01:00
Marcus Efraimsson
488bbaacab
Chore: Remove unused dependenices in plugin client middlewares (#84624)
* Chore: Remove unused dependenices in plugin client middlewares

* refactor logger middleware to remove cfg dependency

* hack to make tracing work in api group builders
2024-03-22 12:54:35 +01:00
ismail simsek
016d6f2f6d
InfluxDB: Fix alias interpolation when it has $__interval or multiple tags (#84940)
fix $__interval interpolating in alias
2024-03-22 11:27:04 +01:00
Giuseppe Guerra
ef5d71711a
Plugins: Enable feature toggle enablePluginsTracingByDefault by default (#84645)
* Enable feature flag enablePluginsTracingByDefault by default

* re-generate feature toggles
2024-03-22 11:22:36 +02:00
Agnès Toulet
4f8b14ebf4
FeatureToggle: Update newPDFRendering to public preview (#84883)
FeatureToggle: update newPDFRendering to public preview
2024-03-22 09:50:53 +01:00
Ieva
9772ed6526
RBAC: Enable annotation permission update by default (#84787)
* display teams to team reader if they also have the access to list team permissions

* fix a typo in the docs

* enable annotationPermissionUpdate by default

* update wording
2024-03-22 00:45:23 +02:00
Pepe Cano
2d6586952d
Alerting: Add placeholder to the Email Contact Point Message (#84064) 2024-03-21 13:03:12 -04:00
Ivan Ortega Alba
33f9e8554d
GenAI: Autogenerate title and description for panels and dashboards (#84933) 2024-03-21 17:58:27 +01:00
Todd Treece
cdb2e7dd3e
Chore: Sync go workspace (#84932) 2024-03-21 18:34:40 +02:00
Giuseppe Guerra
eb31f71f60
Plugins: Enable feature toggle pluginsDynamicAngularDetectionPatterns by default (#84723)
* Enable feature toggle pluginsDynamicAngularDetectionPatterns by default

* Change backgroundJobInterval to 24h

* re-generate feature toggles

* Use different intervals for cloud vs on-prem

* temporarily switch interval log to info level

* debug level again

* Simplify provideDynamic for tests

* re-generated feature toggles files

* PR review feedback

* PR review feedback: removed dependency from plugin management config
2024-03-21 18:22:06 +02:00
Marcus Efraimsson
6c1de260a2
API Server: Standalone observability (#84789)
Adds support for logs (specify level), metrics (enable metrics and Prometheus /metrics endpoint 
and traces (jaeger or otlp) for standalone API server. This will allow any grafana core service 
part of standalone apiserver to use logging, metrics and traces as normal.
2024-03-21 17:06:32 +01:00
Xavi Lacasa
a813046f3d
Better tracing during extSvcAcc registration (#84719) 2024-03-21 16:41:10 +01:00
Erik Sundell
29d4f6a217
Datasource: Change query filtering (#84656)
* call filterQuery from queryrunner

* test query hide filtering

* fix more broken tests

* lint errrors

* remove redundant filterQuery call

* skip filter in variable queries

* fix broken cypress test

* change tooltip text

* fix translations

* fix comments

* do not execute query is targets are empty

* add more tests

* remove unsued import

* update translations

* revert id change

* change header text

* update comment for hide prop

* rename hide query prop

* change tooltip and introduce different toggle state text

* update tests

* update comment and regenerate types

* run extract again

* fix broken e2e test

* track event

* fix build issues

* revert changes in wire file
2024-03-21 13:39:39 +01:00
Giuseppe Guerra
3387132b9b
Build: Add "gen-feature-toggles" Makefile target (#84803)
* Add Makefile target "make gen-feature-toggles" to generate feature toggles files

* Better output for gen-feature-toggles
2024-03-21 12:04:49 +01:00
Selene
473898e47c
Core: Remove thema and kindsys dependencies (#84499)
* Move some thema code inside grafana

* Use new codegen instead of thema for core kinds

* Replace TS generator

* Use new generator for go types

* Remove thema from oapi generator

* Remove thema from generators

* Don't use kindsys/thema for core kinds

* Remove kindsys/thema from plugins

* Remove last thema related

* Remove most of cuectx and move utils_ts into codegen. It also deletes wire dependency

* Merge plugins generators

* Delete thema dependency 🎉

* Fix CODEOWNERS

* Fix package name

* Fix TS output names

* More path fixes

* Fix mod codeowners

* Use original plugin's name

* Remove kindsys dependency 🎉

* Modify oapi schema and create an apply function to fix elasticsearch errors

* cue.mod was deleted by mistake

* Fix TS panels

* sort imports

* Fixing elasticsearch output

* Downgrade oapi-codegen library

* Update output ts files

* More fixes

* Restore old elasticsearch generated file and skip its generation. Remove core imports into plugins

* More lint fixes

* Add codeowners

* restore embed.go file

* Fix embed.go
2024-03-21 11:11:29 +01:00
Andres Martinez Gotor
9298a5fcb5
AzureMonitor: Update standalone HTTP middlewares (#84833) 2024-03-21 08:53:27 +01:00
Matthew Jacobson
fbd057b258
Alerting: Stop returning autogen routes for non-admin on api/v2/status (#84864)
* Alerting: Stop returning autogen routes for non-admin on api/v2/status

* Improve api/v2/status integration tests for user roles
2024-03-20 22:04:35 +02:00
Will Browne
c8c372c327
Prometheus: Prevent duplicate registration of custom header middleware (#84860)
* remove dupe middleware

* fix test
2024-03-20 21:22:33 +02:00
Andreas Christou
00c094f7cf
Azure: Update data link title for clarity (#84686)
Update data link title for clarity
2024-03-20 13:39:00 -05:00
William Wernert
6d16cf2699
Alerting: Marshal incoming json.RawMessage in diff (#84692)
This will ensure the encoding is correct when comparing
to the existing rule.
2024-03-20 13:10:39 -04:00
Adam Simpson
311aa94fab
MSSQL: Add Windows AD/Kerberos auth (#84742)
* mssql: Add Kerberos/Windows AD auth

* need username for cache file

* account for no port in cc file

* add tests around constring

* remove un-needed port

* add docs

* remove comments

* move defer to same locale as where it begins

* fix linting and spelling

* fix gosec linter

* note lack of grafana cloud support
2024-03-20 16:41:57 +02:00
Yuri Tseretyan
04c9f459ec
Alerting: do not check for folder in file provisioning (#84822)
provide nil folder service in file provisioning
2024-03-20 10:39:03 -04:00
Ida Štambuk
18eac9df9e
Feature toggles: Remove redshiftAsyncQueryDataSupport and athenaAsyncQueryDataSupport toggles (#84653) 2024-03-20 15:14:21 +01:00
Andres Martinez Gotor
a705ff7892
API Server: refactor plugin ID handling (#84753) 2024-03-20 13:49:19 +01:00
Fabrizio
288b06b64c
Loki: Replace imports of infra/log with SDK (#84336) 2024-03-20 11:25:35 +02:00
Ivana Huckova
77b1c97482
Elasticsearch: Remove xpack button and make includeFrozen not dependant on it (#84734) 2024-03-20 09:59:26 +01:00
Gábor Farkas
fba2b61408
postgres: removed unused code (#84736)
sql: removed unused code
2024-03-20 09:28:42 +01:00
George Robinson
f3e5ad00d6
Remove extra defers in screenshot sevice (#84697) 2024-03-20 07:13:16 +00:00
Yuri Tseretyan
e593d36ed8
Alerting: Update rule access control to explicitly check for permissions "alert.rules:read" and "folders:read" (#78289)
* require "folders:read" and "alert.rules:read"  in all rules API requests (write and read). 

* add check for permissions "folders:read" and "alert.rules:read" to AuthorizeAccessToRuleGroup and HasAccessToRuleGroup

* check only access to datasource in rule testing API

---------

Co-authored-by: William Wernert <william.wernert@grafana.com>
2024-03-19 22:20:30 -04:00
Andreas Christou
6bb7ab261a
AzureMonitor: User authentication support (#81918)
* Stub out frontend user auth

* Stub out backend user auth

* Add context

* Reorganise files

* Refactor app registration form

* Alert for user auth service principal credentials

* AzureMonitor: Add flag for enabling/disabling fallback credentials for current user authentication (#82332)

* Rename field

* Add fallback setting

* Update tests and mock

* Remove duplicate setting line

* Update name of property

* Update frontend settings

* Update docs and default config files

* Update azure-sdk

* Fix lint

* Update test

* Bump dependency

* Update configuration

* Update docs/sources/setup-grafana/configure-grafana/_index.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Docs review

* AzureMonitor: User authentication frontend updates (#83107)

* Rename field

* Add fallback setting

* Update tests and mock

* Remove duplicate setting line

* Update name of property

* Update frontend settings

* Update docs and default config files

* Add alerts to query editor

- Add authenticatedBy property to grafana/data
- Update mocks
- Update query editor to disable it under certain circumstances
- Update tests

* Add separate FallbackCredentials component

- Reset AppRegistrationCredentials component to only handle clientsecret credentials
- Update AzureCredentialsForm
- Update selectors
- Update tests
- Update credentials utility functions logic

* Alert when fallback credentials disabled

* Update condition

* Update azure-sdk

* Fix lint

* Update test

* Remove unneeded conditions

* Set auth type correctly

* Legacy cloud options

* Fix client secret

* Remove accidental import

* Bump dependency

* Add tests

* Don't use VerticalGroup component

* Remove unused import

* Fix lint

* Appropriately set oAuthPassThru and disableGrafanaCache properties

* Clear azureCredentials on authType change

* Correctly retrieve secret

* Fix bug in authTypeOptions

* Update public/app/plugins/datasource/azuremonitor/components/ConfigEditor/CurrentUserFallbackCredentials.tsx

Co-authored-by: Andrew Hackmann <5140848+bossinc@users.noreply.github.com>

* Update public/app/plugins/datasource/azuremonitor/components/QueryEditor/QueryEditor.tsx

Co-authored-by: Andrew Hackmann <5140848+bossinc@users.noreply.github.com>

* Update public/app/plugins/datasource/azuremonitor/components/ConfigEditor/CurrentUserFallbackCredentials.tsx

Co-authored-by: Andrew Hackmann <5140848+bossinc@users.noreply.github.com>

* Add documentation links

* Fix broken link

---------

Co-authored-by: Andrew Hackmann <5140848+bossinc@users.noreply.github.com>

* AzureMonitor: Update docs for current user authentication (#83440)

* Rename field

* Add fallback setting

* Update tests and mock

* Remove duplicate setting line

* Update name of property

* Update frontend settings

* Update docs and default config files

* Add alerts to query editor

- Add authenticatedBy property to grafana/data
- Update mocks
- Update query editor to disable it under certain circumstances
- Update tests

* Add separate FallbackCredentials component

- Reset AppRegistrationCredentials component to only handle clientsecret credentials
- Update AzureCredentialsForm
- Update selectors
- Update tests
- Update credentials utility functions logic

* Alert when fallback credentials disabled

* Update condition

* Update azure-sdk

* Fix lint

* Update test

* Remove unneeded conditions

* Set auth type correctly

* Legacy cloud options

* Fix client secret

* Remove accidental import

* Bump dependency

* Add tests

* Don't use VerticalGroup component

* Remove unused import

* Update docs

* Fix lint

* Appropriately set oAuthPassThru and disableGrafanaCache properties

* Clear azureCredentials on authType change

* Correctly retrieve secret

* Feedback

* Spelling

* Update docs/sources/datasources/azure-monitor/_index.md

Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com>

* Update docs/sources/datasources/azure-monitor/_index.md

Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com>

* Update docs/sources/datasources/azure-monitor/_index.md

Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com>

* Update docs/sources/datasources/azure-monitor/_index.md

Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com>

---------

Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com>

* Docs review

* Update docs with additional configuration information

* Fix to appropriately hide the query editor

* Typo

* Update isCredentialsComplete

* Update test

---------

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Co-authored-by: Andrew Hackmann <5140848+bossinc@users.noreply.github.com>
Co-authored-by: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com>
2024-03-19 16:32:24 +00:00
Hugo Kiyodi Oshiro
b1c4ebe6e8
Plugins: Enable managedPluginsInstall by default (#84721)
Plugins: enable managedPluginsInstall by default
2024-03-19 16:34:46 +01:00
Andreas Christou
7c3f621688
Chore: Update grafana-azure-sdk-go (#84741)
* Update grafana-azure-sdk-go

* Update test
2024-03-19 14:56:40 +00:00
Yuri Tseretyan
9dc4221508
Alerting: Log expression command types during evaluation (#84614) 2024-03-19 10:00:03 -04:00
Ryan McKinley
e27c08cfa9
QueryService: Return application/json and better errors (#84234) 2024-03-19 15:52:15 +02:00
Fabrizio
d1f791cf1f
Jaeger: Decouple Jaeger plugin (#81377) 2024-03-19 15:39:31 +02:00
Santiago
4ad6d66479
Alerting: Remove ID from UserGrafanaConfig struct (#84602)
* Alerting: Remove ID from UserGrafanaConfig struct

* user custom mimir image withoud id in grafana config

* change mimir image name
2024-03-19 12:47:13 +01:00
Santiago
c9bb18101c
Alerting: Decrypt secrets before sending configuration to the remote Alertmanager (#83640)
* (WIP) Alerting: Decrypt secrets before sending configuration to the remote Alertmanager

* refactor, fix tests

* test decrypting secrets

* tidy up

* test SendConfiguration, quote keys, refactor tests

* make linter happy

* decrypt configuration before comparing

* copy configuration struct before decrypting

* reduce diff in TestCompareAndSendConfiguration

* clean up remote/alertmanager.go

* make linter happy

* avoid serializing into JSON to copy struct

* codeowners
2024-03-19 12:12:03 +01:00
Fabrizio
c1c9ccb8e8
Loki: Replace imports of infra/httpclient with SDK (#84337) 2024-03-19 10:59:53 +01:00
Andres Martinez Gotor
abb8ba3885
Update comment in service.go (#84674) 2024-03-19 09:09:07 +01:00
Marcus Efraimsson
e978d0810e
DS apiserver: Minor fixes (#84691) 2024-03-19 09:02:52 +01:00
Agnès Toulet
58170d4141
Rendering: Add PDFRendering capability (#84438)
* Rendering: Add PDFRendering capability

* fix tests
2024-03-19 08:48:46 +01:00
Isabella Siu
0606a8e413
CloudWatch: Static labels should use label name (#84611)
CloudWatch: static labels should use label name
2024-03-18 17:30:59 -04:00
Charandas
2d1cd82a98
K8s: standalone: use Grafana's logger to stream all logs (#84530)
---
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2024-03-18 19:25:30 +02:00
Matthew Jacobson
3ea5c08c88
Alerting: External AM fix parsing basic auth with escape characters (#84681) 2024-03-18 13:04:57 -04:00
Ivana Huckova
494d169980
Elasticsearch: Fix legend for alerting, expressions and previously frontend queries (#84485)
* Elasticsearch: Fix legend for alerting, expressions and previously frontend queries

* Add comment

* Update comment
2024-03-18 18:01:33 +01:00
Kyle Brandt
818c94f067
Scopes: (Chore) Fix ScopeDashboard by adding spec (#84675) 2024-03-18 17:16:53 +01:00
Rob
677b765dab
NodeGraph: Edge color and stroke-dasharray support (#83855)
* Adds color and stroke-dasharray support for node graph edges

Adds support for providing color, highlighted color, and visual display of node graph edges as dashed lines via stroke-dasharray.

* Updates node graph documentation

* Updates documentation

Adds default for `highlightedColor`

* Update docs/sources/panels-visualizations/visualizations/node-graph/index.md

Co-authored-by: Fabrizio <135109076+fabrizio-grafana@users.noreply.github.com>

* Update packages/grafana-data/src/utils/nodeGraph.ts

Co-authored-by: Fabrizio <135109076+fabrizio-grafana@users.noreply.github.com>

* Update docs/sources/panels-visualizations/visualizations/node-graph/index.md

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

* Removes highlightedColor; deprecates highlighted

Per [request](https://github.com/grafana/grafana/pull/83855#issuecomment-1999810826), deprecates `highlighted` in code and documentation, and removes `highlightedColor` as an additional property. `highlighted` will continue to be supported in its original state (makes the edge red), but is superseded if `color` is provided.

* Update types.ts

Missed a file in my last commit. Removes `highlightedColor` and deprecates `highlighted`.

* Add test scenario in test data source

---------

Co-authored-by: Fabrizio <135109076+fabrizio-grafana@users.noreply.github.com>
Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>
Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
2024-03-18 16:26:22 +01:00
Kyle Brandt
aec2ef727a
Prometheus/Scopes: Update to use scopespec type from app (#84593) 2024-03-18 09:49:26 -04:00
Andrej Ocenas
5b085976bf
Pyroscope: Fix template variable support (#84477) 2024-03-18 14:25:47 +01:00
Kyle Brandt
aac2cf0aa5
Scopes: Update BE API to include object for linking scope to dashboards (#84608)
* Add ScopeDashboard

---------

Co-authored-by: Todd Treece <todd.treece@grafana.com>
2024-03-18 09:22:28 -04:00
Isabella Siu
00f16cd018
CloudWatch Logs: Remove toggle for cloudWatchLogsMonacoEditor (#84414) 2024-03-18 08:56:57 -04:00
Ieva
7aa0ba8c59
Teams: Display teams page to team reader if they also have the access to list team permissions (#84650)
* display teams to team reader if they also have the access to list team permissions

* fix a typo in the docs
2024-03-18 14:52:01 +02:00
Jack Westbrook
4ca68925a1
Backend: Delete bundled plugin tests (#84646) 2024-03-18 13:28:24 +01:00
Andres Martinez Gotor
e394110f44
Fix api_plugins_test locally (#84484) 2024-03-18 12:08:49 +01:00
Joey
f5e83d07a7
Tempo: Deprecate old search (#84498)
* Add logic to update query from old search to new search i.e. nativeSearch to traceqlSearch

* Remove nativeSearch query and transform

* Update tracking

* Remove nativeSearch from query field

* Udpdate gen comment

* Fix tests

* Add tests

* Remove comments

* Remove log

* Remove log

* Update comment

* Update ids etc for migratedQuery

* Remove old nativeSearch folder

* Fix tests, manual testing
2024-03-18 09:17:10 +00:00
Andres Martinez Gotor
6204f1e847
Chore: Use SigV4 middleware from aws-sdk (#84462) 2024-03-18 09:33:22 +01:00
Dan Cech
89f3b70e17
Storage: Add support for listing resource history (#84331)
* add support for listing resource history

* make watch handle custom label selectors properly

* fix tests

* Apply suggestions from code review

Co-authored-by: Diego Augusto Molina <diegoaugustomolina@gmail.com>

* properly handle special characters in json label matcher

* tidy up

---------

Co-authored-by: Diego Augusto Molina <diegoaugustomolina@gmail.com>
2024-03-15 19:17:54 -04:00
Josh Hunt
08f4aeded1
E2C: Change permissions for navigating to Cloud Migration (#84594)
* allow org admins / settings writers to access e2c

* test for org admin specifically
2024-03-15 17:22:39 +00:00
William Wernert
97f37b2e6f
Alerting: Clamp Loki ASH range query to configured max_query_length (#83986)
* Clamp range in loki http client to configured max_query_length

Defaults to 721h to match Loki default
2024-03-15 18:59:45 +02:00
Josh Hunt
f2628bfad4
Whitelabelling: Override version in UI from config (#84392)
* Unify how the version is shown in the UI

* use versionString in dashboard help bundles

* fix lint

* remove comment

* fix test types

* make test less flakey
2024-03-15 18:39:13 +02:00
Karl Persson
d4e802dd47
Authn: Add function to resolve identity from org and namespace id (#84555)
* Add function to get the namespaced id

* Add function to resolve an identity through authn.Service from org and namespace id

* Switch to resolve identity for re-authenticate in another org
2024-03-15 15:08:15 +01:00