Hejle
Manual setup of OpenTelemetry with/without Microsoft.Extensions.Hosting in a Console application
Alright, I actually found the solution myself
I had forgotten to register my actitivy-source with the AddSource-method.
So it should have looked like this:
And It does apear to be neccesary to call StartAsync for OTL to listen to the Acitivy.
4 replies
Manual setup of OpenTelemetry with/without Microsoft.Extensions.Hosting in a Console application
Note: It does not seem to matter if I StartAsync or not, but I feel like that could be related to the issue I have.
I am also using the following imports:
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="OpenTelemetry" Version="1.7.0-alpha.1" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.7.0-alpha.1" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.7.0-alpha.1" />
4 replies