mirror of
https://github.com/openai/codex.git
synced 2026-11-28 15:33:11 +00:00
Sanitize skill names in injection metrics (#34601)
## Why Skill names may contain characters that are not valid in metric tag values. ## What changed Pass skill names through `sanitize_metric_tag_value` before using them as the `skill` tag on `codex.skill.injected` counters for both explicit and implicit skill invocations. GitOrigin-RevId: 0ed633fbd468739acc30193b566d830e20bc7860
This commit is contained in:
1 parent
87f71e35b8
commit
6c00dc087e
2 files changed
+6
-2
No files matched your search
@@ -11,6 +11,7 @@ use codex_analytics::SkillInvocation;
|
||||
use codex_analytics::TrackEventsContext;
|
||||
use codex_exec_server::LOCAL_FS;
|
||||
use codex_otel::SessionTelemetry;
|
||||
use codex_otel::sanitize_metric_tag_value;
|
||||
use codex_protocol::user_input::UserInput;
|
||||
use codex_utils_absolute_path::AbsolutePathBuf;
|
||||
use codex_utils_path_uri::PathUri;
|
||||
@@ -135,11 +136,12 @@ fn emit_skill_injected_metric(
|
||||
let Some(otel) = otel else {
|
||||
return;
|
||||
};
|
||||
let skill_name_tag = sanitize_metric_tag_value(skill.name.as_str());
|
||||
|
||||
otel.counter(
|
||||
"codex.skill.injected",
|
||||
/*inc*/ 1,
|
||||
&[("status", status), ("skill", skill.name.as_str())],
|
||||
&[("status", status), ("skill", skill_name_tag.as_str())],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user