-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathschema.rs
More file actions
117 lines (109 loc) · 4.24 KB
/
schema.rs
File metadata and controls
117 lines (109 loc) · 4.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
// Copyright 2024-Present Datadog, Inc. https://www.datadoghq.com/
// SPDX-License-Identifier: Apache-2.0
//! This module provides struct representing the info endpoint response
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
/// Wrapper for an agent info response storing the state hash from the agent
#[derive(Clone, Deserialize, Default, Debug, PartialEq)]
pub struct AgentInfo {
/// Hash of the info
pub state_hash: String,
/// Info response from the agent
pub info: AgentInfoStruct,
}
/// Schema of an agent info response
#[allow(missing_docs)]
#[derive(Clone, Serialize, Deserialize, Default, Debug, PartialEq)]
pub struct AgentInfoStruct {
/// Version of the agent
pub version: Option<String>,
/// Commit of the version of the agent
pub git_commit: Option<String>,
/// List of available endpoints
pub endpoints: Option<Vec<String>>,
/// List of feature flags
pub feature_flags: Option<Vec<String>>,
pub client_drop_p0s: Option<bool>,
pub span_meta_structs: Option<bool>,
pub long_running_spans: Option<bool>,
pub evp_proxy_allowed_headers: Option<Vec<String>>,
/// Configuration of the agent
pub config: Option<Config>,
/// List of keys mapped to peer tags
pub peer_tags: Option<Vec<String>>,
/// List of span kinds eligible for stats computation
pub span_kinds_stats_computed: Option<Vec<String>>,
/// Obfuscation version supported by the agent for client-side stats
pub obfuscation_version: Option<u32>,
/// Container tags hash from HTTP response header
pub container_tags_hash: Option<String>,
/// Exact-match tag filters applied before stats computation (root span only).
#[serde(default)]
pub filter_tags: FilterTagsConfig,
/// Regex-match tag filters applied before stats computation (root span only).
#[serde(default)]
pub filter_tags_regex: FilterTagsConfig,
/// Regex patterns for root-span resource names; matching traces are excluded from stats.
#[serde(default)]
pub ignore_resources: Vec<String>,
}
/// Require/reject lists for tag-based trace filters exposed by the agent /info endpoint.
#[derive(Clone, Serialize, Deserialize, Default, Debug, PartialEq)]
pub struct FilterTagsConfig {
/// All listed filters must match at least one root-span tag for the trace to be accepted.
#[serde(default)]
pub require: Vec<String>,
/// If any listed filter matches a root-span tag the trace is rejected.
#[serde(default)]
pub reject: Vec<String>,
}
#[allow(missing_docs)]
#[derive(Clone, Serialize, Deserialize, Default, Debug, PartialEq)]
pub struct Config {
pub default_env: Option<String>,
pub target_tps: Option<f64>,
pub max_eps: Option<f64>,
pub receiver_port: Option<i32>,
pub receiver_socket: Option<String>,
pub connection_limit: Option<i32>,
pub receiver_timeout: Option<i32>,
pub max_request_bytes: Option<i64>,
pub statsd_port: Option<i32>,
pub max_memory: Option<f64>,
pub max_cpu: Option<f64>,
pub analyzed_spans_by_service: Option<HashMap<String, HashMap<String, f64>>>,
pub obfuscation: Option<ObfuscationConfig>,
}
#[allow(missing_docs)]
#[derive(Clone, Serialize, Deserialize, Default, Debug, PartialEq)]
pub struct ObfuscationConfig {
pub elastic_search: bool,
pub mongo: bool,
pub sql_exec_plan: bool,
pub sql_exec_plan_normalize: bool,
#[cfg(feature = "stats-obfuscation")]
// Option because it might not exist with old agents
pub sql_obfuscation_mode: Option<libdd_trace_obfuscation::sql::SqlObfuscationMode>,
pub http: HttpObfuscationConfig,
pub remove_stack_traces: bool,
pub redis: RedisObfuscationConfig,
pub memcached: MemcachedObfuscationConfig,
}
#[allow(missing_docs)]
#[derive(Clone, Serialize, Deserialize, Default, Debug, PartialEq)]
pub struct HttpObfuscationConfig {
pub remove_query_string: bool,
pub remove_path_digits: bool,
}
#[allow(missing_docs)]
#[derive(Clone, Serialize, Deserialize, Default, Debug, PartialEq)]
pub struct RedisObfuscationConfig {
pub enabled: bool,
pub remove_all_args: bool,
}
#[allow(missing_docs)]
#[derive(Clone, Serialize, Deserialize, Default, Debug, PartialEq)]
pub struct MemcachedObfuscationConfig {
pub enabled: bool,
pub keep_command: bool,
}