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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var queue = serviceScope.ResolveOptional<HandlerQueue<T>>();
|
|
||||||
|
|
||||||
using var _ = LogContext.PushProperty("EventId", Guid.NewGuid());
|
using var _ = LogContext.PushProperty("EventId", Guid.NewGuid());
|
||||||
using var __ = LogContext.Push(await serviceScope.Resolve<SerilogGatewayEnricherFactory>().GetEnricher(shardId, evt));
|
using var __ = LogContext.Push(await serviceScope.Resolve<SerilogGatewayEnricherFactory>().GetEnricher(shardId, evt));
|
||||||
_logger.Verbose("Received gateway event: {@Event}", evt);
|
_logger.Verbose("Received gateway event: {@Event}", evt);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var queue = serviceScope.ResolveOptional<HandlerQueue<T>>();
|
||||||
|
|
||||||
// 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
|
// 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>>();
|
var sentryEnricher = serviceScope.ResolveOptional<ISentryEnricher<T>>();
|
||||||
sentryEnricher?.Enrich(serviceScope.Resolve<Scope>(), shardId, evt);
|
sentryEnricher?.Enrich(serviceScope.Resolve<Scope>(), shardId, evt);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user