import { Construct } from 'constructs'; /** * Configuration properties for CloudWatch Transaction Search */ export interface CloudWatchTransactionSearchProps { /** * Sampling percentage for span indexing * * @default 1 (1% of spans indexed) */ readonly samplingPercentage?: number; /** * Name of the CloudWatch Logs resource policy * * @default 'TransactionSearchXRayAccess' */ readonly policyName?: string; } /** * Enables CloudWatch Transaction Search for X-Ray traces * * This construct configures account-level settings to enable cost-effective * collection of all X-Ray spans through CloudWatch Logs. It performs three steps: * * 1. Creates a CloudWatch Logs resource-based policy allowing X-Ray to send traces * 2. Configures X-Ray to send trace segments to CloudWatch Logs * 3. Sets the sampling percentage for span indexing (default 1%) * * The construct checks if Transaction Search is already enabled and only applies * configuration if needed. It's idempotent and safe to deploy multiple times. * * ## Benefits * - Cost-effective: Uses CloudWatch Logs pricing instead of X-Ray pricing * - Full visibility: All spans are collected and searchable * - Automatic indexing: 1% of spans indexed by default for trace summaries * * ## Usage * ```typescript * new CloudWatchTransactionSearch(this, 'TransactionSearch', { * samplingPercentage: 1 // Optional: 1% is default * }); * ``` * * @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Enable-TransactionSearch.html */ export declare class CloudWatchTransactionSearch extends Construct { constructor(scope: Construct, id: string, props?: CloudWatchTransactionSearchProps); }