@karmaniverous/aws-xray-tools
    Preparing search index...

    Function captureAwsSdkV3Client

    • Capture (instrument) an AWS SDK v3 client with AWS X-Ray when enabled.

      Guarded behavior:

      • When capture is not enabled (based on shouldEnableXray), returns the original client unchanged and does not load aws-xray-sdk.
      • When capture is enabled but daemonAddress is missing, throws.
      • When capture is enabled, synchronously loads aws-xray-sdk via createRequire (through requireAwsXraySdk) and uses its captureAWSv3Client helper to instrument the client.

      Type Parameters

      • TClient extends object

        AWS SDK v3 client type (any object with methods).

      Parameters

      • client: TClient

        The AWS SDK v3 client instance to capture.

      • opts: { daemonAddress?: string; logger?: Logger; mode?: XrayMode } = {}

        Capture options.

      Returns TClient

      The captured client (or the original client when capture is disabled).

      If capture is enabled but AWS_XRAY_DAEMON_ADDRESS is not set.

      If capture is enabled but aws-xray-sdk is not installed.

      If aws-xray-sdk does not expose captureAWSv3Client.