MiddlewareSpec

Spec that describes how to instrument a framework middleware function, e.g. an express middleware.

Constructor

new MiddlewareSpec(constructorParams)

Parameters:
NameTypeDescription
constructorParamsMiddlewareSpecParams

Members

appendPath :boolean

Indicates if the route path for the middleware should be appended to the transaction name or not.

Type:
  • boolean

next :number|RouteNextFunction

When a number, indicates the argument position of the "next" callback in the original middleware function's parameters list. Otherwise, it's a function that will be invoked with the arguments of the middleware and another function for wrapping calls that represent continuation from the instrumented middleware.

Type:

params :RouteParameterFunction

A function to extract the route parameters from the instrumented middleware's arguments list.

req :number|RouteRequestFunction

When a number, indicates the argument position of the request object in the middleware function's arguments list. Otherwise, it's a function that extracts the request object from the middleware arguments.

Type:

res :number

Indicates the argument position of the response object in the middleware function's arguments list.

Type:
  • number

route :number|string|null

When a number, indicates the argument position of the route string in the middleware function's arguments list. Otherwise, it is a string that represents the route path.

Type:
  • number | string | null

type :string

Indicates the type of middleware that is being instrumented.

Type:
  • string