-
Notifications
You must be signed in to change notification settings - Fork 542
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
gRPC instrumentation not checking for suppress_instrumentation in context #476
Comments
I faced this issue on calling Cloud Trace API in gRPC via opentelemetry-exporter-gcp-trace==1.0.0rc0. I didn't faced the issue when I just used |
Hi! I would like to pick this up, but are there any good starting references for me to look at? |
@NickSulistio |
The client side has been implemented by #559 |
Before going to actual implementation, I want to make the clarification in the server side checking.
Here the propagator is initiated by the client side so once the server side receives the key in the header. It will suppress the instrumentation.
For the server side, I am thinking of how we can make the method-based suppress. def SimpleMethod(self, request, context):
token = context.attach(
set_context_value(_SUPPRESS_INSTRUMENTATION_KEY, True)
)
try:
return Response(
server_id=request.client_id, response_data=request.request_data,
)
finally:
context.detach(token) This will not work because the instrumentation happens from the interceptor. Before setting up the key, the instrumentation has been started. I wonder which way the instrumentor should follow 🤔 . I am not 100% sure about this and the proposed behavior. |
opentelemetry-instrumentation-grpc
is not checking for the specialsuppress_instrumentation
context key before creating spans. This causes a recursion loop and stack overflow if you useSimpleSpanProcessor
and a gRPC based exporter (like OTLP or Cloud Monitoring).Describe your environment
opentelemetry-instrumentation-grpc
0.20b0Steps to reproduce
Using
SimpleSpanProcessor
and OTLP exporterWhat is the expected behavior?
Spans should not be created while
suppress_instrumentation
is in contextWhat is the actual behavior?
Spans get created and it create noise or causes stack overflow
The text was updated successfully, but these errors were encountered: