aKode fase 1 (parziale): niente Statsig, analytics, upload Sentry, update check e announcement remoti
This commit is contained in:
@@ -6,31 +6,13 @@ use codex_utils_absolute_path::AbsolutePathBuf;
|
||||
use serde::Deserialize;
|
||||
use serde::Serialize;
|
||||
|
||||
pub(crate) const STATSIG_OTLP_HTTP_ENDPOINT: &str = "https://ab.chatgpt.com/otlp/v1/metrics";
|
||||
pub(crate) const STATSIG_API_KEY_HEADER: &str = "statsig-api-key";
|
||||
pub(crate) const STATSIG_API_KEY: &str = "client-MkRuleRQBd6qakfnDYqJVR9JuXcY57Ljly3vi5JVUIO";
|
||||
|
||||
/// aKode: the upstream built-in Statsig exporter (ab.chatgpt.com with an
|
||||
/// embedded API key) has been removed. The `Statsig` variant is kept only so
|
||||
/// old configuration files still parse; it always resolves to `None`, so no
|
||||
/// telemetry is ever sent unless the user configures an explicit exporter.
|
||||
pub(crate) fn resolve_exporter(exporter: &OtelExporter) -> OtelExporter {
|
||||
match exporter {
|
||||
OtelExporter::Statsig => {
|
||||
// Keep the built-in Statsig default off in debug builds so
|
||||
// incremental local development and test runs do not emit
|
||||
// best-effort OTEL traffic unless a test or binary opts into an
|
||||
// explicit exporter configuration.
|
||||
if cfg!(debug_assertions) {
|
||||
return OtelExporter::None;
|
||||
}
|
||||
|
||||
OtelExporter::OtlpHttp {
|
||||
endpoint: STATSIG_OTLP_HTTP_ENDPOINT.to_string(),
|
||||
headers: HashMap::from([(
|
||||
STATSIG_API_KEY_HEADER.to_string(),
|
||||
STATSIG_API_KEY.to_string(),
|
||||
)]),
|
||||
protocol: OtelHttpProtocol::Json,
|
||||
tls: None,
|
||||
}
|
||||
}
|
||||
OtelExporter::Statsig => OtelExporter::None,
|
||||
_ => exporter.clone(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user