Skip to content
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

Update gRPC server status code to span status code mapping #1756

Closed
srikanthccv opened this issue Apr 15, 2023 · 6 comments · Fixed by #2019
Closed

Update gRPC server status code to span status code mapping #1756

srikanthccv opened this issue Apr 15, 2023 · 6 comments · Fixed by #2019
Assignees
Labels
good first issue Good for newcomers gRPC help wanted Extra attention is needed instrumentation

Comments

@srikanthccv
Copy link
Member

Spec ref: open-telemetry/opentelemetry-specification#3333

@neomatrix3
Copy link

Hello @srikanthccv I would like to contribute to this project

@srikanthccv
Copy link
Member Author

This is already taken. You can find other good-first-issues not assigned to anybody here https://github.com/open-telemetry/opentelemetry-python-contrib/issues?q=is%3Aopen+label%3A%22good+first+issue%22+no%3Aassignee

@neomatrix3
Copy link

thanks

@FilipNikolovski
Copy link
Contributor

Any movement on this issue? Would be happy to help here.

@chenikabukes chenikabukes removed their assignment Sep 25, 2023
@ccorbacho
Copy link

For anyone picking this up (as I've been reviewing the same issue in the Java implementation) -

The problem in Python land is in the handling of grpc.RpcError when it gets thrown:
https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_client.py#L154

https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_client.py#L212

As per the upstream docs, anything that doesn't return OK will throw RpcError():
https://grpc.github.io/grpc/python/grpc.html#grpc-exceptions

However, rather than just treating that as an error, as the code currently does, we need to be checking the status first, and then decide if that status is actually one we should mark the span as error or not (e.g. NOT_FOUND should not mark the span as an error).

@FilipNikolovski
Copy link
Contributor

@srikanthccv I'd be happy to pick this up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers gRPC help wanted Extra attention is needed instrumentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants