mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 23:28:33 -06:00
added quieter opentelemetry tracer
This commit is contained in:
20
Management.Web/CustomConsoleExporter.cs
Normal file
20
Management.Web/CustomConsoleExporter.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.Diagnostics;
|
||||
using OpenTelemetry;
|
||||
|
||||
public class CustomConsoleExporter : BaseExporter<Activity>
|
||||
{
|
||||
public override ExportResult Export(in Batch<Activity> batch)
|
||||
{
|
||||
using var scope = SuppressInstrumentationScope.Begin();
|
||||
|
||||
foreach (var activity in batch)
|
||||
{
|
||||
string[] ignoreOperations = [
|
||||
"Microsoft.AspNetCore.Hosting.HttpRequestIn",
|
||||
];
|
||||
if (!ignoreOperations.Contains(activity.OperationName))
|
||||
Console.WriteLine($"{activity.OperationName}: {activity.DisplayName}");
|
||||
}
|
||||
return ExportResult.Success;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user