You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This only happens when trailing_metadata is passed as an argument to context.abort.
What is the expected behavior?
Running the server without opentelemetry, the (expected) error from running the client is:
grpc.aio._call.AioRpcError: <AioRpcError of RPC that terminated with:
status = StatusCode.ABORTED
details = "This is the actual error message"
debug_error_string = "UNKNOWN:Error received from peer {grpc_message:"This is the actual error message", grpc_status:10, created_time:"2023-11-16T15:09:03.552303+00:00"}"
>
When running the server under opentelemetry-instrument, I expect the same output as when it is run without OTEL.
What is the actual behavior?
Instead, an exception is still raised but the underlying code, details, and trailing_metadata are missing. This makes any nuanced error handling on the client side impossible.
grpc.aio._call.AioRpcError: <AioRpcError of RPC that terminated with:
status = StatusCode.UNKNOWN
details = "Unexpected <class 'TypeError'>: _OpenTelemetryServicerContext.abort() got an unexpected keyword argument 'trailing_metadata'"
debug_error_string = "UNKNOWN:Error received from peer {created_time:"2023-11-16T15:30:02.017999+00:00", grpc_status:2, grpc_message:"Unexpected <class \'TypeError\'>: _OpenTelemetryServicerContext.abort() got an unexpected keyword argument \'trailing_metadata\'"}"
>
Describe your environment
Python: 3.12.0
opentelemetry-distro[otlp]==0.42b0
opentelemetry-instrumentation-grpc==0.42b0
grpcio==1.59.2
Steps to reproduce
Full replication can be found here.
server.py
:This server is just adopted from the grpc examples. The helloworld protobuf artefacts can be found there.
For a client, the
async_greeter_client.py
from grpc examples can be used.This only happens when
trailing_metadata
is passed as an argument tocontext.abort
.What is the expected behavior?
Running the server without opentelemetry, the (expected) error from running the client is:
When running the server under
opentelemetry-instrument
, I expect the same output as when it is run without OTEL.What is the actual behavior?
Instead, an exception is still raised but the underlying code, details, and trailing_metadata are missing. This makes any nuanced error handling on the client side impossible.
Additional context
The
abort
method forgrpc.ServicerContext
andgrpc.aio.ServicerContext
is different. It's unclear why. The AIO instrumentation re-uses the_OpenTelemetryServicerContext
from the non-async server instrumentation which is how this bug snuck in, despite there being a test in place for the abort.The text was updated successfully, but these errors were encountered: