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.

interface http2 {
    allowlist?: string | RegExp | ((url) => boolean) | (string | RegExp | ((url) => boolean))[];
    blocklist?: string | RegExp | ((url) => boolean) | (string | RegExp | ((url) => boolean))[];
    client?: boolean | Http2Client;
    enablePropagationWithAmazonHeaders?: boolean;
    enabled?: boolean;
    headers?: string[];
    measured?: boolean | {
        [key: string]: boolean;
    };
    server?: boolean | Http2Server;
    service?: any;
    splitByDomain?: boolean;
    validateStatus?: ((code) => boolean);
}

Hierarchy

  • Http2Client
  • Http2Server
    • http2

Properties

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

List of URLs that should be instrumented.

Type declaration

    • (url): boolean
    • Parameters

      • url: string

      Returns boolean

Default

/^.*$/
blocklist?: string | RegExp | ((url) => boolean) | (string | RegExp | ((url) => boolean))[]

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

Type declaration

    • (url): boolean
    • Parameters

      • url: string

      Returns boolean

Default

[]
client?: boolean | Http2Client

Configuration for HTTP clients.

enablePropagationWithAmazonHeaders?: boolean

Enable injection of tracing headers into requests signed with AWS IAM headers. Disable this if you get AWS signature errors (HTTP 403).

Default

false
enabled?: boolean

Whether to enable the plugin.

Default

true
headers?: string[]

An array of headers to include in the span metadata.

Default

[]
measured?: boolean | {
    [key: string]: 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.

Type declaration

  • [key: string]: boolean
server?: boolean | Http2Server

Configuration for HTTP servers.

service?: any

The service name to be used for this plugin.

splitByDomain?: boolean

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

Default

false
validateStatus?: ((code) => 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.

Type declaration

    • (code): 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.

      Parameters

      • code: number

      Returns boolean

      Default

      code => code < 400 || code >= 500
      

Default

code => code < 400 || code >= 500

Generated using TypeDoc