* update with sdk
* do sql
* fix core plugins
* fix proxy settings
* bump SDK version
* tidy
* enable pdc for test
* add codeowners
* bump dep
* go mod tidy
* bump SDK
* make create call consistent with update and delete
* send multiple targets to graphite and correlate the responses with the requests
* make create call consistent with update and delete
* send multiple targets to graphite and correlate the responses with the requests
* Revert "make create call consistent with update and delete"
This reverts commit 26b6463bd6.
* refactor query -> target parsing and fix unit tests
* add additional validations and more unit tests
* change error statement to warn
This commit extends graphite QueryData() instrumentation to include in
the traces information about possible errors.
I've added an attribute about the graphite response code as well as
records for errors if there are any.
* chore: remove all remaining uses of golang.org/x/net/context
This PR finishes the work started in #47532, replacing all calls to that package with the stdlib context and using http.NewRequestWithContext to include the context where necessary.
Bonus: small formatting fixes to goimports in these files.
closes#44178
* tweak: use context.Background in favor of TODO for tests
* Separate Tracer interface to TracerService and Tracer
* Fix lint
* Fix:Make it possible to start spans for both opentracing and opentelemetry in ds proxy
* Add span methods, use span interface for rest of tracing
* Fix logs in tracing
* Fix tests that are related to tracing
* Fix resourcepermissions test
* Fix some tests
* Fix more tests
* Add TracingService to wire cli runner
* Remove GlobalTracer from bus
* Renaming test function
* Remove GlobalTracer from TSDB
* Replace GlobalTracer in api
* Adjust tests to the InitializeForTests func
* Remove GlobalTracer from services
* Remove GlobalTracer
* Remove bus.NewTest
* Remove Tracer interface
* Add InitializeForBus
* Simplify tests
* Clean up tests
* Rename TracerService to Tracer
* Update pkg/middleware/request_tracing.go
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
* Initialize tracer before passing it to SQLStore initialization in commands
* Remove tests for opentracing
* Set span attributes correctly, remove unnecessary trace initiliazation form test
* Add tracer instance to newSQLStore
* Fix changes due to rebase
* Add modified tracing middleware test
* Fix opentracing implementation tags
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Refactor usage of legacy data contracts. Moves legacy data contracts
to pkg/tsdb/legacydata package.
Refactor pkg/expr to be a proper service/dependency that can be provided
to wire to remove some unneeded dependencies to SSE in ngalert and other places.
Refactor pkg/expr to not use the legacydata,RequestHandler and use
backend.QueryDataHandler instead.
Fixes#30144
Co-authored-by: dsotirakis <sotirakis.dim@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
Co-authored-by: spinillos <selenepinillos@gmail.com>
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
Co-authored-by: Leonard Gram <leo@xlson.com>
* Convert tag values returned as numbers to string
This is a bug in Graphite <= 1.1.7. Since 1.1.8 all values are converted to strings.
* Simplify type conversions
* Fix linting errors
* Use Dataframes and extract tags from response
* Fix timestamp conversion
* Add tests for data frame conversion
* Add missing RefID and simplify returning an error
* draft dataframe/sdk convertion for graphite
* intermedia
* modify init because registration failed
* Allocate memory for each data point value
* Remove redundant memory aliasing
* Remove redundant new line
* Sort imports
* Simplify returning nil values
* fix lint
* remove unused jsondata
* add checks on query length
* remove basic auth from request
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
Uses new httpclient package from grafana-plugin-sdk-go introduced
via grafana/grafana-plugin-sdk-go#328.
Replaces the GetHTTPClient, GetTransport, GetTLSConfig methods defined
on DataSource model.
Longer-term the goal is to migrate core HTTP backend data sources to use the
SDK contracts and using httpclient.Provider for creating HTTP clients and such.
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Changes the time value of the response to be milliseconds, which I think is like the other data sources I have seen.
Also if it sees the timerange values as numbers, assumes they are unixMS (and come from expressions, or our new backend.TimeRange type). When this timerange is used, the request is sent to graphite with from and until as epoch timestamps
* Store passwords in secureJsonData
* Revert unnecessary refactors
* Fix for nil jsonSecureData value
* Remove copied encryption code from migration
* Fix wrong field reference
* Remove migration and provisioning changes
* Use password getters in datasource proxy
* Refactor password handling in datasource configs
* Add provisioning warnings
* Update documentation
* Remove migration command, moved to separate PR
* Remove unused code
* Set the upgrade version
* Remove unused code
* Remove double reference
I found this article benchmarking Replace vs Regexp,
https://medium.com/codezillas/golang-replace-vs-regexp-de4e48482f53
See,
$ gometalinter --vendor --deadline 10m --disable-all --enable=megacheck ./...
pkg/tsdb/graphite/graphite.go:167:28⚠️ regular expression does not contain any meta characters (SA6004) (megacheck)
pkg/tsdb/graphite/graphite.go:172:28⚠️ regular expression does not contain any meta characters (SA6004) (megacheck)