Skip to content

Conversation

@mohammadVatandoost
Copy link
Contributor

Fixes #2591

@mohammadVatandoost mohammadVatandoost requested a review from a team as a code owner February 12, 2025 21:27
@codecov
Copy link

codecov bot commented Feb 12, 2025

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 79.1%. Comparing base (2997c4b) to head (1479571).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
opentelemetry-otlp/src/exporter/http/mod.rs 0.0% 1 Missing ⚠️
opentelemetry-otlp/src/exporter/tonic/mod.rs 0.0% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #2656   +/-   ##
=====================================
  Coverage   79.1%   79.1%           
=====================================
  Files        122     122           
  Lines      22562   22562           
=====================================
  Hits       17861   17861           
  Misses      4701    4701           

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

@lalitb
Copy link
Member

lalitb commented Feb 12, 2025

@mohammadVatandoost Thanks for working on this. Can you have a look into the OTLP flow, as I believe there are some other places too. E,g

.or(env::var(OTEL_EXPORTER_OTLP_TIMEOUT).ok())
{
Some(val) => match val.parse() {
Ok(seconds) => Duration::from_secs(seconds),
.

Also update the changelog as this is a breaking change.

@cijothomas @TommyCpp - Should this be a breaking change for environment variables, or should we maintain the current behavior (interpreting values as seconds) while adding support for specifying milliseconds? For example, 10 (also 10s) would remain 10 seconds, while 10ms would represent 10 milliseconds. Currently, the compile-time configuration with_timeout accepts a duration argument, allowing both seconds and milliseconds. Trying to avoid breaking changes unless it significantly complicates the implementation, or adds to confusion.

@cijothomas
Copy link
Member

@cijothomas @TommyCpp - Should this be a breaking change for environment variables, or should we maintain the current behavior (interpreting values as seconds) while adding support for specifying milliseconds? For example, 10 (also 10s) would remain 10 seconds, while 10ms would represent 10 milliseconds. Currently, the compile-time configuration with_timeout accepts a duration argument, allowing both seconds and milliseconds. Trying to avoid breaking changes unless it significantly complicates the implementation, or adds to confusion.

I think this is a bug and must be treated accordingly. Every bug can be thought of as a breaking change for those users who were relying on the buggy behavior 🤣 !
10s,10ms are not something covered by spec, and won't be respected by other languages, so its best to stick with ENV variables spec as-is.

I agree that the impact is bad - A user who had set 1 sec timeout now instantly only has a 1 ms timeout (that can easily be hit much more frequently) with the upgrade - this can be covered in change-log and migration guide as a key warning/bullet point.

Happy to hear other thoughts.

@TommyCpp
Copy link
Contributor

10 (also 10s) would remain 10 seconds, while 10ms would represent 10 milliseconds

probably additional complexity we don't want to maintain on the long term. I think we should just note it in breaking changes

@mohammadVatandoost
Copy link
Contributor Author

mohammadVatandoost commented Feb 13, 2025

OTEL_EXPORTER_OTLP_TIMEOUT

@lalitb The line, you mentioned, is already changed. Please see the PR file changes.
I couldn't find any other places than these three files. Please let me know if i miss sth.

Changelog is updated

@lalitb
Copy link
Member

lalitb commented Feb 13, 2025

I couldn't find any other places than these three files. Please let me know if i miss sth.

I think it looks good.

Changelog is updated

The changes also affects signal specific env-variables - OTEL_EXPORTER_OTLP_TRACES_TIMEOUT OTEL_EXPORTER_OTLP_METRICS_TIMEOUT OTEL_EXPORTER_OTLP_LOGS_TIMEOUT. Please mention them too in the changelog.

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.

LGTM, nit comment on updating changelog with signal specific env-variables.

@mohammadVatandoost
Copy link
Contributor Author

The changes also affects signal specific env-variables - OTEL_EXPORTER_OTLP_TRACES_TIMEOUT OTEL_EXPORTER_OTLP_METRICS_TIMEOUT OTEL_EXPORTER_OTLP_LOGS_TIMEOUT. Please mention them too in the changelog.

Added

@cijothomas cijothomas merged commit 41b381a into open-telemetry:main Feb 14, 2025
20 of 21 checks passed
cijothomas added a commit to cijothomas/opentelemetry-rust that referenced this pull request Feb 18, 2025
Co-authored-by: Braden Steffaniak <[email protected]>
Co-authored-by: Cijo Thomas <[email protected]>
Co-authored-by: Lalit Kumar Bhasin <[email protected]>
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.

Timeout and delay values from ENV variable should be in milliseconds

6 participants