Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions services/budgateway/tensorzero-internal/src/config_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,11 @@ pub struct AnalyticsConfig {
#[serde(default)]
pub enabled: bool,
pub geoip_db_path: Option<std::path::PathBuf>,
/// When enabled, skip direct ClickHouse writes and rely only on OTel spans.
/// The OTel collector will process spans into InferenceFact and rollup tables
/// via materialized views. This reduces duplicate writes and improves performance.
#[serde(default)]
pub otel_only: bool,
}

#[derive(Debug, Default, Deserialize, PartialEq)]
Expand Down
4 changes: 4 additions & 0 deletions services/budgateway/tensorzero-internal/src/gateway_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,7 @@ mod tests {
analytics: AnalyticsConfig {
enabled: false,
geoip_db_path: None,
otel_only: false, // Use legacy direct writes
},
blocking: BlockingConfig { enabled: false },
};
Expand Down Expand Up @@ -744,6 +745,7 @@ mod tests {
analytics: AnalyticsConfig {
enabled: false,
geoip_db_path: None,
otel_only: false,
},
blocking: BlockingConfig { enabled: false },
};
Expand Down Expand Up @@ -774,6 +776,7 @@ mod tests {
analytics: AnalyticsConfig {
enabled: false,
geoip_db_path: None,
otel_only: false,
},
blocking: BlockingConfig { enabled: false },
};
Expand Down Expand Up @@ -972,6 +975,7 @@ mod tests {
analytics: AnalyticsConfig {
enabled: false,
geoip_db_path: None,
otel_only: false,
},
blocking: BlockingConfig { enabled: false },
};
Expand Down
Loading
Loading