Replies: 3 comments
-
The above already shows the issue.. There is no one listening for OTLP at the given url... Did you change to the right endpoint and it still does not work? If that is the case, share the self-diagnostics logs from that. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply. I should’ve clarified a few things: The same code which works on .NET 7 does not work on .NET Framework 4.7.2. So, I can say the URL, password and backend is working at some point. The logs I showed are from the right endpoint. I changed the URL after I created the log for safety reasons.
That's a point I can check. .NET Framework uses grpc.core package and not grpc.net.client package like .NET 7. Maybe the endpoint can’t/doesn’t listen to the older version. |
Beta Was this translation helpful? Give feedback.
-
I found my problem. grpc.core has a file with the name "roots.pem" the file includes all certificates used for grpc calls. I have my own certificates which obviously are not included in this file. For test purposes I made a few adjustments in the source code. I deleted reference for grpc.core, fixed following errors and used the workaround from Microsoft for using grpc client with .net framework https://learn.microsoft.com/en-us/aspnet/core/grpc/netstandard?view=aspnetcore-6.0#net-framework. It worked for me, so my only question is. Are there plans to migrate from grpc.core to grpc.net.client? grpc.core is already in maintenance mode and will be deprecated in the future. |
Beta Was this translation helpful? Give feedback.
-
I have a .NET Framework 4.6.2 Application which I want to instrument. The data will be exported to an azure backend.
I tried the following code in .NET 7. It works without any problems.
With these packages:
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.6.0" /> <PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.6.0" />
With the .NET Framework application the Self-Diagnostic-Tool gives this error:
If you are seeing this message, it means that the OpenTelemetry SDK has successfully created the log file used to write self-diagnostic logs. This file will be appended with logs as they appear. If you do not see any logs following this line, it means no logs of the configured LogLevel is occurring. You may change the LogLevel to show lower log levels, so that logs of lower severities will be shown.
2023-10-23T13:06:03.1112894Z:TracerProviderSdk event: '{0}'{Building TracerProvider.}
2023-10-23T13:06:03.2176181Z:TracerProviderSdk event: '{0}'{Sampler added = "OpenTelemetry.Trace.ParentBasedSampler".}
2023-10-23T13:06:03.2176181Z:TracerProviderSdk event: '{0}'{Processors added = "OpenTelemetry.BatchActivityExportProcessor".}
2023-10-23T13:06:03.2196188Z:TracerProviderSdk event: '{0}'{TracerProvider built successfully.}
2023-10-23T13:06:03.2316581Z:Activity started. Name = '{0}', Id = '{1}'.{Test}{00-f77f340abd2f7fa6e2d07e7ae7d00e7b-71800828f3eeb901-01}
2023-10-23T13:06:03.2351630Z:Activity stopped. Name = '{0}', Id = '{1}'.{Test}{00-f77f340abd2f7fa6e2d07e7ae7d00e7b-71800828f3eeb901-01}
2023-10-23T13:06:03.4198420Z:Exporter failed send data to collector to {0} endpoint. Data will not be sent. Exception: {1}{https://ExampleURL.com/}{Grpc.Core.RpcException: Status(StatusCode="Unavailable", Detail="failed to connect to all addresses", DebugException="Grpc.Core.Internal.CoreErrorDetailException: {"created":"@1698066363.409000000","description":"Failed to pick subchannel","file":"......\src\core\ext\filters\client_channel\client_channel.cc","file_line":3129,"referenced_errors":[{"created":"@1698066363.409000000","description":"failed to connect to all addresses","file":"......\src\core\lib\transport\error_utils.cc","file_line":163,"grpc_status":14}]}") ---> Grpc.Core.Internal.CoreErrorDetailException: {"created":"@1698066363.409000000","description":"Failed to pick subchannel","file":"......\src\core\ext\filters\client_channel\client_channel.cc","file_line":3129,"referenced_errors":[{"created":"@1698066363.409000000","description":"failed to connect to all addresses","file":"......\src\core\lib\transport\error_utils.cc","file_line":163,"grpc_status":14}]}
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Grpc.Core.Internal.AsyncCall
2.UnaryCall(TRequest msg) at Grpc.Core.Calls.BlockingUnaryCall[TRequest,TResponse](CallInvocationDetails
2 call, TRequest req)at Grpc.Core.DefaultCallInvoker.BlockingUnaryCall[TRequest,TResponse](Method
2 method, String host, CallOptions options, TRequest request) at Grpc.Core.Interceptors.InterceptingCallInvoker.<BlockingUnaryCall>b__3_0[TRequest,TResponse](TRequest req, ClientInterceptorContext
2 ctx)at Grpc.Core.ClientBase.ClientBaseConfiguration.ClientBaseConfigurationInterceptor.BlockingUnaryCall[TRequest,TResponse](TRequest request, ClientInterceptorContext
2 context, BlockingUnaryCallContinuation
2 continuation)at Grpc.Core.Interceptors.InterceptingCallInvoker.BlockingUnaryCall[TRequest,TResponse](Method
2 method, String host, CallOptions options, TRequest request) at OpenTelemetry.Proto.Collector.Trace.V1.TraceService.TraceServiceClient.Export(ExportTraceServiceRequest request, CallOptions options) at OpenTelemetry.Proto.Collector.Trace.V1.TraceService.TraceServiceClient.Export(ExportTraceServiceRequest request, Metadata headers, Nullable
1 deadline, CancellationToken cancellationToken)at OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation.ExportClient.OtlpGrpcTraceExportClient.SendExportRequest(ExportTraceServiceRequest request, CancellationToken cancellationToken)}
2023-10-23T13:06:03.4208416Z:ForceFlush invoked for processor type '{0}' returned result '{1}'.{BatchActivityExportProcessor}{True}
2023-10-23T13:06:03.4218412Z:'{0}' exporting to '{1}' dropped '0' items.{BatchActivityExportProcessor}{OtlpTraceExporter}
2023-10-23T13:06:03.4383632Z:'{0}' Disposed.{TracerProvider}
My question is do I need more configuration in a .NET Framework application? The only difference I can see is the referenced grpc package.
Beta Was this translation helpful? Give feedback.
All reactions