Correlation facilitates the grouping of all requests, messages, logs, and traces belonging to a business flow. They all include a randomly generated unique identifier that is referred to as a "Correlation ID".
Using correlation makes it easy to investigate problems in a business flow because the correlation ID propagates throughout all the components involved, and it can be used to search the logs. This is especially true in distributed systems where data can be scattered across different machines.
NBB.Correlation
- provides core correlation functionality such as accessing the current correlation ID
NBB.Correlation.Serilog
- correlation extensions for Serilog logging infrastructureNBB.Correlation.Serilog.SqlServer
- extensions for log persistence using the Serilog sink for SQL Server
NBB.Correlation.AspNet
- correlation extensions for ASP.NET
The correlation ID can be attached to messages and transported across all microservices involved in a business flow.
There is a dedicated messaging header nbb-correlationID interpreted by:
message bus publisher
- the publisher automatically adds the current correlation ID to the envelope headersmessaging host
- there is a built-incorrelation middleware
that reads the messaging header and sets the current correlation ID
A tag named nbb.correlation_id is added to the messaging publisher and subscriber spans.
For details see NBB.Messaging.OpenTelemetry