grafana/pkg/plugins
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
..
backendplugin Plugins: Improve client instrumentation by adding cancelled status and logging errors (#65099) 2023-03-21 13:42:57 +01:00
codegen extract kindsys to external library (#64562) 2023-03-15 12:04:28 -04:00
config Plugins: Introduce plugin package specific logger (#62204) 2023-02-28 16:10:27 +01:00
log Plugins: Introduce plugin package specific logger (#62204) 2023-02-28 16:10:27 +01:00
manager Plugins: Improve instrumentation by adding metrics and tracing (#61035) 2023-03-28 11:01:06 +02:00
pfs Schema: Remove exclusion for timeseries and update imports (#65242) 2023-03-23 02:14:54 +02:00
plugindef Docs: Update plugin.json docs and schema (#64297) 2023-03-10 15:07:35 +01:00
pluginscdn Plugins: Fix plugins CDN not working when plugins are not in domain's root path (#63202) 2023-02-24 14:28:13 +01:00
repo Plugins: Introduce plugin package specific logger (#62204) 2023-02-28 16:10:27 +01:00
storage Plugins: Introduce plugin package specific logger (#62204) 2023-02-28 16:10:27 +01:00
errors.go Plugins: Use error plane for api/ds/query (#54750) 2022-09-14 18:19:57 +02:00
fakes.go NavTree: Make it possible to configure where in nav tree plugins live (#55484) 2022-09-28 08:29:35 +02:00
ifaces.go Plugins: Refactor loader + finder to support multiple sourcing methods (#64735) 2023-03-20 14:35:49 +01:00
localfiles.go Plugins: Refactor loader + finder to support multiple sourcing methods (#64735) 2023-03-20 14:35:49 +01:00
models.go Plugins: Extend panel menu with links from plugins (#63089) 2023-03-02 15:42:00 +01:00
plugins.go Plugins: Refactor loader + finder to support multiple sourcing methods (#64735) 2023-03-20 14:35:49 +01:00