Loki: Fix nil pointer in api.go (#78727)

This commit is contained in:
Sven Grossmann 2023-11-28 11:48:23 +01:00 committed by GitHub
parent 6e0a06e52a
commit 777d119a80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -213,7 +213,7 @@ func (api *LokiAPI) DataQuery(ctx context.Context, query lokiQuery, responseOpts
if res.Error != nil {
span.RecordError(res.Error)
span.SetStatus(codes.Error, err.Error())
span.SetStatus(codes.Error, res.Error.Error())
instrumentation.UpdatePluginParsingResponseDurationSeconds(ctx, time.Since(start), "error")
api.log.Error("Error parsing response from loki", "error", res.Error, "metricDataplane", responseOpts.metricDataplane, "duration", time.Since(start), "stage", stageParseResponse)
return nil, res.Error