datadog_agent_commons/platform/
mod.rs1#[cfg(target_os = "linux")]
4mod linux_impl;
5
6use std::path::{Path, PathBuf};
7
8#[cfg(target_os = "linux")]
9pub use self::linux_impl::*;
10
11#[cfg(target_os = "macos")]
12mod macos_impl;
13
14#[cfg(target_os = "macos")]
15pub use self::macos_impl::*;
16
17pub const DATADOG_AGENT_ENV_VAR_PREFIX: &str = "DD";
19
20pub struct PlatformSettings;
22
23impl PlatformSettings {
24 pub fn get_config_dir_path() -> &'static Path {
26 Path::new(DATADOG_AGENT_CONF_DIR)
27 }
28
29 pub fn get_config_file_path() -> PathBuf {
31 Self::get_config_dir_path().join("datadog.yaml")
32 }
33
34 pub fn get_auth_token_path() -> PathBuf {
36 Self::get_config_dir_path().join("auth_token")
37 }
38
39 pub fn get_ipc_cert_filename() -> &'static Path {
41 Path::new("ipc_cert.pem")
42 }
43
44 pub fn get_default_log_file_path() -> PathBuf {
46 Path::new(DATADOG_AGENT_LOG_DIR).join("agent-data-plane.log")
47 }
48
49 pub fn get_default_dogstatsd_log_file_path() -> PathBuf {
51 Path::new(DATADOG_AGENT_LOG_DIR)
52 .join("dogstatsd_info")
53 .join("dogstatsd-stats.log")
54 }
55
56 pub const fn get_default_syslog_uri() -> &'static str {
58 DATADOG_AGENT_DEFAULT_SYSLOG_URI
59 }
60
61 pub const fn get_env_var_prefix() -> &'static str {
63 DATADOG_AGENT_ENV_VAR_PREFIX
64 }
65}