mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
46 lines
1.0 KiB
Rust
46 lines
1.0 KiB
Rust
use std::collections::HashMap;
|
|
use std::path::PathBuf;
|
|
|
|
use codex_utils_absolute_path::AbsolutePathBuf;
|
|
|
|
#[derive(Clone, Debug)]
|
|
pub struct OtelSettings {
|
|
pub environment: String,
|
|
pub service_name: String,
|
|
pub service_version: String,
|
|
pub codex_home: PathBuf,
|
|
pub exporter: OtelExporter,
|
|
pub trace_exporter: OtelExporter,
|
|
}
|
|
|
|
#[derive(Clone, Debug)]
|
|
pub enum OtelHttpProtocol {
|
|
/// HTTP protocol with binary protobuf
|
|
Binary,
|
|
/// HTTP protocol with JSON payload
|
|
Json,
|
|
}
|
|
|
|
#[derive(Clone, Debug, Default)]
|
|
pub struct OtelTlsConfig {
|
|
pub ca_certificate: Option<AbsolutePathBuf>,
|
|
pub client_certificate: Option<AbsolutePathBuf>,
|
|
pub client_private_key: Option<AbsolutePathBuf>,
|
|
}
|
|
|
|
#[derive(Clone, Debug)]
|
|
pub enum OtelExporter {
|
|
None,
|
|
OtlpGrpc {
|
|
endpoint: String,
|
|
headers: HashMap<String, String>,
|
|
tls: Option<OtelTlsConfig>,
|
|
},
|
|
OtlpHttp {
|
|
endpoint: String,
|
|
headers: HashMap<String, String>,
|
|
protocol: OtelHttpProtocol,
|
|
tls: Option<OtelTlsConfig>,
|
|
},
|
|
}
|