Skip to content

Commit

Permalink
[library-config] Apply host global config (#855)
Browse files Browse the repository at this point in the history
# What does this PR do?

* Parse default host config with correct precedence between local and fleet managed files
* Add all product enablement configurations for phase 1 
* Refactor deserialization and applying config to reduce code duplications and memory allocations (in particular we were copying the file bytes twice before, which we aren't now)
  • Loading branch information
paullegranddc authored Feb 5, 2025
1 parent 15bc56d commit e57ee81
Show file tree
Hide file tree
Showing 2 changed files with 470 additions and 137 deletions.
12 changes: 11 additions & 1 deletion library-config-ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,21 @@ pub extern "C" fn ddog_library_configurator_get(
pub extern "C" fn ddog_library_config_name_to_env(name: LibraryConfigName) -> ffi::CStr<'static> {
use LibraryConfigName::*;
ffi::CStr::from_std(match name {
DdTraceApmEnabled => ddcommon::cstr!("DD_TRACE_ENABLED"),
DdRuntimeMetricsEnabled => ddcommon::cstr!("DD_RUNTIME_METRICS_ENABLED"),
DdLogsInjection => ddcommon::cstr!("DD_LOGS_INJECTION"),
DdProfilingEnabled => ddcommon::cstr!("DD_PROFILING_ENABLED"),
DdDataStreamsEnabled => ddcommon::cstr!("DD_DATA_STREAMS_ENABLED"),
DdAppsecEnabled => ddcommon::cstr!("DD_APPSEC_ENABLED"),
DdIastEnabled => ddcommon::cstr!("DD_IAST_ENABLED"),
DdDynamicInstrumentationEnabled => ddcommon::cstr!("DD_DYNAMIC_INSTRUMENTATION_ENABLED"),
DdDataJobsEnabled => ddcommon::cstr!("DD_DATA_JOBS_ENABLED"),
DdAppsecScaEnabled => ddcommon::cstr!("DD_APPSEC_SCA_ENABLED"),

DdTraceDebug => ddcommon::cstr!("DD_TRACE_DEBUG"),
DdService => ddcommon::cstr!("DD_SERVICE"),
DdEnv => ddcommon::cstr!("DD_ENV"),
DdVersion => ddcommon::cstr!("DD_VERSION"),
DdProfilingEnabled => ddcommon::cstr!("DD_PROFILING_ENABLED"),
})
}

Expand Down
Loading

0 comments on commit e57ee81

Please sign in to comment.