import * as logs from 'aws-cdk-lib/aws-logs'; import * as secrets from 'aws-cdk-lib/aws-secretsmanager'; import { Construct } from 'constructs'; import * as dd from 'datadog-cdk-constructs-v2'; import { DatadogAppSecMode } from 'datadog-cdk-constructs-v2'; /** * Props for the DatadogLambdaInstrumentation construct. * Copied over from original Datadog construct. * This interface is intentionally not extending the original DatadogProps, so that the dependency needs to be bundled as well. * * latest version for nodeLayerVersion: https://github.com/DataDog/datadog-lambda-js/releases * * latest version for extensionLayerVersion: https://github.com/DataDog/datadog-lambda-extension/releases * * * @see dd.DatadogProps */ export interface DatadogLambdaInstrumentationProps { readonly service: string; /** * Whether to suppress the system log lines (START, END, REPORT) from Lambda logs. * Datadog recommends keeping the REPORT logs, as they are used to populate the invocations list in the * serverless function views. * https://docs.datadoghq.com/logs/guide/forwarder/?tab=cloudformation&site=us#log-filtering-optional */ readonly suppressSystemLogs?: boolean; /** * Whether to enable enhanced metrics for the Lambda functions. * * @defaultValue false */ readonly enableEnhancedMetrics?: boolean; readonly nodeLayerVersion: number; readonly extensionLayerVersion: number; readonly addLayers?: boolean; readonly forwarderArn?: string; readonly flushMetricsToLogs?: boolean; readonly site?: string; readonly apiKey?: string; readonly apiKeySecretArn?: string; readonly apiKeySecret?: secrets.ISecret; readonly apiKmsKey?: string; readonly enableDatadogTracing?: boolean; readonly enableDatadogASM?: boolean; readonly enableMergeXrayTraces?: boolean; readonly injectLogContext?: boolean; readonly logLevel?: string; readonly enableDatadogLogs?: boolean; readonly captureLambdaPayload?: boolean; readonly env?: string; readonly version?: string; readonly tags?: string; readonly createForwarderPermissions?: boolean; readonly sourceCodeIntegration?: boolean; readonly enableColdStartTracing?: boolean; readonly minColdStartTraceDuration?: number; readonly coldStartTraceSkipLibs?: string; readonly enableProfiling?: boolean; readonly encodeAuthorizerContext?: boolean; readonly decodeAuthorizerContext?: boolean; readonly apmFlushDeadline?: string | number; readonly redirectHandler?: boolean; readonly grantSecretReadAccess?: boolean; readonly useLayersFromAccount?: string; readonly datadogAppSecMode?: DatadogAppSecMode; } /** * Wrapper construct for Datadog's Lambda instrumentation. * This construct will create a Datadog construct with the provided props and add the Lambda functions to it. * Per default, it will disable all additional features, that cause Datadog charging for Serverless Functions features. * So just change it, if you need the advanced features. * * Additionally, some defaults from the datadog-integration account module are applied: * - the secret and site for the API key is read from a shared secret in rio-developer-tools account * * To use it, install Datadog CDK Constructs package: * ```bash * npm i -D datadog-cdk-constructs-v2 * ``` */ export declare class DatadogLambdaInstrumentation extends Construct { private delegate; private datadogSecret; private readonly site; private readonly enhancedMetricsEnabled; private readonly suppressSystemLogs?; constructor(scope: Construct, id: string, props: DatadogLambdaInstrumentationProps); addLambdaFunctions(lambdaFunctions: dd.LambdaFunction[], construct?: Construct): void; addGitCommitMetadata(lambdaFunctions: dd.LambdaFunction[], gitCommitSha?: string, gitRepoUrl?: string): void; addForwarderToNonLambdaLogGroups(logGroups: logs.ILogGroup[]): void; }