-
Notifications
You must be signed in to change notification settings - Fork 731
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
OpenTelemetry against Jaeger works in Simple but not Batch #2758
Comments
Yes, it is possible. The Jaeger exporter defaults to We have a sample ASP.NET application targeting .NET Framework 4.8 which can be configured to use the Jaeger exporter using the batch processor. The exporter can be configured here (change opentelemetry-dotnet/examples/AspNet/Web.config Lines 8 to 10 in 2df1a62
We'd need a more complete repro in order to assist any further. |
Well, I'm not running this as an ASP.NET application. Might that be part of the issue? I have a console application right now where I test this out, as the end goal for this is not to have it for web purposes, but for an .NET framework 4.8 based application.
I'll see if I can include a more complete code to reproduce this. |
I have this hooked up with Fody and MethodBoundaryAspect.Fody in the end. So you can probably ignore some of the interface referenced "On..." code that is found in the end of the OpenTelemetryAdapter.cs -> OpenTelemetryEngine -> Startup.cs OpenTelemetryAdapter.cs
OpenTelemetryEngine.cs
Startup.cs
|
Is your application short running? It could be that not enough time passes for the batch to be sent. If this is the case there's a couple ways you can solve it. Either delay the termination of your application or disposing your tracer provider as I do in this minimal example: using System.Diagnostics;
using OpenTelemetry;
using OpenTelemetry.Trace;
namespace ConsoleApp1
{
internal class Program
{
static void Main(string[] args)
{
using (var tracerProvider = Sdk.CreateTracerProviderBuilder()
.AddSource("MySource")
// Using all the default options. This will use the batch processor.
.AddJaegerExporter()
.Build())
{
using (var activitySource = new ActivitySource("MySource"))
{
using (var activity = activitySource.StartActivity("Root"))
{
activity?.Stop();
}
}
}
}
}
} |
Iv read your thought about being to short. Im not sure how it could be to short as there is a task delay of 500 ms. Im running with the latest OT 1.1.0 you get by NuGet in VS.
|
Invoking |
So, what dose this mean? Shorter |
@alanwest your short example with the |
@alanwest Iv understod now that by disposing the trace provider before the application terminates, everything will work as it should. Because you are right, this application is very fast and dose not get correct closure for the trace provider. All that is left now is to see if this will work in a real case as well where the application that uses this process wont get terminated abruptly. But that's another chapter. So I guess this question can be closed now as all questions about this so far are solved. Thank you for your help and insight! |
Great, glad you got things working! |
Have a pretty much working environment to use for tracing, OpenTelemetry against Jaeger Tracing. I sort of read that
ExportProcessorType.Batch
is preferred and more efficient thenExportProcessorType.Simple
. How ever, when running in .NET Framework 4.8 application,ExportProcessorType.Batch
dose not seem to give any results being logged. I did a data packet capture with Wireshark and found out data did not even get sent when running withExportProcessorType.Batch
.Is there something with this configuration that is missing to have this as
ExportProcessorType.Batch
instead ofExportProcessorType.Simple
? Or is it not even possible to run in Batch?The text was updated successfully, but these errors were encountered: