opentelemetry-rust icon indicating copy to clipboard operation
opentelemetry-rust copied to clipboard

SpanBuilder should not allow with_span_id and with_trace_id

Open cijothomas opened this issue 9 months ago • 2 comments

https://github.com/open-telemetry/opentelemetry-rust/blob/main/opentelemetry/src/trace/tracer.rs#L242 with_trace_id, with_span_id allow one to specify TraceId,SpanId via builder - there is no such capability in the specification. If user want to control traceid,spanid generation, they can use IdGenerator.

This must be removed from SpanBuilder

cijothomas avatar Mar 03 '25 19:03 cijothomas

@cijothomas I'd like to take this issue (and perhaps similar issues you put above). Do I need to do anything other than just removing those methods from SpanBuilder? It looks that there is no place which uses them in this repository.

Shunpoco avatar Mar 06 '25 20:03 Shunpoco

This may have same dependency breaking issue as https://github.com/open-telemetry/opentelemetry-rust/issues/2753#issuecomment-2704824718

If tracing-opentelemetry is not dependent on this, then we can remove it right away.

cijothomas avatar Mar 07 '25 22:03 cijothomas