grafana/pkg/infra
Giuseppe Guerra a89202eab2
Plugins: Improve instrumentation by adding metrics and tracing (#61035)
* WIP: Plugins tracing

* Trace ID middleware

* Add prometheus metrics and tracing to plugins updater

* Add TODOs

* Add instrumented http client

* Add tracing to grafana update checker

* Goimports

* Moved plugins tracing to middleware

* goimports, fix tests

* Removed X-Trace-Id header

* Fix comment in NewTracingHeaderMiddleware

* Add metrics to instrumented http client

* Add instrumented http client options

* Removed unused function

* Switch to contextual logger

* Refactoring, fix tests

* Moved InstrumentedHTTPClient and PrometheusMetrics to their own package

* Tracing middleware: handle errors

* Report span status codes when recording errors

* Add tests for tracing middleware

* Moved fakeSpan and fakeTracer to pkg/infra/tracing

* Add TestHTTPClientTracing

* Lint

* Changes after PR review

* Tests: Made "ended" in FakeSpan private, allow calling End only once

* Testing: panic in FakeSpan if span already ended

* Refactoring: Simplify Grafana updater checks

* Refactoring: Simplify plugins updater error checks and logs

* Fix wrong call to checkForUpdates -> instrumentedCheckForUpdates

* Tests: Fix wrong call to checkForUpdates -> instrumentedCheckForUpdates

* Log update checks duration, use Info log level for check succeeded logs

* Add plugin context span attributes in tracing_middleware

* Refactor prometheus metrics as httpclient middleware

* Fix call to ProvidePluginsService in plugins_test.go

* Propagate context to update checker outgoing http requests

* Plugin client tracing middleware: Removed operation name in status

* Fix tests

* Goimports tracing_middleware.go

* Goimports

* Fix imports

* Changed span name to plugins client middleware

* Add span name assertion in TestTracingMiddleware

* Removed Prometheus metrics middleware from grafana and plugins updatechecker

* Add span attributes for ds name, type, uid, panel and dashboard ids

* Fix http header reading in tracing middlewares

* Use contexthandler.FromContext, add X-Query-Group-Id

* Add test for RunStream

* Fix imports

* Changes from PR review

* TestTracingMiddleware: Changed assert to require for didPanic assertion

* Lint

* Fix imports
2023-03-28 11:01:06 +02:00
..
appcontext Chore: Fix goimports grouping in pkg/infra (#62421) 2023-01-30 08:32:25 +00:00
db Chore: Add function for detecting if the SQL driver supported CTEs (#64441) 2023-03-20 10:27:08 +02:00
filestorage Chore: skip flakey FS API tests (#62087) 2023-01-30 21:01:59 +01:00
fs Chore: Upgrade Go to 1.19.1 (#54902) 2022-09-12 12:03:49 +02:00
grn EntityStore: Rename ObjectStore to EntityStore (part 1) (#59613) 2022-11-30 13:42:42 -08:00
httpclient Plugins: Improve instrumentation by adding metrics and tracing (#61035) 2023-03-28 11:01:06 +02:00
kvstore SupportBundles: Add bundle encryption based on age (#62501) 2023-02-24 09:24:44 -06:00
localcache Migrate to Wire for dependency injection (#32289) 2021-08-25 15:11:22 +02:00
log Chore: Fix goimports grouping in pkg/infra (#62421) 2023-01-30 08:32:25 +00:00
metrics Prometheus Metrics: Add missing stat_total_teams metric (#65133) 2023-03-22 09:14:43 +01:00
network Backend: fix IPv6 address parsing erroneous (#28585) 2020-11-25 07:55:22 +01:00
process PluginsCatalog: adding error information about disabled plugins. (#39171) 2021-09-20 09:08:00 +02:00
proxy Plugins: Add sql support for the secure socks proxy (#64630) 2023-03-16 06:54:19 -06:00
remotecache remotecache: set secret service on encryptionstorage (#64849) 2023-03-15 20:19:35 +01:00
serverlock SQLStore: Fix wrong usage of xorm's insert functions in tests (#63850) 2023-03-02 13:01:36 +02:00
slugify switch from github.com/gofrs/uuid to github.com/google/uuid (#65016) 2023-03-21 06:31:29 -04:00
tracing Plugins: Improve instrumentation by adding metrics and tracing (#61035) 2023-03-28 11:01:06 +02:00
usagestats Chore: Split usagestats service (#65191) 2023-03-23 19:19:19 +02:00
x/persistentcollection Chore: Persistent collection (#56074) 2022-09-30 21:34:44 +04:00