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

[API] Return NoopLogRecord from NoopLogger #2668

Merged
merged 5 commits into from
May 16, 2024

Conversation

marcalff
Copy link
Member

Fixes #2656

Based on PR contribution #2662 from @yurishkuro

Changes

Please provide a brief description of the changes here.

NoopLogger was incorrectly returning nullptr, causing segfaults in client code. After this change it returns a dummy no-op log record.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@yurishkuro
Copy link
Member

Based on PR contribution #2662 from @yurishkuro

Nit: I personally don't care but when you have new contributors (e.g. someone just starting in oss) I always try to preserve their own commits, e.g. by branching off of their branch, so that they get proper credit as contributors. E.g. GitHub shows all authors:
image

@marcalff
Copy link
Member Author

marcalff commented May 14, 2024

Based on PR contribution #2662 from @yurishkuro

Nit: I personally don't care but when you have new contributors (e.g. someone just starting in oss) I always try to preserve their own commits, e.g. by branching off of their branch, so that they get proper credit as contributors.

Good point, I need to improve my github skills to do that.

Now that 2662 is closed, the branch is deleted so I can't reopen it to use it.

@yurishkuro Feel like submitting a 1 line change using the web interface, to get the git credits fixed ?

@marcalff marcalff marked this pull request as ready for review May 14, 2024 19:03
@marcalff marcalff requested a review from a team May 14, 2024 19:03
@marcalff marcalff added the pr:do-not-merge This PR is not ready to be merged. label May 14, 2024
@marcalff
Copy link
Member Author

Do not merge label, waiting for additional commit.

Ready for review.

@marcalff marcalff added the pr:please-review This PR is ready for review label May 14, 2024
@yurishkuro
Copy link
Member

Feel like submitting a 1 line change using the web interface, to get the git credits fixed ?

no it's fine, like I said, I don't care, it was more of a general comment on a nicer way of accepting contributions.

@marcalff
Copy link
Member Author

Feel like submitting a 1 line change using the web interface, to get the git credits fixed ?

no it's fine, like I said, I don't care, it was more of a general comment on a nicer way of accepting contributions.

Thanks. Point taken.

@marcalff marcalff removed the pr:do-not-merge This PR is not ready to be merged. label May 14, 2024
@marcalff
Copy link
Member Author

To add to change set upon merge:

Co-authored-by: Yuri Shkuro <[email protected]>

Copy link

codecov bot commented May 15, 2024

Codecov Report

Attention: Patch coverage is 64.28571% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 87.59%. Comparing base (497eaf4) to head (75ec527).
Report is 63 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2668      +/-   ##
==========================================
+ Coverage   87.12%   87.59%   +0.47%     
==========================================
  Files         200      188      -12     
  Lines        6109     5847     -262     
==========================================
- Hits         5322     5121     -201     
+ Misses        787      726      -61     
Files Coverage Δ
api/include/opentelemetry/logs/event_logger.h 90.91% <ø> (-1.39%) ⬇️
api/include/opentelemetry/logs/logger.h 63.89% <ø> (-0.69%) ⬇️
sdk/src/logs/logger.cc 80.56% <ø> (+1.61%) ⬆️
api/include/opentelemetry/logs/noop.h 77.78% <64.29%> (-0.79%) ⬇️

... and 55 files with indirect coverage changes

Copy link
Member

@lalitb lalitb left a comment

Choose a reason for hiding this comment

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

For - #2668 (comment)

I see a perf concern here if the SDK is not configured.

@yurishkuro
Copy link
Member

I see a perf concern here if the SDK is not configured.

I'll take perf concern over segfault. Right now the noop implementation is simply not usable.

@lalitb
Copy link
Member

lalitb commented May 16, 2024

I'll take perf concern over segfault. Right now the noop implementation is simply not usable.

Yes segfault was indeed a bug to be fixed. The fix is unfortunately adding a perf overhead for instrumented libraries when the logging is not enabled, which is not good. Not an issue with this PR, more of the constraint added by the design. I will create a tracking issue for this to be handled separately.

@marcalff marcalff merged commit 9c767df into open-telemetry:main May 16, 2024
49 checks passed
@marcalff marcalff deleted the fix_noop_logger_2656 branch June 3, 2024 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:please-review This PR is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[API] NoopLogger causes segfault
4 participants