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

[chore][exporter/debug] refactor code to make independent from Logging exporter #9922

Conversation

andrzej-stencel
Copy link
Member

This PR is the first part of this draft PR: #9298.

This refactoring is needed to implement [exporter/debug] change behavior of "normal" verbosity to be different from "basic" #7806. I want to change the behavior of the Debug exporter, but leave the behavior of the Logging exporter unchanged.

Link to tracking Issue:

@andrzej-stencel andrzej-stencel requested review from a team and mx-psi April 9, 2024 09:10
@andrzej-stencel andrzej-stencel added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Apr 9, 2024
Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

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

No strong opinion here, but an alternative solution could be to have a custom unmarshal function/initialization logic for the logging exporter that overrides verbosity from normal to set to basic. That way we would avoid duplicating code. Any thoughts on which one is better?

@andrzej-stencel
Copy link
Member Author

andrzej-stencel commented Apr 9, 2024

No strong opinion here, but an alternative solution could be to have a custom unmarshal function/initialization logic for the logging exporter that overrides verbosity from normal to set to basic. That way we would avoid duplicating code. Any thoughts on which one is better?

I feel we might have more changes coming to the Debug exporter that I don't think we want to introduce to the Logging exporter - see e.g. #9372, #9921. I would leave the Logging exporter's code unchanged, waiting to be removed in September 2024, and only work with the Debug exporter's code.

In other words, I don't think we will have changes we want to introduce to both Logging and Debug exporter - I'd rather leave the Logging exporter's behavior unchanged until it's removed. Because of this, the code duplication resulting from the split is not a problem. It's actually expected, as the Debug exporter is expected to evolve without the Logging exporter being touched.

@mx-psi
Copy link
Member

mx-psi commented Apr 9, 2024

Okay, I am fine with this approach, let me ping @open-telemetry/collector-approvers just in case someone has a different opinion and we can wait a couple days to give people time to voice their opinion

Copy link

codecov bot commented Apr 15, 2024

Codecov Report

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

Project coverage is 91.72%. Comparing base (e8cabb7) to head (d653bc1).

Files Patch % Lines
exporter/debugexporter/exporter.go 63.41% 15 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9922      +/-   ##
==========================================
- Coverage   91.79%   91.72%   -0.08%     
==========================================
  Files         358      359       +1     
  Lines       16576    16634      +58     
==========================================
+ Hits        15216    15257      +41     
- Misses       1037     1053      +16     
- Partials      323      324       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

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

Will merge tomorrow unless somebody else objects

@mx-psi mx-psi merged commit 9731ea3 into open-telemetry:main Apr 16, 2024
48 of 49 checks passed
@github-actions github-actions bot added this to the next release milestone Apr 16, 2024
@andrzej-stencel andrzej-stencel deleted the debug-exporter-refactor-split-logging-debug-exporter branch April 16, 2024 10:39
codeboten pushed a commit that referenced this pull request May 28, 2024
steves-canva pushed a commit to Canva/opentelemetry-collector that referenced this pull request Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants