Closed zoell closed 5 years ago
Could you please provide some more information? I need the portion of the script that you use to access the raw document please.
I actually did not do anything on the scripting side yet.
I have a json document in elasticsearch and I want to get the last one, for that I configured the metrics this way:
In other panels it seems to be working.
I have never used elastic search before. I'm not sure how the dataSource is structured. could you please look into the browser's console and post any error output. Maybe it tells which module casts the error. My own code has no single .toString() in it.
Here it is: /public/app/features/panel/metrics_panel_ctrl.ts:177
Panel data error: TypeError: Cannot read property 'toString' of undefined
at t.isMsResolutionNeeded (time_series2.ts:362)
at new t (time_series2.ts:165)
at SVGCtrl.seriesHandler (svg_ctrl.js:260)
at Array.map (<anonymous>)
at SVGCtrl.onDataReceived (svg_ctrl.js:249)
at s.emit (index.js:129)
at t.emit (config.html:4)
at SVGCtrl.t.handleQueryResult (metrics_panel_ctrl.ts:303)
at angular.js:17051
at angular.js:17095
The referenced row is:
const timeFromInterpolated = this.templateSrv.replace(this.panel.timeFrom, this.panel.scopedVars);
And here is the raw query and response:
{
"xhrStatus": "complete",
"request": {
"method": "POST",
"url": "api/datasources/proxy/14/_msearch",
"data": "{\"search_type\":\"query_then_fetch\",\"ignore_unavailable\":true,\"index\":[\"MY-INDEX-NAME-2018\"],\"max_concurrent_shard_requests\":256}\n{\"size\":1,\"query\":{\"bool\":{\"filter\":[{\"range\":{\"Timestamp\":{\"gte\":\"1545292800000\",\"lte\":\"1545328799999\",\"format\":\"epoch_millis\"}}},{\"query_string\":{\"analyze_wildcard\":true,\"query\":\"*\"}}]}},\"sort\":{\"Timestamp\":{\"order\":\"desc\",\"unmapped_type\":\"boolean\"}},\"script_fields\":{},\"docvalue_fields\":[\"Timestamp\"]}\n"
},
"response": {
"responses": [
{
"took": 0,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 2,
"max_score": null,
"hits": [
{
"_index": "MY-INDEX-NAME-2018",
"_type": "myIndexType",
"_id": "R5nJy2cBXDM0sPvEudx1",
"_score": null,
"_source": { ...HERE IS MY JSON DOCUMENT... },
"fields": {
"Timestamp": [
"2018-12-20T13:24:14.223Z"
]
},
"sort": [
1545312254223
]
}
]
},
"status": 200
}
]
}
}
Any way you can see from these what could be the problem?
thx for the info. As I expected the elastic search raw data is neither used as time series nor table data - ok that was a no brainer :) currently I only differenciate between those two datasources
I would have to investigate that further. Is there any open elastic search endpoint around where I can get free test data?
Where can I send you a test ES access?
MarcusCalidus[at]gmail.com
OK sent you the details.
Fixed in this Pull Request: https://github.com/grafana/grafana-plugin-repository/pull/353
@zoell please let me know if the applied fix worked - so we can close the issue. Thank you
Yes it works. Thanks!
I am trying to use raw document metrics with elasticsearch but receiving the mentioned error.
Is this not compatible with raw document?