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 elastic instrumentation #670

Merged
merged 6 commits into from
Sep 14, 2021

Conversation

ItayGibel-helios
Copy link
Contributor

Description

opentelemetry-instrumentation-elasticsearch: 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

  • 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 as a code owner September 9, 2021 12:50
@owais
Copy link
Contributor

owais commented Sep 13, 2021

This looks fine but it's a bit strange to just have a response hook without request. Let's add a request hook as well and we can merge this.

Thanks

@@ -97,17 +97,23 @@ def _instrument(self, **kwargs):
"""
tracer_provider = kwargs.get("tracer_provider")
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you update the usage docs with an example of using the request/response hooks with their function signatures?

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.

Copy link
Contributor

@lzchen lzchen left a comment

Choose a reason for hiding this comment

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

@ItayGibel-heliosphere
Updates from others aren't allowed in this PR. Can you rebase with main so we can merge this in?

@lzchen lzchen merged commit 291e508 into open-telemetry:main Sep 14, 2021
@nozik nozik deleted the elastic_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.

None yet

4 participants