TracingMiddleware
Creates a trace and metadata for every request
final class TracingMiddleware
See https://opentelemetry.io/docs/specs/semconv/http/http-spans/
Creates a trace and metadata for every request
final class TracingMiddleware
See https://opentelemetry.io/docs/specs/semconv/http/http-spans/
import Vapor
Vapor is a framework for building server applications, APIs and websites in Swift. It provides a safe, performant and scalable foundation for building large complex backends.
protocol AsyncMiddleware : Middleware
AsyncMiddleware
is placed between the server and your router. It is capable of mutating both incoming requests and outgoing responses. AsyncMiddleware
can choose to pass requests on to the next AsyncMiddleware
in a chain, or they can short circuit and return a custom Response
if desired.
@preconcurrency protocol Middleware : Sendable
Middleware
is placed between the server and your router. It is capable of mutating both incoming requests and outgoing responses. Middleware
can choose to pass requests on to the next Middleware
in a chain, or they can short circuit and return a custom Response
if desired.
protocol Sendable
init()
Create a TracingMiddleware
init(setCustomAttributes: @escaping (inout SpanAttributes, Request) -> Void)
Create a TracingMiddleware
func respond(to request: Request, chainingTo next: any AsyncResponder) async throws -> Response
func makeResponder(chainingTo responder: Responder) -> Responder
Wraps a Responder
in a single Middleware
creating a new Responder
.
func respond(to request: Request, chainingTo next: Responder) -> EventLoopFuture<Response>