DataDog / datadog-lambda-extension

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Duplicated javaagent when using the version v31 with datadog forwarder

LEQADA opened this issue · comments

commented

In this PR #86 the behavior of the extension was changed.

was

export JAVA_TOOL_OPTIONS="-javaagent:$DD_Agent_Jar -XX:+TieredCompilation -XX:TieredStopAtLevel=1"

and now it's

export JAVA_TOOL_OPTIONS="$JAVA_TOOL_OPTIONS -javaagent:$DD_Agent_Jar -XX:+TieredCompilation -XX:TieredStopAtLevel=1"

In the documentation it suggests to set JAVA_TOOL_OPTIONS env variable:

JAVA_TOOL_OPTIONS: -javaagent:"/opt/java/lib/dd-java-agent.jar" -XX:+TieredCompilation -XX:TieredStopAtLevel=1

But when we do that we get the JAVA_TOOL_OPTIONS with a duplicated javaagent

-javaagent:/opt/java/lib/dd-java-agent.jar -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -javaagent:/opt/java/lib/dd-java-agent.jar -XX:+TieredCompilation -XX:TieredStopAtLevel=1

Am I doing something wrong? Is there a new way to set the javaagent?

Hi!

Thanks for reaching out. The Datadog Extension and the Datadog Forwarder are mutually exclusive methods of ingesting data into Datadog.
The docs you linked to are for the datadog forwarder not the datadog extension. The Extension Docs are here.

The script in this library (modified in #86) was updated because JAVA_TOOL_OPTIONS is commonly used to set other flags, including compilation flags in #83.

If you're using this library, you shouldn't need to set -javaagent at all, as the script will do it.
Thanks!