mirror of
https://github.com/openai/codex.git
synced 2026-09-17 12:23:33 +00:00
Merge cd696403ee into sapling-pr-archive-bolinfest
This commit is contained in:
@@ -611,6 +611,14 @@
|
||||
"description": "Log user prompt in traces",
|
||||
"type": "boolean"
|
||||
},
|
||||
"metrics_exporter": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/OtelExporterKind"
|
||||
}
|
||||
],
|
||||
"description": "Optional metrics exporter"
|
||||
},
|
||||
"trace_exporter": {
|
||||
"allOf": [
|
||||
{
|
||||
|
||||
@@ -1824,12 +1824,13 @@ impl Config {
|
||||
.unwrap_or(DEFAULT_OTEL_ENVIRONMENT.to_string());
|
||||
let exporter = t.exporter.unwrap_or(OtelExporterKind::None);
|
||||
let trace_exporter = t.trace_exporter.unwrap_or_else(|| exporter.clone());
|
||||
let metrics_exporter = t.metrics_exporter.unwrap_or(OtelExporterKind::Statsig);
|
||||
OtelConfig {
|
||||
log_user_prompt,
|
||||
environment,
|
||||
exporter,
|
||||
trace_exporter,
|
||||
metrics_exporter: OtelExporterKind::Statsig,
|
||||
metrics_exporter,
|
||||
}
|
||||
},
|
||||
};
|
||||
@@ -4089,6 +4090,23 @@ model_verbosity = "high"
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn metrics_exporter_defaults_to_statsig_when_missing() -> std::io::Result<()> {
|
||||
let fixture = create_test_fixture()?;
|
||||
|
||||
let config = Config::load_from_base_config_with_overrides(
|
||||
fixture.cfg.clone(),
|
||||
ConfigOverrides {
|
||||
cwd: Some(fixture.cwd()),
|
||||
..Default::default()
|
||||
},
|
||||
fixture.codex_home(),
|
||||
)?;
|
||||
|
||||
assert_eq!(config.otel.metrics_exporter, OtelExporterKind::Statsig);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_precedence_fixture_with_gpt3_profile() -> std::io::Result<()> {
|
||||
let fixture = create_test_fixture()?;
|
||||
|
||||
@@ -437,6 +437,9 @@ pub struct OtelConfigToml {
|
||||
|
||||
/// Optional trace exporter
|
||||
pub trace_exporter: Option<OtelExporterKind>,
|
||||
|
||||
/// Optional metrics exporter
|
||||
pub metrics_exporter: Option<OtelExporterKind>,
|
||||
}
|
||||
|
||||
/// Effective OTEL settings after defaults are applied.
|
||||
|
||||
Reference in New Issue
Block a user