Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface koa

This plugin automatically instruments the koa module.

Hierarchy

  • HttpServer
    • koa

Index

Properties

Optional allowlist

allowlist: string | RegExp | ((url: string) => boolean) | (string | RegExp | ((url: string) => boolean))[]

List of URLs that should be instrumented.

default

/^.*$/

Optional analytics

analytics: boolean | number | {}

Whether to enable App Analytics. Can also be set to a number instead to control the sample rate, or to an key-value pair with span names as keys and booleans or sample rates as values for more granular control.

Optional blocklist

blocklist: string | RegExp | ((url: string) => boolean) | (string | RegExp | ((url: string) => boolean))[]

List of URLs that should not be instrumented. Takes precedence over allowlist if a URL matches an entry in both.

default

[]

Optional enabled

enabled: undefined | false | true

Whether to enable the plugin.

default

true

Optional headers

headers: string[]

An array of headers to include in the span metadata.

default

[]

Optional hooks

hooks: undefined | { request?: undefined | ((span?: opentracing.Span, req?: IncomingMessage, res?: ServerResponse) => any) }

Hooks to run before spans are finished.

Optional middleware

middleware: undefined | false | true

Whether to enable instrumention of .middleware spans

default

true

Optional service

service: string | any

The service name to be used for this plugin.

Optional validateStatus

validateStatus: undefined | ((code: number) => boolean)

Callback function to determine if there was an error. It should take a status code as its only parameter and return true for success or false for errors.

default

code => code < 500

Generated using TypeDoc