Skip to content

refactor: prioritize code-based config over env vars in OTLP exporter #2827

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

Merged
merged 5 commits into from
Mar 19, 2025

Conversation

gruebel
Copy link
Member

@gruebel gruebel commented Mar 18, 2025

Fixes #2818

Changes

  • had to make the timeout field optional to properly handle code-based config prefer over env vars

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 18, 2025 17:04
@gruebel gruebel changed the title prioritize code-based config over env vars in OTLP exporter refactor: prioritize code-based config over env vars in OTLP exporter Mar 18, 2025
Copy link

codecov bot commented Mar 18, 2025

Codecov Report

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

Project coverage is 80.4%. Comparing base (06abe3d) to head (5f101d8).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
opentelemetry-otlp/src/exporter/mod.rs 96.1% 2 Missing ⚠️
opentelemetry-otlp/src/exporter/tonic/mod.rs 97.6% 2 Missing ⚠️
opentelemetry-otlp/src/exporter/http/mod.rs 97.6% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #2827     +/-   ##
=======================================
+ Coverage   79.7%   80.4%   +0.7%     
=======================================
  Files        124     124             
  Lines      23297   23390     +93     
=======================================
+ Hits       18578   18828    +250     
+ Misses      4719    4562    -157     

☔ 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.

Copy link
Member

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

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

LGTM. Please modify the docs and changelog with more details so users will have easier time navigating this change.

@cijothomas
Copy link
Member

cijothomas commented Mar 18, 2025

@TommyCpp Could you also double check? I recall you suggested to add a with_env_preference like API to make it easier to migrate, but it looks like we preferred ENV over code only for OTLP, and that too for 2-3 settings, which make me think there is no need of additional convenience method to revert to old behavior.. Please take a look and see if this is okay!

@cijothomas cijothomas merged commit 5be79c7 into open-telemetry:main Mar 19, 2025
23 checks passed
@gruebel gruebel deleted the otlp-exporter-env branch March 19, 2025 21:39
@TommyCpp
Copy link
Contributor

but it looks like we preferred ENV over code only for OTLP, and that too for 2-3 settings, which make me think there is no need of additional convenience method to revert to old behavior

Yep if that's the case then sounds fair to me

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.

OTLP Exporter - treat code based config as final
4 participants