Mark grpc data source timeouts as cancelled queries (#100573)

* Set up to reproduce issue locally

* add check for deadline exceeded

* Revert "Set up to reproduce issue locally"

This reverts commit d8d9b354ca.

* Trigger build

---------

Co-authored-by: Will Browne <will.browne@grafana.com>
This commit is contained in:
Ivana Huckova 2025-02-13 13:40:53 +01:00 committed by GitHub
parent 1c7a758127
commit a69fac6e16
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -35,7 +35,7 @@ func RequestStatusFromError(err error) RequestStatus {
status = RequestStatusError
if errors.Is(err, context.Canceled) {
status = RequestStatusCancelled
} else if s, ok := grpcstatus.FromError(err); ok && s.Code() == grpccodes.Canceled {
} else if s, ok := grpcstatus.FromError(err); ok && s.Code() == grpccodes.Canceled || s.Code() == grpccodes.DeadlineExceeded {
status = RequestStatusCancelled
}
}