Commit Graph

11988 Commits

Author SHA1 Message Date
Gábor Farkas
710248674d
postgres: update unit test to be ready for the xorm-removal (#78537)
postgres: removed xorm from unit tests
2023-11-24 11:11:18 +01:00
Mihai Doarna
27d8b68c9c
Auth: Add more tests for the SSO settings upsert function (#78544)
* add more tests for the SSO settings upsert function

* fix client id to match provider

* use time now in tests
2023-11-24 12:02:05 +02:00
Jo
7d559bc69a
AuthProxy: Do not allow sessions to be assigned with other methods (#78602)
do not allow login token with other methods
2023-11-24 11:00:53 +01:00
Jean-Philippe Quéméner
11d4f604f5
fix(alerting): proper handling for queries with multiple conditions in migration (#78591)
fix(alerting): proper handling for queries with multiple conditions
2023-11-23 18:05:44 +01:00
gotjosh
23fe8f4e9c
Alerting: Introduce a Mimir client as part of the Remote Alertmanager (#78357)
* Alerting: Introduce a Mimir client as part of the Remote Alertmanager

This is our first attempt at making Grafana communicate use Mimir as a backend - it uses a new set of APIs that we've developed on the Mimir side to upload the grafana configuration and alertmanager state so that it can then be ported over.

Codewise, we've introduced a couple of things:

A client to isolate in its own package all the communication that happens with Mimir
A few changes to the remote/alertmanager to include uploading the configuration and state when it starts
A few refactors that align a bit better with the design approach that we're thinking
An integration tests again these newly developed APIs using a custom image

---------

Signed-off-by: gotjosh <josue.abreu@gmail.com>
Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>
2023-11-23 16:59:36 +00:00
Misi
7128415529
Auth: Add more context to logs around token rotation, revocation (#78600)
Add more context to logs around token rotation, revocation

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
2023-11-23 16:48:54 +01:00
Joey
4f46fb412c
Tempo: Embed flame graph in span details (#77537)
* Embed flame graph

* Update test

* Update test

* Use toggle

* Update test

* Add tests

* Use const

* Cleanup

* Update profile tag

* Move flame graph out of tags, remove request and other cleanup + tests

* Update test

* Set flame graph by profile id and simplify logic

* Cleanup and redrawListView

* Create/use feature toggle
2023-11-23 13:36:53 +00:00
Gabriel MABILLE
91a5c3803c
RBAC: GrafanaAdmin users are admins of the Global Organization (#78559) 2023-11-23 12:17:28 +01:00
Ieva
778841cabe
Annotations: Remove dashboard permission checks for annotations (#78352)
remove checks for access to dashboard if FlagAnnotationPermissionUpdate is enabled
2023-11-23 10:47:37 +00:00
Kevin Wang
8bdfb7e1cf
chore(authn.service): fix typo in log statement (#76205) 2023-11-23 09:06:19 +01:00
Todd Treece
4203a83538
K8s: Prevent user impersonation (#78555) 2023-11-22 15:55:37 -05:00
Pablo
302519fe26
CloudWatch: Add AWS Bedrock metrics definition (#78478) 2023-11-22 13:40:40 -05:00
ismail simsek
c5f3ce1371
InfluxDB: Parse data for table view to have parity with frontend parser (#78365)
* Use TimeSeriesWide format for table response

* fix group by query result parsing

* handle labels

* provide a test where result has no tags

* parsing results without time column

* clean the code

* remove the comment line

* more cleaning

* lint
2023-11-22 19:27:42 +01:00
Oscar Kilhed
4c4f11f4b3
Avatar: Allow browser caching of /avatar/ (#78314)
don't set no-store headers to /avatar/
2023-11-22 17:41:54 +01:00
Ashley Harrison
4290ed3d86
Chore: Remove newBrowseDashboards feature toggle (#78190)
* remove all the things

* fix OldFolderPicker tests

* i18n

* remove more unused code

* remove mutation of error object since it's now frozen in the redux state

* fix error handling
2023-11-22 15:22:00 +00:00
Jo
40c8e2fc75
Live: Move empty orgRole safety valve (#78531)
move empty orgRole safety valve
2023-11-22 15:51:11 +01:00
Mihai Doarna
f0d3e27ea7
Add unit tests for the removeSSOSettings API method (#78476)
add unit tests for the removeSSOSettings api method
2023-11-22 15:57:12 +02:00
Jo
0de66a8099
Authz: Remove use of SignedInUser copy for permission evaluation (#78448)
* remove use of SignedInUserCopies

* add extra safety to not cross assign permissions

unwind circular dependency

dashboardacl->dashboardaccess

fix missing import

* correctly set teams for permissions

* fix missing inits

* nit: check err

* exit early for api keys
2023-11-22 14:20:22 +01:00
Ieva
9a3b2937aa
Data sources: Refactor logic for naming new data sources (#78479)
* move the name finding logic for new data sources from frontend to backend

* cleanup and fix test

* linting

* change the way the number after the ds type is incremented - keep incrementing it without adding more hyphens

* enterprise spec updates (unrelated to the PR)
2023-11-22 09:57:26 +00:00
Xavi Lacasa
72759be6ec
AuthN: Support HA setups with External Service Account management (#78425)
* Lock when creating external service

* Add local lock back

* Improve function signature

* Define lockName separately to make it more explicit

* Update pkg/infra/serverlock/serverlock.go

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

* Update pkg/infra/serverlock/serverlock.go

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

---------

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2023-11-22 10:15:13 +01:00
Joey
61553e1693
Tempo: Switch to sdk httpclient from infra httpclient (#78446)
Switch to sdk httpclient from infra httpclient
2023-11-22 09:14:53 +00:00
Tania
39754ba2d6
Nested Folders: Wrap create/update operations with transactions (#78000)
* Nested Folders: Add transaction to create and update methods

* Update tests

* Make IncreaseVersionForAllRulesInNamespace synchronous

* Resolve merge conflicts
2023-11-21 23:06:20 +02:00
Juan Cabanas
9c5daed336
PublicDashboards: Middleware creation (#77941) 2023-11-21 17:56:36 -03:00
Misi
3607a00692
Auth: Use camelCase in SSO Settings API (#78480)
Return/accept camelCase fields in sso setting api
2023-11-21 17:41:47 +01:00
Julien Duchesne
5acb981680
Swagger: Rename API Key AddCommand (#78491)
As a global definition, `AddAPIKeyCommand` is clearer
2023-11-21 11:25:21 -05:00
Gabriel MABILLE
b6b86bb0b3
RBAC: Check plugins:install globally (#78438)
* RBAC: Check plugins:install globally

* Add disclamer to the RBACSingleOrganization config option
2023-11-21 15:09:43 +01:00
Karl Persson
1eb19befaa
Login: refactor auth info package (#78459)
* Remove unused stats and metrics

* No longer collect metrics

* Remove unused dependency

* Move database from sub package
2023-11-21 14:47:23 +01:00
Andres Martinez Gotor
f8a6380510
Chore: Change endpoint to check versions in cli (#78008) 2023-11-21 12:46:26 +01:00
Andres Martinez Gotor
20f3a87bf5
Bug: Fix loading behavior with FlagExternalCorePlugins (#78388) 2023-11-21 11:51:13 +01:00
Karl Persson
d42201dbf4
Login: remove unused function (#78442)
* Move test to the db so we test the queries and not just testing the mock

* Remove unused function and dependencies

* Remove unused functions from the database

* Add some integration tests
2023-11-21 11:44:13 +01:00
Ivan Babrou
860b3bbce7
Dashboards: Implement natural sort for query variables (#78024) 2023-11-21 10:17:38 +01:00
Sven Grossmann
44586df7bf
Loki: Fix scope of labels variable being wrong (#78417)
fix scope of labels var
2023-11-21 10:14:21 +01:00
Mihai Doarna
875ea092df
Add more unit tests for removeSSOSettings method (#78329)
* add more unit tests for remove sso settings

* add unit tests for the service method
2023-11-21 10:11:52 +02:00
Kevin Yu
7f7d912af7
CloudWatch: Call query method from DataSourceWithBackend to support public dashboards (#77532)
* CloudWatch: call query method from DataSourceWithBackend to support public dashboards

* add test

* remove unneeded properties from test case

* update betterer

* add parens to group related logic

* remove unnecessary aliasing of variable

* use t.Cleanup

* remove redundant check

* add comment
2023-11-20 14:44:22 -08:00
Kat Yang
2f2ce3edbb
Chore: Deprecate ID from Folder (#78281)
* Chore: Deprecate ID from Folder

* chore: add more linter comments

* chore: add missing lint comment
2023-11-20 15:44:51 -05:00
Jo
259ecb1793
AuthZ: Improve team ID fetching for signedInUser (#78378)
* improve team ID fetching for signedInUser

* remove inner join

* rename func

* nit: remove extra params

* nit: spacing and wrapping
2023-11-20 16:23:13 +01:00
Misi
53f53a44e3
Auth: Make clientTokenRotation enabled by default (#78384)
Make clientTokenRotation enabled by default
2023-11-20 15:28:33 +01:00
Ieva
87c3703a0d
Data sources: show data source menu to users who only have access to create a data source (#78347)
* show data source menu to users who only have access to create a data source

* return early if missing permissions
2023-11-20 13:59:02 +00:00
Karl Persson
72db9739c7
UserAuth: clean-up auth entries on update (#78377)
* UserAuth: clean-up auth entries on update

* Update pkg/services/login/authinfoservice/database/database.go

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

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2023-11-20 14:58:32 +01:00
Ivana Huckova
28f4c3ed44
Elasticsearch: Fix processing of raw_data with not-recognized time format (#78262)
* Elasticsearch: Fix non-standard time field in raw data queries

* Update snapshot tests

* Refactor
2023-11-20 12:01:41 +01:00
Misi
437ae8e8c5
Auth: Refactor OAuth connectors' initialization (#77919)
* Refactor AzureAD to init itself

* Use mapstructure to convert data to OAuthInfo

* Update

* Align tests

* Remove unused functions

* Add owner to mapstructure

* Clean up, lint

* Refactor Okta init, Align tests

* Address review comments, fix name in newSocialBase

* Update newSocialBase first param

* Refactor GitLab init, align tests

* Update pkg/login/social/common.go

Co-authored-by: Karl Persson <kalle.persson@grafana.com>

* Use ini conversion to map

* Leftovers

* Refactor GitHub connector initialization, align tests

* Refactor Google connector init, align tests

* Refactor grafana_com connector, align tests

* Refactor generic_oauth connector init, align tests

* cleanup

* Remove util.go

* Add tests for custom field init

* Change OAuthInfo's Extra type

* Fix

* Replace interface{} with any

* clean up

---------

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
2023-11-20 09:45:40 +01:00
Ryan McKinley
49fc8214a0
K8s: Add etcd tests for dual write (local) (#78161) 2023-11-17 14:20:54 -05:00
Ivan Ortega Alba
ddfe4e1bdd
FeatureToggle: Disable dashgpt by default and mark it as preview (#78348) 2023-11-17 18:51:51 +02:00
Matthew Jacobson
893839d27b
Alerting: Move general alert rule validation from db-layer to model (#78325)
Alerting: Move general alert rule validation to model
2023-11-17 11:20:50 -05:00
Karl Persson
a929e3f2cf
Auth: Remove unused function (#78332)
Remove unused function
2023-11-17 17:07:39 +01:00
Karl Persson
140b5b4a61
AuthN: Add debug logs and check error during oauth token sync (#78323)
Add some debug logs and handle error
2023-11-17 16:03:25 +01:00
Giuseppe Guerra
027a157898
Plugins: Allow disabling "skip host environment variables" per-plugin (#78266)
* Plugins: Allow disabling skipping host environment variables per-plugin

* Renamed SkipEnvVarsDecorateFunc to SkipHostEnvVarsDecorateFunc

* PR review feedback

* fix tests
2023-11-17 16:12:05 +02:00
Will Browne
ddb7406caa
Plugins: Add running method to interface (#78326)
* add running to interface

* add context
2023-11-17 13:52:31 +01:00
Tania
a9208f623a
Nested Folders: Refactor query for getting folders (#78286)
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2023-11-17 13:09:30 +01:00
Mihai Doarna
9da9bbf907
Add swagger code for the removeProviderSettings API method (#78270)
* add swagger code for the remove provider SSO settings API method

* replace fine grained with role based

* address feedback
2023-11-17 14:07:26 +02:00
Domas
6edc86a7ed
Chore: Add app o11y viz as code owners for sparkline related stuff (#78310)
* add app o11y viz as code owners for sparkline related stuff

* run gencue
2023-11-17 14:02:52 +02:00
Esteban Beltran
5a2127c221
Sandbox: Fix configuration key for sandbox exceptions (#78317)
* Sandbox: Disable incident app inside the sandbox code

* Fix wrong key for default config and config key

* Rllback file
2023-11-17 12:35:09 +02:00
Ashley Harrison
7404ed66f6
Chore: Remove navAdminSubsections toggle (#78179)
* remove navAdminSubsections toggle

* missed one!
2023-11-17 10:04:34 +00:00
Ieva
2a5547e1b5
Annotations: Update annotation scope resolver to resolve annotation scopes to dash and folder scopes (#78222)
* update annotation scope resolver to resolve dashboard annotation scopes to dash and folder scopes

* Update annotations.go

remove unwanted changes

* remove unwanted change

* use switch statement
2023-11-17 11:57:25 +02:00
Gabriel MABILLE
36fd9040af
Chore: Fix flaky test (#78309)
* Chore: Fix flaky test

* Found another one
2023-11-17 11:38:57 +02:00
Jean-Philippe Quéméner
2d2e058563
refactor: use constant for prometheus datasource type (#78287) 2023-11-17 01:07:35 +01:00
Gabriel MABILLE
25c2d99350
ExtSvcAuth: Add traces to external service accounts setup (#76779)
* AuthN: Add traces to external service accounts setup
2023-11-16 20:45:31 +01:00
Alexander Zobnin
5e50d9b178
Folders: Fix fetching empty folder (#78280) 2023-11-16 17:50:52 +01:00
Sven Grossmann
a01f8c5b42
Loki: Add backend functionality to parse structured metadata from Loki (#77361)
* prepare backend for structured metadata

* add `lokiStructuredMetadata` feature toggle

* use `lokiStructuredMetadata` feature flag

* add field type check to `labelTypesField`

* remove fixme

* fix feature toggle

* add field in dataplane mode

* use `data.Labels` where possible

* adjust framing tests

* improve verbiage

* improve naming

* update tests to "attributes"
2023-11-16 17:06:14 +01:00
Kat Yang
2d09bac2b8
Chore: Deprecate FolderIDs only used by Swagger (#78219) 2023-11-16 09:57:04 -05:00
Sam
0cf6b94fa2
tsdb/elasticsearch: remove TimeInterval field from tsdb/elasticsearch client (#78264)
remove TimeInterval field from tsdb/elasticsearch client #78187

Co-authored-by: Sam <samucap@users.noreply.github.com>
2023-11-16 14:57:21 +01:00
Ieva
b0448b92e5
Dashboards: Allow updating a dashboard if the user doesn't have access to the parent folder (#78075)
* change where folder checks are done for dash creation/updates

* add test for folder not being found

* test fixes

* more test fixes

* add nlint directive to where folder IDs are used

* fix bad merge

* fix test
2023-11-16 11:11:35 +00:00
Gabriel MABILLE
ba717454e1
ExtSvcAuth: Clean up orphaned external services on start up (#77951)
* Plugin: Remove external service on plugin removal

* Early exit no service account

* Add log

* WIP

* Cable OAuth2Server client removal

* Move function lower

* Add function to test removal

* Add test to RemoveExternalService

* Test RemoveExtSvcAccount

* remove apostrophy in comment

* Add cfg to plugin installer to check features

* Add feature flag check in the service registration service

* Comments

* Move metrics Inc

* Initialize map

* Reorder

* Initialize mutex as well

* Add HasExternalService as suggested

* WIP: CleanUpOrphanedExternalServices

* Commit suggestion

Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>

* Nit on test.

Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>

* oauthserver return names

* Name is not Slug

* Use plugin ID not slug

* Add background job

* remove negation on feature check

* Add test to the CleanUp function

* Test GetExternalServiceNames

* rename test

* Add test for ExtSvcAccountsService_GetExternalServiceNames

* Add a todo

* Add todo

* Option based on mix

* Rewrite a bit the comment

* Opinionated choice use slugs instead of names everywhere

* Nit.

* Comments and re-ordering

* Comment

* Add log

* Add context

---------

Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>
2023-11-16 12:07:42 +01:00
Matias Chomicki
9cb303c3f7
Log Rows: Added popover menu with filter options when a log line is selected (#75306)
* LogRow: detect text selection

* LogRow: refactor menu as component

* LogRow: add actions to menu

* LogRow: hack menu position

* Remove unsused imports

* LogRowMessage: remove popover code

* PopoverMenu: refactor

* LogRows: implement PopoverMenu at log rows level

* PopoverMenu: implement copy

* PopoverMenu: receive row model

* PopoverMenu: fix onClick capture issue

* Explore: add new filter methods and props for line filters

* PopoverMenu: use new filter props

* Explore: separate toggleable and non toggleable filters

* PopoverMenu: improve copy

* ModifyQuery: extend line filter with value argument

* PopoverMenu: close with escape

* Remove unused import

* Prettier

* PopoverMenu: remove label filter options

* LogRow: rename text selection handling prop

* Update test

* Remove unused import

* Popover menu: add unit test

* LogRows: update unit test

* Log row: hide the log row menu if the user is selecting text

* Log row: dont hide row menu if popover is not in scope

* Log rows: rename state variable

* Popover menu: allow menu to scroll

* Log rows: fix classname prop

* Log rows: close popover if mouse event comes from outside the log rows

* Declare new class using object style

* Fix style declaration

* Logs Popover Menu: add string filtering functions (#76757)

* Loki modifyQuery: add line does not contain query modification

* Elastic modifyQuery: implement line filters

* Modify query: change action name to not be loki specific

* Prettier

* Prettier

* Elastic: escape filter values

* Popover menu: create feature flag

* Log Rows: integrate logsRowsPopoverMenu flag

* Rename feature flag

* Popover menu: track interactions

* Prettier

* logRowsPopoverMenu: update stage

* Popover menu: add ds type to tracking data

* Log rows: move feature flag check

* Improve handle deselection
2023-11-16 11:48:10 +02:00
Shirley
9452a6fcf7
CloudWatch: Add missing GameLift metrics (#76102)
Add missing GameLift metrics
2023-11-16 10:02:29 +01:00
ismail simsek
5096806eab
InfluxDB: Don't sort retention policies on the backend (#78252)
don't sort retention policies
2023-11-16 10:39:15 +02:00
Misi
7ae0ff1309
RBAC: Add OAuth provider scopes separately to fixed:authentication.config:writer (#78202)
Add OAuth provider setting scopes to fixed:authentication writer

* Change SSO Settings api scopes

* Remove unused RBAC Action
2023-11-16 09:15:51 +01:00
Ryan McKinley
71f32d4e19
K8s: Ensure there is always a user in appcontext.User (#78247) 2023-11-15 16:52:54 -08:00
Dan Cech
c330b7d18d
Chore: Update settings to support k8s needs (#78235)
use util.SplitString, implement DynamicSection KeysHash
2023-11-15 15:26:28 -05:00
Ben Tasker
f38f657f87
InfluxDB: Add new truthiness operators (Is and Is Not) to InfluxQL Query Builder (#77923)
* InfluxDB: Add new truthiness operators (`Is` and `Is Not`) to InfluxQL Editor for use with boolean fields

* InfluxDB: Make the front-end aware of the new operators so that translation between raw and builder works

* Chore: Add tests

* feat: identify type of field value to allow other types to work with Is/Is Not

Tags: always quote
Integer: Don't quote
Float: Don't quote
Boolean: Don't quote
String: Quote

* Chore: Add test-cases for type inference

* Update front-end to infer type for operators Is and Is Not

* chore: Add front-end tests

* chore: add additional front-end tests

* chore: fix failing lint test

* chore: fix tests (run prettier)
2023-11-15 21:10:37 +01:00
Kyle Brandt
a94acf4b63
Revert "InfluxDB: Response parser improvements (#76852)" (#78224)
This reverts commit 046791e2be.

Is causing malformed frames, and resulting in errors about mismatched field lengths in the logs, No data in the UI, and will cause SSE to panic.

I think this is because of the global slice vars since it seems to take concurrency to replicate it.
2023-11-15 14:01:36 -05:00
Giuseppe Guerra
cb0a88a027
Plugins: Backend: Skip host environment variables (#77858)
* Add pluginsSkipHostEnvVars feature flag

* Set go-plugin's SkipHostEnvVar depending on feature flags

* add missing file

* Re-generate feature flags

* Add allowedHostEnvVarNames

* Fix feature toggles not being passed to plugin context service's plugin env vars

* Fix tests

* PR review feedback: Use cfg.Features

* Fix tests

* PR review feedback: removed DefaultProviderWithFeatures

* merge with master

* fix tests

* use features.IsEnabledGlobally
2023-11-15 18:09:14 +01:00
Yuri Tseretyan
7cec741bae
Alerting: Extract alerting rules authorization logic to a service (#77006)
* extract alerting authorization logic to separate package
* convert authorization logic to service
2023-11-15 18:54:54 +02:00
Ieva
2c73f15839
Revert "Revert "RBAC: remove dashboard ACL logic from dash store, service #78130" (#78203)
Revert "Revert "RBAC: remove dashboard ACL logic from dash store, service #78130 (#78198)"

This reverts commit 8057b9298d.
2023-11-15 16:45:49 +00:00
Taku Maeda
210ec8247b
Plugins: Add AWS/MediaLive metric for CloudWatch (#78163) 2023-11-15 18:42:23 +02:00
Kat Yang
d090dab138
Chore: Deprecate FolderID from SaveDashboardCommand (#77813) 2023-11-15 11:21:02 -05:00
Will Browne
b3ad61e180
Plugins: Add plugin version field to proto interface (#78213)
add plugin version
2023-11-15 16:53:30 +01:00
Dominik Prokop
0122f7ccad
DashboardScene: Support dashboard links (#77855)
* MenuItem: Allow react node as label

* LinkButton: Expose ButtonLinkProps

* Typecheck fix

* DashboardLinks: Refactor and use LinkButton and menu

* DashbaordLinks scene object

* Use flex layout for dashboard controls

* Update public/app/features/dashboard/components/SubMenu/DashboardLinksDashboard.tsx

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>

* fix keepTime and includeVars

* Add ellipsis to menu item label and description

* Use DashboardLink type from grafana/schema

* Update dashboard scene controls layout

* Fix e2e

* Test fix

* Bring back keyboard navigation

* Remove unused code

* One more fix

---------

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2023-11-15 17:49:51 +02:00
Kat Yang
8d581b8358
Chore: Deprecate ID in GetFolderQuery (#77647) 2023-11-15 10:30:00 -05:00
Kat Yang
a640d9d395
Chore: Deprecate Id from Folder in DTOs (#77943)
* Chore: Deprecate Id from Folder in DTOs

* chore: regen spec
2023-11-15 10:29:49 -05:00
Kat Yang
ae326eaed1
Chore: Deprecate FolderID from DashboardACLInfoDTO (#77652)
* Chore: Deprecate FolderID from DashboardACLInfoDTO

* chore: regen specs
2023-11-15 10:29:20 -05:00
Kat Yang
3a2e96b0db
Chore: Deprecate FolderID from Dashboard (#77823)
* Chore: Deprecate FolderID from Dashboard

* chore: add two missing nolint comments
2023-11-15 10:28:50 -05:00
ismail simsek
0214b25663
Prometheus: Fix calculating rate interval when there is no interval specified (#78193)
* Use data source scrape interval when no interval is specified

* scrape interval as 15s
2023-11-15 16:20:37 +01:00
Sergey Kostrukov
40152922d3
Azure Monitor: support AzureCredentials in common format on backend (#77424)
* Use GetDefaultCloud from SDK

* Use GetAzureCloud from SDK

* Credentials parser moved to azmoncredentials

* Refactor legacy credentials

* Tests

* Fix test description

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>

---------

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
2023-11-15 14:59:23 +00:00
Ryan McKinley
b8e8d84ef7
Swagger: Show k8s APIs (#78091) 2023-11-15 06:42:35 -08:00
Julien Duchesne
c551c9e71f
Swagger: Fix listTokensResponse (#78155)
* Swagger: Fix listTokensResponse
It should return a list of Tokens, not a single one
Also regenerated the API spec from the latest changes + this branch

* Remove pointer
2023-11-15 08:59:54 -05:00
Eric Leijonmarck
8057b9298d
Revert "RBAC: remove dashboard ACL logic from dash store, service #78130 (#78198)
Revert "RBAC: remove dashboard ACL logic from dash store and service (#78130)"

This reverts commit dd54931147.
2023-11-15 15:33:38 +02:00
Torkel Ödegaard
1f1d348e17
DataTrails: Auto query, explore and breakdown/drilldown prototype (#77019)
* First try

* Update

* app with drilldowns

* Progres

* Progress

* update

* Update

* update

* Update

* Update

* Progress

* Update

* Progress

* Update

* Progress

* logs url sync

* related metrics

* Progress

* progress

* Progress

* Update

* Update

* Update

* Update

* Update

* fix

* Update

* update

* Update

* update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* update

* Update

* Update

* Settings

* Update

* Tweaks

* update

* Improve auto queries

* Update

* Update

* Fixes

* Update

* Update

* Update

* fix

* Update

* Removing logs view, cleanup

* Update

* Update

* disabled not implemented buttons

* Update

* Feature toggle on dashboard menu

* remove unused prometheus change

* removed bit

* Fix failing test

* chore: added `/public/app/features/trails/` to CODEOWNERS

* go mod tidy

* go mod tidy

* fix: added missing arg

* Moved panel action

* Moved panel action

---------

Co-authored-by: André Pereira <adrapereira@gmail.com>
Co-authored-by: Darren Janeczek <darren.janeczek@grafana.com>
2023-11-15 11:28:29 +00:00
Ben Tasker
c06debe200
InfluxDB: Add support for >= and <= comparison operators to IQL Query Builder (#77917)
* InfluxDB: Add support for `>=` and `<=` comparison operators to InfluxQL Query Builder

* Add front-end support for the new operators

This ensures that the query translates correctly between raw and builder mode

* Chore: add test for new operators

* chore: add front-end tests

* fix: don't skip quoting on `<>`

This preserves the pre-existing behaviour, fixing a failing test

* chore: fix tests
2023-11-15 12:21:41 +01:00
Tania
1d1d42c984
Nested Folders: Decrease max nested folders depth (#78133)
* Nested Folders: Decrease allowed nested folders depth

* Fix folder height check in Move
2023-11-15 10:25:40 +01:00
Gábor Farkas
b97e485fe0
mysql: update unit test to be ready for the xorm-removal (#78064)
* mysql: update unit test to be ready for the xorm-removal

* removed unused code
2023-11-15 09:46:18 +01:00
Ieva
dd54931147
RBAC: remove dashboard ACL logic from dash store and service (#78130)
remove dashboard ACL logic from dash store and service
2023-11-15 08:25:51 +00:00
William Wernert
1a53a716e9
Annotations: Lift parts of RBAC from xorm store into auth service (#76967)
* [WIP] Lift RBAC from xorm store

* Cleanup RBAC, fix tests

* Use the scope type map as a map
* Remove dependency on dashboard service
* Make dashboards a map for constant time lookups (useful later)
---
* Lift RBAC tests into a new file to test at service level
* Add necessary access resource structs to xorm store tests

* Move authorization into separate service

* Pass features to searchstore.Builder

* Sort imports

* Code cleanup

* Remove useless scope type check

* Lift permission check into `Authorize()`

* Use clearer language when checking scope types

* Include dashboard permissions in test to ensure they're ignored

* Switch to errutil

* Cleanup sql.Cfg refs
2023-11-14 18:11:01 -05:00
Ryan McKinley
2b1e731c15
K8s/Playlist: Test dual write path (#77604) 2023-11-15 00:07:32 +02:00
Misi
19a7cd88b0
Auth: Add SAML scopes to fixed:authentication.config:writer (#78147)
Add SAML scopes back to fixed authenticationConfigWriterRole
2023-11-14 23:02:52 +02:00
Ryan McKinley
f69fd3726b
FeatureToggles: Add context and and an explicit global check (#78081) 2023-11-14 12:50:27 -08:00
Ryan McKinley
c887ef2c9a
K8s: Set version info in response (#78083)
Co-authored-by: Jeff Levin <jeff@levinology.com>
2023-11-14 12:29:15 -08:00
João Calisto
c506da53f3
Feature Registry: Update toggle configs for admin page visibility (#78062)
* Feature Registry: Update toggle configs for admin page visibility

* update

* fix rebase
2023-11-14 17:04:54 +00:00
linoman
408dab8c57
IAM: Protect managed service account frontend details page (#77839)
* Add `isManaged` property to frontend model

* Remove enabled and token buttons for managed SA

* Replace trash icon for lock icon for managed SA

* Block the role picker for managed SA

* Filter SA list usiong the managed filter

* Rename external for managed

* Add only managed filter

* Toggle the enable buttons for managed sa

* Disable add token and delete token buttons

* Remove the edit name button

* Disable the Role picker for managed sa

* Hide the permissions section

* Add managed by row

---------

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2023-11-14 17:52:48 +01:00
Mihai Doarna
6d74746997
Auth: Replace literal http status codes with constants from http pkg (#78116)
replace literal http status codes with constants from http pkg
2023-11-14 17:07:51 +02:00
Ryan McKinley
a221c1d754
Chore: Remvoe newDBLibrary feature flag (#78074) 2023-11-14 06:51:35 -08:00
Jo
580477bf8e
NGAlerting: Use identity.Requester interface instead of SignedInUser (#76360)
* unfurl SignedInUserAttrs services

* replace signedInUser with Requester

replace signedInUser with requester

* fix tests

* linting

---------

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
2023-11-14 14:47:34 +00:00
Giuseppe Guerra
ab4fc07cc7
Plugins: Add statusSource to partial data response error log (#78057)
* Plugins: Add statusSource to partial data response error log

* Introduce DefaultStatusSource

* Add StatusSourceFromPluginErrorSource

* Moved StatusSourceFromPluginErrorSource

* Update pkg/services/pluginsintegration/clientmiddleware/logger_middleware.go
2023-11-14 16:27:48 +02:00
Ashley Harrison
e389ffa137
Chore: only show short commit hash in the help menu (#78038)
only show short commit hash in the help menu
2023-11-14 13:22:46 +00:00
Andres Martinez Gotor
fcc2f01c7e
Chore: Update otel deps (#78069)
Co-authored-by: Giuseppe Guerra <giuseppe@guerra.in>
Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>
2023-11-14 14:14:15 +01:00
Santiago
4a152a0e35
Alerting: Add lifecycle methods to the forked Alertmanager (#77741)
* Alerting: Add an empty Forked Alertmanager

* Alerting: Add methods for silences to the forked Alertmanager

* check for errors in tests

* make linter happy

* Alerting: Add methods for alerts to the forked Alertmanager

* Alerting: Add methods for receivers to the forked Alertmanager

* Alerting: Add TestTemplate method to the forked Alertmanager

* make linter happy

* separate into both forked AMs

* fix tests

* Alerting: Add lifecycle methods to the forked Alertmanager
2023-11-14 11:17:17 +01:00
Will Browne
26bcfe300f
Plugins: Follow root level dist and siblings when walking file system (#78042)
* simplify

* add comments

* tidy up

* remove line

* update comment

* fix pfs test

* fix err import

* delete code
2023-11-14 10:31:46 +01:00
Ryan McKinley
ea37a116f7
K8s: expose namespace in frontend_settings (#78090)
Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
2023-11-14 06:34:09 +02:00
Ryan McKinley
1be1432926
K8s: Add subresource to the example apiserver (#78030) 2023-11-14 05:51:58 +02:00
Ryan McKinley
a2a6f9a6d8
K8s: Update comments and structure to help a security review (#77881) 2023-11-13 12:51:41 -08:00
Ryan McKinley
dec9a07738
Settings: Actually deprecate access to feature flags (#78073) 2023-11-13 11:39:01 -08:00
Ryan McKinley
3509a5abb9
FeatureFlags: Cleanup usage of cfg.IsFeatureToggleEnabled (#78014) 2023-11-13 07:55:15 -08:00
Marcus Efraimsson
2b146b97b4
Plugins: Remove usage of deprecated folder id (#78061) 2023-11-13 16:49:28 +01:00
Gabriel MABILLE
fe8d0e6381
ExtSvcAuth: Refactor external service registry to use ExternalServiceRegistry variables (#78056)
ExtSvcAuth: Refactor external service registry to use ExternalServiceRegistry
2023-11-13 16:23:11 +01:00
Ryan McKinley
55d61c93d2
K8s: Upgrade to v0.28.3 (#78033) 2023-11-13 06:53:24 -08:00
Ryan McKinley
ad44164910
Preferences: Remove SQLX backing store (#78015) 2023-11-13 06:22:22 -08:00
Will Browne
4299efbc56
Plugins: Expose PID through proto interface (#77821)
* expose PID thru interface

* apply PR feedback

* simplify

* add read lock
2023-11-13 14:41:53 +01:00
Fabrizio
edde17741d
Fix trace ID in error message (#78041) 2023-11-13 14:31:19 +01:00
Gabriel MABILLE
20a2840046
Plugin: Remove external service on plugin removal (#77712)
* Plugin: Remove external service on plugin removal

* Add feature flag check in the service registration service

* Initialize map

* Add HasExternalService as suggested

* Commit suggestion

Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>

* Nit on test.

Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>


---------

Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>
2023-11-13 13:18:13 +01:00
Ieva
eca45f6492
Chore: remove gcomOnlyExternalOrgRoleSync feature toggle (#78001)
remove gcomOnlyExternalOrgRoleSync feature toggle
2023-11-13 09:56:02 +00:00
Gábor Farkas
fe18c63204
mysql: do not import httpClient from core grafana (#77628)
mysql: do not use core-only exports
2023-11-13 10:25:19 +01:00
ismail simsek
b607a4e0a2
Prometheus: Fix $__rate_interval calculation (#77234)
* Remove unused param

* simple unit test

* rename

* rename

* add some comments

* Update values

* refactor

* rename

* always calculate rate interval

* fix unit tests

* Fix indentation

* linter fix

* update test

* Fixing issues with the calculation

* new test

* fix $__interval interpolation

* fix test

* add comment
2023-11-13 10:13:07 +01:00
Torkel Ödegaard
4bc322ca1d
DashboardScene: Pass panel id to PanelProps.id (#77927)
* Panel props id

* Removing panel works

* Update
2023-11-13 09:51:21 +01:00
Gábor Farkas
2d391c1bf5
postgresql: change plugin id (#77444)
* postgres: change plugin id

* fixed cue file

* codeowners update

* fixed backend test
2023-11-13 08:49:26 +01:00
Ryan McKinley
675e946b40
SQLX: Remove two unreachable services (#78016) 2023-11-12 09:29:14 -08:00
Ivana Huckova
8cd8eb7882
Revert "Loki: Add error source to DataQuery (#77876)" (#78006)
This reverts commit 934456dc1c.
2023-11-10 17:03:59 +01:00
Marcus Efraimsson
c7442c0fd2
Instrumentation: Check embedded errors in query data response for plugin metrics/logs status label (#77613)
Check embedded errors in query data response for plugin metrics/logs status label.
Plugin Request Completed log messages are now logged with info level if status=ok, 
otherwise error level.

Fixes #76769
2023-11-10 16:55:01 +01:00
Giuseppe Guerra
7b4bcc86f1
Plugins: Pass OTEL sampling config to plugins (#76834)
* Pass OTEL sampling config to plugins

* fix capital letters

* Do not pass sampler env vars if sampling is not configured

* Add tests

* PR review feedback

* Simplify tracing env vars logic

* Update test to reflect pkg/infra/tracing behaviour
2023-11-10 14:56:08 +01:00
Sonia Aguilar
68e37c3925
Alerting: Adds the new alertingSimplifiedRouting feature toggle (#77984)
Adds the new alertingSimplifiedRouting feature toggle for the simplified alert routing
2023-11-10 14:14:39 +01:00
Alexander Zobnin
944593c4d5
Team LBAC: Able to configure default rule (#77946)
Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
2023-11-10 12:31:37 +00:00
Tania
6b4337a842
Nested folders: Write to folders table even if the feature toggle is off (#77788)
* Update folders table even if the feature toggle is off

* Fix failing test

* Apply review feedback

* Revert test changes
2023-11-10 13:03:00 +01:00
Hugo Kiyodi Oshiro
e754c5a6c6
Plugins: Change managed plugins installation call (#77120) 2023-11-10 12:28:36 +01:00
Will Browne
7d2d5fbe89
Plugins: Add referer and user login params to plugin CDN redirect logs (#77942)
add referer and user
2023-11-10 11:52:06 +01:00
Giuseppe Guerra
da117aea1c
Plugins: Allow disabling angular deprecation UI for specific plugins (#77026)
* Plugins:Allow disabling angular deprecation UI for specific plugins

* add backend test

* changed test names

* lint

* Removed angular properties from DataSourceDTO

* Update tests

* Move angularDetected and hideAngularDeprecation in angularMeta property

* Fix angular property name in AppPluginConfig

* Fix reference to angularMeta.detected

* Fix hide_angular_deprecation not working for core plugins

* lint
2023-11-10 11:44:54 +01:00
Ivana Huckova
934456dc1c
Loki: Add error source to DataQuery (#77876)
* Loki: Add error source to DataQuery

* Create middlewares to fix healtcheck test

* Add comment for errors from ReadPrometheusStyleResult
2023-11-10 10:26:56 +01:00
Johannes Przymusinski
641a47c71d
Provisioning: Remove trailing space from log message (#73124)
Remove trailing space from log message
2023-11-10 07:24:35 +00:00
Ryan McKinley
d410ef3439
K8s: Use grafana executable for standalone api service (#77904)
Co-authored-by: Dan Cech <dcech@grafana.com>
2023-11-09 16:50:27 -08:00
Andreas Christou
8808de0b45
AzureMonitor: Improve error handling and update tests (#77967)
* Improve error handling and update tests

* Assert errors are nil

* Refactor away redundant code
2023-11-09 21:13:07 +00:00
Gilles De Mey
323ee7c38c
Alerting: Remove react-enable (#77955) 2023-11-09 18:35:03 +01:00
Alexander Weaver
36dba7584d
grpcserver: Extract existing span context from grpc request metadata prior to span creation (#77833)
Extract existing span context from grpc metadata
2023-11-09 11:25:19 -06:00
linoman
5bc4f56c79
IAM: Protect external service accounts frontend list page (#77834)
* Add `isExternal` property to frontend model

* Remove enabled and token buttons for external SA

* Replace trash icon for lock icon for external SA

* Block the role picker for external SA

* Filter SA list using the external filter

* Add only external filter at backend

---------

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2023-11-09 17:45:46 +01:00
Kat Yang
c94410fdee
Chore: Deprecate FolderIds from FindPersistedDashboardsQuery (#77651)
* Chore: Deprecate FolderIds from FindPersistedDashboardsQuery

* Update pkg/services/dashboards/models.go

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

---------

Co-authored-by: Arati R. <33031346+suntala@users.noreply.github.com>
2023-11-09 11:07:10 -05:00
Kat Yang
1c758ab5f2
Chore: Deprecate folderID from dashboardIdentity (#77650) 2023-11-09 10:57:33 -05:00
Kat Yang
4e57324d58
Chore: Deprecate FolderID from GetDashboardQuery (#77812) 2023-11-09 10:53:39 -05:00
Andrej Ocenas
494a07b522
Flamegraph: Add collapsing for similar items in the stack (#77461) 2023-11-09 15:31:07 +01:00
Santiago
8b751eb216
Alerting: Add TestTemplate method to the forked Alertmanager (#77577)
* Alerting: Add an empty Forked Alertmanager

* Alerting: Add methods for silences to the forked Alertmanager

* check for errors in tests

* make linter happy

* Alerting: Add methods for alerts to the forked Alertmanager

* Alerting: Add methods for receivers to the forked Alertmanager

* Alerting: Add TestTemplate method to the forked Alertmanager

* make linter happy

* separate into both forked AMs

* fix tests
2023-11-09 12:35:24 +01:00
Matias Chomicki
174c2ab45a
Logs infinite scrolling: create feature flag (#77885)
logsInfiniteScrolling: create feature flag
2023-11-09 11:54:03 +01:00
Agnès Toulet
bb12fe7d82
UsageInsights: Disable frontend features when backend is disabled (#77772)
* UsageInsights: Disable frontend features when backend is disabled

* Disable DS insights

* Update doc

* fix linter issue

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

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

---------

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
2023-11-09 11:53:20 +01:00
Santiago
ba51c371ec
Alerting: Add methods for receivers to the forked Alertmanager (#77574)
* Alerting: Add an empty Forked Alertmanager

* Alerting: Add methods for silences to the forked Alertmanager

* check for errors in tests

* make linter happy

* Alerting: Add methods for alerts to the forked Alertmanager

* Alerting: Add methods for receivers to the forked Alertmanager

* make linter happy

* separate into both forked AMs

* fix tests

* rename testErr -> expErr
2023-11-09 11:38:16 +01:00
Andres Martinez Gotor
f7361a2755
Chore: Update TestData README (#77607)
Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com>
2023-11-09 10:03:00 +01:00