diff --git a/Cargo.toml b/Cargo.toml index df17634..6df02be 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,7 +49,7 @@ normpath = "1.5.0" octocrab = "*" opentelemetry = { version = "*", features = ["metrics"] } opentelemetry_sdk = { version = "*", features = ["metrics", "rt-tokio", "experimental_metrics_periodicreader_with_async_runtime"] } -opentelemetry-otlp = { version = "*", features = ["metrics", "reqwest", "http-proto", "reqwest-client", "reqwest-rustls", "grpc-tonic"] } +opentelemetry-otlp = { version = "*", default-features = false, features = ["trace", "metrics", "internal-logs", "http-proto", "reqwest-blocking-client", "reqwest-rustls", "grpc-tonic"] } path-clean = "1.0.1" pathdiff = "0.2.3" petgraph = "0.8.3" diff --git a/src/shared/capture.rs b/src/shared/capture.rs index c0f1b89..0f572fb 100644 --- a/src/shared/capture.rs +++ b/src/shared/capture.rs @@ -244,7 +244,7 @@ impl OutputCapture { output.extend(stdout); output.extend(stderr); - output.sort_by(|(l_time, _), (r_time, _)| l_time.cmp(r_time)); + output.sort_by_key(|(l_time, _)| *l_time); let text: String = output .iter() @@ -260,7 +260,7 @@ impl OutputCapture { output.extend(self.stdout.iter()); output.extend(self.stderr.iter()); - output.sort_by(|(l_time, _), (r_time, _)| l_time.cmp(r_time)); + output.sort_by_key(|(l_time, _)| *l_time); output .iter() diff --git a/src/shared/logging.rs b/src/shared/logging.rs index 362ac09..5bb9f2c 100644 --- a/src/shared/logging.rs +++ b/src/shared/logging.rs @@ -416,3 +416,37 @@ impl LoggingOpts { } } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn http_span_exporter_builds_with_default_client() { + let url = Url::parse("http://127.0.0.1:4318/v1/traces").unwrap(); + let result = SpanExporter::builder() + .with_http() + .with_endpoint(url) + .with_timeout(Duration::from_secs(3)) + .build(); + assert!( + result.is_ok(), + "HTTP span exporter must build; got {:?}", + result.err() + ); + } + + #[test] + fn http_metric_exporter_builds_with_default_client() { + let result = MetricExporter::builder() + .with_http() + .with_endpoint("http://127.0.0.1:4318") + .with_timeout(Duration::from_secs(3)) + .build(); + assert!( + result.is_ok(), + "HTTP metric exporter must build; got {:?}", + result.err() + ); + } +}