Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version mismatch #3168

Closed
Kielek opened this issue Nov 30, 2023 · 5 comments · Fixed by #3343
Closed

Version mismatch #3168

Kielek opened this issue Nov 30, 2023 · 5 comments · Fixed by #3343
Milestone

Comments

@Kielek
Copy link
Contributor

Kielek commented Nov 30, 2023

Same issue here. Where the project, or dependant projects, have direct dependencies on Microsoft.Extensions.* 6.0, we are having Could not load file or assembly issues. Adding OpenTelemetry.AutoInstrumentation nuget package does not solve the issue.

I am not familiar on how the injection mechanism work, but why a net6 project should hard reference Microsoft.Extensions 7.* packages?
Shouldn't be that depending on the target framework, the dependancy is >= [targetframework].*

Originally posted by @federicobarera in #3075 (comment)

@Kielek
Copy link
Contributor Author

Kielek commented Nov 30, 2023

@federicobarera, could you please create Minimal, Reproducible Example? It should include all steps you are using to build the package.

@federicobarera
Copy link

federicobarera commented Dec 1, 2023

Hi, you can find a repro with instructions here: https://github.com/federicobarera/otel-auto-repro

image

@rajkumar-rangaraj
Copy link
Contributor

To resolve an issue, you have to either remove this package reference or update it to version 7.0.0: <PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" /> in the https://github.com/federicobarera/otel-auto-repro/blob/master/Dependencies/Dependencies.csproj. We are aware of the root cause of the issue and will address the application crash issue in the next version. Instead of crashing the app, it should safely back off and provide more detailed information in the log files to aid in fixing the issue.

@federicobarera
Copy link

federicobarera commented Dec 1, 2023

@rajkumar-rangaraj, @Kielek

I have a couple more questions regarding this issue.

EDIT:

  1. The Troubleshooting docs mention that adding OpenTelemetry.AutoInstrumentation should auto resolve the versioning issues. This is not happening. Is this a bug or an intended behavior/limitation. As we are planning adoption across tens of teams and projects I am trying to assess the effort required in getting auto instrumentation working.

  2. net8. We also had compatibility issues with projects runing net8 and the 0.43 operator (referencing 1.11 AutoInstrumentation Assembly -> Microsoft.Extensions 7.x). Given the next verson (1.12) is referencing 8.x Microsoft.Ex, are all applications expected to adopt 8.x Microsoft.Ex dependencies? Do you know when the next operator is going to support the next version of the auto instrumentation?

  3. We hoped for an initial no-code changes adoption of otel. The assembly conflicts seem to indicate that this is not going to be the case. Is there any future plan for the auto-instrumentation to be able to work with both net6/8 using whatever version of assemblies is available in the runtime?

@rajkumar-rangaraj
Copy link
Contributor

@federicobarera OpenTelemetry .NET SDK has reference to old version of Microsoft.Extensions.Logging.Configuration. Hence the usage of NuGet did not help.

  "OpenTelemetry/1.6.0": {
    "dependencies": {
      "Microsoft.Extensions.Logging.Configuration": "3.1.0",
      "OpenTelemetry.Api.ProviderBuilderExtensions": "1.6.0"
    },
    "runtime": {
      "lib/net6.0/OpenTelemetry.dll": {
        "assemblyVersion": "1.0.0.0",
        "fileVersion": "1.6.0.1006"
      }
    }
  },

Next Version (1.7) version of OpenTelemetry .NET SDK has 8.0.0. version of Microsoft.Extensions.Logging.Configuration. When auto-instrumentation takes reference to next version of OpenTelemetry .NET SDK, this issue will be resolved. OpenTelemetry .NET SDK might release 1.7 version of SDK next month.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants