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

gRPC loading issue with OTLP Exporter on .NET Framework 4.8 #4999

Closed
ClumsyPenguin opened this issue Oct 27, 2023 · 6 comments
Closed

gRPC loading issue with OTLP Exporter on .NET Framework 4.8 #4999

ClumsyPenguin opened this issue Oct 27, 2023 · 6 comments
Labels
bug Something isn't working pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package

Comments

@ClumsyPenguin
Copy link

ClumsyPenguin commented Oct 27, 2023

Bug Report

OTel packages:

OpenTelemetry V1.6.0
OpenTelemetry.Api V1.6.0
OpenTelemetry.Api.ProviderBuilderExtensions V1.6.0
OpenTelemetry.Exporter.Console V1.6.0
OpenTelemetry.Exporter.OpenTelemetryProtocol_V1.6.0_
OpenTelemetry.Extensions.Hosting V1.6.0
OpenTelemetry.Instrumentation.AspNet V1.6.0-beta.1
OpenTelemetry.Instrumentation.AspNet.TelemetryHtppModule V1.6.0-beta.1
OpenTelemetry.Instrumentation.Http V1.5.1-beta.1
OpenTelemetry.Instrumentation.SqlClient V1.5.1-beta.1

gRPC packages:

Grpc.Core.Api V2.46.6
Grpc V2.46.6
Grpc.Core V2.46.6

Runtime version: net48

Symptom

StackTrace of the issue

System.IO.FileNotFoundException: Error loading native library. Not found in any of the possible locations: C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Grpc.Core\v4.0_2.0.0.0__d754f35622e28bad\grpc_csharp_ext.x64.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Grpc.Core\v4.0_2.0.0.0__d754f35622e28bad\runtimes/win-x64/native\grpc_csharp_ext.x64.dll,C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Grpc.Core\v4.0_2.0.0.0__d754f35622e28bad\../..\runtimes/win-x64/native\grpc_csharp_ext.x64.dll
   at Grpc.Core.Internal.UnmanagedLibrary.FirstValidLibraryPath(String[] libraryPathAlternatives)
   at Grpc.Core.Internal.UnmanagedLibrary..ctor(String[] libraryPathAlternatives)
   at Grpc.Core.Internal.NativeExtension.LoadNativeMethodsUsingExplicitLoad()
   at Grpc.Core.Internal.NativeExtension.LoadNativeMethods()
   at Grpc.Core.Internal.NativeExtension..ctor()
   at Grpc.Core.Internal.NativeExtension.Get()
   at Grpc.Core.Internal.NativeMethods.Get()
   at Grpc.Core.GrpcEnvironment.GrpcNativeInit()
   at Grpc.Core.GrpcEnvironment..ctor()
   at Grpc.Core.GrpcEnvironment.AddRef()
   at Grpc.Core.Channel..ctor(String target, ChannelCredentials credentials, IEnumerable`1 options)
   at Grpc.Core.Channel..ctor(String target, ChannelCredentials credentials)
   at OpenTelemetry.Exporter.OtlpExporterOptionsExtensions.CreateChannel(OtlpExporterOptions options)
   at OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation.ExportClient.OtlpGrpcTraceExportClient..ctor(OtlpExporterOptions options, TraceServiceClient traceServiceClient)
   at OpenTelemetry.Exporter.OtlpExporterOptionsExtensions.GetTraceExportClient(OtlpExporterOptions options)
   at OpenTelemetry.Exporter.OtlpTraceExporter..ctor(OtlpExporterOptions exporterOptions, SdkLimitOptions sdkLimitOptions, IExportClient`1 exportClient)
   at OpenTelemetry.Trace.OtlpTraceExporterHelperExtensions.BuildOtlpExporterProcessor(OtlpExporterOptions exporterOptions, SdkLimitOptions sdkLimitOptions, IServiceProvider serviceProvider, Func`2 configureExporterInstance)
   at OpenTelemetry.Trace.OtlpTraceExporterHelperExtensions.<>c__DisplayClass2_0.<AddOtlpExporter>b__1(IServiceProvider sp)
   at OpenTelemetry.Trace.TracerProviderBuilderExtensions.<>c__DisplayClass8_0.<AddProcessor>b__0(IServiceProvider sp, TracerProviderBuilder builder)
   at OpenTelemetry.Trace.OpenTelemetryDependencyInjectionTracingServiceCollectionExtensions.ConfigureTracerProviderBuilderCallbackWrapper.ConfigureBuilder(IServiceProvider serviceProvider, TracerProviderBuilder tracerProviderBuilder)
   at OpenTelemetry.Trace.TracerProviderSdk..ctor(IServiceProvider serviceProvider, Boolean ownsServiceProvider)
   at OpenTelemetry.Trace.TracerProviderBuilderBase.Build()
   at OpenTelemetry.Trace.TracerProviderBuilderBase.InvokeBuild()
   at OpenTelemetry.Trace.TracerProviderBuilderExtensions.Build(TracerProviderBuilder tracerProviderBuilder)

What is the expected behavior?

Working OTLP exporter in combination with .NET Framework 4.8

Reproduce

MVP reproducing the issue described above:
https://github.com/ClumsyPenguin/OtelExporter

image

Additional context

I am using manual instrumentation through an interceptor in our common interfaces for Services, Repositories, Controllers, etc...

Previously i was using Jaeger exporter to view my traces in Jaeger UI. However since that package is deprecated i am trying to switch to the OTLP exporter at this moment.

Current workaround is to switch back to the deprecated Jaeger exporter for now.

Ticker originates from open-telemetry/opentelemetry-dotnet-instrumentation#3044

@ClumsyPenguin ClumsyPenguin added the bug Something isn't working label Oct 27, 2023
@ClumsyPenguin
Copy link
Author

Possible related prs/issues:

#4860
#4719
#3421
#4613

@vishweshbankwar vishweshbankwar added the pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package label Nov 16, 2023
@tarasevichvlad
Copy link

Hi. Any info for this topic? Any workround?

Copy link
Contributor

This issue was marked stale due to lack of activity and will be closed in 7 days. Commenting will instruct the bot to automatically remove the label. This bot runs once per day.

@github-actions github-actions bot added the Stale Issues and pull requests which have been flagged for closing due to inactivity label Nov 14, 2024
@smunukuru170
Copy link

hi..wondering if there is a solution for this. I am having the same issue when implementing zero code instrumentation for a .net component running on docker.

@github-actions github-actions bot removed the Stale Issues and pull requests which have been flagged for closing due to inactivity label Nov 16, 2024
@philipuren
Copy link

I have the same problem, also with .Net Framework 4.8, but with the same code in .Net 8 I didn't have any problems.
Then I copied
C:\Users\Me.nuget\packages\grpc.core\2.44.0\runtimes\win-x64\native\grpc_csharp_ext.x64.dll
into
C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Grpc.Core\v4.0_2.0.0.0__d754f35622e28bad
This temporary work-around worked, although I hate it.

@rajkumar-rangaraj
Copy link
Contributor

The issue has been resolved in version 1.11.0-rc.1 of OpenTelemetry.Exporter.OpenTelemetryProtocol. In this version, we have removed the dependencies on Grpc packages, which should fix the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package
Projects
None yet
Development

No branches or pull requests

6 participants