dd-trace
    Preparing search index...

    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.

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

    Properties

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

    List of URLs/paths that should be instrumented.

    Note that when used for an http client the entry represents a full outbound URL (https://example.org/api/foo) but when used as a server the entry represents an inbound path (/api/foo).

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

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

    Note that when used for an http client the entry represents a full outbound URL (https://example.org/api/foo) but when used as a server the entry represents an inbound path (/api/foo).

    []
    
    client?: boolean | Http2Client

    Configuration for HTTP clients.

    enabled?: boolean

    Whether to enable the plugin.

    true
    
    enablePropagationWithAmazonHeaders?: boolean

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

    false
    
    filter?: (urlOrPath: string) => boolean

    Custom filter function used to decide whether a URL/path is allowed. When provided, this takes precedence over allowlist/blocklist configuration. If not provided, allowlist/blocklist logic will be used instead.

    Type Declaration

      • (urlOrPath: string): boolean
      • Parameters

        • urlOrPath: string

          The URL or path to filter

        Returns boolean

        true to instrument the request, false to skip it

    headers?: string[]

    An array of headers to include in the span metadata.

    []
    
    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.

    queryStringObfuscation?: string | boolean | RegExp

    Whether (or how) to obfuscate querystring values in http.url.

    • true: obfuscate all values
    • false: disable obfuscation
    • string: regex string used to obfuscate matching values (empty string disables)
    • RegExp: regex used to obfuscate matching values
    resourceRenamingEnabled?: boolean

    Whether to enable resource renaming when the framework route is unavailable.

    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.

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

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