Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[.NET Profiler] Setup env var(s) for profiler #212

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions linux/datadog_wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,18 @@ setUpDotnetEnv() {
return
fi

echo "Exporting environment variables"
export CORECLR_ENABLE_PROFILING=1
export CORECLR_PROFILER="{846F5F1C-F9AE-4B07-969E-05C26BC060D8}"
export CORECLR_PROFILER_PATH="${DD_DIR}/Datadog.Trace.ClrProfiler.Native.so"
export DD_DOTNET_TRACER_HOME="${DD_DIR}"

if [[ "${DD_PROFILING_ENABLED:-,,}" == "1" ]]; then
echo "Profiler is enabled."
export LD_PRELOAD="${DD_DIR}/continuousprofiler/Datadog.Linux.ApiWrapper.x64.so"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if we definitely want to overwrite LD_PRELOAD or "append" to it? (I don't know if that's a thing for LD_PRELOAD)

fi
echo "Creating log folder for .NET APM"
${DD_DIR}/createLogPath.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm kind of surprised we weren't doing this already 😅 we may need to make this executable first?

Alternatively, I think you can run it as (but don't quote me):

Suggested change
${DD_DIR}/createLogPath.sh
sh ${DD_DIR}/createLogPath.sh

}

setUpJavaEnv() {
Expand Down Expand Up @@ -195,6 +203,10 @@ setUpPyEnv() {
}

main

# Allow the profiler to add this to its tag
export WEBSITE_OS="linux"

echo "Executing start command: \"$DD_START_APP\""
cd "$CURRENT_DIR"
eval "$DD_START_APP"