open-telemetry / opentelemetry-dotnet-contrib

This repository contains set of components extending functionality of the OpenTelemetry .NET SDK. Instrumentation libraries, exporters, and other components can find their home here.
https://opentelemetry.io
Apache License 2.0
473 stars 282 forks source link

Reconsider adding `netstandard2.0` support for OpenTelemetry.Resources.AWS #1621

Closed prajon84 closed 3 weeks ago

prajon84 commented 8 months ago

Issue with OpenTelemetry.ResourceDetectors.AWS

Trying to add OpenTelemetry.ResourceDetectors.AWS but adding to in-house library project which is in netstandard 2.0 But, as per this PR, this library has been released in .net6.0 which is not usable in our case.

Additional Context

Can this library be updated to support for both net6.0,net8.0 and netstandard2.0 too something with similar as this

prajon84 commented 8 months ago

@Kielek

prajon84 commented 7 months ago

👋 @Kielek I want to consume OpenTelemetry.ResourceDetectors.AWS in netstandard library project.

Kielek commented 7 months ago

@prajon84, is there any reason why you cannot retarget you application to modern .NET versions? For now, there is no supported .NET version which is not covered by net6.0 or net462 target framework.

@srprash, @ppittle FYI

prajon84 commented 7 months ago

@prajon84, is there any reason why you cannot retarget you application to modern .NET versions? For now, there is no supported .NET version which is not covered by net6.0 or net462 target framework.

Because we are consuming it to in-house library which is netstandard2.0 not to our applications.

ghost commented 4 months ago

Hei @Kielek Updating to support .net8 runtimes wouldn't be a problem tho? I found out that aws instrumenting in an dotnet8 application is not working (whereas http instrumenting for exampel works). When i switched the runtime to dotnet6 for testing it worked. If it`s more than just updating the target runtimes, i can open a new issues as well... Thanks

Kielek commented 4 months ago

@ppittle, @srprash, could you please check previous comment?

ghost commented 4 months ago

@ppittle, @srprash, could you please check previous comment?

I did some more testing and it turned out that it actually works. The problem is that I do the AWS calls in a referenced project. So let`s say ProjectA starts the App and does the tracing with all of its instrumenting, and it calls Project B which for example sends a request to dynamo. Project B is a simple project reference, but is injected via DependencyInjection. In that case it is only registered as a HTTP request.

But anyways: Should the described Scenario work in theory? Is it some basic dotnet project config i am missing @Kielek ? Sorry for hijacking that tread btw

Update: I managed to find out the actual reason and created an issues for it: https://github.com/open-telemetry/opentelemetry-dotnet-contrib/issues/1953

ppittle commented 4 months ago

I haven't yet tried re-adding a NET Standard target, is there a technical impediment? Per https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1177, are the nullability improvements (which are very nice to have!) not work with NET Standard 2? Or is there an issue with build/deploy scripts?

If there's no technical challenge, I am ok with re-adding the .NET Standard target to support this use-case.

Kielek commented 3 weeks ago

Done in #2164. If you need a release, feel free to create request release. Closing.