Skip to content

Commit 72a43c8

Browse files
committed
subscriber: rename Layer::new_span to on_new_span (#1674)
While we're breaking things, we may as well do this as well. Closes #630 Closes #662
1 parent c471d7d commit 72a43c8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tracing-opentelemetry/benches/trace.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl<S> tracing_subscriber::Layer<S> for RegistryAccessLayer
6060
where
6161
S: tracing_core::Subscriber + for<'span> tracing_subscriber::registry::LookupSpan<'span>,
6262
{
63-
fn new_span(
63+
fn on_new_span(
6464
&self,
6565
_attrs: &tracing_core::span::Attributes<'_>,
6666
id: &tracing::span::Id,
@@ -87,7 +87,7 @@ impl<S> tracing_subscriber::Layer<S> for OtelDataLayer
8787
where
8888
S: tracing_core::Subscriber + for<'span> tracing_subscriber::registry::LookupSpan<'span>,
8989
{
90-
fn new_span(
90+
fn on_new_span(
9191
&self,
9292
attrs: &tracing_core::span::Attributes<'_>,
9393
id: &tracing::span::Id,

tracing-opentelemetry/src/layer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ where
410410
///
411411
/// [OpenTelemetry `Span`]: opentelemetry::trace::Span
412412
/// [tracing `Span`]: tracing::Span
413-
fn new_span(&self, attrs: &Attributes<'_>, id: &span::Id, ctx: Context<'_, S>) {
413+
fn on_new_span(&self, attrs: &Attributes<'_>, id: &span::Id, ctx: Context<'_, S>) {
414414
let span = ctx.span(id).expect("Span not found, this is a bug");
415415
let mut extensions = span.extensions_mut();
416416

0 commit comments

Comments
 (0)