chore(otel): rename OtelManager to SessionTelemetry (#13808)

## Summary
This is a purely mechanical refactor of `OtelManager` ->
`SessionTelemetry` to better convey what the struct is doing. No
behavior change.

## Why

`OtelManager` ended up sounding much broader than what this type
actually does. It doesn't manage OTEL globally; it's the session-scoped
telemetry surface for emitting log/trace events and recording metrics
with consistent session metadata (`app_version`, `model`, `slug`,
`originator`, etc.).

`SessionTelemetry` is a more accurate name, and updating the call sites
makes that boundary a lot easier to follow.

## Validation

- `just fmt`
- `cargo test -p codex-otel`
- `cargo test -p codex-core`
This commit is contained in:
Owen Lin
2026-03-06 16:23:30 -08:00
committed by GitHub
parent 3794363cac
commit 289ed549cf
45 changed files with 318 additions and 290 deletions

View File

@@ -7,7 +7,7 @@ use codex_core::ModelProviderInfo;
use codex_core::Prompt;
use codex_core::ResponseEvent;
use codex_core::WireApi;
use codex_otel::OtelManager;
use codex_otel::SessionTelemetry;
use codex_otel::TelemetryAuthMode;
use codex_protocol::ThreadId;
use codex_protocol::config_types::ReasoningSummary;
@@ -72,7 +72,7 @@ async fn responses_stream_includes_subagent_header_on_review() {
let session_source = SessionSource::SubAgent(SubAgentSource::Review);
let model_info =
codex_core::test_support::construct_model_info_offline(model.as_str(), &config);
let otel_manager = OtelManager::new(
let session_telemetry = SessionTelemetry::new(
conversation_id,
model.as_str(),
model_info.slug.as_str(),
@@ -113,7 +113,7 @@ async fn responses_stream_includes_subagent_header_on_review() {
.stream(
&prompt,
&model_info,
&otel_manager,
&session_telemetry,
effort,
summary.unwrap_or(model_info.default_reasoning_summary),
None,
@@ -185,7 +185,7 @@ async fn responses_stream_includes_subagent_header_on_other() {
let model_info =
codex_core::test_support::construct_model_info_offline(model.as_str(), &config);
let otel_manager = OtelManager::new(
let session_telemetry = SessionTelemetry::new(
conversation_id,
model.as_str(),
model_info.slug.as_str(),
@@ -226,7 +226,7 @@ async fn responses_stream_includes_subagent_header_on_other() {
.stream(
&prompt,
&model_info,
&otel_manager,
&session_telemetry,
effort,
summary.unwrap_or(model_info.default_reasoning_summary),
None,
@@ -297,7 +297,7 @@ async fn responses_respects_model_info_overrides_from_config() {
SessionSource::SubAgent(SubAgentSource::Other("override-check".to_string()));
let model_info =
codex_core::test_support::construct_model_info_offline(model.as_str(), &config);
let otel_manager = OtelManager::new(
let session_telemetry = SessionTelemetry::new(
conversation_id,
model.as_str(),
model_info.slug.as_str(),
@@ -338,7 +338,7 @@ async fn responses_respects_model_info_overrides_from_config() {
.stream(
&prompt,
&model_info,
&otel_manager,
&session_telemetry,
effort,
summary.unwrap_or(model_info.default_reasoning_summary),
None,