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

Unix domain sockets for APM in libdd_opentracing #125

Closed
cep21 opened this issue Feb 5, 2020 · 5 comments · Fixed by #133
Closed

Unix domain sockets for APM in libdd_opentracing #125

cep21 opened this issue Feb 5, 2020 · 5 comments · Fixed by #133

Comments

@cep21
Copy link

cep21 commented Feb 5, 2020

Hi,

I currently use unix domain sockets in my k8s setup because they are easier to safely share across containers than host ports. Some more information about them here. I also have them working for APM inside python and various dd-trace libraries. I would like to enable APM for my k8s nginx ingress controller. I believe it uses libdd_opentracing.so. If I configure the field agent_host to a unix domain socket will it "just work"? Any advice on using UDS + nginx via the libdd_opentracing.so integration?

Thanks!

@cep21
Copy link
Author

cep21 commented Feb 5, 2020

I believe it will not work due to how the agent protocol is setup at https://github.com/DataDog/dd-opentracing-cpp/blob/master/src/agent_writer.cpp#L44

@cgilmour
Copy link
Contributor

cgilmour commented Feb 5, 2020

You're correct, it will not "just work".
The agent writer is implemented using libcurl, and that needs extra options set when using a unix domain socket as the transport instead of TCP.

@cep21
Copy link
Author

cep21 commented Feb 5, 2020

Thanks for the update. Would support for unix domain sockets for APM be reasonable feature to track for libdd_opentracing.so?

@cgilmour
Copy link
Contributor

Hi @cep21, this has been added and will ship in the next release.
To enable it, a few steps will be required:

  • configure a volume mount for the agent daemonset. It will create the socket in this location
  • add the DD_APM_RECEIVER_SOCKET environment variable to the agent, providing a path within the volume mount. Eg; if the mount path is /var/run/datadog-agent, then the variable should be set to /var/run/datadog-agent/trace-agent.socket
  • put an identical volume mount on the ingress-controller's deployment
  • add the DD_TRACE_AGENT_URL environment variable to that deployment, set to the same value as DD_APM_RECEIVER_SOCKET from the earlier step
  • make sure that nginx will pass-through the environment variable using the directive env DD_APM_RECEIVER_SOCKET;. One way to set this is using the main snippet configuration.

@cep21
Copy link
Author

cep21 commented Apr 16, 2020

I'm guessing I also have to wait for a release of the nginx controller that has the latest ddtrace library? Can you update when that happens (or do you know which release it should target?)

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

Successfully merging a pull request may close this issue.

2 participants