mirror of
https://github.com/openai/codex.git
synced 2026-11-19 15:04:25 +00:00
Emit turn cost telemetry for ChatGPT sessions (#41944)
## What changed - Query workspace-visible turn estimates for ChatGPT-authenticated sessions through the appropriate Codex or ChatGPT endpoint. - Track completed response IDs and emit `codex.turn.cost_microusd` only when the estimate is nonnegative, visible, and covers every observed response. - Keep error response bodies out of turn-cost worker logs. ## Testing - Cover both endpoint styles, nullable estimates, settlement validation, exact micro-USD conversion, and response-ID tracking. - Add an app-server integration test that verifies a settled ChatGPT turn reaches the OTLP metrics exporter with its turn, conversation, and auth-mode attributes. GitOrigin-RevId: 6ae3f8df729fad52984a0c6efafd8c96c7214e55
This commit is contained in:
1 parent
9c7edd4bc3
commit
e39ab0c185
10 files changed
+776
-32
No files matched your search
@@ -34,10 +34,13 @@ use serde::Serialize;
|
||||
use serde::de::DeserializeOwned;
|
||||
use std::fmt;
|
||||
|
||||
mod chatgpt_turn_cost;
|
||||
mod rate_limit_resets;
|
||||
mod thread_usage;
|
||||
pub(crate) mod turn_usage;
|
||||
|
||||
pub use chatgpt_turn_cost::ChatgptThreadTurnCosts;
|
||||
pub use chatgpt_turn_cost::ChatgptTurnCost;
|
||||
pub use thread_usage::ThreadUsage;
|
||||
pub use thread_usage::ThreadUsageBreakdownGroup;
|
||||
|
||||
|
||||
Reference in new issue
Block a user