1- // Verifies bottlecap holds the cold-start `aws.lambda.enhanced.invocations`
2- // metric until the Telemetry API's `platform.initStart` event reports the
3- // runtime, so the metric carries `durable_function:true` for a real
4- // durable-configured Lambda function (#1301). A plain (non-durable) function
5- // is invoked alongside as a guard against the tag being set unconditionally.
1+ // Verifies the cold-start invocations metric has durable_function:true only for a durable function.
62import { hasMetricWithTag } from './utils/datadog' ;
73import { forceColdStart , invokeLambda } from './utils/lambda' ;
84import { IDENTIFIER , DEFAULT_DATADOG_INDEXING_WAIT_MS } from '../config' ;
@@ -23,15 +19,10 @@ describe('Durable Function Cold-Start Metric Tag Integration Tests', () => {
2319
2420 await Promise . all ( functionNames . map ( ( fn ) => forceColdStart ( fn ) ) ) ;
2521
26- // Back up the query window by 60s so the metric bucket (which Datadog
27- // aligns to the rollup interval boundary, often before the invocation)
28- // falls inside the range we pass to /api/v1/query.
22+ // Back up 60s so the metric's rollup bucket falls inside the query range.
2923 invocationStartTime = Date . now ( ) - 60_000 ;
3024
31- // Durable functions reject unqualified-ARN invokes ("You cannot invoke a
32- // durable function using an unqualified ARN"); `:$LATEST` satisfies that
33- // without publishing a version. Metric queries below use the base
34- // (unqualified) function name, which is unaffected by this qualifier.
25+ // Durable functions reject unqualified-ARN invokes; `:$LATEST` avoids publishing a version.
3526 await Promise . all ( [
3627 invokeLambda ( `${ durableFunctionName } :$LATEST` ) ,
3728 invokeLambda ( nonDurableFunctionName ) ,
0 commit comments