Timur Olzhabayev
116088c722
Chore: Making versioncheck url rely on config instead of being hardcoded ( #85855 )
...
* Making versioncheck url rely on config instead of being hardcoded
* Update pkg/services/updatechecker/plugins.go
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
* making the names a bit more generic and using url.url library
* fixing tests
* fixing linting
---------
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2024-04-11 12:04:53 +02: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
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
Denis Limarev
4d8287b319
Performance: add preallocation for some slice/map ( #57860 )
...
This change preallocates slices and maps where the size of the data is known before the object is created.
Co-authored-by: Joe Blubaugh <joe.blubaugh@grafana.com>
2022-11-22 20:24:36 +08:00
Jo
062d255124
Handle ioutil deprecations ( #53526 )
...
* replace ioutil.ReadFile -> os.ReadFile
* replace ioutil.ReadAll -> io.ReadAll
* replace ioutil.TempFile -> os.CreateTemp
* replace ioutil.NopCloser -> io.NopCloser
* replace ioutil.WriteFile -> os.WriteFile
* replace ioutil.TempDir -> os.MkdirTemp
* replace ioutil.Discard -> io.Discard
2022-08-10 15:37:51 +02:00
Will Browne
f3c1448b57
Analytics: Enable grafana and plugin update checks to be operated independently ( #46352 )
...
* add separate cfg for controlling plugin update checks
* https
* add specific version note to docs
* pr feedback
* fixup
2022-04-06 10:50:21 +02:00
Will Browne
76603b93d6
Plugins: Refactor Grafana and Plugin version update checkers ( #44529 )
...
* refactor
* rework plugin update checking
* make smarter
* simplify
* fix linter issue
* make use of mutex
* apply feedback to simplify
* format imports
* fix tests
2022-01-31 16:06:16 +01:00