Skip to content

Commit

Permalink
support for aws.lambda.enhanced.runtime_duration in integration tests (
Browse files Browse the repository at this point in the history
  • Loading branch information
maxday authored Sep 28, 2021
1 parent 64adacd commit 808abd1
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 20 deletions.
12 changes: 6 additions & 6 deletions integration_tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,12 @@ for function_name in "${all_functions[@]}"; do
echo "$raw_logs" | \
grep "\[sketch\]" | \
perl -p -e "s/(ts\":)[0-9]{10}/\1XXX/g" | \
perl -p -e "s/(min\":)[0-9\.e\-]{2,20}/\1XXX/g" | \
perl -p -e "s/(max\":)[0-9\.e\-]{2,20}/\1XXX/g" | \
perl -p -e "s/(cnt\":)[0-9\.e\-]{2,20}/\1XXX/g" | \
perl -p -e "s/(avg\":)[0-9\.e\-]{2,20}/\1XXX/g" | \
perl -p -e "s/(sum\":)[0-9\.e\-]{2,20}/\1XXX/g" | \
perl -p -e "s/(k\":\[)[0-9\.e\-]{1,20}/\1XXX/g" | \
perl -p -e "s/(min\":)[0-9\.e\-]{2,30}/\1XXX/g" | \
perl -p -e "s/(max\":)[0-9\.e\-]{2,30}/\1XXX/g" | \
perl -p -e "s/(cnt\":)[0-9\.e\-]{2,30}/\1XXX/g" | \
perl -p -e "s/(avg\":)[0-9\.e\-]{2,30}/\1XXX/g" | \
perl -p -e "s/(sum\":)[0-9\.e\-]{2,30}/\1XXX/g" | \
perl -p -e "s/(k\":\[)[0-9\.e\-]{1,30}/\1XXX/g" | \
perl -p -e "s/(datadog-nodev)[0-9]+\.[0-9]+\.[0-9]+/\1X\.X\.X/g" | \
perl -p -e "s/(datadog_lambda:v)[0-9]+\.[0-9]+\.[0-9]+/\1X\.X\.X/g" | \
perl -p -e "s/(dd_lambda_layer:datadog-python)[0-9_]+\.[0-9]+\.[0-9]+/\1X\.X\.X/g" | \
Expand Down
3 changes: 2 additions & 1 deletion integration_tests/snapshots/enhanced-metric-node
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
[sketch] {"metric":"aws.lambda.enhanced.invocations","distributions":null,"tags":["account_id:601427279990","aws_account:601427279990","cold_start:true","datadog_lambda:vX.X.X","dd_extension_version:123","env:integration-tests-env","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-extension-XXXXXX-enhanced-metric-node","functionname:integration-tests-extension-XXXXXX-enhanced-metric-node","memorysize:1024","region:sa-east-1","resource:integration-tests-extension-XXXXXX-enhanced-metric-node","runtime:nodejs14.x","service:integration-tests-service","taga:valuea","tagb:valueb","tagc:valuec","tagd:valued","version:integration-tests-version"],"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","distributions":null,"tags":["account_id:601427279990","aws_account:601427279990","cold_start:true","dd_extension_version:123","env:integration-tests-env","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-extension-XXXXXX-enhanced-metric-node","functionname:integration-tests-extension-XXXXXX-enhanced-metric-node","region:sa-east-1","resource:integration-tests-extension-XXXXXX-enhanced-metric-node","service:integration-tests-service","taga:valuea","tagb:valueb","tagc:valuec","tagd:valued","version:integration-tests-version"],"dogsketches":[{"ts":XXX,"cnt":1,"min":XXX,"max":XXX,"avg":XXX,"sum":XXX,"k":[XXX],"n":[1]}]}
[sketch] {"metric":"aws.lambda.enhanced.memorysize","distributions":null,"tags":["account_id:601427279990","aws_account:601427279990","cold_start:true","dd_extension_version:123","env:integration-tests-env","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-extension-XXXXXX-enhanced-metric-node","functionname:integration-tests-extension-XXXXXX-enhanced-metric-node","region:sa-east-1","resource:integration-tests-extension-XXXXXX-enhanced-metric-node","service:integration-tests-service","taga:valuea","tagb:valueb","tagc:valuec","tagd:valued","version:integration-tests-version"],"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","distributions":null,"tags":["account_id:601427279990","aws_account:601427279990","dd_extension_version:123","dd_lambda_layer:datadog-nodevX.X.X","env:integration-tests-env","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-extension-XXXXXX-enhanced-metric-node","functionname:integration-tests-extension-XXXXXX-enhanced-metric-node","region:sa-east-1","resource:integration-tests-extension-XXXXXX-enhanced-metric-node","service:integration-tests-service","taga:valuea","tagb:valueb","tagc:valuec","tagd:valued","version:integration-tests-version"],"dogsketches":[{"ts":XXX,"cnt":1,"k":[XXX],"n":[1]}]}
[sketch] {"metric":"aws.lambda.enhanced.runtime_duration","distributions":null,"tags":["account_id:601427279990","aws_account:601427279990","cold_start:true","dd_extension_version:123","env:integration-tests-env","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-extension-XXXXXX-enhanced-metric-node","functionname:integration-tests-extension-XXXXXX-enhanced-metric-node","region:sa-east-1","resource:integration-tests-extension-XXXXXX-enhanced-metric-node","service:integration-tests-service","taga:valuea","tagb:valueb","tagc:valuec","tagd:valued","version:integration-tests-version"],"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","distributions":null,"tags":["account_id:601427279990","aws_account:601427279990","dd_extension_version:123","dd_lambda_layer:datadog-nodevX.X.X","env:integration-tests-env","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-extension-XXXXXX-enhanced-metric-node","functionname:integration-tests-extension-XXXXXX-enhanced-metric-node","region:sa-east-1","resource:integration-tests-extension-XXXXXX-enhanced-metric-node","service:integration-tests-service","taga:valuea","tagb:valueb","tagc:valuec","tagd:valued","version:integration-tests-version"],"dogsketches":[{"ts":XXX,"cnt":1,"min":1,"max":1,"avg":1,"sum":1,"k":[XXX],"n":[1]}]}
2 changes: 1 addition & 1 deletion integration_tests/snapshots/enhanced-metric-python
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
[sketch] {"metric":"aws.lambda.enhanced.invocations","distributions":null,"tags":["account_id:601427279990","aws_account:601427279990","cold_start:true","datadog_lambda:vX.X.X","dd_extension_version:123","dd_lambda_layer:datadog-pythonX.X.X","env:integration-tests-env","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-extension-XXXXXX-enhanced-metric-python","functionname:integration-tests-extension-XXXXXX-enhanced-metric-python","memorysize:1024","region:sa-east-1","resource:integration-tests-extension-XXXXXX-enhanced-metric-python","runtime:python3.8","service:integration-tests-service","taga:valuea","tagb:valueb","tagc:valuec","tagd:valued","version:integration-tests-version"],"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","distributions":null,"tags":["account_id:601427279990","aws_account:601427279990","cold_start:true","dd_extension_version:123","env:integration-tests-env","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-extension-XXXXXX-enhanced-metric-python","functionname:integration-tests-extension-XXXXXX-enhanced-metric-python","region:sa-east-1","resource:integration-tests-extension-XXXXXX-enhanced-metric-python","service:integration-tests-service","taga:valuea","tagb:valueb","tagc:valuec","tagd:valued","version:integration-tests-version"],"dogsketches":[{"ts":XXX,"cnt":1,"min":XXX,"max":XXX,"avg":XXX,"sum":XXX,"k":[XXX],"n":[1]}]}
[sketch] {"metric":"aws.lambda.enhanced.memorysize","distributions":null,"tags":["account_id:601427279990","aws_account:601427279990","cold_start:true","dd_extension_version:123","env:integration-tests-env","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-extension-XXXXXX-enhanced-metric-python","functionname:integration-tests-extension-XXXXXX-enhanced-metric-python","region:sa-east-1","resource:integration-tests-extension-XXXXXX-enhanced-metric-python","service:integration-tests-service","taga:valuea","tagb:valueb","tagc:valuec","tagd:valued","version:integration-tests-version"],"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","distributions":null,"tags":["account_id:601427279990","aws_account:601427279990","dd_extension_version:123","dd_lambda_layer:datadog-pythonX.X.X","env:integration-tests-env","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-extension-XXXXXX-enhanced-metric-python","functionname:integration-tests-extension-XXXXXX-enhanced-metric-python","region:sa-east-1","resource:integration-tests-extension-XXXXXX-enhanced-metric-python","service:integration-tests-service","taga:valuea","tagb:valueb","tagc:valuec","tagd:valued","version:integration-tests-version"],"dogsketches":[{"ts":XXX,"cnt":1,"min":1,"max":1,"avg":1,"sum":1,"k":[XXX],"n":[1]}]}
[sketch] {"metric":"aws.lambda.enhanced.runtime_duration","distributions":null,"tags":["account_id:601427279990","aws_account:601427279990","cold_start:true","dd_extension_version:123","env:integration-tests-env","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-extension-XXXXXX-enhanced-metric-python","functionname:integration-tests-extension-XXXXXX-enhanced-metric-python","region:sa-east-1","resource:integration-tests-extension-XXXXXX-enhanced-metric-python","service:integration-tests-service","taga:valuea","tagb:valueb","tagc:valuec","tagd:valued","version:integration-tests-version"],"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","distributions":null,"tags":["account_id:601427279990","aws_account:601427279990","dd_extension_version:123","dd_lambda_layer:datadog-pythonX.X.X","env:integration-tests-env","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-extension-XXXXXX-enhanced-metric-python","functionname:integration-tests-extension-XXXXXX-enhanced-metric-python","region:sa-east-1","resource:integration-tests-extension-XXXXXX-enhanced-metric-python","service:integration-tests-service","taga:valuea","tagb:valueb","tagc:valuec","tagd:valued","version:integration-tests-version"],"dogsketches":[{"ts":XXX,"cnt":1,"min":1,"max":1,"avg":1,"sum":1,"k":[XXX],"n":[1]}]}
2 changes: 1 addition & 1 deletion integration_tests/snapshots/no-enhanced-metric-node
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[sketch] {"metric":"serverless.lambda-extension.integration-test.count","distributions":null,"tags":["account_id:601427279990","aws_account:601427279990","dd_extension_version:123","dd_lambda_layer:datadog-nodevX.X.X","env:integration-tests-env","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-extension-XXXXXX-no-enhanced-metric-node","functionname:integration-tests-extension-XXXXXX-no-enhanced-metric-node","region:sa-east-1","resource:integration-tests-extension-XXXXXX-no-enhanced-metric-node","service:integration-tests-service","version:integration-tests-version"],"dogsketches":[{"ts":XXX,"cnt":2,"max":1,"avg":XXX,"sum":1,"k":[XXX,1338],"n":[1,1]}]}
[sketch] {"metric":"serverless.lambda-extension.integration-test.count","distributions":null,"tags":["account_id:601427279990","aws_account:601427279990","dd_extension_version:123","dd_lambda_layer:datadog-nodevX.X.X","env:integration-tests-env","function_arn:arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-extension-XXXXXX-no-enhanced-metric-node","functionname:integration-tests-extension-XXXXXX-no-enhanced-metric-node","region:sa-east-1","resource:integration-tests-extension-XXXXXX-no-enhanced-metric-node","service:integration-tests-service","version:integration-tests-version"],"dogsketches":[{"ts":XXX,"cnt":1,"min":1,"max":1,"avg":1,"sum":1,"k":[XXX],"n":[1]}]}
2 changes: 1 addition & 1 deletion integration_tests/snapshots/simple-trace-python
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[trace] {"traceID":XXX,"spans":[{"service":"aws.lambda","name":"aws.lambda","resource":"integration-tests-extension-XXXXXX-simple-trace-python","trace_id":XXX,"span_id":XXX,"parent_id":XXX,"start":XXX,"duration":XXX,"error":0,"meta":{"_dd.compute_stats":"1","_dd.origin":"lambda","account_id":"601427279990","aws_account":"601427279990","cold_start":"true","datadog_lambda":"X.X.X","dd_extension_version":"123","dd_trace":"X.X.X","env":"integration-tests-env","function_arn":"arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-extension-XXXXXX-simple-trace-python","function_version":"$LATEST","functionname":"integration-tests-extension-XXXXXX-simple-trace-python","region":"sa-east-1","request_id":"XXX","resource_names":"integration-tests-extension-XXXXXX-simple-trace-python","runtime-id":"XXX","service":"integration-tests-service","tagA":"valueA","tagB":"valueB","taga":"valuea","tagb":"valueb","tagc":"valuec","tagd":"valued","version":"integration-tests-version"},"metrics":{"_dd.agent_psr":1,"_dd.tracer_kr":1,"_sampling_priority_v1":1,"_top_level":1,"system.pid":XXX},"type":"serverless"},{"service":"aws.lambda","name":"integration_test","resource":"integration-test","trace_id":XXX,"span_id":XXX,"parent_id":XXX,"start":XXX,"duration":XXX,"error":0,"meta":{"_dd.compute_stats":"1","_dd.origin":"lambda","account_id":"601427279990","aws_account":"601427279990","dd_extension_version":"123","env":"integration-tests-env","function_arn":"arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-extension-XXXXXX-simple-trace-python","functionname":"integration-tests-extension-XXXXXX-simple-trace-python","region":"sa-east-1","service":"integration-tests-service","tagA":"valueA","tagB":"valueB","taga":"valuea","tagb":"valueb","tagc":"valuec","tagd":"valued","version":"integration-tests-version"},"metrics":null,"type":""},{"service":"aws.lambda","name":"requests.request","resource":"requests.request","trace_id":XXX,"span_id":XXX,"parent_id":XXX,"start":XXX,"duration":XXX,"error":0,"meta":{"_dd.compute_stats":"1","_dd.origin":"lambda","account_id":"601427279990","aws_account":"601427279990","dd_extension_version":"123","env":"integration-tests-env","function_arn":"arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-extension-XXXXXX-simple-trace-python","functionname":"integration-tests-extension-XXXXXX-simple-trace-python","http.method":"POST","http.status_code":"200","http.url":"http://127.0.0.1:8124/lambda/flush","region":"sa-east-1","service":"integration-tests-service","tagA":"valueA","tagB":"valueB","taga":"valuea","tagb":"valueb","tagc":"valuec","tagd":"valued","version":"integration-tests-version"},"metrics":{"_dd.measured":1},"type":"http"}],"startTime":XXX,"endTime":XXX}
[trace] {"traceID":XXX,"spans":[{"service":"aws.lambda","name":"aws.lambda","resource":"integration-tests-extension-XXXXXX-simple-trace-python","trace_id":XXX,"span_id":XXX,"parent_id":XXX,"start":XXX,"duration":XXX,"error":0,"meta":{"_dd.compute_stats":"1","_dd.origin":"lambda","account_id":"601427279990","aws_account":"601427279990","cold_start":"true","datadog_lambda":"X.X.X","dd_extension_version":"123","dd_trace":"X.X.X","env":"integration-tests-env","function_arn":"arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-extension-XXXXXX-simple-trace-python","function_version":"$LATEST","functionname":"integration-tests-extension-XXXXXX-simple-trace-python","region":"sa-east-1","request_id":"XXX","resource_names":"integration-tests-extension-XXXXXX-simple-trace-python","runtime-id":"XXX","service":"integration-tests-service","tagA":"valueA","tagB":"valueB","taga":"valuea","tagb":"valueb","tagc":"valuec","tagd":"valued","version":"integration-tests-version"},"metrics":{"_dd.agent_psr":1,"_dd.tracer_kr":1,"_sampling_priority_v1":1,"_top_level":1,"system.pid":XXX},"type":"serverless"},{"service":"aws.lambda","name":"integration_test","resource":"integration-test","trace_id":XXX,"span_id":XXX,"parent_id":XXX,"start":XXX,"duration":XXX,"error":0,"meta":{"_dd.compute_stats":"1","_dd.origin":"lambda","account_id":"601427279990","aws_account":"601427279990","dd_extension_version":"123","env":"integration-tests-env","function_arn":"arn:aws:lambda:sa-east-1:601427279990:function:integration-tests-extension-XXXXXX-simple-trace-python","functionname":"integration-tests-extension-XXXXXX-simple-trace-python","region":"sa-east-1","service":"integration-tests-service","tagA":"valueA","tagB":"valueB","taga":"valuea","tagb":"valueb","tagc":"valuec","tagd":"valued","version":"integration-tests-version"},"metrics":null,"type":""}],"startTime":XXX,"endTime":XXX}
Loading

0 comments on commit 808abd1

Please sign in to comment.