NServiceBus icon indicating copy to clipboard operation
NServiceBus copied to clipboard

Log process duration for failures and store relavant environment timeout values in diagnostics file

Open ramonsmits opened this issue 10 months ago • 0 comments

Describe the suggested improvement

Is your improvement related to a problem? Please describe.

When timeout related errors occurs it helps to know how long a message was being processed.

Take the following TransactionAbortedException / TimeoutException, having the processing duration helps diagnose what the timeout value is:

Log showing immediate retry due to TransactionAbortedException

Describe the suggested solution

  1. Log duration as part of the error. NServiceBus already has OpenTelemetry and a stopwatch running.
  2. Have Core and Transports add environment values for detected timeouts into the diagnostics file
  • Core: TransactionScope enabled? -> Log default timeout duration
  • Transport: SQLT -> Command Timeout, and other values, if not detectable write "default" or "unknown"

Additional Context

No response

ramonsmits avatar Feb 19 '25 09:02 ramonsmits