Skip to content

Commit 2a1b03a

Browse files
mohammadVatandoostBSteffaniakcijothomaslalitb
committed
Chang timeout value to miliseconds (open-telemetry#2656)
Co-authored-by: Braden Steffaniak <[email protected]> Co-authored-by: Cijo Thomas <[email protected]> Co-authored-by: Lalit Kumar Bhasin <[email protected]>
1 parent 07a57f0 commit 2a1b03a

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

opentelemetry-otlp/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## vNext
44

5+
- The `OTEL_EXPORTER_OTLP_TIMEOUT`, `OTEL_EXPORTER_OTLP_TRACES_TIMEOUT`, `OTEL_EXPORTER_OTLP_METRICS_TIMEOUT` and `OTEL_EXPORTER_OTLP_LOGS_TIMEOUT` are changed from seconds to miliseconds.
6+
57
- *Breaking*
68

79
ExporterBuilder's build() method now Result with `ExporterBuildError` being the

opentelemetry-otlp/src/exporter/http/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl HttpExporterBuilder {
120120
.or(env::var(OTEL_EXPORTER_OTLP_TIMEOUT).ok())
121121
{
122122
Some(val) => match val.parse() {
123-
Ok(seconds) => Duration::from_secs(seconds),
123+
Ok(seconds) => Duration::from_millis(seconds),
124124
Err(_) => self.exporter_config.timeout,
125125
},
126126
None => self.exporter_config.timeout,

opentelemetry-otlp/src/exporter/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const OTEL_EXPORTER_OTLP_PROTOCOL_HTTP_JSON: &str = "http/json";
5353
/// Max waiting time for the backend to process each signal batch, defaults to 10 seconds.
5454
pub const OTEL_EXPORTER_OTLP_TIMEOUT: &str = "OTEL_EXPORTER_OTLP_TIMEOUT";
5555
/// Default max waiting time for the backend to process each signal batch.
56-
pub const OTEL_EXPORTER_OTLP_TIMEOUT_DEFAULT: u64 = 10;
56+
pub const OTEL_EXPORTER_OTLP_TIMEOUT_DEFAULT: u64 = 10000;
5757

5858
// Endpoints per protocol https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md
5959
#[cfg(feature = "grpc-tonic")]
@@ -88,7 +88,7 @@ impl Default for ExportConfig {
8888
// don't use default_endpoint(protocol) here otherwise we
8989
// won't know if user provided a value
9090
protocol,
91-
timeout: Duration::from_secs(OTEL_EXPORTER_OTLP_TIMEOUT_DEFAULT),
91+
timeout: Duration::from_millis(OTEL_EXPORTER_OTLP_TIMEOUT_DEFAULT),
9292
}
9393
}
9494
}

opentelemetry-otlp/src/exporter/tonic/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ impl TonicExporterBuilder {
206206
.or(env::var(OTEL_EXPORTER_OTLP_TIMEOUT).ok())
207207
{
208208
Some(val) => match val.parse() {
209-
Ok(seconds) => Duration::from_secs(seconds),
209+
Ok(seconds) => Duration::from_millis(seconds),
210210
Err(_) => config.timeout,
211211
},
212212
None => config.timeout,

0 commit comments

Comments
 (0)