mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
Add process-scoped SQLite telemetry (#22154)
## Summary - add SQLite init, backfill-gate, and fallback telemetry without introducing a cross-cutting state-db access wrapper - install one process-scoped telemetry sink after OTEL startup and let low-level state/rollout paths emit through it directly - add process-start metrics for the process owners that initialize SQLite --------- Co-authored-by: Owen Lin <owen@openai.com>
This commit is contained in:
@@ -99,3 +99,18 @@ pub fn build_provider(
|
||||
pub fn codex_export_filter(meta: &tracing::Metadata<'_>) -> bool {
|
||||
meta.target().starts_with("codex_otel")
|
||||
}
|
||||
|
||||
pub fn record_process_start(otel: Option<&OtelProvider>, originator: &str) {
|
||||
let Some(metrics) = otel.and_then(OtelProvider::metrics) else {
|
||||
return;
|
||||
};
|
||||
let _ = codex_otel::record_process_start_once(metrics, originator);
|
||||
}
|
||||
|
||||
pub fn install_sqlite_telemetry(otel: Option<&OtelProvider>, originator: &str) {
|
||||
let Some(metrics) = otel.and_then(OtelProvider::metrics) else {
|
||||
return;
|
||||
};
|
||||
let telemetry = codex_rollout::sqlite_telemetry_recorder(metrics.clone(), originator);
|
||||
let _ = codex_state::install_process_db_telemetry(telemetry);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user