opentelemetry-dotnet-instrumentation icon indicating copy to clipboard operation
opentelemetry-dotnet-instrumentation copied to clipboard

[Question] Does Automatic Instrumentation handle cases when tracing-related dependencies are not added to .csproj?

Open animysore opened this issue 2 years ago • 4 comments

This is a question regarding a specific use-case and if the automatic instrumentation technique supports it. If my ASP.Net application does not reference any tracing related libraries (i.e. OpenTelemetry SDK, OpenTracing, DiagnosticsSource, Logging.Extensions, etc.) will the automatic instrumentation handle this case, by copying over the necessary DLLs, their child dependencies, and capture incoming and outgoing HTTP messages?

Just wanted to clarify this because all the examples provided include some or all of the above dependencies in their .csproj files.

Thanks!😄

animysore avatar Jul 26 '22 03:07 animysore

TL;DR; Yes. In case of problems look at the troubleshooting docs.

The automatic instrumentation binaries should contain all needed references. They should be automatically loaded when needed. However, there are a few cases when dependencies must be manually provided; see:

Please let us know if the provided information is helpful. Feel free to ask more questions if needed. Finally, close the issue if you do not need any more help at the moment 😉

pellared avatar Jul 26 '22 04:07 pellared

Thank you @pellared 😄 Closing this issue as no other questions (for now 😉 ).

animysore avatar Jul 27 '22 08:07 animysore

Re-opening this to ask a follow up question (would be happy to move it to a new issue if needed)

Is it possible to enable automatic aspnet instrumentation, without having to modify the Web.config or applicationHost.config files to add the TelemetryHttpModule dependency?

Just thinking out loud - there are certain ways to programmatically register HTTP Modules - like here where they use a PreApplicationStartMethod attribute; do you think a solution like the one described here might be added in this library to automate the registration of TelemetryHttpModule as well?

animysore avatar Aug 03 '22 19:08 animysore

So far our discussions have only covered what you can see in #689. We are currently focusing on addressing other instrumentation gaps and usability issues, but we welcome any thoughts, ideas, or prototypes that you may have on the subject.

nrcventura avatar Aug 03 '22 19:08 nrcventura

Closing for now, please rise new ticket if we can help.

Kielek avatar Aug 17 '22 16:08 Kielek