Commit Graph

415 Commits

Author SHA1 Message Date
Jo
f2bf066ad2
SigningKeys: Add jwks endpoint (#76040)
* add jwks

add remote caching

add expose jwks test

tweaks

* fix swagger

* nt
2023-10-05 15:17:31 +02:00
Marcus Efraimsson
e4c1a7a141
Tracing: Standardize on otel tracing (#75528) 2023-10-03 14:54:20 +02:00
Marcus Efraimsson
0128d0403f
Tracing: Use tracing.InitializeTracerForTest (#75479) 2023-09-27 09:51:57 +02:00
Marcus Efraimsson
534e3ebf0c
Plugins: Use a Grafana specific SDK tracer implementation for core plugins (#75388) 2023-09-26 14:46:31 +02:00
Dave Henderson
ce1169f8b7
Tracing: Support remote, rate-limited, and probabilistic sampling in tracing.opentelemetry config section (#73587)
* tracing: Support remote sampling server

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

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

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

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

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

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

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

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

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

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

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

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

* Satisfying the doc-validator check

* satisfy prettier

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

* back out unnecessary change

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

---------

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
2023-09-11 12:13:29 -04:00
Will Browne
e855efb13d
Plugins: Move store and plugin dto to pluginsintegration (#74655)
move store and plugin dto
2023-09-11 13:59:24 +02:00
Sven Grossmann
7e01dde762
Logging: Add WithContextualAttributes to pass log params based on the given context (#74428)
* suggestion to use `RegisterContextualLogProvider`

* add `pluginId`

* change to `WithContextualAttributes`

* move approach to instrumentation.go

* improve `WithContextualAttributes`

* unexport consts

* typo

* remove comment

* add `nil` check
2023-09-07 13:13:34 +02:00
linoman
13f4382214
Auth: Implement requester interface in access control module (#74289)
* Implement requester interface in the access control module
2023-09-06 11:16:10 +02:00
Serge Zaitsev
bd12ce0cbc
Chore: capitalise log messages for app platform (#74336) 2023-09-04 18:46:08 +02:00
Marcus Andersson
017078913a
Plugins: Added plugin preload time measurement to frontendmetrics (#73916)
Added preload ms to frontend metricts.
2023-09-04 07:09:14 +02:00
Dan Cech
85a207fceb
Chore: Replace entity GRN with infra/grn GRN (#74198)
replace entity GRN with infra/grn GRN
2023-08-31 15:43:35 -04:00
Ryan McKinley
025b2f3011
Chore: use any rather than interface{} (#74066) 2023-08-30 18:46:47 +03:00
Alexander Weaver
2245a3d0d1
Tracer: Export ContextWithSpan (#73715)
Export ContextWithSpan
2023-08-25 13:48:58 -05:00
Marcus Efraimsson
040b7d2571
Chore: Add errutils helpers (#73577)
Add helpers for the errutil package in favor of errutil.NewBase.
2023-08-22 12:52:24 +02:00
Dan Cech
dd97038b00
Slug: Combine various slugify fixes for special character handling (#73164)
* combine various slugify fixes for special character handling

* a couple more test cases

* update more tests

* goimports
2023-08-10 16:12:50 -04:00
Sofia Papagiannaki
afb59af79b
Usage stats: Tune collector execution startup and interval (#72688)
* Do not update statistics at service collector startup

* Configurable collector interval

* Introduce initial random delay

* Prevent reporting metrics until the stats have been collected

* Apply suggestion from code review
2023-08-03 11:01:44 +03:00
Sofia Papagiannaki
2c26a02b82
Search v1: Remove unnecessary subqueries (#72388)
* Add feature flag

* Introduce interface and dummy implementation

* Add tests for the new filter

* accessControlDashboardPermissionFilterNoFolderSubquery implementation

* join only if it's necessary

* force ordering for tests

* Temporarily enable new query for benchmarks
2023-08-02 10:39:25 +03:00
Serge Zaitsev
2bfef9e916
Tracing: Differentiate collector and agent better (#71851)
* differentiate collector and agent better

* Add back the max packet size

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

---------

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2023-08-01 14:23:31 +02:00
Emil Tullstedt
ab0a115372
Annotations: Improve updating annotation tags queries (#71201)
Annotations: Improve annotation tag updates
2023-07-31 18:19:59 +03:00
Stephanie Hingtgen
5cd1541aee
HTTP Client Metrics: Add datasource_type to datasource metrics (#72130)
Metrics: Add datasource_type to datasource metrics
2023-07-24 14:22:08 +02:00
Stephanie Hingtgen
4ece133fce
Secure socks proxy: use Grafana Plugin SDK (#71616) 2023-07-18 15:23:02 -06:00
Will Browne
a8577c21ba
Plugins: Migrate PluginStore mock to pre-existing fakes package (#71664)
* migrate to existing fakes package

* fix imports
2023-07-17 10:21:44 +00:00
Juraci Paixão Kröhling
c4be5cd747
Tracing: Reduce the max packet size for Jaeger exporter (#71659)
Reduce the max packet size for Jaeger exporter

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
2023-07-14 16:31:50 +01:00
Emil Tullstedt
5c19272065
Slug: Use urlencoding to support non-ASCII characters (#70691) 2023-07-10 21:05:39 +02:00
Ieva
a65cb4d808
RBAC: remove simple RBAC disabled checks (#71137)
* remove simple RBAC disabled checks

* fixing tests

* remove old AC tests
2023-07-10 15:14:21 +03:00
Jo
4821175d40
Auth: Add auth.azure_ad security improvements (#912)
* security improvements id_token

* add audience validation

* add allowOrganizations

* add allowOrganizations tests and documentation

* add log warn on no configuration

* anonymize tenant id

* Apply suggestions from code review

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>

* Update docs/sources/setup-grafana/configure-security/configure-authentication/azuread/index.md

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>

* Update pkg/login/social/azuread_oauth_test.go

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>

* Update pkg/login/social/azuread_oauth_test.go

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>

* optimize key validation and add mising fields

* fix missing key_id

* lint

* Update docs/sources/setup-grafana/configure-security/configure-authentication/azuread/index.md

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>

* lint docs

---------

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
2023-06-23 09:13:38 +02:00
Bryan Boreham
c45ff94806
Tracing: supply Grafana build version (#69733)
* tracing: supply Grafana build version

Not etcd client version.

* go mod tidy
2023-06-22 11:55:30 +03:00
Andreas Deininger
95b1f3c875
Fixing typos (#70487) 2023-06-22 09:43:38 +01:00
ismail simsek
680fc85cdf
Chore: Delete unused cookie forward middleware (#70403)
Delete unused cookie forward middleware
2023-06-21 22:39:10 +03:00
Juan Cabanas
ee73d41d24
PublicDashboards: Audit table pagination (#69823) 2023-06-21 10:48:09 -03:00
Zoltán Bedi
aedcd651fa
Test: Fix windows test for SQL data sources (#69137) 2023-06-21 11:14:05 +02:00
Will Browne
a221e1d226
Plugins: Standardize Golang enum naming convention (#69449)
* standardize enum pattern

* fix up
2023-06-08 12:21:19 +02:00
Eng Zer Jun
cf1945d0c3
Tests: use t.Setenv to set env vars (#69516)
This commit replaces `os.Setenv` with `t.Setenv` in tests. The
environment variable is automatically restored to its original value
when the test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.Setenv

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-06-05 11:31:03 +02:00
Renato Monteiro
63c26e91ee
Metrics: Update Help to mention active viewers (#63384) 2023-06-01 11:56:43 +02:00
Ieva
d8b66d5c4b
RBAC: remove some IsDisabled checks (#69272)
* remove some access contorl IsDisabled() checks

* cleaning up tests

* update tests

* linting
2023-05-31 09:58:57 +01:00
Ieva
4980b64274
RBAC: Remove legacy ac from authorization middleware (#68898)
remove legacy AC fallback from RBAC middleware, and some unused auth logic
2023-05-24 09:49:42 +01:00
Ieva
900348f3d9
Chore: remove tests for legacy AC, update other tests to work with RBAC (#68895)
* remove tests for legacy AC, update other tests to work with RBAC

* update usage stat tests to use RBAC
2023-05-23 15:29:20 +01:00
Serge Zaitsev
6d8f9c5bf4
Chore: Remove opentracing and use opentelemetry instead (#67200)
* remove opentracing and use otel instead

* add various samplers for jaeger

* remove useless test that is covered in otel now

* we do not need a struct there

* remove old tests

* restore tests that parse various configurations

* check errors in tests

* Update pkg/infra/tracing/tracing_test.go

fix typo

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

* add test for both legacy and new config formats

* use named constants

---------

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2023-04-27 15:04:43 +02:00
Stephanie Hingtgen
255d8f3326
Plugins: Remove secure socks proxy feature toggle (#66611) 2023-04-18 11:11:23 -06:00
Eric Leijonmarck
15c9ced944
Revert "APIkeys: Add metrics for apikey endpoints (#66732)" (#66754)
This reverts commit c505d26430.
2023-04-18 13:05:52 +01:00
Eric Leijonmarck
c505d26430
APIkeys: Add metrics for apikey endpoints (#66732)
add metrics for apikey endpoints
2023-04-18 11:12:19 +01:00
Ryan McKinley
15b469bd12
UsageStats: Add database age and driver (#66535)
Co-authored-by: Dan Cech <dcech@grafana.com>
2023-04-17 18:27:04 -07:00
Ryan McKinley
fef490e4f8
Analytics: Add total dashboard byte size to reporting (#66425)
Co-authored-by: Dan Cech <dcech@grafana.com>
2023-04-13 21:37:03 +03:00
Michael Mandrus
5626461b3c
Caching: Refactor enterprise query caching middleware to a wire service (#65616)
* define initial service and add to wire

* update caching service interface

* add skipQueryCache header handler and update metrics query function to use it

* add caching service as a dependency to query service

* working caching impl

* propagate cache status to frontend in response

* beginning of improvements suggested by Lean - separate caching logic from query logic.

* more changes to simplify query function

* Decided to revert renaming of function

* Remove error status from cache request

* add extra documentation

* Move query caching duration metric to query package

* add a little bit of documentation

* wip: convert resource caching

* Change return type of query service QueryData to a QueryDataResponse with Headers

* update codeowners

* change X-Cache value to const

* use resource caching in endpoint handlers

* write resource headers to response even if it's not a cache hit

* fix panic caused by lack of nil check

* update unit test

* remove NONE header - shouldn't show up in OSS

* Convert everything to use the plugin middleware

* revert a few more things

* clean up unused vars

* start reverting resource caching, start to implement in plugin middleware

* revert more, fix typo

* Update caching interfaces - resource caching now has a separate cache method

* continue wiring up new resource caching conventions - still in progress

* add more safety to implementation

* remove some unused objects

* remove some code that I left in by accident

* add some comments, fix codeowners, fix duplicate registration

* fix source of panic in resource middleware

* Update client decorator test to provide an empty response object

* create tests for caching middleware

* fix unit test

* Update pkg/services/caching/service.go

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

* improve error message in error log

* quick docs update

* Remove use of mockery. Update return signature to return an explicit hit/miss bool

* create unit test for empty request context

* rename caching metrics to make it clear they pertain to caching

* Update pkg/services/pluginsintegration/clientmiddleware/caching_middleware.go

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* Add clarifying comments to cache skip middleware func

* Add comment pointing to the resource cache update call

* fix unit tests (missing dependency)

* try to fix mystery syntax error

* fix a panic

* Caching: Introduce feature toggle to caching service refactor (#66323)

* introduce new feature toggle

* hide calls to new service behind a feature flag

* remove licensing flag from toggle (misunderstood what it was for)

* fix unit tests

* rerun toggle gen

---------

Co-authored-by: Arati R. <33031346+suntala@users.noreply.github.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2023-04-12 12:30:33 -04:00
Piotr Jamróz
b68be999f7
Correlations: Add usage stats about correlations (#66021)
* Add usage stats about correlations

* Add stats.correlations.count to collected stats

* Expose grafana_stat_totals_correlations metric

* Organize imports
2023-04-11 08:53:34 +02:00
Stephanie Hingtgen
536fad5b61
Plugins: add env variables needed for the secure socks proxy in the plugins sdk (#65878) 2023-04-07 08:20:25 -06:00
Sofia Papagiannaki
988a120d6d
Search v1: Add support for inherited folder permissions if nested folders are enabled (#63275)
* Add features dependency to SQLBuilder

* Add features dependency to AccessControlDashboardPermissionFilter

* Add test for folder inheritance

* Dashboard permissions: Return recursive query

* Recursive query for inherited folders

* Modify search builder

* Adjust db.SQLBuilder

* Pass flag to SQLbuilder if CTEs are supported

* Add support for mysql < 8.0

* Add benchmarking for search with nested folders

* Set features to AlertStore

* Update pkg/infra/db/sqlbuilder.go

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>

* Set features to LibraryElementService

* SQLBuilder tests with nested folder flag set

* Apply suggestion from code review

Co-authored-by: IevaVasiljeva <ieva.vasiljeva@grafana.com>
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2023-04-06 11:16:15 +03:00
Will Browne
bff9f4c890
Plugins: Move config factory to pluginsintegration package (#65716)
* move config to pluginsintegration package

* change to all plugin toggle

* fixes

* fixes

* fix lerna

* fix test
2023-04-05 14:40:08 +02:00
Sofia Papagiannaki
caac9838d8
Build: Fix Redis/Memcached integration tests (#64298)
* Build: Fix integration cache tests

* Allow REDIS_URL with scheme

* Reduce cache integration tests timeout to 5m

* Apply suggestion from code review

* Run redis/memcached integration tests in OSS pipelines

* Change redis image
2023-04-05 11:55:55 +03:00
Alexander Weaver
fb520edd72
Alerting: Use a completely isolated context for state history writes (#64989)
* Add fresh context with timeout and same log properties, re-derive logger

* Unify timeout constants

* Move ctx after shortcut that got added through rebasing

* Unify timeouts

* Port opentracing's SpanFromContext and ContextFromSpan to the grafana tracing package

* Support both opentracing and otel variants

* Better document why we're creating a new ctx

* Add new func to FakeSpan which was added after rebase

* Support grafana-specific traceID key in both tracer implementations
2023-04-04 16:41:46 -05:00