jaegertracing / jaeger-client-csharp

🛑 This library is DEPRECATED!
https://jaegertracing.io/
Apache License 2.0
304 stars 67 forks source link

Warnings :invalid parent span IDs=5de506523c95fe6d; skipping clock skew adjustment #209

Closed kou-h closed 3 years ago

kou-h commented 3 years ago

How can I solve it。 .net 5 image

Falco20019 commented 3 years ago

This also occurred in #207 yesterday, so maybe something changed in the server side. I will consult @yurishkuro about this. Thanks for reporting.

yurishkuro commented 3 years ago

the message means there is parent span id present on the root span, but the parent span itself is missing

Falco20019 commented 3 years ago

So sounds like some spans were not finished and therefore not transmitted. Please make sure to call Finish on the span to finalize it and also make sure to dispose the tracer when the application ends. Otherwise, it can happen that some spans get lost on end.

kou-h commented 3 years ago

the message means there is parent span id present on the root span, but the parent span itself is missing

OK, I see. Thank you

kou-h commented 3 years ago

So sounds like some spans were not finished and therefore not transmitted. Please make sure to call Finish on the span to finalize it and also make sure to dispose the tracer when the application ends. Otherwise, it can happen that some spans get lost on end.

OK, I see. Thank you。 Sorry, there's one more question. I don't want to upload the information printed by c#ilogger to Jaeger. Is there any way to solve it. image

Falco20019 commented 3 years ago

These are not from the ILogger. These are from span.Log calls. I assume you use OpenTracing.Contrib.NetCore, so what you see is what is documented here: https://github.com/opentracing-contrib/csharp-netcore#microsoftextensionslogging-based-instrumentation

You can disable log entries you are not interested in from within you Startup code:

services.Configure<LoggerFilterOptions>(options =>
{
    // All interesting request-specific logs are instrumented via DiagnosticSource.
    options.AddFilter<OpenTracingLoggerProvider>("Microsoft.AspNetCore.Hosting", LogLevel.None);

    // The "Information"-level in ASP.NET Core is too verbose.
    options.AddFilter<OpenTracingLoggerProvider>("Microsoft.AspNetCore", LogLevel.Warning);

    // EF Core is sending everything to DiagnosticSource AND ILogger so we completely disable the category.
    options.AddFilter<OpenTracingLoggerProvider>("Microsoft.EntityFrameworkCore", LogLevel.None);
});

These are namespaces and you can work with prefixes. So setting Microsoft you would disable everything from classes in any namespaces related to Microsoft and Microsoft.*. So just set these for the log sources you are not interested in. Completely disabling is a bit harder since I have seen no way to configure the OpenTracingLogger directly.

The only way I could think of to completely remove the the LoggerProvider is doing the initialization yourself by calling AddOpenTracingCoreServices instead of AddOpenTracing and just without adding the logger line: https://github.com/opentracing-contrib/csharp-netcore/blob/e5b0c8a6fc1321ff87f558b69c5ad1a95912acc3/src/OpenTracing.Contrib.NetCore/Configuration/ServiceCollectionExtensions.cs#L22-L37

kou-h commented 3 years ago

这些不是来自。这些来自呼叫。我想你用,所以你看到的是什么记录在这里:https://github.com/opentracing-contrib/csharp-netcore#microsoftextensionslogging-based-instrumentationILogger``span.Log``OpenTracing.Contrib.NetCore

您可以从启动代码内禁用您不感兴趣的日志条目:

services.Configure<LoggerFilterOptions>(options =>
{
    // All interesting request-specific logs are instrumented via DiagnosticSource.
    options.AddFilter<OpenTracingLoggerProvider>("Microsoft.AspNetCore.Hosting", LogLevel.None);

    // The "Information"-level in ASP.NET Core is too verbose.
    options.AddFilter<OpenTracingLoggerProvider>("Microsoft.AspNetCore", LogLevel.Warning);

    // EF Core is sending everything to DiagnosticSource AND ILogger so we completely disable the category.
    options.AddFilter<OpenTracingLoggerProvider>("Microsoft.EntityFrameworkCore", LogLevel.None);
});

这些是命名空间,您可以处理前缀。因此,设置微软,你会禁用一切从类在任何名称空间有关和。因此,只需将这些设置为您不感兴趣的日志源。完全禁用是有点困难,因为我已经看到没有办法直接配置。Microsoft``Microsoft.*``OpenTracingLogger

我能想到的完全删除的唯一方法是做初始化自己通过调用,而不是 只是没有添加记录线 :https://github.com/opentracing-contrib/csharp-netcore/blob/e5b0c8a6fc1321ff87f558b69c5ad1a95912acc3/src/OpenTracing.Contrib.NetCore/Configuration/ServiceCollectionExtensions.cs#L22-L37LoggerProvider``AddOpenTracingCoreServices``AddOpenTracing

Thank you very much. With AddOpenTracingCoreServices the problem can be solved.