Skip to content

refactor(tracing): decouple OTel support into adapter crate#765

Open
JohnTitor wants to merge 1 commit into
actix:mainfrom
JohnTitor:split-otel-dep
Open

refactor(tracing): decouple OTel support into adapter crate#765
JohnTitor wants to merge 1 commit into
actix:mainfrom
JohnTitor:split-otel-dep

Conversation

@JohnTitor

@JohnTitor JohnTitor commented Jun 20, 2026

Copy link
Copy Markdown
Member

PR Type

Refactor

PR Checklist

  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • A changelog entry has been made for the appropriate packages.
  • Format code with the nightly rustfmt (cargo +nightly fmt).

Overview

This is an attempt to remove the OTel features to support. Currently it becomes harder and harder to maintain, and old versions should be quite lower usage than newer's.
This decouples the part of code which implements OTel support as another adapter crate so that we can versioning them independently. The new adapter crate matches the OTel crate version so users can easily expect what version they should use.
And the main crate can contain any functional changes independently so users can find combination they want (e.g. users can use the latest core crate feature + older OTel).

cc @LukeMathWalker this is kinda drastic change and would love to hear your inputs if you have!

@JohnTitor
JohnTitor marked this pull request as ready for review June 20, 2026 23:04

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OTel users would have to migrate like this example. I guess it's not that painful.

/// headers and attach it to the root [`tracing::Span`].
///
/// [`TracingLogger`]: crate::TracingLogger
pub trait TraceContext: Clone + 'static {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for adapter crate. One bonus point, users can alternatively implement their desired backend if want.

@@ -0,0 +1,25 @@
[package]
name = "tracing-actix-web-opentelemetry"
version = "0.32.0"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to match the version here with opentelemetry.

--tests --examples --bins --
-A unknown_lints -D clippy::todo -D clippy::dbg_macro

- name: Check tracing-actix-web with Clippy

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is something I want to remove by this change :>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant