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

grpc aioserver context the code getting #1475

Open
ezinall opened this issue Dec 5, 2022 · 1 comment
Open

grpc aioserver context the code getting #1475

ezinall opened this issue Dec 5, 2022 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed instrumentation

Comments

@ezinall
Copy link

ezinall commented Dec 5, 2022

Describe your environment Describe any aspect of your environment relevant to the problem, including your Python version, platform, version numbers of installed dependencies, information about your cloud hosting provider, etc. If you're reporting a problem with a specific version of a library in this repo, please check whether the problem has been fixed on main.

Steps to reproduce
Make grpc aio server interceptor
Try to get status code from context in interceptor

What is the expected behavior?
https://grpc.github.io/grpc/python/grpc.html?highlight=servicercontext#grpc.ServicerContext.code
Get the code by context.code()

What is the actual behavior?
TypeError: 'StatusCode' object is not callable

Additional context
class opentelemetry.instrumentation.grpc._server._OpenTelemetryServicerContext doesn't have code method but have code preperty.
And _OpenTelemetryServicerContext inherits grpc.ServicerContext instead of grpc.aio.ServicerContext

@ezinall ezinall added the bug Something isn't working label Dec 5, 2022
@ezinall ezinall changed the title aioserver context the code getting grpc aioserver context the code getting Dec 5, 2022
@srikanthccv srikanthccv added help wanted Extra attention is needed instrumentation labels Dec 7, 2022
@cookiefission
Copy link
Contributor

I think the behaviour of code was fixed in #1578 .

There is an arity issue with abort for the AIO servicer context which is probably caused by the inheritance mismatch mentioned here. I'll raise a separate issue for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed instrumentation
Projects
None yet
Development

No branches or pull requests

3 participants