test(integration): add enhanced duration metrics tests#1107
Draft
jchrostek-dd wants to merge 4 commits intomainfrom
Draft
test(integration): add enhanced duration metrics tests#1107jchrostek-dd wants to merge 4 commits intomainfrom
jchrostek-dd wants to merge 4 commits intomainfrom
Conversation
Add integration tests for Lambda enhanced duration metrics to verify that runtime_duration, billed_duration, duration, post_runtime_duration, and init_duration metrics are correctly emitted across runtimes. Changes: - Add ENHANCED_METRICS_CONFIG and getEnhancedMetrics() to utils/datadog.ts - Extend invokeAndCollectTelemetry to return RuntimeTelemetry with metrics - Add duration metrics tests to on-demand.test.ts for all runtimes - Update lmi, otlp, snapstart tests for new RuntimeTelemetry return type Tests gracefully skip when metrics data isn't available in query window. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Rename DatadogTelemetry -> InvocationTracesLogs (per-invocation data) - Rename RuntimeTelemetry -> DatadogTelemetry (aggregated telemetry) - Remove redundant getMetricPoints wrapper - Remove metricsApiAvailable graceful degradation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add metrics checking to lmi.test.ts similar to on-demand.test.ts: - Import MetricPoint and ENHANCED_METRICS_CONFIG from datadog.ts - Add duration metrics describe block with config-driven tests - Test all 5 duration metrics (runtime_duration, billed_duration, duration, post_runtime_duration, init_duration) - Graceful skipping when metrics not indexed in query time window - Tests handle LMI-specific behavior (init_duration may be absent) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Rewrite duration metrics tests to be explicit: - Each metric has its own it() block with clear assertions - Remove dynamic looping through metrics config - Fix metrics query to strip alias from function name (use base name only) Tests are skipped (describe.skip) pending investigation: - Datadog metrics API returns inconsistent/flaky results - Sometimes metrics are indexed, sometimes not - Need to investigate: enhanced metrics config, query format, indexing delay 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
getEnhancedMetrics()andRuntimeTelemetrytypeTest plan
🤖 Generated with Claude Code