Commit Graph

67 Commits

Author SHA1 Message Date
Arve Knudsen
87c3a2b790
PluginManager: Make Plugins, Renderer and DataSources non-global (#31866)
* PluginManager: Make Plugins and DataSources non-global

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix integration tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Replace outdated command

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* DashboardService: Ensure it gets constructed with necessary parameters

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix build

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* DashboardService: Ensure it gets constructed with necessary parameters

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Remove dead code

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix test

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix test

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Remove FocusConvey

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix test

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Remove dead code

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Undo interface changes

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Backend: Move tsdbifaces.RequestHandler to plugins.DataRequestHandler

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Rename to DataSourceCount

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Consolidate dashboard interfaces into one

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix test

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix dashboard integration tests

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-03-17 16:06:10 +01:00
Arve Knudsen
b79e61656a
Introduce TSDB service (#31520)
* Introduce TSDB service

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
Co-authored-by: Will Browne <will.browne@grafana.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2021-03-08 07:02:49 +01:00
Emil Hessman
6f72ae38d5
Chore: Rewrite tsdb azuremonitor time grain test to standard library (#30089) 2021-01-06 20:16:53 +01:00
Arve Knudsen
c2cad26ca9
Chore: Disable default golangci-lint filter (#29751)
* Disable default golangci-lint filter

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Chore: Fix linter warnings

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-12-15 09:32:06 +01:00
Sebastian Poxhofer
63c8945db5
AzureMonitor: Unit MilliSeconds naming (#29399) 2020-12-02 10:09:33 +01:00
Arve Knudsen
4dd7b7a82d
Chore: Remove unused Go code (#28852)
* Chore: Remove more unused Go code

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-11-17 11:51:31 +01:00
Arve Knudsen
574553ec7b
Chore: Fix issues found by staticcheck (#28802)
* Fix linting issues

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-11-05 11:29:39 +01:00
Kyle Brandt
96e6524a7d
AzureMonitor: Support decimal (as float64) type in analytics/logs (#28480)
loss of precision but will make the response work instead of erroring
follows work already done in the ADX plugin
fixes #28278
2020-10-26 08:27:16 -04:00
Kyle Brandt
c9a5d1ad4b
AzureMonitor: pass through null values instead of 0 (#28126)
fixes #28001
2020-10-09 08:15:19 -04:00
Arve Knudsen
a078e40238
Settings: Rename constants/variables to follow Go naming standards (#28002)
* settings: Rename constants/variables to follow Go naming standards
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-10-02 15:45:45 +02:00
Jorge Vallecillo
9e3def4214
Fix typos (#27711) 2020-09-22 11:00:59 -07:00
Arve Knudsen
a5d9196a53
Chore/fix lint issues (#27704)
* Chore: Fix linting issues

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-09-22 16:22:19 +02:00
Marcus Efraimsson
e85b266f2e
Azure/Insights: Fix handling of none dimension values (#27513)
Properly handle legacy dimension values in the backend.

Fixes #27512
2020-09-10 18:21:56 +02:00
Kyle Brandt
9bab551d8b
AzureMonitor: change filterDimensions property to match what is stored (#27459)
Changes the dimensionsFilters property to dimensionsFilter in the Azure Monitor Datasource's AzureMonitor service to make what is sent to match the saved model.

Before this, the property that the backend was expecting was not available in the case of alerting, where the stored model is fetched.

This also fixes a panic when there is a dimension alias but no dimension
2020-09-08 15:12:08 -04:00
Kyle Brandt
06323b8e52
AzureMonitor: select plugin route from cloudname (#27273)
* AzureMonitor: select plugin route from cloudname
fixes #27243
2020-08-31 11:10:31 -04:00
Kyle Brandt
c724449d3d
AzureMonitor: fix panic introduced in 7.1.4 (#27113)
happens when unit was "Unspecified" and alias is being used
2020-08-21 11:37:30 -04:00
Kyle Brandt
660510084c
AzureAnalytics: Use fillmode Null with format as time series (#27054)
previously was using fillmode previous, which is not what we want here.
Also we do not have fill missing with this data source anyways
Fixes #27013
2020-08-19 10:42:54 -04:00
Kyle Brandt
f9f60c9193
AzureMonitor: map more units (#26990)
add BitsPerSecond and Seconds
2020-08-13 12:57:16 -04:00
Kyle Brandt
62b103b843
Azuremonitor: do not set unit if literal "Unspecified" (#26839)
part of #26828
2020-08-06 16:03:25 -04:00
Kyle Brandt
fb5ff6a70f
Azure: Insights metrics - do not sort if no data (#26486)
fixes #26473
2020-07-21 10:24:55 -04:00
Ryan McKinley
5d09e4539c
Azure: convert azure units to grafana units (#26429) 2020-07-20 12:29:13 -07:00
Arve Knudsen
d4e4cb4c71
Chore: Enable Go linter gocritic (#26224)
* Chore: Enable gocritic linter

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-07-16 14:39:01 +02:00
Kyle Brandt
c980f37509
Azure: Insights Analytics, fix possible panics and return error body (#26361)
missing return statements can result in panic
2020-07-15 15:55:10 -04:00
Kyle Brandt
590702c497
Azure: Handle real type nan/inf values in Log/Insights Analytics (#26342)
Before this, if the user were to divide by 0.0, "Infinity" would be returned in the result and the user would get an error: "unexpected type, expected json.Number but got string". Now these values are properly set as Inf values (and also made sure to handle NaN as well).
2020-07-15 09:39:41 -04:00
Kyle Brandt
c1ede4fc71
backend: use latest go plugin sdk (0.74.0) to sort wide frames (#26207)
This makes it so results are more stable between refreshes of data and fixes sorting issues with Azure Application Insights service as well as the two Azure Analytics services.

fixes #22937
2020-07-10 12:22:50 -04:00
Dominik Prokop
74b2c2acdc
Fix lint (#26130) 2020-07-07 16:48:25 +02:00
Kyle Brandt
9164a35240
Azure: Restore Insights Metrics alias feature (#26098)
also fix case sensitivity for azure monitor metrics
2020-07-07 08:42:03 -04:00
Arve Knudsen
41d432b5ae
Chore: Enable whitespace linter (#25903)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-07-06 20:17:28 +02:00
Kyle Brandt
4be56cde0d
Azure: Multiple dimension support for Azure Monitor Service (#25947)
Azure Monitor (metrics) support multiple dimensions instead of just one.

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2020-06-30 16:26:46 -04:00
Kyle Brandt
72fa5ccb7b
Azure/Log Analytics: return more error information (#25937)
When there is an error message in the HTTP response, this copies that error so it is relayed to the user by being shown in the frontend.

This also makes it so when there is an error the interpolated query string (ExecutedQueryString) is returned so users can see it in the query inspector.
2020-06-30 16:05:53 -04:00
Arve Knudsen
3651a8e976
Chore: Disable scopelint for tests (#25923)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-30 11:05:47 +02:00
Kyle Brandt
aee5626dca
chore: fix lint breaking build (#25916) 2020-06-29 19:45:50 -04:00
Kyle Brandt
d243cd9421
Backend: use latest Go plugin sdk (#25909)
* backend: use latest go plugin sdk which fixes #25287
* update for Frame.Meta.Custom SDK changes
2020-06-29 16:20:24 -04:00
Kyle Brandt
9a8289b6d9
Azure: Application Insights metrics to Frame and support multiple query dimensions (#25849)
- The Application Insights Service now returns a dataframe. This is a "wide" formatted dataframe with a single time index.
- Multiple "group by" dimensions may now be selected instead of just one with Application Insights.
- Some types are copied / slightly altered from the Azure Go SDK but that SDK is not imported at this time.

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2020-06-29 15:06:58 -04:00
Arve Knudsen
d1e6214a4a
Chore: Enable scopelint Go linter (#25896)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-29 17:04:38 +02:00
Kyle Brandt
bc9c53389c
Azure: Split insights into two services (#25410)
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>
2020-06-25 12:48:18 -04:00
Marcus Efraimsson
58cefe73ee
Datasources: Handle URL parsing error (#25742)
Adds handling of error returned from URL parsing.

Fixes #25714
2020-06-22 16:34:40 +02:00
Marcus Efraimsson
53175a41c9
Make tsdb dataframes response able to carry encoded/decoded frames (#25454)
Make tsdb dataframes response able to carry encoded and/or decoded frames
2020-06-09 13:13:06 +02:00
Kyle Brandt
ef61a64c46
Azure Monitor: Log Analytics response to data frames (#25297)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2020-06-05 12:32:10 -04:00
Kyle Brandt
376a9d35e4
Azure Monitor: Change response to be dataframes (#25123)
note: This is just Azure Monitor within the Azure Monitor datasource (not insights, insights analytics, or log analytics yet).

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2020-06-01 12:37:39 -04:00
Kyle Brandt
fcb9dcb0b8
AzureMonitor: Types for front-end queries (#24937) 2020-05-26 10:52:33 -04:00
Daniel Lee
64046e9a27
azuremonitor: limit macro regex to known macros (#24528) 2020-05-12 08:52:42 +02:00
Daniel Lee
67ed579647
azuremonitor: Deep linking from Log Analytic queries to the Azure Portal (#24417)
* azuremonitor: add gzipped and base64 encoded query to metadata

for Azure Log Analytic query responses

* azure monitor: add fields to metadata for log analytics

* azuremonitor: correction to text in query editor

* azuremonitor: adds subscription id to result metadata

* azuremonitor: build deep link url for Log Analytics

Most of the information needed for building the url
comes from the backend. The workspace friendly name
and the resource group that the workspace belongs
to are fetched in a separate API call. This call is
cached otherwise there would be a workspaces call
per query on the dashboard.

* docs: azure log analytics deep linking

* Apply suggestions from code review

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* docs: fixing review comments for azure monitor

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-05-11 19:11:03 +02:00
Mario Trangoni
5116420e9a
Fix misspell issues (#23905)
* Fix misspell issues

See,
$ golangci-lint run --timeout 10m --disable-all -E misspell ./...

Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>

* Fix codespell issues

See,
$ codespell -S './.git*' -L 'uint,thru,pres,unknwon,serie,referer,uptodate,durationm'

Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>

* ci please?

* non-empty commit - ci?

* Trigger build

Co-authored-by: bergquist <carl.bergquist@gmail.com>
Co-authored-by: Kyle Brandt <kyle@grafana.com>
2020-04-29 21:37:21 +02:00
Daniel Lee
c05049f395
azuremonitor: port azure log analytics query function to the backend (#23839)
* 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>
2020-04-27 17:43:02 +02:00
Daniel Lee
b0488259d0
azuremonitor: fix for app insights azure china url (#23877) 2020-04-27 12:40:11 +02:00
Chad Nedzlek
0e7c746a87
Azure Monitor: Fix app insights source to allow for new __timeFrom and __timeTo (#21879)
* Fix app insights source to allow for new __timeFrom and __timeTo

* Try fixing the switch
2020-03-10 00:55:41 +01:00
Arve Knudsen
bb50fc5965
pkg/tsdb: Check errors (#19837)
Check errors in pkg/tsdb.
2019-10-22 16:16:53 +02:00
Chad Nedzlek
20faef8de5 AzureMonitor: Alerting for Azure Application Insights (#19381)
* 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)
2019-10-07 14:18:14 +02:00
Sriramajeyam
50acb37a17 Azure Monitor : Query more than 10 dimensions ( Fixes #17230 ) (#18693)
* Fixes #17230

* Resovled comments

* Resolved comments

* spell fix
2019-10-03 16:53:11 +02:00