Skip to content

Commit

Permalink
feature: expose SimpleSpanProcessor::new
Browse files Browse the repository at this point in the history
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 open-telemetry#2060
  • Loading branch information
demurgos committed Sep 16, 2024
1 parent 7ab5e0f commit 1e099bc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion opentelemetry-sdk/src/trace/span_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ pub struct SimpleSpanProcessor {
}

impl SimpleSpanProcessor {
pub(crate) fn new(exporter: Box<dyn SpanExporter>) -> Self {
/// Create a new [SimpleSpanProcessor] using the provided exporter.
pub fn new(exporter: Box<dyn SpanExporter>) -> Self {
Self {
exporter: Mutex::new(exporter),
}
Expand Down

0 comments on commit 1e099bc

Please sign in to comment.