Skip to content
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
9 changes: 9 additions & 0 deletions scripts/datadog_wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ export DD_TRACE_STATS_COMPUTATION_ENABLED="${DD_TRACE_STATS_COMPUTATION_ENABLED:

debug_log "DD_TRACE_STATS_COMPUTATION_ENABLED: $DD_TRACE_STATS_COMPUTATION_ENABLED"

# When the tracer has no API key, load feature flag config through the
# extension, which adds the key it resolved (e.g. from DD_API_KEY_SECRET_ARN).
# The variables are every API key setting dd-trace-java reads, plus
# DATADOG_API_KEY, which dd-trace-js reads (Node uses this wrapper for AppSec).
if [[ "$DD_API_KEY$DATADOG_API_KEY$DD_API_KEY_FILE$DD_PROFILING_API_KEY$DD_PROFILING_API_KEY_FILE$DD_PROFILING_APIKEY$DD_PROFILING_APIKEY_FILE" =~ ^[[:space:]]*$ ]]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

My only concern is this could potentially break customers who set their API key only in a Java system property or a Java/.NET config file. The wrapper can’t see those keys and will set the local base URL. The tracer then sends the request without its key, so the extension returns 403 if it doesn’t have a key of its own.

then
export DD_FEATURE_FLAGS_CONFIGURATION_SOURCE_AGENTLESS_BASE_URL="${DD_FEATURE_FLAGS_CONFIGURATION_SOURCE_AGENTLESS_BASE_URL:-http://127.0.0.1:8126}"
fi

# if it is .NET
if [[ "$AWS_EXECUTION_ENV" == *"dotnet"* ]]
then
Expand Down
Loading