@aws/aws-distro-opentelemetry-node-autoinstrumentation
Version:
This package provides Amazon Web Services distribution of the OpenTelemetry Node Instrumentation, which allows for auto-instrumentation of NodeJS applications.
40 lines • 1.69 kB
TypeScript
import { AttributeValue } from '@opentelemetry/api';
export interface ParsedSqsUrl {
queueName: string;
accountId: string;
region?: string;
}
export declare class SqsUrlParser {
/**
* Best-effort logic to extract queue name from an HTTP url. This method should only be used with
* a string that is, with reasonably high confidence, an SQS queue URL. Handles new/legacy/some
* custom URLs. Essentially, we require that the URL should have exactly three parts, delimited by
* /'s (excluding schema), the second part should be a account id consisting of digits, and the third part
* should be a valid queue name, per SQS naming conventions.
*
* Unlike parseUrl which only handles new URLs and their queuename parsing, this
* implements its own queue name parsing logic to support multiple URL formats.
*/
static getQueueName(url: AttributeValue | undefined): string | undefined;
/**
* Extracts the account ID from an SQS URL.
*/
static getAccountId(url: AttributeValue | undefined): string | undefined;
/**
* Extracts the region from an SQS URL.
*/
static getRegion(url: AttributeValue | undefined): string | undefined;
/**
* Parses an SQS URL and extracts its components.
* Format: https://sqs.<region>.amazonaws.com/<accountId>/<queueName>
* @param url - The SQS URL to parse
* @returns Object containing queue name, account ID and region, or undefined if invalid
* @private
*/
private static parseUrl;
/**
* Checks if the URL is a valid SQS URL.
*/
private static isValidQueueName;
}
//# sourceMappingURL=sqs-url-parser.d.ts.map