mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 07:38:33 -06:00
have akka.net and signalr communicating
This commit is contained in:
@@ -1,7 +1,23 @@
|
||||
using System.Diagnostics;
|
||||
using System.Security.Policy;
|
||||
|
||||
public static class DiagnosticsConfig
|
||||
{
|
||||
public const string SourceName = "canvas-management-source";
|
||||
public static ActivitySource Source = new ActivitySource(SourceName);
|
||||
public readonly static ActivitySource Source = new(SourceName);
|
||||
|
||||
public static Activity? Activity(this ITraceableMessage message, string activityName)
|
||||
{
|
||||
if (message.ParentTrace != null && message.ParentSpan != null)
|
||||
{
|
||||
ActivityContext parentContext = new ActivityContext(
|
||||
(ActivityTraceId)message.ParentTrace,
|
||||
(ActivitySpanId)message.ParentSpan,
|
||||
ActivityTraceFlags.Recorded
|
||||
);
|
||||
|
||||
return Source?.StartActivity(activityName, ActivityKind.Internal, parentContext);
|
||||
}
|
||||
return Source?.StartActivity(activityName);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user