DataDog / dd-trace-dotnet

.NET Client Library for Datadog APM
https://docs.datadoghq.com/tracing/
Apache License 2.0
456 stars 142 forks source link

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

Open saugereau opened 2 days ago

saugereau commented 2 days ago

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):

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 commented 2 days ago

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 commented 1 day ago

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

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) ?