mirror of
https://github.com/openai/codex.git
synced 2026-10-29 19:08:43 +00:00
Add OpenTelemetry requirement types to the app-server protocol (#57638)
## What changed Add optional `otel` requirements to `ConfigRequirements`, with types for logging controls, tool-result byte limits, environment, and telemetry exporters, including OTLP HTTP/gRPC headers and TLS settings. Update the JSON schemas, precomputed exports, and generated TypeScript and Python bindings. The app-server requirements mapper currently returns `otel: None`. GitOrigin-RevId: f73edc22efe1ab7fddf51419267daa6cf9fd34c5
This commit is contained in:
committed by
copyberry
parent
6ba3a84680
commit
424916ee94
@@ -2977,6 +2977,32 @@ class NullableGetAccountTokenUsageParams(RootModel[GetAccountTokenUsageParams |
|
||||
]
|
||||
|
||||
|
||||
class OtelExporterValue(Enum):
|
||||
none = "none"
|
||||
statsig = "statsig"
|
||||
|
||||
|
||||
class OtelHttpProtocol(Enum):
|
||||
binary = "binary"
|
||||
json = "json"
|
||||
|
||||
|
||||
class OtelTlsConfig(BaseModel):
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
)
|
||||
ca_certificate: Annotated[str | None, Field(alias="ca-certificate")] = None
|
||||
client_certificate: Annotated[str | None, Field(alias="client-certificate")] = None
|
||||
client_private_key: Annotated[str | None, Field(alias="client-private-key")] = None
|
||||
|
||||
|
||||
class OtelToolResultLogConfig(BaseModel):
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
)
|
||||
max_bytes: Annotated[int, Field(ge=0)]
|
||||
|
||||
|
||||
class PatchApplyStatus(Enum):
|
||||
in_progress = "inProgress"
|
||||
completed = "completed"
|
||||
@@ -9126,6 +9152,59 @@ class NewThreadModelDefaults(BaseModel):
|
||||
service_tier: Annotated[str | None, Field(alias="serviceTier")] = None
|
||||
|
||||
|
||||
class OtlpHttp(BaseModel):
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
)
|
||||
endpoint: str
|
||||
headers: Annotated[dict[str, str], Field(description="Exporter request headers.")]
|
||||
protocol: OtelHttpProtocol
|
||||
tls: OtelTlsConfig | None = None
|
||||
|
||||
|
||||
class OtlpHttpOtelExporter(BaseModel):
|
||||
model_config = ConfigDict(
|
||||
extra="forbid",
|
||||
populate_by_name=True,
|
||||
)
|
||||
otlp_http: Annotated[OtlpHttp, Field(alias="otlp-http")]
|
||||
|
||||
|
||||
class OtlpGrpc(BaseModel):
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
)
|
||||
endpoint: str
|
||||
headers: Annotated[dict[str, str], Field(description="Exporter request headers.")]
|
||||
tls: OtelTlsConfig | None = None
|
||||
|
||||
|
||||
class OtlpGrpcOtelExporter(BaseModel):
|
||||
model_config = ConfigDict(
|
||||
extra="forbid",
|
||||
populate_by_name=True,
|
||||
)
|
||||
otlp_grpc: Annotated[OtlpGrpc, Field(alias="otlp-grpc")]
|
||||
|
||||
|
||||
class OtelExporter(RootModel[OtelExporterValue | OtlpHttpOtelExporter | OtlpGrpcOtelExporter]):
|
||||
root: OtelExporterValue | OtlpHttpOtelExporter | OtlpGrpcOtelExporter
|
||||
|
||||
|
||||
class OtelRequirements(BaseModel):
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
)
|
||||
environment: str | None = None
|
||||
exporter: OtelExporter | None = None
|
||||
log_agent_responses: bool | None = None
|
||||
log_guardian_assessments: bool | None = None
|
||||
log_user_prompt: bool | None = None
|
||||
metrics_exporter: OtelExporter | None = None
|
||||
tool_result: OtelToolResultLogConfig | None = None
|
||||
trace_exporter: OtelExporter | None = None
|
||||
|
||||
|
||||
class OverriddenMetadata(BaseModel):
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
@@ -12264,6 +12343,7 @@ class ConfigRequirements(BaseModel):
|
||||
),
|
||||
] = None
|
||||
models: ModelsRequirements | None = None
|
||||
otel: OtelRequirements | None = None
|
||||
sqlite_home: Annotated[str | None, Field(alias="sqliteHome")] = None
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user