opentelemetry-dotnet
opentelemetry-dotnet copied to clipboard
How to know AddOtlpExporter Endpoint is working or successful?
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);
});
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.
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.
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.
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.
Closing old issues with no new activity. https://github.com/open-telemetry/opentelemetry-dotnet/issues/3447#issuecomment-1185329104 is tracked via #3881