Summary: 579 instances, 343 unique

Text	Count
pub(super) metrics_client: Option<MetricsClient>,	4
pub(super) use codex_otel::SessionTelemetry;	1
let _ = metrics.record_duration(	4
#[instrument(level = "trace", skip_all, fields(server_name = %server_name))]	3
.map(|traceparent| W3cTraceContext {	1
use codex_otel::TURN_NETWORK_PROXY_METRIC;	1
turn_metrics.record_plugin(skill.plugin_id.as_deref());	1
use codex_otel::GUARDIAN_REVIEW_TOKEN_USAGE_METRIC;	1
if let Some(metrics) = codex_otel::global() {	1
codex_otel::start_global_timer(ORCHESTRATOR_SKILL_DISCOVERY_DURATION_METRIC, &[])	1
pub(crate) fn install_global(mut metrics: MetricsClient) -> MetricsClient {	1
use codex_otel::HOOK_RUN_DURATION_METRIC;	1
fn invalid_traceparent_returns_none() {	1
metrics.histogram(name, value, &tags)	1
let Some(metrics) = codex_otel::global() else {	5
target: "codex_otel.trace_safe",	2
.get_or_init(load_traceparent_context)	1
traceparent: client_metadata	1
#[tracing::instrument(name = "mcp.runtime.refresh_if_dirty", skip_all)]	1
callback_traceparent: Option<String>,	1
match trace.traceparent {	1
use codex_otel::StatsigMetricsSettings;	1
#[tracing::instrument(level = "trace", skip_all, fields(item_count = items.len()))]	3
codex_otel::set_parent_from_w3c_trace_context(&open_session_span, trace);	1
crate::metrics::install_global(MetricsClient::new(MetricsConfig::in_memory(	2
target: "codex_otel.log_only",	1
traceparent: headers.remove("traceparent"),	1
.get("traceparent")	1
use codex_otel::HOOK_RUN_METRIC;	1
pub traceparent: Option<String>,	1
use codex_otel::set_parent_from_context;	2
let callback_traceparent =	1
"traceparent",	1
let (sequence, traceparent, subscriptions) = {	1
metrics.counter(	1
#[instrument(level = "trace",	3
request.metadata_mut().insert("traceparent", traceparent);	1
if let Some(traceparent) = trace.and_then(|trace| trace.traceparent)	1
#[instrument(name = "session_init", level = "info", skip_all)]	1
if let Some(traceparent) = call.traceparent.as_ref() {	1
pub(crate) fn new(metrics_client: Option<MetricsClient>) -> Self {	2
pub const WS_REQUEST_HEADER_TRACEPARENT_CLIENT_METADATA_KEY: &str = "ws_request_header_traceparent";	1
codex_otel::global(),	1
const AUDIT_TARGET: &str = "codex_otel.network_proxy";	1
use super::client::MetricsClient;	1
metrics.counter(	1
&& let Ok(value) = HeaderValue::try_from(traceparent)	1
let _ = metrics.counter(metric_name, /*inc*/ 1, &tags);	1
let _ = metrics.record_duration(name, duration, &[]);	1
.map(|trace| (trace.traceparent, trace.tracestate))	1
if let Err(err) = codex_otel::validate_tracestate_member(&member_key, &fields) {	1
let _ = metrics.counter(	1
pub(super) traceparent: Option<String>,	1
let _ = metrics.record_duration(metric, duration, tags);	2
metrics.counter("codex.turns", /*inc*/ 1, &[])?;	1
use codex_otel::OtelHttpProtocol;	2
inject_span_traceparent(&mut open_session_request, &open_session_span);	1
use codex_otel::current_span_trace_id;	1
otel: codex_otel::global_statsig_metrics_settings(),	2
let metrics = codex_otel::global();	1
let _ = metrics.counter("codex.mcp.protocol_discovery", /*inc*/ 1, &tags);	1
(sequence, execution.traceparent.clone(), subscriptions)	1
let _ = codex_otel::record_process_start_once(metrics, originator);	1
pub(crate) metrics: Option<MetricsClient>,	1
metrics.counter(CLASSIFICATION_METRIC, /*inc*/ 1, &tags);	1
assert!(is_log_export_target("codex_otel.log_only"));	1
traceparent = context.traceparent.as_deref().unwrap_or_default(),	1
trace.traceparent.as_ref()?;	1
#[instrument(name = "session.flush_rollout", level = "trace", skip_all)]	1
let parts = traceparent.split('-').collect::<Vec<_>>();	2
use codex_otel::GOAL_TOKEN_COUNT_METRIC;	1
#[tracing::instrument(name = "codex.exec_server.remote.noise.connect", skip_all)]	1
if let Some(metrics) = codex_otel::global() {	8
use codex_otel::RuntimeMetricsSummary;	3
metrics: Option<MetricsClient>,	1
metrics: codex_otel::MetricsClient,	2
callback_traceparent,	1
if let Err(err) = codex_otel::validate_tracestate_entries(&valid_entries) {	1
#[instrument(level = "info", skip_all)]	1
pub fn traceparent_context_from_env() -> Option<Context> {	1
use codex_otel::TURN_MEMORY_METRIC;	1
if let Some(traceparent) = trace.and_then(|trace| trace.traceparent.as_deref()) {	1
pub(super) inner: Arc<MetricsClientInner>,	1
#[tracing::instrument(	12
assert!(!is_log_export_target("codex_otel.trace_safe.debug"));	1
fn missing_traceparent_returns_none() {	1
#[instrument(level = "trace", skip_all, fields(tool_spec_count = specs.len()))]	1
metrics.record_duration_ms_f64(name, duration_ms, &tags)	1
use codex_otel::SessionTelemetry;	20
let expected_trace = codex_otel::span_w3c_trace_context(&parent_span)	2
use codex_otel::STARTUP_PREWARM_DURATION_METRIC;	1
trace: codex_otel::current_span_w3c_trace_context(),	1
pub fn record_process_start_once(metrics: &MetricsClient, originator: &str) -> Result<bool> {	1
#[instrument(level = "trace", skip_all)]	12
if let Err(err) = codex_otel::validate_tracestate_member(member_key, &field) {	1
if let Some(metrics) = codex_otel::global() {	1
metrics: &MetricsClient,	1
use codex_otel::THREAD_SKILLS_TRUNCATED_METRIC;	1
pub metrics: Option<MetricsClient>,	1
request.metadata_mut().insert("traceparent", traceparent);	1
_ => self.metrics.histogram(name, value, &tags),	1
&& let Ok(traceparent) = traceparent.parse()	1
pub fn with_metrics(mut self, metrics: MetricsClient) -> Self {	1
use codex_otel::AuthEnvTelemetryMetadata;	1
target: "codex_otel.log_only",	2
let _ = metrics.histogram(name, value, tags);	1
metrics.counter(WFP_SETUP_FAILURE_METRIC, /*inc*/ 1, &tags)?;	1
metrics.record_duration(API_CALL_DURATION_METRIC, Duration::from_millis(100), &[])?;	1
headers.remove("traceparent");	1
use codex_otel::GUARDIAN_REVIEW_COUNT_METRIC;	1
optional string traceparent = 11;	1
let _ = metrics.histogram(	1
metrics.histogram(TURN_TOKEN_USAGE_METRIC, /*value*/ 100, &[])?;	1
if let Some(metrics) = otel.as_ref().and_then(codex_otel::OtelProvider::metrics) {	2
use codex_otel::CURATED_PLUGINS_STARTUP_SYNC_METRIC;	1
&& !codex_otel::set_parent_from_w3c_trace_context(&request_span, trace)	1
pub(crate) const OTEL_TARGET_PREFIX: &str = "codex_otel";	1
codex_otel::start_global_timer("codex.remote_models.fetch_update.duration_ms", &[]);	1
client: MetricsClient,	1
#[instrument(level = "trace", skip_all, err)]	3
Some(traceparent) => {	1
metrics.histogram(	1
extension_metrics.histogram(name, value, &tags);	1
let _ = metrics.counter(RUN_METRIC, /*inc*/ 1, &tags);	1
let _ = metrics.counter(	1
use codex_otel::OtelProvider;	4
#[instrument(	15
assert!(is_trace_safe_target("codex_otel.trace_safe"));	1
traceparent: Option<String>,	1
fn enabled_metrics(&self) -> Option<&MetricsClient> {	1
#[tracing::instrument(name = "code_mode.grpc.open_binding", level = "info", skip_all)]	1
let trace = codex_otel::span_w3c_trace_context(&execute_span);	1
.with_filter(filter_fn(codex_otel::OtelProvider::trace_export_filter)),	3
.or_else(codex_otel::global)	1
let Some(metrics) = codex_otel::global() else {	5
&& let Some(metrics) = codex_otel::global()	1
optional string traceparent = 10;	1
fn new(metrics_client: Option<MetricsClient>) -> Self {	1
if codex_otel::context_from_w3c_trace_context(&trace).is_some() {	1
#[instrument(name = "turn_context.make", level = "trace", skip_all)]	1
metrics.counter("codex.conversation.turn.count", /*inc*/ 1, &[])?;	1
traceparent: Option<String>,	1
let _ = self.metrics.counter(name, inc, &tags);	1
impl MetricsClient {	1
metrics.counter(TOOL_CALL_COUNT_METRIC, /*inc*/ 1, &[])?;	1
impl MetricsClientInner {	1
use codex_otel::TURN_TOKEN_USAGE_METRIC;	1
use codex_otel::RuntimeMetricTotals;	1
let _ = metrics.histogram(ROLLOUT_SIZE_BYTES_METRIC, size_bytes, &[]);	1
use codex_otel::span_w3c_trace_context;	1
#[tracing::instrument(	27
pub(crate) const OTEL_LOG_ONLY_TARGET: &str = "codex_otel.log_only";	1
#[tracing::instrument(name = "connectors.executor_plugin.declarations.load", skip_all)]	1
assert!(!is_log_export_target("codex_otel.trace_safe"));	1
let (traceparent, tracestate) = trace	1
target: "codex_otel.log_only",	1
#[tracing::instrument(name = "mcp.runtime.refresh_wait", skip_all)]	1
let metric_client = codex_otel::global();	1
#[instrument(level = "trace", skip_all)]	34
pub(crate) const OTEL_TRACE_SAFE_TARGET: &str = "codex_otel.trace_safe";	1
use codex_otel::TURN_E2E_DURATION_METRIC;	1
use codex_otel::traceparent_context_from_env;	2
metrics: MetricsClient,	2
metrics_client: Option<&MetricsClient>,	1
#[instrument(level = "trace", skip_all, fields(dynamic_tool_count = dynamic_tools.len()))]	1
let expected_traceparent = expected_trace	2
let traceparent = env::var(TRACEPARENT_ENV_VAR).ok()?;	1
let metrics = codex_otel::MetricsClient::new(MetricsConfig::in_memory(	1
let _ = metrics.histogram(	2
metrics_client: Option<MetricsClient>,	1
let traceparent = trace.traceparent.as_deref().expect("request traceparent");	2
use codex_otel::CURATED_PLUGINS_STARTUP_SYNC_FINAL_METRIC;	1
metrics.record_duration(TOOL_CALL_DURATION_METRIC, Duration::from_millis(25), &[])?;	1
#[tracing::instrument(name = "mcp.executor_plugin.servers.load", skip_all)]	1
codex_otel::global(),	2
metrics.record_duration(	3
let _ = metrics.counter(	2
pub use crate::metrics::client::MetricsClient;	1
assert!(event.target.starts_with("codex_otel."));	1
let _ = metrics.histogram(RUN_DURATION_METRIC, duration_ms, &tags);	1
pub(crate) fn recorder(metrics: codex_otel::MetricsClient, originator: &str) -> DbTelemetryHandle {	1
let _ = metrics.histogram(RESULTS_PAYLOAD_BYTES_METRIC, payload_bytes, &[]);	1
#[tracing::instrument(name = "mcp.runtime.resolve_for_step", skip_all)]	1
pub(super) struct MetricsClientInner {	1
headers.insert("traceparent", value);	1
self.inner.metrics.record_created();	1
use codex_otel::THREAD_SKILLS_ENABLED_TOTAL_METRIC;	1
assert!(!is_trace_safe_target("codex_otel.network_proxy"));	1
static GLOBAL_METRICS: OnceLock<MetricsClient> = OnceLock::new();	1
metrics.counter(name, inc, &tags)	1
#[instrument(	2
pub traceparent: ::core::option::Option<::prost::alloc::string::String>,	1
inner: Arc::new(MetricsClientInner {	1
if let Some(context) = traceparent_context_from_env() {	1
context_from_trace_headers(trace.traceparent.as_deref(), trace.tracestate.as_deref())	1
let metrics = MetricsClient::new(config)?;	2
use codex_otel::THREAD_SKILLS_KEPT_TOTAL_METRIC;	1
pub(super) use codex_otel::RuntimeMetricsSummary;	1
traceparent: trace.traceparent.clone(),	2
let _ = metrics.counter(	2
use codex_otel::TURN_UNIFIED_EXEC_RUNNING_PROCESSES_METRIC;	1
trace_id = %codex_otel::current_span_trace_id().unwrap_or_default(),	1
Some(MetricsClient::new(config)?)	1
use codex_otel::set_parent_from_w3c_trace_context;	3
metrics.counter(CLASSIFICATION_TRUNCATION_METRIC, /*inc*/ 1, &tags);	1
codex_otel::start_global_timer("codex.remote_models.load_cache.duration_ms", &[]);	1
assert!(!is_trace_safe_target("codex_otel.log_only"));	1
assert!(is_log_export_target("codex_otel.network_proxy"));	1
let _ = metrics.counter(	5
use codex_otel::GOAL_USAGE_LIMITED_METRIC;	1
use codex_otel::GUARDIAN_REVIEW_DURATION_METRIC;	1
self.metrics.record_created();	1
use codex_otel::TOOL_CALL_UNIFIED_EXEC_METRIC;	1
metrics: &codex_otel::MetricsClient,	1
metrics.record_duration(name, duration, &tags)	1
metrics: codex_otel::MetricsClient,	1
"traceparent".to_string(),	1
#[instrument(name = "startup_prewarm.resolve", level = "trace", skip_all)]	1
use codex_otel::GOAL_BLOCKED_METRIC;	1
headers.insert("traceparent", value);	1
use codex_otel::OtelTlsConfig as OtelTlsSettings;	1
&& let Ok(traceparent) = traceparent.parse()	1
#[tracing::instrument(name = "world_state.build", level = "info", skip_all)]	1
traceparent: None,	1
use codex_otel::ToolDecisionSource;	2
fn load_traceparent_context() -> Option<Context> {	1
context_from_trace_headers(Some("not-a-traceparent"), /*tracestate*/ None).is_none()	1
use crate::metrics::MetricsClient;	3
codex_otel::span_w3c_trace_context(span).and_then(|trace| trace.traceparent)	1
pub(super) fn active_inner(&self) -> Arc<MetricsClientInner> {	1
pub(crate) fn new(name: &str, tags: &[(&str, &str)], client: &MetricsClient) -> Self {	1
use codex_otel::OtelSettings;	3
metrics.histogram(	2
otel: Option<codex_otel::StatsigMetricsSettings>,	1
let _ = metrics.counter(name, /*inc*/ 1, tags);	1
let _ = metrics.counter(metric_name, /*inc*/ 1, &tag_refs);	1
metrics.histogram(	1
if let Err(err) = codex_otel::validate_span_attributes(&attribute) {	1
use codex_otel::MetricsClient;	14
traceparent: Some(traceparent.clone()),	1
codex_otel::start_global_timer("codex.cloud_config_bundle.fetch.duration_ms", &[]);	1
traceparent: Some("traceparent".to_string()),	1
let _ = metrics.record_duration(	3
if let Some(metrics) = codex_otel::global()	1
if let Some(metrics) = codex_otel::global() {	1
use codex_otel::THREAD_SKILLS_DESCRIPTION_TRUNCATED_CHARS_METRIC;	1
self.execute_request(request, callback_traceparent)	1
use codex_otel::GOAL_DURATION_SECONDS_METRIC;	1
let Some(trace) = codex_otel::current_span_w3c_trace_context() else {	1
fn inject_span_traceparent<T>(request: &mut tonic::Request<T>, span: &tracing::Span) {	1
#[instrument(level = "trace", skip_all, fields(mcp_server_count = self.servers.len()))]	1
const AGENT_COMMUNICATION_TARGET: &str = "codex_otel.agent_communication";	1
codex_otel::MetricsClient,	1
use codex_otel::OtelExporter;	3
.with_target("codex_otel.trace_safe", LevelFilter::OFF)	1
use codex_otel::MetricsClient;	1
codex_otel::inject_span_w3c_trace_headers(&request_span, &mut headers);	1
use codex_otel::THREAD_STARTED_METRIC;	1
let metrics = MetricsClient::new(	1
headers.insert("traceparent".to_string(), traceparent.to_string());	1
let _ = metrics.counter(metric_name, /*inc*/ 1, &failure_tags);	1
use codex_otel::ARTIFACT_OPERATION_STARTED_METRIC;	1
/// Existing `traceparent` and `tracestate` values are replaced so callers can	1
.expect("parent traceparent");	2
if let Ok(value) = http::HeaderValue::from_str(&traceparent) {	1
let expected_parts = expected_traceparent.split('-').collect::<Vec<_>>();	2
let _ = metrics.record_duration(name, duration, tags);	1
let _ = metrics.counter(THREAD_METRIC, /*inc*/ 1, &tags);	1
codex_memories_extension::install(&mut builder, codex_otel::global());	1
codex_otel::set_parent_from_w3c_trace_context(	1
if let Some(traceparent) = trace.traceparent	1
.traceparent	2
let _ = metrics.record_duration("codex.shell_snapshot.duration_ms", duration, &tags);	1
#[instrument(level = "trace", skip_all, fields(server_name = %server_name))]	1
#[tracing::instrument(level = "trace", skip_all, fields(skill = %entry.name))]	1
pub(super) active: Option<Arc<RwLock<Arc<MetricsClientInner>>>>,	1
phase_two_e2e_timer: Option<codex_otel::Timer>,	1
pub fn global() -> Option<MetricsClient> {	1
use codex_otel::GUARDIAN_REVIEW_TTFT_DURATION_METRIC;	1
#[tracing::instrument(name = "mcp.executor_plugin.metadata.load", skip_all)]	1
trace: codex_otel::current_span_w3c_trace_context(),	1
use codex_otel::STARTUP_PREWARM_AGE_AT_FIRST_TURN_METRIC;	1
} else if let Some(context) = traceparent_context_from_env() {	1
#[tracing::instrument(level = "debug", skip_all, fields(noise_side = "executor"))]	1
let _ = codex_otel::record_process_start_once(metrics, otel_originator.as_str());	1
metrics.counter(	3
use codex_otel::sanitize_metric_tag_value;	6
self.inner.metrics.record_resumed();	1
metrics_client: Option<MetricsClient>,	7
let _ = metrics.counter(metric_name, /*inc*/ 1, &tag_refs);	1
use codex_otel::GOAL_BUDGET_LIMITED_METRIC;	1
#[tracing::instrument(name = "agents_md.refresh", skip_all)]	1
pub fn metrics(&self) -> Option<&MetricsClient> {	1
#[instrument(name = "turn_context.build", level = "trace", skip_all)]	1
let _ = metrics.counter("codex.shell_snapshot", /*inc*/ 1, &tags);	1
codex_otel::span_w3c_trace_context(&execute_span).and_then(|trace| trace.traceparent);	1
traceparent.to_string(),	1
traceparent: Some(traceparent.to_string()),	1
pub struct MetricsClient {	1
use codex_otel::MetricsConfig;	2
#[tracing::instrument(name = "mcp.runtime.refresh", skip_all)]	1
#[tracing::instrument(name = "skills.executor.catalog_root", level = "info", skip_all)]	1
use codex_otel::ORIGINATOR_TAG;	1
use codex_otel::TelemetryAuthMode;	5
#[tracing::instrument(name = "codex.exec_server.remote.connect", skip_all)]	1
pub fn new(metrics: MetricsClient) -> Self {	1
pub(crate) fn start_timer(&self, name: &str) -> Option<codex_otel::Timer> {	2
if let Some(traceparent) =	1
#[tracing::instrument(name = "step_context.capture", level = "info", skip_all)]	1
pub fn with_metrics_without_metadata_tags(mut self, metrics: MetricsClient) -> Self {	1
.with_target("codex_otel.log_only", LevelFilter::OFF)	1
target: "codex_otel.log_only",	1
metrics.counter(API_CALL_COUNT_METRIC, /*inc*/ 1, &[])?;	1
use codex_otel::GOAL_CREATED_METRIC;	1
pub(crate) _timer: Option<codex_otel::Timer>,	1
metrics.histogram(	1
use codex_otel::TURN_TOOL_CALL_METRIC;	1
use codex_otel::current_span_w3c_trace_context;	3
pub use crate::trace_context::traceparent_context_from_env;	1
metrics.counter(	1
use codex_otel::bounded_originator_tag_value;	1
fn register_active_gauges(metrics: &MetricsClient, active: &Arc<Mutex<ActiveCounts>>) {	1
assert!(is_trace_safe_target("codex_otel.trace_safe.summary"));	1
use codex_otel::GOAL_RESUMED_METRIC;	1
let traceparent = traceparent?;	1
use codex_otel::ARTIFACT_OPERATION_EXPECTED_OUTPUT_COUNT_METRIC;	1
#[tracing::instrument(level = "trace", skip_all)]	5
#[tracing::instrument(name = "capability_roots.resolve", skip_all)]	1
traceparent: Some(format!("00-{trace_id}-{span_id}-01")),	1
let _ = self.metrics.record_duration(name, duration, &tags);	1
let _ = metrics.histogram(RUN_IO_BYTES_METRIC, io_bytes, &tags);	1
match context_from_trace_headers(Some(&traceparent), tracestate.as_deref()) {	1
codex_otel::set_parent_from_w3c_trace_context(&execute_span, trace);	1
let _ = metrics.histogram_with_boundaries(	1
#[tracing::instrument(name = "mcp.runtime_config.project_for_step", skip_all)]	1
metrics.counter(TURN_COST_MICROUSD_METRIC, /*inc*/ 1, &[])?;	1
use codex_otel::TURN_TTFM_DURATION_METRIC;	1
traceparent,	3
inject_span_traceparent(&mut request, &subscribe_span);	1
let _ = metrics.histogram(	3
#[tracing::instrument(name = "plugins.executor.package.resolve", skip_all)]	1
traceparent: Option<&str>,	1
use codex_otel::GOAL_COMPLETED_METRIC;	1
