chore(otel): reorganize codex-otel crate#13800
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b3f493326e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| pub mod config; | ||
| mod events; | ||
| pub mod metrics; | ||
| pub mod otel_provider; | ||
| pub mod provider; | ||
| pub mod trace_context; |
There was a problem hiding this comment.
Preserve legacy traces module re-export
lib.rs no longer exports pub mod traces, and src/traces/mod.rs was removed. Downstream imports like codex_otel::traces::otel_manager::{OtelManager, OtelEventMetadata, ToolDecisionSource} will now fail to compile. That is a public API break despite the stated compatibility/no-behavior-change intent; add a shim module that re-exports the moved items.
Useful? React with 👍 / 👎.
Summary
This is a structural cleanup of
codex-otelto make the ownership boundaries a lot clearer.For example, previously it was quite confusing that
OtelManagerwhich emits log + trace event telemetry lived undercodex-rs/otel/src/traces/. Also, there were two places that defined methods on OtelManager viaimpl OtelManager(lib.rsandotel_manager.rs).What changed:
OtelProviderimplementation intosrc/provider.rsOtelManagerand session-scoped event emission intosrc/events/otel_manager.rssrc/events/shared.rssrc/targets.rstraceparent_context_from_env()intosrc/trace_context.rssrc/otel_provider.rsas a compatibility shim for existing importscodex-otelREADME to reflect the new layoutWhy
lib.rsandotel_provider.rswere doing too many different jobs at once: provider setup, export routing, trace-context helpers, and session event emission all lived together.This refactor separates those concerns without trying to change the behavior of the crate. The goal is to make future OTEL work easier to reason about and easier to review.
Notes
OtelManagerremains the session-scoped event emitter in this PRotel_providershim keeps downstream churn low while the internals move aroundValidation
just fmtcargo test -p codex-oteljust fix -p codex-otel