NServiceBus.SimpleMonitoring
3.1.0
See the version list below for details.
dotnet add package NServiceBus.SimpleMonitoring --version 3.1.0
NuGet\Install-Package NServiceBus.SimpleMonitoring -Version 3.1.0
<PackageReference Include="NServiceBus.SimpleMonitoring" Version="3.1.0" />
paket add NServiceBus.SimpleMonitoring --version 3.1.0
#r "nuget: NServiceBus.SimpleMonitoring, 3.1.0"
// Install NServiceBus.SimpleMonitoring as a Cake Addin #addin nuget:?package=NServiceBus.SimpleMonitoring&version=3.1.0 // Install NServiceBus.SimpleMonitoring as a Cake Tool #tool nuget:?package=NServiceBus.SimpleMonitoring&version=3.1.0
NServiceBus.SimpleMonitoring
Adds some additional diagnostics to NServiceBus 7, 6 and 5.
Version compatibility
NServiceBus | NServiceBus.SimpleMonitoring |
---|---|
v5.x | v1.x |
v6.x | v2.x |
v7.x | v3.x |
Please note that there might be versions targeting other NServiceBus versions. Please check the Releases for all versions. or check the root of the master
branch of the repository.
Use cases
Additional processing duration information about processed messages is written to the log. A threshold can be configured so that a Warning log entry will be written indicating that a message is still processing. For example, a message should take less then 10 seconds to be processed, if it takes longer a Warning log entry is written while the message is still being processed. Messages that hang an endpoint can now easily be identified. When a message completes processing its total processing duration is written to the log with level Debug but a message that took more then the threshold will also be logged with log level Warning.
Log event examples
Log event written for every completed message:
DEBUG NServiceBus.SimpleMonitoring Message '000526b2-44cd-4d6d-9aa3-a8ad0126e6e6' total processing duration: '0:00:00,1349758'
Log event written for completed messages where the duration exceeds the threshold:
WARN NServiceBus.SimpleMonitoring Message '6625296c-50b1-4f07-ac90-a8ad0127304a' total processing duration (0:00:23,0370282) is larger than the threshold '0:00:15'.
Log event written every interval for each message currently being processed but exceeding the threshold
WARN NServiceBus.SimpleMonitoring Message '6625296c-50b1-4f07-ac90-a8ad0127304a' is already running for '0:00:20,1372179' which is larger than the thresshold '0:00:15'.
Note that the formatting of the log events is different per used logging framework but the message part is the same.
Installation
Via Nuget
Install the Nuget package NServiceBus.SimpleMonitoring
Zero configuration and deployment
Alternatively, download the nuget package, extract the DLL and drop-in the DLL in the endpoint installation path and restart the endpoint. Assembly scanning ensures this module will get auto loaded and enabled using default configuration values.
Configuration
Set the Warning threshold
The default warning threshold is 15 seconds.
The threshold value can only be configured via code or via AppSetting.
Note that is both are used the AppSetting takes precedence.
Via code:
endpointConfiguration.ReportLongRunningMessages(TimeSpan.FromMinutes(3));
Via AppSetting:
<appSettings>
<add key="NServiceBus/SimpleMonitoring/LongRunningMessages/WarningThresholdInSeconds" value="180"/>
</appSettings>
Note that the above snippet will report messages with log level Warning if their processing duration is over 180 seconds (3 minutes).
Show durations for all messages
Message processing durations are always logged with log level Debug however the default NServiceBus log level is Info since version 5. Please set the NServiceBus logging log level to Debug if this is required.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net452 is compatible. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.5.2
- NServiceBus (>= 7.0.0 && < 8.0.0)
-
.NETStandard 2.0
- NServiceBus (>= 7.0.0 && < 8.0.0)
- System.Configuration.ConfigurationManager (>= 4.7.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.