Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ env_filter = "0.1"

# deps for grpc export
http = { version = "1.2", optional = true }
tonic = { version = "0.13", optional = true }
tonic = { version = "0.14", optional = true }

rand = "0.9.0"

opentelemetry = { version = "0.30", default-features = false, features = [
opentelemetry = { version = "0.31", default-features = false, features = [
"trace",
"logs",
] }
opentelemetry_sdk = { version = "0.30", default-features = false, features = [
opentelemetry_sdk = { version = "0.31", default-features = false, features = [
"trace",
"experimental_metrics_custom_reader",
"experimental_trace_batch_span_processor_with_async_runtime",
Expand All @@ -33,7 +33,7 @@ opentelemetry_sdk = { version = "0.30", default-features = false, features = [
"logs",
"spec_unstable_metrics_views"
] }
opentelemetry-otlp = { version = "0.30", default-features = false, features = [
opentelemetry-otlp = { version = "0.31", default-features = false, features = [
"trace",
"metrics",
"logs",
Expand All @@ -45,7 +45,7 @@ tokio = { version = "1.44.1", default-features = false, features = [
] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tracing-opentelemetry = "0.31"
tracing-opentelemetry = { git = "https://github.com/marc-pydantic/tracing-opentelemetry", branch = "marc/opentelemetry-0.31" }
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be easier if you move this in as a module to this crate?


thiserror = "2"

Expand All @@ -59,7 +59,7 @@ regex = "1.11.1"
async-trait = "0.1.88"
futures = { version = "0.3.31", features = ["futures-executor"] }
insta = "1.42.1"
opentelemetry_sdk = { version = "0.30", default-features = false, features = [
opentelemetry_sdk = { version = "0.31", default-features = false, features = [
"testing",
] }
regex = "1.11.1"
Expand All @@ -70,10 +70,10 @@ tokio = { version = "1.44.1", features = [
] }
ulid = "1.2.0"
wiremock = "=0.6.4"
tonic-build = "0.13"
tonic = { version = "0.13", features = ["transport"] }
prost = "0.13"
opentelemetry-proto = { version = "0.30", features = [
tonic-build = "0.14"
tonic = { version = "0.14", features = ["transport"] }
prost = "0.14"
opentelemetry-proto = { version = "0.31", features = [
"tonic",
"gen-tonic-messages",
] }
Expand Down
8 changes: 8 additions & 0 deletions src/bridges/tracing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ mod tests {
),
},
parent_span_id: 00000000000000f0,
parent_span_is_remote: false,
span_kind: Internal,
name: "root span",
start_time: SystemTime {
Expand Down Expand Up @@ -682,6 +683,7 @@ mod tests {
),
},
parent_span_id: 00000000000000f2,
parent_span_is_remote: false,
span_kind: Internal,
name: "hello world span",
start_time: SystemTime {
Expand Down Expand Up @@ -798,6 +800,7 @@ mod tests {
),
},
parent_span_id: 00000000000000f0,
parent_span_is_remote: false,
span_kind: Internal,
name: "hello world span",
start_time: SystemTime {
Expand Down Expand Up @@ -920,6 +923,7 @@ mod tests {
),
},
parent_span_id: 00000000000000f4,
parent_span_is_remote: false,
span_kind: Internal,
name: "debug span",
start_time: SystemTime {
Expand Down Expand Up @@ -1036,6 +1040,7 @@ mod tests {
),
},
parent_span_id: 00000000000000f0,
parent_span_is_remote: false,
span_kind: Internal,
name: "debug span",
start_time: SystemTime {
Expand Down Expand Up @@ -1158,6 +1163,7 @@ mod tests {
),
},
parent_span_id: 00000000000000f6,
parent_span_is_remote: false,
span_kind: Internal,
name: "debug span with explicit parent",
start_time: SystemTime {
Expand Down Expand Up @@ -1274,6 +1280,7 @@ mod tests {
),
},
parent_span_id: 00000000000000f0,
parent_span_is_remote: false,
span_kind: Internal,
name: "debug span with explicit parent",
start_time: SystemTime {
Expand Down Expand Up @@ -1396,6 +1403,7 @@ mod tests {
),
},
parent_span_id: 0000000000000000,
parent_span_is_remote: false,
span_kind: Internal,
name: "root span",
start_time: SystemTime {
Expand Down
6 changes: 4 additions & 2 deletions src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ pub struct DeterministicIdGenerator {

impl IdGenerator for DeterministicIdGenerator {
fn new_trace_id(&self) -> opentelemetry::trace::TraceId {
TraceId::from_u128(self.next_trace_id.fetch_add(1, Ordering::Relaxed).into())
let id = self.next_trace_id.fetch_add(1, Ordering::Relaxed) as u128;
TraceId::from_bytes(id.to_be_bytes())
}

fn new_span_id(&self) -> opentelemetry::trace::SpanId {
SpanId::from_u64(self.next_span_id.fetch_add(1, Ordering::Relaxed))
let id = self.next_span_id.fetch_add(1, Ordering::Relaxed);
SpanId::from_bytes(id.to_be_bytes())
}
}

Expand Down
8 changes: 8 additions & 0 deletions tests/test_basic_exports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ fn test_basic_span() {
),
},
parent_span_id: 00000000000000f0,
parent_span_is_remote: false,
span_kind: Internal,
name: "root span",
start_time: SystemTime {
Expand Down Expand Up @@ -217,6 +218,7 @@ fn test_basic_span() {
),
},
parent_span_id: 00000000000000f2,
parent_span_is_remote: false,
span_kind: Internal,
name: "hello world span",
start_time: SystemTime {
Expand Down Expand Up @@ -373,6 +375,7 @@ fn test_basic_span() {
),
},
parent_span_id: 00000000000000f0,
parent_span_is_remote: false,
span_kind: Internal,
name: "hello world span",
start_time: SystemTime {
Expand Down Expand Up @@ -535,6 +538,7 @@ fn test_basic_span() {
),
},
parent_span_id: 00000000000000f4,
parent_span_is_remote: false,
span_kind: Internal,
name: "debug span",
start_time: SystemTime {
Expand Down Expand Up @@ -671,6 +675,7 @@ fn test_basic_span() {
),
},
parent_span_id: 00000000000000f0,
parent_span_is_remote: false,
span_kind: Internal,
name: "debug span",
start_time: SystemTime {
Expand Down Expand Up @@ -813,6 +818,7 @@ fn test_basic_span() {
),
},
parent_span_id: 00000000000000f6,
parent_span_is_remote: false,
span_kind: Internal,
name: "debug span with explicit parent",
start_time: SystemTime {
Expand Down Expand Up @@ -949,6 +955,7 @@ fn test_basic_span() {
),
},
parent_span_id: 00000000000000f0,
parent_span_is_remote: false,
span_kind: Internal,
name: "debug span with explicit parent",
start_time: SystemTime {
Expand Down Expand Up @@ -1091,6 +1098,7 @@ fn test_basic_span() {
),
},
parent_span_id: 0000000000000000,
parent_span_is_remote: false,
span_kind: Internal,
name: "root span",
start_time: SystemTime {
Expand Down
6 changes: 3 additions & 3 deletions tests/test_grpc_sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ async fn test_grpc_protobuf_export() {
AnyValue {
value: Some(
StringValue(
"0.30.0",
"0.31.0",
),
),
},
Expand Down Expand Up @@ -307,7 +307,7 @@ async fn test_grpc_protobuf_export() {
],
trace_state: "",
parent_span_id: [],
flags: 1,
flags: 257,
name: "grpc_test_span",
kind: Internal,
start_time_unix_nano: 0,
Expand Down Expand Up @@ -523,7 +523,7 @@ async fn test_grpc_protobuf_export() {
AnyValue {
value: Some(
StringValue(
"0.30.0",
"0.31.0",
),
),
},
Expand Down
8 changes: 4 additions & 4 deletions tests/test_http_sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ async fn test_http_protobuf_export() {
AnyValue {
value: Some(
StringValue(
"0.30.0",
"0.31.0",
),
),
},
Expand Down Expand Up @@ -167,7 +167,7 @@ async fn test_http_protobuf_export() {
],
trace_state: "",
parent_span_id: [],
flags: 1,
flags: 257,
name: "test_span",
kind: Internal,
start_time_unix_nano: 0,
Expand Down Expand Up @@ -430,7 +430,7 @@ async fn test_http_json_export() {
AnyValue {
value: Some(
StringValue(
"0.30.0",
"0.31.0",
),
),
},
Expand Down Expand Up @@ -483,7 +483,7 @@ async fn test_http_json_export() {
],
trace_state: "",
parent_span_id: [],
flags: 1,
flags: 257,
name: "json_test_span",
kind: Internal,
start_time_unix_nano: 0,
Expand Down