Skip to content

Commit 3b5a8f0

Browse files
author
nglore
committed
Addressing PR feedback
1 parent 3f789c0 commit 3b5a8f0

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/ReverseProxy/Delegation/HttpSysDelegator.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,12 @@ public DelegationQueueState(Exception ex)
325325

326326
public Exception? InitializationException { get; }
327327

328-
public string Id { get; } = Activity.Current?.SpanId.ToHexString() ?? ActivitySpanId.CreateRandom().ToHexString();
328+
public string Id { get; } = Activity.Current switch
329+
{
330+
{ IdFormat: ActivityIdFormat.W3C } => Activity.Current.SpanId.ToHexString(),
331+
{ Id: not null } => Activity.Current.Id,
332+
_ => ActivitySpanId.CreateRandom().ToHexString(),
333+
};
329334
}
330335

331336
private readonly struct QueueKey : IEquatable<QueueKey>
@@ -384,12 +389,12 @@ private static class Log
384389
"Detached from queue with name '{queueName}' and url prefix '{urlPrefix}'. Detached queue state id '{stateId}'");
385390

386391
private static readonly Action<ILogger, string?, string?, string, Exception?> _queueNoLongerExists = LoggerMessage.Define<string?, string?, string>(
387-
LogLevel.Information,
392+
LogLevel.Debug,
388393
EventIds.DelegationQueueNoLongerExists,
389394
"Destination queue with name '{queueName}' and url prefix '{urlPrefix}' no longer exists. Detaching and attempting to re-initialize. Current state id '{stateId}'");
390395

391396
private static readonly Action<ILogger, string?, string?, Exception?> _queueDisposed = LoggerMessage.Define<string?, string?>(
392-
LogLevel.Information,
397+
LogLevel.Debug,
393398
EventIds.DelegationQueueDisposed,
394399
"Destination queue with name '{queueName}' and url prefix '{urlPrefix}' was disposed. Attempting to re-initialize.");
395400

0 commit comments

Comments
 (0)