Skip to content

Commit b52597f

Browse files
chore: made function build_span_flags as private
1 parent e5394b8 commit b52597f

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

opentelemetry-proto/CHANGELOG.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
## vNext
44

55
- **Feature**: Add span flags support for `isRemote` property in OTLP trace transformation ([#3153](https://github.com/open-telemetry/opentelemetry-rust/pull/3153))
6-
- Implemented `build_span_flags` function that sets OTLP span flags based on parent span's `isRemote` property
7-
- Updated span and link transformations to properly set flags field (0x100 for local, 0x300 for remote)
8-
- Added comprehensive tests for span flags functionality
6+
- Updated span and link transformations to properly set flags field (0x100 for local, 0x300 for remote)
7+
98
- Update proto definitions to v1.7.0.
109
- Added Rust generated protos for profiles collector. [#3077](https://github.com/open-telemetry/opentelemetry-rust/pull/3077)
1110
- **Breaking change**: package opentelemetry_proto::tonic::profiles::v1 renamed to opentelemetry_proto::tonic::profiles::v1development. [#3077](https://github.com/open-telemetry/opentelemetry-rust/pull/3077)

opentelemetry-proto/src/transform/trace.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#[cfg(feature = "gen-tonic-messages")]
22
/// Builds span flags based on the parent span's remote property.
33
/// This follows the OTLP specification for span flags.
4-
pub fn build_span_flags(parent_span_is_remote: bool, base_flags: u32) -> u32 {
4+
fn build_span_flags(parent_span_is_remote: bool, base_flags: u32) -> u32 {
55
use crate::proto::tonic::trace::v1::SpanFlags;
66
let mut flags = base_flags;
77
flags |= SpanFlags::ContextHasIsRemoteMask as u32;
@@ -54,7 +54,7 @@ pub mod tonic {
5454
trace_state: link.span_context.trace_state().header(),
5555
attributes: Attributes::from(link.attributes).0,
5656
dropped_attributes_count: link.dropped_attributes_count,
57-
flags: super::build_span_flags(
57+
flags: build_span_flags(
5858
link.span_context.is_remote(),
5959
link.span_context.trace_flags().to_u8() as u32,
6060
),
@@ -75,7 +75,7 @@ pub mod tonic {
7575
vec![]
7676
}
7777
},
78-
flags: super::build_span_flags(
78+
flags: build_span_flags(
7979
source_span.parent_span_is_remote,
8080
source_span.span_context.trace_flags().to_u8() as u32,
8181
),
@@ -137,7 +137,7 @@ pub mod tonic {
137137
vec![]
138138
}
139139
},
140-
flags: super::build_span_flags(
140+
flags: build_span_flags(
141141
source_span.parent_span_is_remote,
142142
source_span.span_context.trace_flags().to_u8() as u32,
143143
),
@@ -223,13 +223,13 @@ mod span_flags_tests {
223223

224224
#[test]
225225
fn test_build_span_flags_local_parent() {
226-
let flags = super::build_span_flags(false, 0); // is_remote = false
226+
let flags = build_span_flags(false, 0); // is_remote = false
227227
assert_eq!(flags, SpanFlags::ContextHasIsRemoteMask as u32); // 0x100
228228
}
229229

230230
#[test]
231231
fn test_build_span_flags_remote_parent() {
232-
let flags = super::build_span_flags(true, 0); // is_remote = true
232+
let flags = build_span_flags(true, 0); // is_remote = true
233233
assert_eq!(
234234
flags,
235235
(SpanFlags::ContextHasIsRemoteMask as u32) | (SpanFlags::ContextIsRemoteMask as u32)
@@ -238,13 +238,13 @@ mod span_flags_tests {
238238

239239
#[test]
240240
fn test_build_span_flags_no_parent() {
241-
let flags = super::build_span_flags(false, 0); // no parent = false
241+
let flags = build_span_flags(false, 0); // no parent = false
242242
assert_eq!(flags, SpanFlags::ContextHasIsRemoteMask as u32); // 0x100
243243
}
244244

245245
#[test]
246246
fn test_build_span_flags_preserves_base_flags() {
247-
let flags = super::build_span_flags(false, 0x01); // SAMPLED flag, local parent
247+
let flags = build_span_flags(false, 0x01); // SAMPLED flag, local parent
248248
assert_eq!(flags, 0x01 | (SpanFlags::ContextHasIsRemoteMask as u32)); // 0x101
249249
}
250250

opentelemetry-sdk/CHANGELOG.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
## vNext
44

55
- **Feature**: Add span flags support for `isRemote` property in OTLP exporter ([#3153](https://github.com/open-telemetry/opentelemetry-rust/pull/3153))
6-
- Added `parent_span_is_remote` field to `SpanData` to store parent span remote flag
7-
- Implemented `build_span_flags` function that sets OTLP span flags based on parent span's `isRemote` property
8-
- Updated span and link transformations to properly set flags field (0x100 for local, 0x300 for remote)
9-
- Added comprehensive tests for span flags functionality
6+
- Updated span and link transformations to properly set flags field (0x100 for local, 0x300 for remote)
7+
108
- TODO: Placeholder for Span processor related things
119
- *Fix* SpanProcessor::on_start is no longer called on non recording spans
1210
- **Fix**: Restore true parallel exports in the async-native `BatchSpanProcessor` by honoring `OTEL_BSP_MAX_CONCURRENT_EXPORTS` ([#2959](https://github.com/open-telemetry/opentelemetry-rust/pull/3028)). A regression in [#2685](https://github.com/open-telemetry/opentelemetry-rust/pull/2685) inadvertently awaited the `export()` future directly in `opentelemetry-sdk/src/trace/span_processor_with_async_runtime.rs` instead of spawning it on the runtime, forcing all exports to run sequentially.

0 commit comments

Comments
 (0)