dd-trace
    Preparing search index...

    Interface connect

    This plugin automatically instruments the connect module.

    interface connect {
        allowlist?:
            | string
            | RegExp
            | ((urlOrPath: string) => boolean)
            | (string | RegExp | ((urlOrPath: string) => boolean))[];
        blocklist?:
            | string
            | RegExp
            | ((urlOrPath: string) => boolean)
            | (string | RegExp | ((urlOrPath: string) => boolean))[];
        enabled?: boolean;
        enablePropagationWithAmazonHeaders?: boolean;
        headers?: string[];
        hooks?: {
            request?: (
                span?: Span,
                req?: IncomingMessage,
                res?: ServerResponse<IncomingMessage>,
            ) => any;
        };
        measured?: boolean
        | { [key: string]: boolean };
        middleware?: boolean;
        service?: any;
        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).

    []
    
    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
    
    headers?: string[]

    An array of headers to include in the span metadata.

    []
    
    hooks?: {
        request?: (
            span?: Span,
            req?: IncomingMessage,
            res?: ServerResponse<IncomingMessage>,
        ) => any;
    }

    Hooks to run before spans are finished.

    Type Declaration

    • Optionalrequest?: (
          span?: Span,
          req?: IncomingMessage,
          res?: ServerResponse<IncomingMessage>,
      ) => any

      Hook to execute just before the request span finishes.

    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.

    middleware?: boolean

    Whether to enable instrumentation of .middleware spans

    true
    
    service?: any

    The service name to be used for this plugin.

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