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

With Unix Domain Socket, DD_AGENT_HOST not ignored despite DD_TRACE_AGENT_URL #7036

Closed
pukkaone opened this issue May 15, 2024 · 4 comments
Closed
Assignees
Milestone

Comments

@pukkaone
Copy link

pukkaone commented May 15, 2024

While trying to send traces by Unix Domain Socket, I set both environment variables DD_AGENT_HOST and DD_TRACE_AGENT_URL. The documentation for DD_TRACE_AGENT_URL says:

When set this takes precedence over DD_AGENT_HOST and DD_TRACE_AGENT_PORT.

However, the DD_AGENT_HOST environment variable still affects where traces are sent.

How to reproduce

Execute this shell script:

DD_JAVA_AGENT_VERSION=1.34.0
if [ ! -f dd-java-agent.jar ]; then
  curl https://repo.maven.apache.org/maven2/com/datadoghq/dd-java-agent/$DD_JAVA_AGENT_VERSION/dd-java-agent-$DD_JAVA_AGENT_VERSION.jar --output dd-java-agent.jar
fi

cat <<EOF >HelloWorld.java
public class HelloWorld {
  public static void main(String[] args) throws Exception {
    java.util.concurrent.TimeUnit.SECONDS.sleep(1L);
    System.out.println("Hello, World!");
  }
}
EOF

export DD_AGENT_HOST=should-ignore
export DD_TRACE_AGENT_URL=unix:///var/run/datadog/apm.socket
export DD_TRACE_METHODS='HelloWorld[*]'
java -javaagent:dd-java-agent.jar HelloWorld.java

The DATADOG TRACER CONFIGURATION output to the console includes:

"agent_url":"http://should-ignore:8126",
"agent_unix_domain_socket":"/var/run/datadog/apm.socket"

The console output also includes:

[dd.trace 2024-05-15 15:06:43:904 -0700] [dd-trace-processor] WARN datadog.trace.agent.common.writer.ddagent.DDAgentApi - Error while sending 1 (size=526B) traces. Total: 1, Received: 1, Sent: 0, Failed: 1. java.net.UnknownHostException: should-ignore (Will not log warnings for 5 minutes)

Work around

If I do not set the DD_AGENT_HOST environment variable and set the DD_TRACE_AGENT_URL environment variable, then traces are sent to the intended Unix Domain Socket.

@mcculls
Copy link
Contributor

mcculls commented May 17, 2024

Hi @pukkaone - thanks for reporting, we'll fix this for the next release

@mcculls mcculls added this to the 1.35.0 milestone May 17, 2024
@mcculls mcculls self-assigned this May 17, 2024
@mcculls
Copy link
Contributor

mcculls commented May 30, 2024

Hi @pukkaone - this is fixed by #7094 which will be in the next release (1.35.0)

@amarziali
Copy link
Collaborator

The fix has been delivered in 1.35.0-RC1 freshly released.

Copy link

🤖 This issue has been addressed in the latest release. See full details in the Release Notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants