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

Respect suppress instrumentation key in gRPC client #559

Merged

Conversation

RyanSiu1995
Copy link
Contributor

Description

Make gRPC client instrumentor respect _SUPPRESS_INSTRUMENTATION_KEY

Fixes # (issue)
#476

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

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

  • Unit Test added

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this projects
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@RyanSiu1995 RyanSiu1995 requested review from a team, codeboten and srikanthccv and removed request for a team July 1, 2021 07:21
@RyanSiu1995 RyanSiu1995 force-pushed the respect-suppress_instrumentation branch from 05889c6 to b0e315f Compare July 1, 2021 23:09
@@ -122,6 +123,9 @@ def _start_guarded_span(self, *args, **kwargs):
return _GuardedSpan(self._start_span(*args, **kwargs))

def intercept_unary(self, request, metadata, client_info, invoker):
if context.get_value(_SUPPRESS_INSTRUMENTATION_KEY):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this functionality need to be added to the server interceptor too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From all the implementations under contrib repo,
_SUPPRESS_INSTRUMENTATION_KEY is mainly used under the client side instead of server side.
So, I did not implement the server side at first place.
My preference is first to make sure the client side works as expected.
Then, we can investigate the server side implementation later on.
I want to make each PR only containing a single feature.

Copy link
Member

@aabmass aabmass Jul 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should definitely be done for the server side as well if you get a chance 😃

@RyanSiu1995 do you mind commenting on #476 so I can assign it to you?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RyanSiu1995
Would you like to contribute that in a separate PR as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will!

@lzchen lzchen requested a review from aabmass July 9, 2021 15:38
Copy link
Member

@aabmass aabmass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution!

@@ -122,6 +123,9 @@ def _start_guarded_span(self, *args, **kwargs):
return _GuardedSpan(self._start_span(*args, **kwargs))

def intercept_unary(self, request, metadata, client_info, invoker):
if context.get_value(_SUPPRESS_INSTRUMENTATION_KEY):
Copy link
Member

@aabmass aabmass Jul 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should definitely be done for the server side as well if you get a chance 😃

@RyanSiu1995 do you mind commenting on #476 so I can assign it to you?

@RyanSiu1995
Copy link
Contributor Author

Thank you for the contribution!

Yes, sure! I will open up the change in server instrumentor really soon.

@codeboten
Copy link
Contributor

@RyanSiu1995 please resolve the conflicts and we can get this merged, thanks!

@RyanSiu1995
Copy link
Contributor Author

@codeboten Done and done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants