67f50478d9
Loki: Refactor getting of panel/dashboard title headers as part of decoupling ( #106829 )
...
* Loki: Refactor getting of panel/dashboard title headers as part of decoupling
* Add headers to be passed to api server
* Address review comments
2025-06-18 17:41:31 +02:00
5a2cba7b01
Plugins: Forward HTTP headers to plugin streaming calls ( #101960 )
...
* forward HTTP headers to plugin streaming calls
* fixup
* fix test based on feedback
* improve test assertions
2025-03-12 10:37:07 +00:00
b7a7f2bd62
Plugins: Use handler middleware from the SDK ( #93445 )
...
updates sdk to v0.251.0
2024-09-30 16:33:15 +02:00
62d326cf04
Plugins: Add baseMiddleware support ( #87799 )
2024-05-14 16:27:40 +03:00
64e0a4282e
DataQuery: Track panel plugin id not type ( #83091 )
2024-02-21 09:38:42 +01:00
f77c831e3f
Data query: Allow logging panel plugin id when executing queries ( #81164 )
...
* Data query: Allo logging panel plugin id when executing queries
* Update tracing header middleware
* Test fix
* Add panelPluginType to query analytics
* Cleanup
2024-01-30 00:06:31 -08:00
92965578b3
CloudWatch Logs: Fix running logs queries with expressions ( #65306 )
2023-03-30 17:40:01 -04:00
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
7261c6f7cd
DataSourceWithBackend: Add queryGroupId
to find correlated/related queries ( #64587 )
...
* add `correlationId` to queries
* trace correlation id in backend
* add correlation id to loki's span
* add correlation id to query chunks
* fix test
* fix DataSourceWithBackend test
* change to `queryGroupId`
* remove empty line
* fix test in `DataSourceWithBackend`
2023-03-17 15:48:13 +01:00
0485cf34cd
Plugins: Pass through dashboard/contextual HTTP headers to plugins/datasources ( #60301 )
...
`X-Dashboard-Uid`, `X-Datasource-Uid`, `X-Grafana-Org-Id`, `X-Panel-Id` are very useful headers set
by Grafana front-end that we would like to see on the data source as
well. This is so that it would be possible to pinpoint from where slow
queries are coming in Mimir/Thanos/Cortex/etc., for example. Relevant
Mimir code lines:
0a94f26203/pkg/frontend/transport/handler.go (L182-L184)
Tested manually that with these changes the headers are visible.
2022-12-22 11:15:00 +01:00