[v9.3.x] Expressions: Fixes the issue showing expressions editor (#62627)

Expressions: Fixes the issue showing expressions editor (#62510)

* Use suggested value for uid

* update the snapshot

* use __expr__

* replace all -100 with __expr__

* update snapshot

* more changes

* revert redundant change

* Use expr.DatasourceUID where it's possible

* generate files

(cherry picked from commit 91221bc436)
This commit is contained in:
ismail simsek
2023-01-31 14:31:33 -05:00
committed by GitHub
parent 4d450ab910
commit ead3a002df
52 changed files with 235 additions and 224 deletions
@@ -32,7 +32,7 @@
"from": 18000,
"to": 10800
},
"datasourceUid": "-100",
"datasourceUid": "__expr__",
"model": {
"expression": "query",
"hide": false,
@@ -50,7 +50,7 @@
"from": 18000,
"to": 10800
},
"datasourceUid": "-100",
"datasourceUid": "__expr__",
"model": {
"expression": "$reduced > 10",
"hide": false,
@@ -95,7 +95,7 @@
"from": 18000,
"to": 10800
},
"datasourceUid": "-100",
"datasourceUid": "__expr__",
"model": {
"expression": "$A",
"intervalMs": 2000,
@@ -112,4 +112,4 @@
}
}
]
}
}
@@ -39,7 +39,7 @@
"from": 18000,
"to": 10800
},
"datasourceUid": "-100",
"datasourceUid": "__expr__",
"model": {
"expression": "query",
"hide": false,
@@ -57,7 +57,7 @@
"from": 18000,
"to": 10800
},
"datasourceUid": "-100",
"datasourceUid": "__expr__",
"model": {
"expression": "$reduced > 10",
"hide": false,
@@ -102,7 +102,7 @@
"from": 18000,
"to": 10800
},
"datasourceUid": "-100",
"datasourceUid": "__expr__",
"model": {
"expression": "$A",
"intervalMs": 2000,
@@ -119,4 +119,4 @@
}
}
]
}
}
@@ -98,7 +98,7 @@ content-type: application/json
"from": 18000,
"to": 10800
},
"datasourceUid": "-100",
"datasourceUid": "__expr__",
"model": {
"expression": "query",
"hide": false,
@@ -116,7 +116,7 @@ content-type: application/json
"from": 18000,
"to": 10800
},
"datasourceUid": "-100",
"datasourceUid": "__expr__",
"model": {
"expression": "$reduced > 10",
"hide": false,
@@ -184,7 +184,7 @@ content-type: application/json
"from": 18000,
"to": 10800
},
"datasourceUid": "-100",
"datasourceUid": "__expr__",
"model": {
"expression": "query",
"hide": false,
@@ -202,7 +202,7 @@ content-type: application/json
"from": 18000,
"to": 10800
},
"datasourceUid": "-100",
"datasourceUid": "__expr__",
"model": {
"expression": "$reduced > 42",
"hide": false,
@@ -283,7 +283,7 @@ Content-Type: application/json
"from": 18000,
"to": 10800
},
"datasourceUid": "-100",
"datasourceUid": "__expr__",
"model": {
"expression": "query",
"hide": false,
@@ -301,7 +301,7 @@ Content-Type: application/json
"from": 18000,
"to": 10800
},
"datasourceUid": "-100",
"datasourceUid": "__expr__",
"model": {
"expression": "$reduced > 42",
"hide": false,
@@ -317,4 +317,4 @@ Content-Type: application/json
}
}
]
}
}
@@ -9,7 +9,7 @@
"from": 18000,
"to": 10800
},
"datasourceUid": "-100",
"datasourceUid": "__expr__",
"model": {
"type": "math",
"expression": "2 + 2 > 1"
@@ -18,4 +18,4 @@
],
"now": "2021-03-11T14:50:42.218+02:00"
}
}
}
+5 -5
View File
@@ -15,7 +15,7 @@ content-type: application/json
"from": 18000,
"to": 10800
},
"datasourceUid": "-100",
"datasourceUid": "__expr__",
"model": {
"type":"math",
"expression":"1 < 2"
@@ -56,7 +56,7 @@ content-type: application/json
"from": 18000,
"to": 10800
},
"datasourceUid": "-100",
"datasourceUid": "__expr__",
"model": {
"expression": "$A",
"intervalMs": 2000,
@@ -113,7 +113,7 @@ content-type: application/json
"from": 18000,
"to": 10800
},
"datasourceUid": "-100",
"datasourceUid": "__expr__",
"model": {
"type":"math",
"expression":"1 < 2"
@@ -121,7 +121,7 @@ content-type: application/json
}
]
}
}}
}
### grafana recipient - lotex payload
POST http://admin:admin@localhost:3000/api/v1/rule/test/{{grafanaRecipient}}
@@ -129,4 +129,4 @@ content-type: application/json
{
"expr": "rate({cluster=\"us-central1\", job=\"loki-prod/loki-canary\"}[1m]) > 0"
}
}