Table of Contents

Class TelemetryMiddleware

Namespace
IceRpc.Telemetry
Assembly
IceRpc.Telemetry.dll

A middleware that starts an Activity per request, following OpenTelemetry conventions. The middleware restores the parent invocation activity from the request TraceContext field before starting the dispatch activity.

public class TelemetryMiddleware : IDispatcher
Inheritance
TelemetryMiddleware
Implements
Inherited Members

Remarks

The activities are only created for requests using the icerpc protocol.

Constructors

TelemetryMiddleware(IDispatcher, ActivitySource)

Constructs a telemetry middleware.

public TelemetryMiddleware(IDispatcher next, ActivitySource activitySource)

Parameters

next IDispatcher

The next dispatcher in the dispatch pipeline.

activitySource ActivitySource

The ActivitySource is used to start the request activity.

Methods

DispatchAsync(IncomingRequest, CancellationToken)

Dispatches an incoming request and returns the corresponding outgoing response.

public ValueTask<OutgoingResponse> DispatchAsync(IncomingRequest request, CancellationToken cancellationToken)

Parameters

request IncomingRequest

The incoming request being dispatched.

cancellationToken CancellationToken

A cancellation token that receives the cancellation requests.

Returns

ValueTask<OutgoingResponse>

The corresponding OutgoingResponse.

See Also