Release 5.0.2 with error source fix for some downstream errors (#1980)
This PR fixes error source for 2 errors: - parsing of invalid json response should be downstream error as we expect to receive valid json from zabbix - no host found error should be downstream. We are bumping sdk that includes that fix https://github.com/grafana/grafana-plugin-sdk-go/pull/1246. As you can see - the invalid json parsing is now downstream error <img width="1498" alt="image" src="https://github.com/user-attachments/assets/88028dbe-0f73-47aa-8262-5729059ce12f" />
This commit is contained in:
@@ -117,23 +117,23 @@ func (ds *ZabbixDatasource) QueryData(ctx context.Context, req *backend.QueryDat
|
||||
query, err := ReadQuery(q)
|
||||
ds.logger.Debug("DS query", "query", q)
|
||||
if err != nil {
|
||||
res.Error = err
|
||||
res = backend.ErrorResponseWithErrorSource(err)
|
||||
} else if query.QueryType == MODE_METRICS {
|
||||
frames, err := zabbixDS.queryNumericItems(ctx, &query)
|
||||
if err != nil {
|
||||
res.Error = err
|
||||
res = backend.ErrorResponseWithErrorSource(err)
|
||||
} else {
|
||||
res.Frames = append(res.Frames, frames...)
|
||||
}
|
||||
} else if query.QueryType == MODE_ITEMID {
|
||||
frames, err := zabbixDS.queryItemIdData(ctx, &query)
|
||||
if err != nil {
|
||||
res.Error = err
|
||||
res = backend.ErrorResponseWithErrorSource(err)
|
||||
} else {
|
||||
res.Frames = append(res.Frames, frames...)
|
||||
}
|
||||
} else {
|
||||
res.Error = backend.DownstreamError(ErrNonMetricQueryNotSupported)
|
||||
res = backend.ErrorResponseWithErrorSource(backend.DownstreamError(ErrNonMetricQueryNotSupported))
|
||||
}
|
||||
qdr.Responses[q.RefID] = res
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user