-
Notifications
You must be signed in to change notification settings - Fork 979
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cancelled status code not reported in the gRPC server metrics #5109
Comments
Observing the behavior of cancel, it seems the status code doesn't change even if the request is canceled. So, I'm inclined to add |
It works for me, cancellations in webflux are defined using |
With the soluction provided, it creates a new event with status cancelled but it could be useful to add the cancel information to the GrpcServerObservationContext which is used to retrieve the timer metric. The same behavior is resolved in webflux adding a boolean at ServerRequestObservationContext |
You mean you simply want this info added to the context even if it is not used here so that you can create an Or do you want the instrumentation also add a low cardinality key-value about the fact of the cancellation (that can also mean removing the event)? Either case, could you create a new issue and explain what you want and how you want to use this information? I think right now you can hack this: it's not great but you can create an |
I think that both would be helpful. On the one hand, we want to differentiate that the timer metric generated has been cancelled. And on the other hand, we have a custom And yes, at least in our case, the event would have no sense.
Perfect!
I will explore it, thanks for the suggestion! |
@jonatan-ivanov I have just created the following issue #5301 |
Hi,
cancelled status codes are not reported in the gRPC server metrics, metrics in these cases are reported without the tag status code because
GrpcServerObservationContext
is not updated with the cancelled. For us it's important the gRPC server metric give us info of the status codes, and this could be improved for example modifying theonCancel
method of theObservationGrpcServerCallListener
before running the stop operation, something like this:I have created a demo to reproduce easily cancelleds, the service has a delay of 5 seconds to give time to the client to cancel the request, you could make the call using postman or a simple grpc client with a deadline lower than 5 seconds.
Thanks for your time.
The text was updated successfully, but these errors were encountered: