Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ name: build

on:
schedule:
- cron: "0 12 * * *" #every day at midday
- cron: "0 12 * * *" #every day at midday (UTC)
push:
paths:
- 'integration_tests/**'

jobs:

Expand Down
9 changes: 8 additions & 1 deletion integration_tests/recorder-extension/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,15 @@ async function next(extensionId) {
app.post('/v1/input', async (req, res) => {
if(JSON.stringify(req.body) !== '{}') { // to avoid printing empty logs due to the connectivity test
for(let i = 0; i < req.body.length; ++i) {
//sort tags to avoid flaky tests
const originalTags = req.body[i].ddtags;
const sortedTags = originalTags.split(",");
sortedTags.sort();
// reset tags once sorted
req.body[i].ddtags = sortedTags.join(",")
const logString = JSON.stringify(req.body[i]);
if(logString.indexOf("[sketch]") === -1 && logString.indexOf("[log]") === -1) { // avoid inception
if(logString.indexOf("[sketch]") === -1 && logString.indexOf("[log]") === -1) { // if we log an unwanted log, it will be availble in the next log api payload -> infinite loop
const tags = logString
console.log("[log]", logString);
}
}
Expand Down
1 change: 0 additions & 1 deletion integration_tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ for function_name in "${all_functions[@]}"; do
echo "$raw_logs" | \
grep "\[log\]" | \
perl -p -e "s/(timestamp\":)[0-9]{13}/\1XXX/g" | \
perl -p -e "s/(ddtags\":\")[a-zA-Z0-9\:\-,_]+/\1XXX/g" | \
perl -p -e "s/(\"REPORT |START |END |HTTP ).*/\1XXX\"}}/g" | \
perl -p -e "s/(request_id\":\")[a-zA-Z0-9\-,]+/\1XXX/g"| \
perl -p -e "s/$stage/XXXXXX/g" | \
Expand Down
5 changes: 5 additions & 0 deletions integration_tests/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ functions:
- arn:aws:lambda:${self:provider.region}:464622532012:layer:Datadog-Node14-x:${env:NODE_LAYER_VERSION}
- {Ref: RecorderExtensionLambdaLayer}
- {Ref: DatadogExtensionIntegrationTestLambdaLayer}
environment:
DD_TAGS: tagA:valueA tagB:valueB
DD_EXTRA_TAGS: tagC:valueC tagD:valueD

noEnhancedMetricTest:
name: integration-tests-lambda-extension-${sls:stage}-noEnhancedMetricTest
Expand Down Expand Up @@ -82,3 +85,5 @@ functions:
DD_LOGS_ENABLED: true
DD_SERVERLESS_LOGS_ENABLED: true
DD_LOGS_INJECTION: true
DD_TAGS: tagA:valueA tagB:valueB
DD_EXTRA_TAGS: tagC:valueC tagD:valueD
20 changes: 10 additions & 10 deletions integration_tests/snapshots/enhancedMetricTest
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[sketch] {"metric":"aws.lambda.enhanced.billed_duration","tags":["account_id:601427279990","aws_account:601427279990","cold_start:true","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","functionname:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","region:sa-east-1","resource:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest"],"dogsketches":[{"ts":"XXX","cnt":"1","min":XXX,"max":XXX,"avg":XXX,"sum":XXX,"k":[XXX],"n":[1]}]}
[sketch] {"metric":"aws.lambda.enhanced.duration","tags":["account_id:601427279990","aws_account:601427279990","cold_start:true","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","functionname:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","region:sa-east-1","resource:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest"],"dogsketches":[{"ts":"XXX","cnt":"1","min":XXX,"max":XXX,"avg":XXX,"sum":XXX,"k":[XXX],"n":[1]}]}
[sketch] {"metric":"aws.lambda.enhanced.estimated_cost","tags":["account_id:601427279990","aws_account:601427279990","cold_start:true","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","functionname:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","region:sa-east-1","resource:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest"],"dogsketches":[{"ts":"XXX","cnt":"1","min":XXX,"max":XXX,"avg":XXX,"sum":XXX,"k":[XXX],"n":[1]}]}
[sketch] {"metric":"aws.lambda.enhanced.init_duration","tags":["account_id:601427279990","aws_account:601427279990","cold_start:true","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","functionname:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","region:sa-east-1","resource:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest"],"dogsketches":[{"ts":"XXX","cnt":"1","min":XXX,"max":XXX,"avg":XXX,"sum":XXX,"k":[XXX],"n":[1]}]}
[sketch] {"metric":"aws.lambda.enhanced.invocations","tags":["account_id:601427279990","aws_account:601427279990","cold_start:false","datadog_lambda:vX.X.X","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","functionname:integration-tests-lambda-extension-XXXXXX-enhancedMetricTest","functionname:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","memorysize:1024","region:sa-east-1","resource:integration-tests-lambda-extension-XXXXXX-enhancedMetricTest","resource:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","runtime:nodejs12.x"],"dogsketches":[{"ts":"XXX","cnt":"1","min":1,"max":1,"avg":1,"sum":1,"k":[XXX],"n":[1]}]}
[sketch] {"metric":"aws.lambda.enhanced.invocations","tags":["account_id:601427279990","aws_account:601427279990","cold_start:true","datadog_lambda:vX.X.X","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","functionname:integration-tests-lambda-extension-XXXXXX-enhancedMetricTest","functionname:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","memorysize:1024","region:sa-east-1","resource:integration-tests-lambda-extension-XXXXXX-enhancedMetricTest","resource:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","runtime:nodejs12.x"],"dogsketches":[{"ts":"XXX","cnt":"1","min":1,"max":1,"avg":1,"sum":1,"k":[XXX],"n":[1]}]}
[sketch] {"metric":"aws.lambda.enhanced.max_memory_used","tags":["account_id:601427279990","aws_account:601427279990","cold_start:true","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","functionname:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","region:sa-east-1","resource:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest"],"dogsketches":[{"ts":"XXX","cnt":"1","min":XXX,"max":XXX,"avg":XXX,"sum":XXX,"k":[XXX],"n":[1]}]}
[sketch] {"metric":"aws.lambda.enhanced.memorysize","tags":["account_id:601427279990","aws_account:601427279990","cold_start:true","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","functionname:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","region:sa-east-1","resource:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest"],"dogsketches":[{"ts":"XXX","cnt":"1","min":XXX,"max":XXX,"avg":XXX,"sum":XXX,"k":[XXX],"n":[1]}]}
[sketch] {"metric":"serverless.lambda-extension.integration-test.count","tags":["account_id:601427279990","aws_account:601427279990","dd_lambda_layer:datadog-nodevX.X.X","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","functionname:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","region:sa-east-1","resource:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest"],"dogsketches":[{"ts":"XXX","cnt":"1","k":[XXX],"n":[1]}]}
[sketch] {"metric":"serverless.lambda-extension.integration-test.count","tags":["account_id:601427279990","aws_account:601427279990","dd_lambda_layer:datadog-nodevX.X.X","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","functionname:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","region:sa-east-1","resource:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest"],"dogsketches":[{"ts":"XXX","cnt":"1","min":1,"max":1,"avg":1,"sum":1,"k":[XXX],"n":[1]}]}
[sketch] {"metric":"aws.lambda.enhanced.billed_duration","tags":["account_id:601427279990","aws_account:601427279990","cold_start:true","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","functionname:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","region:sa-east-1","resource:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","taga:valuea","tagb:valueb","tagc:valuec","tagd:valued"],"dogsketches":[{"ts":"XXX","cnt":"1","min":XXX,"max":XXX,"avg":XXX,"sum":XXX,"k":[XXX],"n":[1]}]}
[sketch] {"metric":"aws.lambda.enhanced.duration","tags":["account_id:601427279990","aws_account:601427279990","cold_start:true","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","functionname:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","region:sa-east-1","resource:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","taga:valuea","tagb:valueb","tagc:valuec","tagd:valued"],"dogsketches":[{"ts":"XXX","cnt":"1","min":XXX,"max":XXX,"avg":XXX,"sum":XXX,"k":[XXX],"n":[1]}]}
[sketch] {"metric":"aws.lambda.enhanced.estimated_cost","tags":["account_id:601427279990","aws_account:601427279990","cold_start:true","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","functionname:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","region:sa-east-1","resource:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","taga:valuea","tagb:valueb","tagc:valuec","tagd:valued"],"dogsketches":[{"ts":"XXX","cnt":"1","min":XXX,"max":XXX,"avg":XXX,"sum":XXX,"k":[XXX],"n":[1]}]}
[sketch] {"metric":"aws.lambda.enhanced.init_duration","tags":["account_id:601427279990","aws_account:601427279990","cold_start:true","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","functionname:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","region:sa-east-1","resource:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","taga:valuea","tagb:valueb","tagc:valuec","tagd:valued"],"dogsketches":[{"ts":"XXX","cnt":"1","min":XXX,"max":XXX,"avg":XXX,"sum":XXX,"k":[XXX],"n":[1]}]}
[sketch] {"metric":"aws.lambda.enhanced.invocations","tags":["account_id:601427279990","aws_account:601427279990","cold_start:false","datadog_lambda:vX.X.X","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","functionname:integration-tests-lambda-extension-XXXXXX-enhancedMetricTest","functionname:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","memorysize:1024","region:sa-east-1","resource:integration-tests-lambda-extension-XXXXXX-enhancedMetricTest","resource:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","runtime:nodejs12.x","taga:valuea","tagb:valueb","tagc:valuec","tagd:valued"],"dogsketches":[{"ts":"XXX","cnt":"1","min":1,"max":1,"avg":1,"sum":1,"k":[XXX],"n":[1]}]}
[sketch] {"metric":"aws.lambda.enhanced.invocations","tags":["account_id:601427279990","aws_account:601427279990","cold_start:true","datadog_lambda:vX.X.X","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","functionname:integration-tests-lambda-extension-XXXXXX-enhancedMetricTest","functionname:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","memorysize:1024","region:sa-east-1","resource:integration-tests-lambda-extension-XXXXXX-enhancedMetricTest","resource:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","runtime:nodejs12.x","taga:valuea","tagb:valueb","tagc:valuec","tagd:valued"],"dogsketches":[{"ts":"XXX","cnt":"1","min":1,"max":1,"avg":1,"sum":1,"k":[XXX],"n":[1]}]}
[sketch] {"metric":"aws.lambda.enhanced.max_memory_used","tags":["account_id:601427279990","aws_account:601427279990","cold_start:true","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","functionname:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","region:sa-east-1","resource:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","taga:valuea","tagb:valueb","tagc:valuec","tagd:valued"],"dogsketches":[{"ts":"XXX","cnt":"1","min":XXX,"max":XXX,"avg":XXX,"sum":XXX,"k":[XXX],"n":[1]}]}
[sketch] {"metric":"aws.lambda.enhanced.memorysize","tags":["account_id:601427279990","aws_account:601427279990","cold_start:true","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","functionname:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","region:sa-east-1","resource:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","taga:valuea","tagb:valueb","tagc:valuec","tagd:valued"],"dogsketches":[{"ts":"XXX","cnt":"1","min":XXX,"max":XXX,"avg":XXX,"sum":XXX,"k":[XXX],"n":[1]}]}
[sketch] {"metric":"serverless.lambda-extension.integration-test.count","tags":["account_id:601427279990","aws_account:601427279990","dd_lambda_layer:datadog-nodevX.X.X","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","functionname:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","region:sa-east-1","resource:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","taga:valuea","tagb:valueb","tagc:valuec","tagd:valued"],"dogsketches":[{"ts":"XXX","cnt":"1","k":[XXX],"n":[1]}]}
[sketch] {"metric":"serverless.lambda-extension.integration-test.count","tags":["account_id:601427279990","aws_account:601427279990","dd_lambda_layer:datadog-nodevX.X.X","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","functionname:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","region:sa-east-1","resource:integration-tests-lambda-extension-XXXXXX-enhancedmetrictest","taga:valuea","tagb:valueb","tagc:valuec","tagd:valued"],"dogsketches":[{"ts":"XXX","cnt":"1","min":1,"max":1,"avg":1,"sum":1,"k":[XXX],"n":[1]}]}
Loading