import type * as constructs from 'constructs'; /** * The trace sampling strategy used by the Fargate Datadog integration. */ export declare enum TraceSamplingMode { /** * Use RIO's per-Agent head-sampling target of 5 traces/sec and an additional * error-sampling budget of 10 local error trace chunks/sec. * Target-per-second sampling is a practical default for both low- and * high-traffic services. */ DEFAULT = 0, /** Do not set sampling environment variables; retain Datadog's defaults. */ DATADOG_DEFAULT = 1, /** Set a fixed sampling rule on the application tracer. */ FIXED_RATE = 2, /** Set a per-Agent target number of traces per second. */ TARGET_PER_SECOND = 3 } /** * Use RIO's default Datadog Agent sampling targets. * * This is also the default when `traceSampling` is omitted. */ export interface RioDefaultTraceSamplingOptions { /** * The sampling strategy. May be omitted to use the default. * * @defaultValue - `TraceSamplingMode.DEFAULT` */ readonly mode?: TraceSamplingMode.DEFAULT; } /** Do not set sampling environment variables; retain Datadog's defaults. */ export interface DatadogDefaultTraceSamplingOptions { /** The sampling strategy. */ readonly mode: TraceSamplingMode.DATADOG_DEFAULT; } /** Configure a fixed application-tracer sampling rate. */ export interface FixedRateTraceSamplingOptions { /** The sampling strategy. */ readonly mode: TraceSamplingMode.FIXED_RATE; /** * The global tracer sampling-rule rate, from 0.0 to 1.0 inclusive. * Datadog tracers additionally apply their built-in 100-traces-per-second * rate limit when sampling rules are configured. This construct does not * expose or override that per-instance safeguard. */ readonly fixedRate: number; } /** Configure Datadog Agent target sampling. */ export interface TargetPerSecondTraceSamplingOptions { /** The sampling strategy. */ readonly mode: TraceSamplingMode.TARGET_PER_SECOND; /** * The average head-sampling target in traces per second for each Agent * sidecar (and therefore each Fargate service instance). Traffic spikes * can exceed this target; it is not a hard cap on total ingestion. */ readonly targetTracesPerSecond: number; /** * The budget for additional local error trace chunks per second missed by * head sampling, for each Agent sidecar (and therefore each Fargate service * instance). This does not cap error traces already kept by head sampling. */ readonly errorTracesPerSecond?: number; } /** * Options for configuring Datadog APM trace sampling. * * This discriminated union makes mode-specific settings invalid in TypeScript * before synthesis. Numeric ranges are checked during synthesis. */ export type TraceSamplingOptions = RioDefaultTraceSamplingOptions | DatadogDefaultTraceSamplingOptions | FixedRateTraceSamplingOptions | TargetPerSecondTraceSamplingOptions; export declare class TraceSamplingValidator implements constructs.IValidation { private readonly traceSampling?; constructor(traceSampling?: TraceSamplingOptions | undefined); validate(): string[]; } export declare function addTraceSamplingEnvironmentWarning(scope: constructs.Construct, environment: { [key: string]: string; } | undefined): void; export declare function getApplicationTraceSamplingEnvironment(traceSampling?: TraceSamplingOptions): { [key: string]: string; }; export declare function getAgentTraceSamplingEnvironment(traceSampling?: TraceSamplingOptions): { [key: string]: string; };