Describes the interface for middleware functions with this instrumentation.

Name Type Attributes Default Description
req number | RouteRequestFunction <optional>

Indicates which argument to the middleware is the request object. It can also be a function to extract the request object from the middleware arguments.

res number <optional>

Indicates which argument to the middleware is the response object.

next number | RouteNextFunction <optional>

Indicates which argument to the middleware function is the callback. When it is a function, it will be called with the arguments of the middleware and a function for wrapping calls that represent continuation from the current middleware.

name string <optional>

The name to use for this middleware. Defaults to middleware.name.

params RouteParameterFunction <optional>

A function to extract the route parameters from the middleware arguments. Defaults to using req.params.

type string <optional>
route string | function <optional>

Route/path used for naming segments and transaction name candidates. If a function, will be invoked just before segment creation with middleware invocation.

appendPath boolean <optional>

Indicates that the path associated with the middleware should be appended and popped from the stack of name candidates.