TracingMiddleware

Middleware creating Distributed Tracing spans for each request.

TracingMiddleware.swift:31
struct TracingMiddleware<Context> where Context : RequestContext

Creates a span for each request, including attributes such as the HTTP method.

You may opt in to recording a specific subset of HTTP request/response header values by passing a set of header names.

Uses Swift-Distributed-Tracing for recording the traces. Swift-Distributed-Tracing has a flexible backend, which will need to be initialized before any traces are recorded.

A list of implementations is available in the swift-distributed-tracing repository’s README.