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

adding response_hook to redis instrumentor #669

Merged
merged 3 commits into from
Sep 14, 2021

Conversation

ItayGibel-helios
Copy link
Contributor

Description

opentelemetry-instrumentation-redis: added response_hook callback passed as an argument to the instrument method, enabling the users to add data from the response to the span attributes

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

  • test_response_hook - a new unit test testing the hook activation

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 project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@ItayGibel-helios ItayGibel-helios requested a review from a team September 9, 2021 10:53
)
return func(*args, **kwargs)
def _instrument(
tracer, response_hook: _ResponseHookT = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Should there be a request_hook callback as well? A callable that is executed before the request is made, similar to the hooks in http instrumentaitons.

@@ -41,8 +41,8 @@
API
---
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add an example usage of the hooks in the docstrings?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

@lzchen lzchen merged commit db636a4 into open-telemetry:main Sep 14, 2021
@nozik nozik deleted the redis_response_hook branch November 7, 2021 15:13
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