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>
This commit is contained in:
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"tables": [
|
||||
{
|
||||
"name": "PrimaryResult",
|
||||
"columns": [
|
||||
{
|
||||
"name": "timestamp",
|
||||
"type": "datetime"
|
||||
},
|
||||
{
|
||||
"name": "value",
|
||||
"type": "int"
|
||||
}
|
||||
],
|
||||
"rows": [
|
||||
[
|
||||
"2019-09-13T01:02:03.456789Z",
|
||||
1
|
||||
],
|
||||
[
|
||||
"2019-09-13T02:02:03.456789Z",
|
||||
2
|
||||
]
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"tables": [
|
||||
{
|
||||
"name": "PrimaryResult",
|
||||
"columns": [
|
||||
{
|
||||
"name": "timestamp",
|
||||
"type": "datetime"
|
||||
},
|
||||
{
|
||||
"name": "value",
|
||||
"type": "int"
|
||||
},
|
||||
{
|
||||
"name": "segment",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"rows": [
|
||||
[
|
||||
"2019-09-13T01:02:03.456789Z",
|
||||
1,
|
||||
"a"
|
||||
],
|
||||
[
|
||||
"2019-09-13T01:02:03.456789Z",
|
||||
2,
|
||||
"b"
|
||||
],
|
||||
[
|
||||
"2019-09-14T02:02:03.456789Z",
|
||||
3,
|
||||
"a"
|
||||
],
|
||||
[
|
||||
"2019-09-14T02:02:03.456789Z",
|
||||
4,
|
||||
"b"
|
||||
]
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"value": {
|
||||
"start": "2019-09-13T01:02:03.456789Z",
|
||||
"end": "2019-09-13T02:02:03.456789Z",
|
||||
"value": {
|
||||
"avg": 1.2
|
||||
}
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"value": {
|
||||
"start": "2019-09-13T01:02:03.456789Z",
|
||||
"end": "2019-09-13T03:02:03.456789Z",
|
||||
"interval": "PT1H",
|
||||
"segments": [
|
||||
{
|
||||
"start": "2019-09-13T01:02:03.456789Z",
|
||||
"end": "2019-09-13T02:02:03.456789Z",
|
||||
"value": {
|
||||
"avg": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"start": "2019-09-13T02:02:03.456789Z",
|
||||
"end": "2019-09-13T03:02:03.456789Z",
|
||||
"value": {
|
||||
"avg": 2
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"value": {
|
||||
"start": "2019-09-13T01:02:03.456789Z",
|
||||
"end": "2019-09-13T03:02:03.456789Z",
|
||||
"interval": "PT1H",
|
||||
"segments": [
|
||||
{
|
||||
"start": "2019-09-13T01:02:03.456789Z",
|
||||
"end": "2019-09-13T02:02:03.456789Z",
|
||||
"segments": [
|
||||
{
|
||||
"value": {
|
||||
"avg": 1
|
||||
},
|
||||
"blob": "a"
|
||||
},
|
||||
{
|
||||
"value": {
|
||||
"avg": 3
|
||||
},
|
||||
"blob": "b"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"start": "2019-09-13T02:02:03.456789Z",
|
||||
"end": "2019-09-13T03:02:03.456789Z",
|
||||
"segments": [
|
||||
{
|
||||
"value": {
|
||||
"avg": 2
|
||||
},
|
||||
"blob": "a"
|
||||
},
|
||||
{
|
||||
"value": {
|
||||
"avg": 4
|
||||
},
|
||||
"blob": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user