Use OpenTelemetry .NET API and SDK instead Datadog tracer model.
Instrumented HTTP client and HTTP server applciations exporting traces to Jaeger. We may also try adding manual instrumentation.
We may add additional requirements for the instrumented applications such us:
- Add references to OpenTelemetry NuGet packages.
- Concrete versions of OpenTelemetry NuGet packages must be used.
- Must use newer versions of .NET.
- Prepare the use case secenario and make sure it is working.
- Get rid of everything, but HTTP Client and HTTP Server instrumentation. Reason: quicker iterations (especially thanks to quicker build time). Make sure the use case is still working.
It would be good to have some automation here to test without doing to much stuff manually.
- Remove
Datadog.Trace.Tracer
and a lot of related code. We can just keep the AutoInstrumentation integration boilerplate for HTTP Client and ASP.NET. - Change the
OpenTelemetry.ClrProfiler.Instrumentation.Initialize()
method so that it will be the place where the global OTel trace provider will be configured.
It would be good to have a checkpoint here where the instrumented application is NOOP-instrumented.
- Hardcode the global OTel tracer configuration.
- Configure the OTel tracer based on env vars. SDK should handle it. question
- Add manual instrumentation to the applications.
- Try auto-instrumentation using ActivitySource
e.g. in
OpenTelemetry.ClrProfiler.AutoInstrumentation.Http.HttpClient.HttpMessageHandlerCommon
. - Test with different versions of OTel SDK in runtime.
- Try using
AppDomain.CurrentDomain.AssemblyResolve +=
to add a fallback if the instrumented app does not reference the OTel SDK.
- https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/src/OpenTelemetry/README.md#activity-source
- https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/examples/Console/TestHttpClient.cs
Add msbuild
to your PATH
. You can do it by adding to ~/.bashrc
something more or less like bellow:
PATH="$PATH:/c/Program Files (x86)/Microsoft Visual Studio/2019/Professional/MSBuild/Current/Bin"
sudo mkdir -p /var/log/opentelemetry/dotnet
sudo chmod a+rwx /var/log/opentelemetry/dotnet
Make sure to run
dotnet nuke Clean BuildTracer
before running the PoC smoke test.
For .NET Core 3.1 run:
./poc.sh
For .NET 5.0 run:
aspNetAppTargetFramework=net5.0 sampleAppTargetFramework=net5.0 ./poc.sh
For .NET Framework run:
sampleAppTargetFramework=net46 ./poc.sh
To instrument the .NET BindingRedirect sample application run:
sampleAppTargetFramework=net472 sampleApp=BindingRedirect ./poc.sh