Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface http2

This plugin automatically instruments the http2 module.

By default any option set at the root will apply to both clients and servers. To configure only one or the other, use the client and server options.

Hierarchy

  • Http2Client
  • Http2Server
    • http2

Index

Properties

Optional allowlist

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

List of URLs that should be instrumented.

default

/^.*$/

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 client

client: Http2Client | boolean

Configuration for HTTP clients.

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 measured

measured: boolean | {}

Whether to measure the span. Can also be set to a key-value pair with span names as keys and booleans as values for more granular control.

Optional server

server: Http2Server | boolean

Configuration for HTTP servers.

Optional service

service: string | any

The service name to be used for this plugin.

Optional splitByDomain

splitByDomain: undefined | false | true

Use the remote endpoint host as the service name instead of the default.

default

false

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 < 400

Generated using TypeDoc