* Add check health functions for each datasource and generic checkHealth function
* Log backend errors
* Update testDatasource function
- Remove unused testDatasource functions from pseudo datasources
* Switch datasource to extend DataSourceWithBackend
* Improve errors and responses from health endpoint
* Fix backend lint issues
* Remove unneeded frontend tests
* Remove unused/unnecessary datasource methods
* Update types
* Improve message construction
* Stubbing out checkHealth tests
* Update tests
- Remove comments
- Simplify structure
* Update log analytics health check to query data rather than retrieve workspace metadata
* Fix lint issue
* Fix frontend lint issues
* Update pkg/tsdb/azuremonitor/azuremonitor.go
Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
* Updates based on PR comments
- Don't use deprecated default workspace field
- Handle situation if no workspace is found by notifying user
- Correctly handle health responses
* Remove debug line
* Make use of defined api versions
* Remove field validation functions
* Expose errors in frontend
* Update errors and tests
* Remove instanceSettings
* Update error handling
* Improve error handling and presentation
* Update tests and correctly check error type
* Refactor AzureHealthCheckError and update tests
* Fix lint errors
Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
* 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>
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>
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>
* Add Azure Resource Graph in Azure Plugin
* fix lodash import
* Fix mock queries
* use "backend" sdk
* Address comments
* add converter for object type
* Query error should cause 400 & apply template var
* fix backend test & add documentation
* update image
* Address comments
* marshal body from map
* use interpolated query instead of raw query
* fix test
* filter out empty queries
* fix go linting problem
* use new query field language name
* improve variable tests
* add better tests for interpolate variable
Co-authored-by: joshhunt <josh@trtr.co>
Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
Azure Application Insights Analytics is no longer accessed by the edit button from within the Application Insights service. Instead, there is now an Insights Analytics option in the Service drop down.
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* azuremonitor: add support for log analytics macros
Also adds tests for the kql macros
* azuremonitor: backend implementation for Log Analytics
* azuremonitor: remove gzip header from plugin route
The Go net/http library adds an accept encoding header
for gzip automatically.
https://golang.org/src/net/http/transport.go\#L2454
So no need to specify it manually
* azuremonitor: parses log analytics time series
* azuremonitor: support for table data for Log Analytics
* azuremonitor: for log analytics switch to calling the API...
...from the backend for time series and table queries.
* azuremonitor: fix missing err check
* azuremonitor: support Azure China, Azure Gov...
for log analytics on the backend.
* azuremonitor: review fixes
* azuremonitor: rename test files folder to testdata
To follow Go conventions for test data in tests
* azuremonitor: review fixes
* azuremonitor: better error message for http requests
* azuremonitor: fix for load workspaces on config page
* azuremonitor: strict null check fixes
Co-authored-by: bergquist <carl.bergquist@gmail.com>
* Convert Azure Application Insights datasource to Go
Allows for alerting of Application Insights data source
Closes: #15153
* Fix timeGrainReset
* Default time interval for querys for alerts
* Fix a few rename related bugs
* Update readme to indicate App Insights alerting
* Fix typo and add tests to ensure migration is happening
* Address code review feedback (mostly typos and unintended changes)
* feat: AzureMonitor implements legend key on backend
To be able to remove the duplicated query logic on the
frontend, the backend code needs to implement alias
patterns for legend keys as well as allowing the default
list of allowed time grains to be overridden. Some metrics
do not support all the time grains and the auto timegrain
calculation can be incorrect if the list is not overridden.
* feat: AzureMonitor - removes duplicate query logic on frontend
* AzureMonitor small refactoring
Extracted method and tidied up the auto time grain
code.
* azuremonitor: support for auto time grains for alerting
Converts allowed timegrains into ms and saves in dashboard json.
This makes queries for alerting with an auto time grain work in
the same way as the frontend.
* chore: typings -> implicitAny count down to 3413
* azuremonitor: add more typings