fix: put Serilog event ID / shard ID in same scope as Sentry error ID
This commit is contained in:
parent
7aae41c080
commit
84529f6f32
@ -153,14 +153,14 @@ public class Bot
|
||||
return;
|
||||
}
|
||||
|
||||
using var _ = LogContext.PushProperty("EventId", Guid.NewGuid());
|
||||
using var __ = LogContext.Push(await serviceScope.Resolve<SerilogGatewayEnricherFactory>().GetEnricher(shardId, evt));
|
||||
_logger.Verbose("Received gateway event: {@Event}", evt);
|
||||
|
||||
try
|
||||
{
|
||||
var queue = serviceScope.ResolveOptional<HandlerQueue<T>>();
|
||||
|
||||
using var _ = LogContext.PushProperty("EventId", Guid.NewGuid());
|
||||
using var __ = LogContext.Push(await serviceScope.Resolve<SerilogGatewayEnricherFactory>().GetEnricher(shardId, evt));
|
||||
_logger.Verbose("Received gateway event: {@Event}", evt);
|
||||
|
||||
// Also, find a Sentry enricher for the event type (if one is present), and ask it to put some event data in the Sentry scope
|
||||
var sentryEnricher = serviceScope.ResolveOptional<ISentryEnricher<T>>();
|
||||
sentryEnricher?.Enrich(serviceScope.Resolve<Scope>(), shardId, evt);
|
||||
|
Loading…
Reference in New Issue
Block a user