You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the AddXRayInterceptor(true) configuration, the EFInterceptor attempts to create a subsegment for every database query. However, during the execution of outbox-related queries, if the parent segment hasn't been created yet, the EFInterceptor fails to create the subsegment, leading to an EntityNotFoundException.
Suggested Enhancement:
It would be beneficial if the EFInterceptor could check whether the parent segment exists before attempting to create a subsegment. If the parent segment does not exist, ideally, the interceptor should start it. This enhancement would prevent the EntityNotFoundException and ensure smoother integration between Entity Framework and AWS X-Ray within the context of using MassTransit's Outbox pattern.
The text was updated successfully, but these errors were encountered:
Hi @cikdibest , thanks for reporting the issue and also for providing the suggestion.
The EntityNotFoundException is thrown when a parent segment or subsegment is missing when a new subsegment is created. We throw this exception instead of creating a parent segment on the fly because a) a parent segment should mostly exist on incoming requests when a service is instrumented correctly. b) creating segments on the fly may cause broken traces with unintended segments.
We have configured our DbContext and MassTransit Outbox pattern as follows:
Setup:
Issue Description:
When using the AddXRayInterceptor(true) configuration, the EFInterceptor attempts to create a subsegment for every database query. However, during the execution of outbox-related queries, if the parent segment hasn't been created yet, the EFInterceptor fails to create the subsegment, leading to an EntityNotFoundException.
Suggested Enhancement:
It would be beneficial if the EFInterceptor could check whether the parent segment exists before attempting to create a subsegment. If the parent segment does not exist, ideally, the interceptor should start it. This enhancement would prevent the EntityNotFoundException and ensure smoother integration between Entity Framework and AWS X-Ray within the context of using MassTransit's Outbox pattern.
The text was updated successfully, but these errors were encountered: