Prometheus: Add error source to differentiate errors for api server work (#95999)

add error source to differentiate errors for api server work
This commit is contained in:
Brendan O'Handley 2024-11-07 08:59:53 -06:00 committed by GitHub
parent b2af163dc5
commit b9b5445090
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -237,6 +237,7 @@ func (s *QueryData) rangeQuery(ctx context.Context, c *client.Client, q *models.
return backend.DataResponse{
Error: err,
Status: backend.StatusBadGateway,
ErrorSource: backend.ErrorSourceDownstream,
}
}
@ -256,6 +257,7 @@ func (s *QueryData) instantQuery(ctx context.Context, c *client.Client, q *model
return backend.DataResponse{
Error: err,
Status: backend.StatusBadGateway,
ErrorSource: backend.ErrorSourceDownstream,
}
}
@ -263,6 +265,7 @@ func (s *QueryData) instantQuery(ctx context.Context, c *client.Client, q *model
if res.StatusCode != 200 && q.RefId == "__healthcheck__" {
return backend.DataResponse{
Error: errors.New(res.Status),
ErrorSource: backend.ErrorSourceDownstream,
}
}
@ -281,6 +284,7 @@ func (s *QueryData) exemplarQuery(ctx context.Context, c *client.Client, q *mode
if err != nil {
return backend.DataResponse{
Error: err,
ErrorSource: backend.ErrorSourceDownstream,
}
}