-
Notifications
You must be signed in to change notification settings - Fork 641
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
Add gRPC filter #1241
Add gRPC filter #1241
Conversation
Thanks for the PR! In the issue you mentioned environment variables, something like |
@aabmass thanks for the comment! though I tried to look up the implementation for |
Ok, now I understand this part is referencing the environment variable via |
@aabmass ok, I added the support in the global interceptor to exclude requests to services specified in |
Tox is the right way. They are probably flakes or maybe an already known issue. I'll review this PR :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, sorry for all the comments
...tation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/__init__.py
Outdated
Show resolved
Hide resolved
...tation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/__init__.py
Outdated
Show resolved
Hide resolved
...tation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/__init__.py
Outdated
Show resolved
Hide resolved
...tation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/__init__.py
Outdated
Show resolved
Hide resolved
...tation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/__init__.py
Outdated
Show resolved
Hide resolved
...pentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/filters/__init__.py
Outdated
Show resolved
Hide resolved
...pentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/filters/__init__.py
Outdated
Show resolved
Hide resolved
...pentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/filters/__init__.py
Outdated
Show resolved
Hide resolved
...pentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/filters/__init__.py
Outdated
Show resolved
Hide resolved
...tation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/__init__.py
Outdated
Show resolved
Hide resolved
…emetry/instrumentation/grpc/__init__.py Co-authored-by: Aaron Abbott <[email protected]>
…emetry/instrumentation/grpc/__init__.py Co-authored-by: Aaron Abbott <[email protected]>
…emetry/instrumentation/grpc/__init__.py Co-authored-by: Aaron Abbott <[email protected]>
…emetry/instrumentation/grpc/__init__.py Co-authored-by: Aaron Abbott <[email protected]>
…emetry/instrumentation/grpc/filters/__init__.py Co-authored-by: Aaron Abbott <[email protected]>
…emetry/instrumentation/grpc/filters/__init__.py Co-authored-by: Aaron Abbott <[email protected]>
…emetry/instrumentation/grpc/filters/__init__.py Co-authored-by: Aaron Abbott <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adopted the suggestions and replied to the questions
...pentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/filters/__init__.py
Outdated
Show resolved
Hide resolved
...pentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/filters/__init__.py
Outdated
Show resolved
Hide resolved
...pentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/filters/__init__.py
Outdated
Show resolved
Hide resolved
...tation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/__init__.py
Outdated
Show resolved
Hide resolved
I updated the option name from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
...pentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/filters/__init__.py
Outdated
Show resolved
Hide resolved
...pentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/filters/__init__.py
Outdated
Show resolved
Hide resolved
...pentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/filters/__init__.py
Outdated
Show resolved
Hide resolved
...pentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/filters/__init__.py
Outdated
Show resolved
Hide resolved
...pentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/filters/__init__.py
Outdated
Show resolved
Hide resolved
class _HandlerCallDetails( | ||
collections.namedtuple( | ||
"_HanlderCallDetails", | ||
( | ||
"method", | ||
"invocation_metadata", | ||
), | ||
), | ||
grpc.HandlerCallDetails, | ||
): | ||
pass | ||
|
||
|
||
class _UnaryClientInfo( | ||
collections.namedtuple("_UnaryClientInfo", ("full_method", "timeout")) | ||
): | ||
pass | ||
|
||
|
||
class _StreamClientInfo( | ||
collections.namedtuple( | ||
"_StreamClientInfo", | ||
("full_method", "is_client_stream", "is_server_stream", "timeout"), | ||
) | ||
): | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit I would prefer @dataclass
over named tuple
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either collections.namedtuple
or @dataclass
is fine. I aligned the implementation here with the one in grpcext
.
Description
This pull request adds section to handle filter in client and server interceptors and provides pre-defined commonly used filters.
Fixes #373
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.