Skip to main content

adk_telemetry/
config.rs

1//! Runtime configuration for semantic convention emission.
2//!
3//! Controls opt-in behaviors that cannot be gated at compile time,
4//! such as content event capture.
5
6/// Runtime configuration for semantic convention emission.
7///
8/// Controls opt-in behaviors like content capture that are disabled by default
9/// for privacy protection.
10///
11/// # Example
12/// ```
13/// use adk_telemetry::config::SemconvConfig;
14///
15/// // Default: content capture disabled
16/// let config = SemconvConfig::default();
17/// assert!(!config.capture_content);
18///
19/// // Enable content capture for debugging
20/// let debug_config = SemconvConfig { capture_content: true };
21/// ```
22#[derive(Debug, Clone, Default)]
23pub struct SemconvConfig {
24    /// Whether to capture prompt/completion content as span events.
25    ///
26    /// Default: `false` (privacy protection).
27    /// When enabled, full prompt and completion text is emitted as span events.
28    pub capture_content: bool,
29}
30
31#[cfg(test)]
32mod tests {
33    use super::*;
34
35    #[test]
36    fn test_default_config_disables_content_capture() {
37        let config = SemconvConfig::default();
38        assert!(!config.capture_content);
39    }
40
41    #[test]
42    fn test_config_can_enable_content_capture() {
43        let config = SemconvConfig { capture_content: true };
44        assert!(config.capture_content);
45    }
46}