Skip to content

Commit b7b9c6d

Browse files
authored
fix: do not use EnvironmentExist in GetEnvironmentValue (#83)
EnvironmentExist should not be used because it checks for DD_ prefixed keys most of the time, however GetEnvironmentValue has some extra logic for PYROSCOPE_ prefixed keys
1 parent e28fbed commit b7b9c6d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

profiler/src/ProfilerEngine/Datadog.Profiler.Native/Configuration.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,8 @@ static bool convert_to(shared::WSTRING const& s, DeploymentMode& result)
682682
template <typename T>
683683
T Configuration::GetEnvironmentValue(shared::WSTRING const& name, T const& defaultValue)
684684
{
685-
if (!shared::EnvironmentExist(name)) return defaultValue;
685+
// pyroscope: next line is removed because shared::GetEnvironmentValue has DD_ => PYROSCOPE_ fallback
686+
// if (!shared::EnvironmentExist(name)) return defaultValue;
686687

687688
T result{};
688689
auto r = shared::GetEnvironmentValue(name);

0 commit comments

Comments
 (0)