Skip to content

Commit

Permalink
Merge branch 'main' into versioned-tracer
Browse files Browse the repository at this point in the history
  • Loading branch information
jtescher committed Dec 23, 2021
2 parents 1a504ef + ec40cd4 commit bda6a15
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 35 deletions.
14 changes: 0 additions & 14 deletions opentelemetry/src/global/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,6 @@ impl trace::Tracer for BoxedTracer {
/// which is not possible if it takes generic type parameters.
type Span = BoxedSpan;

/// Returns a span with an inactive `SpanContext`. Used by functions that
/// need to return a default span like `get_active_span` if no span is present.
fn invalid(&self) -> Self::Span {
BoxedSpan(self.0.invalid_boxed())
}

/// Starts a new `Span`.
///
/// Each span has zero or one parent spans and zero or more child spans, which
Expand Down Expand Up @@ -278,9 +272,6 @@ impl trace::Tracer for BoxedTracer {
///
/// [`Tracer`]: crate::trace::Tracer
pub trait ObjectSafeTracer {
/// Create a new invalid span for use in cases where there are no active spans.
fn invalid_boxed(&self) -> Box<dyn ObjectSafeSpan + Send + Sync>;

/// Returns a trait object so the underlying implementation can be swapped
/// out at runtime.
fn start_with_context_boxed(
Expand All @@ -299,11 +290,6 @@ where
S: trace::Span + Send + Sync + 'static,
T: trace::Tracer<Span = S>,
{
/// Create a new invalid span for use in cases where there are no active spans.
fn invalid_boxed(&self) -> Box<dyn ObjectSafeSpan + Send + Sync> {
Box::new(self.invalid())
}

/// Returns a trait object so the underlying implementation can be swapped
/// out at runtime.
fn start_with_context_boxed(
Expand Down
11 changes: 0 additions & 11 deletions opentelemetry/src/sdk/trace/tracer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,6 @@ impl crate::trace::Tracer for Tracer {
/// This implementation of `Tracer` produces `sdk::Span` instances.
type Span = Span;

/// Returns a span with an inactive `SpanContext`. Used by functions that
/// need to return a default span like `get_active_span` if no span is present.
fn invalid(&self) -> Self::Span {
Span::new(
SpanContext::empty_context(),
None,
self.clone(),
SpanLimits::default(),
)
}

/// Starts a new `Span` with a given context.
///
/// Each span has zero or one parent spans and zero or more child spans, which
Expand Down
7 changes: 1 addition & 6 deletions opentelemetry/src/trace/noop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,6 @@ impl NoopTracer {
impl trace::Tracer for NoopTracer {
type Span = NoopSpan;

/// Returns a `NoopSpan` as they are always invalid.
fn invalid(&self) -> Self::Span {
NoopSpan::new()
}

/// Starts a new `NoopSpan` with a given context.
///
/// If the context contains a valid span, it's span context is propagated.
Expand Down Expand Up @@ -178,7 +173,7 @@ impl trace::Tracer for NoopTracer {
span_context: cx.span().span_context().clone(),
}
} else {
self.invalid()
NoopSpan::new()
}
}
}
Expand Down
4 changes: 0 additions & 4 deletions opentelemetry/src/trace/tracer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,6 @@ pub trait Tracer {
/// The `Span` type used by this `Tracer`.
type Span: Span;

/// Returns a span with an invalid `SpanContext`. Used by functions that
/// need to return a default span like `get_active_span` if no span is present.
fn invalid(&self) -> Self::Span;

/// Starts a new `Span`.
///
/// By default the currently active `Span` is set as the new `Span`'s
Expand Down

0 comments on commit bda6a15

Please sign in to comment.