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

refactor: re-export tracing for internal-logs #2867

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

gruebel
Copy link
Member

@gruebel gruebel commented Mar 26, 2025

Changes

  • also no need anymore to exclude tracing from machete

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@gruebel gruebel requested a review from a team as a code owner March 26, 2025 22:00
Copy link

codecov bot commented Mar 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.1%. Comparing base (99cb67d) to head (62685f0).

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #2867   +/-   ##
=====================================
  Coverage   81.1%   81.1%           
=====================================
  Files        124     124           
  Lines      23927   23927           
=====================================
  Hits       19410   19410           
  Misses      4517    4517           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@@ -44,7 +44,7 @@ zpages = ["trace"]
testing = ["opentelemetry/testing"]

# add ons
internal-logs = ["tracing"]
internal-logs = []
Copy link
Contributor

Choose a reason for hiding this comment

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

So there doesn't seem to be any mention of internal-logs anywhere in the crate. Why is there such a feature here?

Copy link
Member

Choose a reason for hiding this comment

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

The "internal-logs" feature is used by internal logging macros defined in the "opentelemetry" crate. These macros expand at compile time, injecting the corresponding logging code into crates that use them and so this feature needs to be defined in those crates too. Ideally, it would be good if this can be avoided, while still allowing individual crates to independently enable or disable logging.

Copy link
Contributor

Choose a reason for hiding this comment

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

@lalitb I know exactly what the feature does in the opentelemetry crate, but the fact that it has no dependencies here and is not referenced in code makes me think that it’s not needed in this crate.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the configuration is/was actually incorrect, it should include the reference to the identically named feature in the opentelemetry crate.

Copy link
Member

Choose a reason for hiding this comment

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

@bantonsson i believe it is being referenced indirectly here

#[doc(hidden)]
pub mod _private {
#[cfg(feature = "internal-logs")]
pub use tracing; // re-export
Copy link
Member

Choose a reason for hiding this comment

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

should this expose entire tracing module or selected components we care about?

Copy link
Member Author

Choose a reason for hiding this comment

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

I exported the macros we actually use now. at the end we can always change it. it is not meant to be used directly by someone else than us.

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.

4 participants