Skip to content

fix: losing this context on register handler function for hapi#2540

Closed
Cheprer wants to merge 1 commit intoopen-telemetry:mainfrom
Cheprer:main
Closed

fix: losing this context on register handler function for hapi#2540
Cheprer wants to merge 1 commit intoopen-telemetry:mainfrom
Cheprer:main

Conversation

@Cheprer
Copy link
Copy Markdown

@Cheprer Cheprer commented Nov 19, 2024

Which problem is this PR solving?

  • When someone is using also a wrapper on the return function from register handler, due to wrapping by opentelemetry before it without retain the context, the following wrapper loses it.

Short description of the changes

  • Use apply to retain the this context of the original function.

@Cheprer Cheprer requested a review from a team as a code owner November 19, 2024 13:51
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Nov 19, 2024

CLA Signed


The committers listed above are authorized under a signed CLA.

@github-actions github-actions Bot added pkg:instrumentation-hapi pkg-status:unmaintained This package is unmaintained. Only bugfixes may be acceped until a new owner has been found. labels Nov 19, 2024
@github-actions
Copy link
Copy Markdown
Contributor

This package does not have an assigned component owner and is considered unmaintained. As such this package is in feature-freeze and this PR will be closed with 14 days unless a new owner or a sponsor (a member of @open-telemetry/javascript-approvers) for the feature is found. It is the responsibility of the author to find a sponsor for this feature.
Are you familiar with this package? Consider becoming a component owner.

@Cheprer
Copy link
Copy Markdown
Author

Cheprer commented Jan 2, 2025

Hi @pichlermarc can we move on with this. What is needed here please?

@pichlermarc
Copy link
Copy Markdown
Member

@Cheprer this is already fixed in the latest version AFAIK. #2625

@Cheprer
Copy link
Copy Markdown
Author

Cheprer commented Jan 15, 2025

@pichlermarc nice, shame that someone else did the same thing again, where this could be merged and fixed much sooner.

@Cheprer Cheprer closed this Jan 15, 2025
@pichlermarc
Copy link
Copy Markdown
Member

@pichlermarc nice, shame that someone else did the same thing again, where this could be merged and fixed much sooner.

Yes, you're right. I really try to do my best but I have to hande too many threads a day on GitHub and Slack - so on my end things tend to fall through the cracks especially on instrumentation packages like @opentelemetry/instrumentation-hapi that have been abandoned for a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working pkg:instrumentation-hapi pkg-status:unmaintained This package is unmaintained. Only bugfixes may be acceped until a new owner has been found.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants