grafana/pkg
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
..
api Plugins: Improve instrumentation by adding metrics and tracing (#61035) 2023-03-28 11:01:06 +02:00
build CI: Add PrereleaseBucket field in versions.go (#64519) 2023-03-09 16:00:38 +02:00
bus Chore: Fix goimports grouping in other backend platform packages (#62422) 2023-01-30 08:26:42 +00:00
cmd Chore: Unite wire graphs for cli and server (#61143) 2023-03-17 16:36:39 +01:00
codegen Docs: Add Default column to generated schema docs (#64550) 2023-03-22 18:42:28 +01:00
components Loki: Push support for multi-tenancy mode (#60866) 2023-01-23 16:24:22 +01:00
cuectx extract kindsys to external library (#64562) 2023-03-15 12:04:28 -04:00
events Alerting: Update rules version when folder title is updated (#53013) 2022-08-01 19:28:38 -04:00
expr CloudWatch Logs: Revert "Queries in an expression should run synchronously (#64443)" (#65036) 2023-03-20 15:54:30 +01:00
extensions Deps: Replace go-jose v2 with go-jose v3 (#64228) 2023-03-06 15:12:51 +01:00
ifaces/gcsifaces Chore: Upgrade Go to 1.19.1 (#54902) 2022-09-12 12:03:49 +02:00
infra Plugins: Improve instrumentation by adding metrics and tracing (#61035) 2023-03-28 11:01:06 +02:00
kinds Chore: Update times in dashboards (#65179) 2023-03-22 15:57:44 +01:00
kindsysreport Chore: Fix times in schemas (#64906) 2023-03-21 10:42:19 +01:00
login Auth: Fix orgrole picker disabled if isSynced user (#64033) 2023-03-22 17:41:59 +00:00
middleware Plugins: Migrate licensing and access control to pkg/services/pluginsintegration package (#65258) 2023-03-27 11:15:37 +02:00
mocks/mock_gcsifaces Chore: Fix goimports grouping in other backend platform packages (#62422) 2023-01-30 08:26:42 +00:00
models Auth: Add feature flag to move token rotation to client (#65060) 2023-03-23 14:39:04 +01:00
modules Chore: Add initial support for deployment modes (#63992) 2023-03-06 14:06:52 -05:00
plugins Plugins: Improve instrumentation by adding metrics and tracing (#61035) 2023-03-28 11:01:06 +02:00
registry extract kindsys to external library (#64562) 2023-03-15 12:04:28 -04:00
server Chore: Split usagestats service (#65191) 2023-03-23 19:19:19 +02:00
services Plugins: Improve instrumentation by adding metrics and tracing (#61035) 2023-03-28 11:01:06 +02:00
setting Auth: Fix orgrole picker disabled if isSynced user (#64033) 2023-03-22 17:41:59 +00:00
tests Alerting: introduce AlertQuery in definitions package (#63825) 2023-03-27 11:55:13 -04:00
tsdb Plugins: Add cloudwatch support with the secure socks proxy (#65303) 2023-03-27 10:00:37 -06:00
util Database: Don't sleep 10ms before every request (#64832) 2023-03-27 11:17:05 +02:00
web Context: add better error message when it panics loading a template (#65219) 2023-03-22 11:40:00 -08:00
README.md Chore: Move all backend contribution documents to a single directory (#61140) 2023-01-11 11:16:52 +01:00
ruleguard.rules.go Chore: update all +build statements (#38782) 2021-09-01 17:38:56 +03:00

This directory contains the code for the Grafana backend.

The contributor documentation for Grafana's backend is in /contribute/backend/README.md.