Class DiagnosticsBehaviour<TMessage>
Logs the start, successful completion, and elapsed time of each message handler, and also creates a distributed tracing Activity with message details.
Implements
IPipelineBehavior<TMessage>
Inherited Members
Namespace: Chapar.Pipeline.Behaviours
Assembly: Chapar.Pipeline.dll
Syntax
public class DiagnosticsBehaviour<TMessage> : IPipelineBehavior<TMessage> where TMessage : IMessage
Type Parameters
| Name | Description |
|---|---|
| TMessage |
Constructors
| Edit this page View SourceDiagnosticsBehaviour(ILogger<DiagnosticsBehaviour<TMessage>>)
Declaration
public DiagnosticsBehaviour(ILogger<DiagnosticsBehaviour<TMessage>> logger)
Parameters
| Type | Name | Description |
|---|---|---|
| ILogger<DiagnosticsBehaviour<TMessage>> | logger |
Methods
| Edit this page View SourceHandleAsync(TMessage, Func<Task>, CancellationToken)
Executes the behaviour and optionally calls the next delegate in the pipeline.
Declaration
public Task HandleAsync(TMessage message, Func<Task> next, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| TMessage | message | The message to process. |
| Func<Task> | next | A delegate representing the next action in the pipeline. |
| CancellationToken | cancellationToken | Token to cancel the operation. |
Returns
| Type | Description |
|---|---|
| Task |