Skip to content

Commit 1e099bc

Browse files
committed
feature: expose SimpleSpanProcessor::new
This commit update the visibility of the method `SimpleSpanProcessor::new` from `pub(crate)` to `pub`. This enables consumers to create `SimpleSpanProcessor` values for use with `trace::provider::Builder::with_span_processor`. In particular, this fixes a consistency issue: the `BatchSpanProcessor` struct may already be built thanks to its `pub` builder. With this change, both processors in this repo may be built manually. Closes #2060
1 parent 7ab5e0f commit 1e099bc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

opentelemetry-sdk/src/trace/span_processor.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ pub struct SimpleSpanProcessor {
109109
}
110110

111111
impl SimpleSpanProcessor {
112-
pub(crate) fn new(exporter: Box<dyn SpanExporter>) -> Self {
112+
/// Create a new [SimpleSpanProcessor] using the provided exporter.
113+
pub fn new(exporter: Box<dyn SpanExporter>) -> Self {
113114
Self {
114115
exporter: Mutex::new(exporter),
115116
}

0 commit comments

Comments
 (0)