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

dd-dotnet.sh from Trace.Bundle 3.4.1 #6327

Open
saugereau opened this issue Nov 20, 2024 · 5 comments
Open

dd-dotnet.sh from Trace.Bundle 3.4.1 #6327

saugereau opened this issue Nov 20, 2024 · 5 comments

Comments

@saugereau
Copy link

saugereau commented Nov 20, 2024

Describe the bug

Installation of Trace.Bundle 3.4.1 does not match the following documentation : https://docs.datadoghq.com/serverless/azure_container_apps/?code-lang=dotnet
The dd-dotnet.sh needs an argument

To Reproduce

When following the documentation :

=> ERROR [final 6/6] RUN /app/datadog/dd-dotnet.sh                                                                                                                                                                                                                                                                                                                                                                                                                                     0.3s
------                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
 > [final 6/6] RUN /app/datadog/dd-dotnet.sh:
0.300 Required command was not provided.
0.300 
0.300 Description:
0.300 
0.300 Usage:
0.300   dd-dotnet [command] [options]
0.300 
0.300 Examples:
0.300   dd-dotnet run --dd-env prod -- myApp --argument-for-my-app
0.300   dd-dotnet check process <pid>
0.300   dd-dotnet check iis <website>
0.300 
0.300 Options:
0.300   -?, -h, --help  Show help and usage information
0.300 
0.300 Commands:
0.300   check
0.300   run <command>  Run a command with the Datadog tracer enabled []
0.300 

Runtime environment (please complete the following information):

  • Instrumentation mode: [e.g. automatic with msi installer or manual with NuGet package]
  • Tracer version: 3.4.1
  • OS: Linux Docker Image : dotnet/sdk:8.0
  • CLR: .NET 8.0

Additional context

Config looks working with (/app is workdir)

RUN chmod +x /app/datadog/dd-dotnet.sh &&  \
    chmod +x /app/datadog/linux-x64/dd-dotnet && \
    chmod +x /app/datadog/linux-arm64/dd-dotnet

USER $APP_UID

ENTRYPOINT ["/app/datadog-init"]
CMD ["/app/datadog/dd-dotnet.sh", "run", "dotnet", "myapp.dll"]

Can you confirm that this kind of configuration is expected ?
Should the documentation be updated ?

@andrewlock
Copy link
Member

Sorry, I'm a little confused, are you referring to the Datadog.Trace.Bundle NuGet package? The docs you have shared there are for the serverless app which uses the serverless-init docker image instead. You can follow the instructions in the NuGet package readme to set the environment variables if so

Alternatively, if you're trying to set up AzureContainerApps, you don't need to use dd-dotnet.sh at all? It's not mentioned in the docs AFAICT?

@saugereau
Copy link
Author

saugereau commented Nov 21, 2024

Hi @andrewlock ,
Yes, I am referencing Datadog.Trace.Bundle. Let me explain why I reference here Datadog.Trace.Bundle :

  • I need custom span on my dotnet project, this is why I need to have a reference to Datadog.Trace lib (within a given version) in my project
  • I assume that if I only use Datadog.Trace and I use the dotnet.sh provided by serverless image, there is a potential mismatch of version between the both
  • How to guarantee that Datadog.Trace lib embedded on dotnet projet match with Tracer in serverless image ? is there any compatibility matrix ? We already see some issue when upgrading Trace lib keeping the same serverless image

Given that dotnet.sh only download latest version of dd-trace-dotnet should I really use the dotnet.sh script provided by the serverless-init docker image (especially if I have a reference to a non latest version of Datadog.Trace) ?

@andrewlock
Copy link
Member

andrewlock commented Nov 28, 2024

Apologies for the delay @saugereau and thanks for the update, that makes complete sense 👍 In terms of your configuration, I agree, what you are suggesting is pretty much the correct approach, I would just make a couple of tweaks to your suggestion:

# Also chmod and run the createLogPath.sh script
RUN chmod +x /app/datadog/dd-dotnet.sh &&  \
    chmod +x /app/datadog/linux-x64/dd-dotnet && \
    chmod +x /app/datadog/linux-arm64/dd-dotnet && \
    /myapp/datadog/createLogPath.sh

USER $APP_UID

# Invert these, so that the entrypoint is `dd-dotnet.sh`
ENTRYPOINT ["/app/datadog/dd-dotnet.sh"]
CMD ["run", "/app/datadog-init", "dotnet", "myapp.dll"]

Otherwise this looks spot on, we'll make sure to document this in the ACA documentation, thanks for bringing it up!

@saugereau
Copy link
Author

Hello @andrewlock ,
Thanks for feedback.
Are we agree that the dd-dotnet.sh use is the one provided by Trace.Bundle ?
Looks like that the dd-dotnet.sh provided by lib need arguments as describe in my issue description, this is why I used it in the CMD argument to wrap the dotnet process....

@andrewlock
Copy link
Member

Are we agree that the dd-dotnet.sh use is the one provided by Trace.Bundle ?

Yes, correct

Looks like that the dd-dotnet.sh provided by lib need arguments as describe in my issue description, this is why I used it in the CMD argument to wrap the dotnet process....

Yes, it needs a run argument, as shown in my message above 🙂
Apologies, I got the arguments back to front initially 🙈 🙄 (I should have copied my sample instead of rewriting 🤦‍♂)

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

2 participants