opentelemetry-dotnet icon indicating copy to clipboard operation
opentelemetry-dotnet copied to clipboard

How to know AddOtlpExporter Endpoint is working or successful?

Open codingkondi opened this issue 2 years ago • 4 comments

when we add endpoint for Opentelemetry how to know the url is working or other way notice us?

 tracerProvider.AddOtlpExporter(opts =>
                {
                    opts.Protocol = OtlpExportProtocol.Grpc;
                    //how could I know the endpoint is work?
                    opts.Endpoint = new Uri(openTelemetrySetting.ServerUrl);
                });

codingkondi avatar Jul 14 '22 09:07 codingkondi

For troubleshooting SDK components like the OTLP exporter you can enable diagnostic logs. Instructions here https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry#self-diagnostics.

alanwest avatar Jul 14 '22 18:07 alanwest

For troubleshooting SDK components like the OTLP exporter you can enable diagnostic logs. Instructions here https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry#self-diagnostics.

Thanks! However, after I tested this feature, I wanna know could it add Ilogger pattern for logging? I wanna replace generating log file with sending log by Ilogger for monitoring.

codingkondi avatar Jul 15 '22 08:07 codingkondi

You can create your own EventListener for "OpenTelemetry-Exporter-OpenTelemetryProtocol" EventSource.

Here is an example of how OTel .NET AutoInstr captures OTel .NET SDK events for logging purposes. I think it is a little easier to understand than the one SdkSelfDiagnosticsEventListener.cs in OTel .NET SDK.

pellared avatar Jul 15 '22 10:07 pellared

There was an attempt to use ILogger for sending internal logs. Its not merged, and was proposed to be part of OTel.Extensions.Hosting package. When that is resurrected, it might be easy for piping to ILogger.

cijothomas avatar Jul 15 '22 16:07 cijothomas

Closing old issues with no new activity. https://github.com/open-telemetry/opentelemetry-dotnet/issues/3447#issuecomment-1185329104 is tracked via #3881

cijothomas avatar Feb 28 '23 17:02 cijothomas