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

feat(instrumentation-grpc): monitor error events with events.errorMonitor #5369

Merged
merged 3 commits into from
Jan 27, 2025

Conversation

cjihrig
Copy link
Contributor

@cjihrig cjihrig commented Jan 24, 2025

Which problem is this PR solving?

errorMonitor should be preferred over 'error' event handlers for instrumentation, as the latter alters the behavior of the server if the user has not added their own error handler.

Related to: #225. I'm not sure we want to close the issue based on this fix.

Short description of the changes

This commit updates instrumentation-grpc to utilize errorMonitor instead of 'error' event handlers. This makes the instrumented server behave more like it would without instrumentation.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

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

  • Ran the test suite.
  • Added an additional assertion for the 'error' handler count of the server.

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added

@cjihrig cjihrig requested a review from a team as a code owner January 24, 2025 16:12
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.62%. Comparing base (bdc0e3a) to head (4523d54).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5369   +/-   ##
=======================================
  Coverage   94.62%   94.62%           
=======================================
  Files         318      318           
  Lines        8038     8039    +1     
  Branches     1687     1687           
=======================================
+ Hits         7606     7607    +1     
  Misses        432      432           
Files with missing lines Coverage Δ
...ntelemetry-instrumentation-grpc/src/serverUtils.ts 90.66% <100.00%> (+0.12%) ⬆️

Copy link
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

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

overall looks good, one comment.

experimental/CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

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

thanks 👍

@pichlermarc pichlermarc added this pull request to the merge queue Jan 27, 2025
@pichlermarc
Copy link
Member

I think this closes #225, it looks like all occurrences of this are now addressed. 👍

Merged via the queue into open-telemetry:main with commit c43f172 Jan 27, 2025
15 checks passed
@pichlermarc
Copy link
Member

I think this closes #225, it looks like all occurrences of this are now addressed. 👍

Ah nevermind, it's also talking about side-effects from other places. Let's leave it open for now.

@cjihrig cjihrig deleted the grpc-err-monitor branch January 27, 2025 16:10
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.

2 participants