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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ sourceCompatibility = 1.8
targetCompatibility = 1.8

group = 'com.datadoghq'
version= '0.3.1'
version= '0.3.2'
archivesBaseName = "datadog-lambda-java"
description = "datadog-lambda-java"

Expand Down
6 changes: 6 additions & 0 deletions scripts/cleanup_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ def cleanup_json_line(json_line: object):
elif "e" in json_line:
# probably a metric
json_line["e"] = 1234567890
if json_line["t"]:
for tag in json_line["t"]:
if "runtime:" in tag:
newTag = "runtime:xxxx"
json_line["t"].remove(tag)
json_line["t"].append(newTag)
return json_line


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ private SpanBuilder addDDTags(SpanBuilder spanBuilder, Context cxt) {
spanBuilder.withTag("cold_start", ColdStart.getColdStart(cxt));
spanBuilder.withTag("datadog_lambda", BuildConfig.datadog_lambda_version);
spanBuilder.withTag("resource_names", functionName);
spanBuilder.withTag("functionname", functionName.toLowerCase());
spanBuilder.withTag("function_version", functionVersion);
spanBuilder.withTag("resource.name", functionName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ REPORT RequestId: XXXX Duration: XXXX ms Billed Duration: XXXX ms Memory Size: 1
START RequestId: XXXX Version: $LATEST
START RequestId: XXXX Version: $LATEST
START RequestId: XXXX Version: $LATEST
[dd.trace 1970-01-01 00:00:00 +0000] [dd-task-scheduler] INFO datadog.trace.agent.core.StatusLogger - DATADOG TRACER CONFIGURATION {"version":"0.80.0~a7d9f70a4","os_name":"Linux","os_version":"4.14.225-175.364.amzn2.x86_64","architecture":"amd64","lang":"jvm","lang_version":"11.0.9.1","jvm_vendor":"Amazon.com Inc.","jvm_version":"11.0.9.1+12-LTS","java_class_version":"55.0","http_nonProxyHosts":"null","http_proxyHost":"null","enabled":true,"service":"lambdainternal.AWSLambda","agent_url":"http://localhost:8126","agent_error":true,"debug":false,"analytics_enabled":false,"sampling_rules":[{},{}],"priority_sampling_enabled":true,"logs_correlation_enabled":true,"profiling_enabled":false,"dd_version":"0.80.0~a7d9f70a4","health_checks_enabled":true,"configuration_file":"no config file present","runtime_id":"00000000-0000-0000-0000-000000000000","logging_settings":{"levelInBrackets":false,"dateTimeFormat":"'[dd.trace 'yyyy-MM-dd HH:mm:ss:SSS Z']'","logFile":"System.err","configurationFile":"simplelogger.properties","showShortLogName":false,"showDateTime":true,"showLogName":true,"showThreadName":true,"defaultLogLevel":"INFO","warnLevelString":"WARN","embedException":false}}
[dd.trace 1970-01-01 00:00:00 +0000] [dd-task-scheduler] INFO datadog.trace.agent.core.StatusLogger - DATADOG TRACER CONFIGURATION {"version":"0.80.0~a7d9f70a4","os_name":"Linux","os_version":"4.14.231-180.360.amzn2.x86_64","architecture":"amd64","lang":"jvm","lang_version":"11.0.11","jvm_vendor":"Amazon.com Inc.","jvm_version":"11.0.11+9-LTS","java_class_version":"55.0","http_nonProxyHosts":"null","http_proxyHost":"null","enabled":true,"service":"lambdainternal.AWSLambda","agent_url":"http://localhost:8126","agent_error":true,"debug":false,"analytics_enabled":false,"sampling_rules":[{},{}],"priority_sampling_enabled":true,"logs_correlation_enabled":true,"profiling_enabled":false,"dd_version":"0.80.0~a7d9f70a4","health_checks_enabled":true,"configuration_file":"no config file present","runtime_id":"00000000-0000-0000-0000-000000000000","logging_settings":{"levelInBrackets":false,"dateTimeFormat":"'[dd.trace 'yyyy-MM-dd HH:mm:ss:SSS Z']'","logFile":"System.err","configurationFile":"simplelogger.properties","showShortLogName":false,"showDateTime":true,"showLogName":true,"showThreadName":true,"defaultLogLevel":"INFO","warnLevelString":"WARN","embedException":false}}
[dd.trace 1970-01-01 00:00:00 +0000] [main] INFO datadog.trace.agent.common.writer.WriterFactory - Detected serverless environment. Using PrintingWriter
{"level": "ERROR", "message": "datadog: The request passed to DDLambda contained null headers. Are you sure the handler signature matches the event provided?"}
{"level": "ERROR", "message": "datadog: The request passed to DDLambda contained null headers. Are you sure the handler signature matches the event provided?"}
{"m": "aws.lambda.enhanced.invocations", "v": 1.0, "t": ["memorysize:1024", "account_id:XXXX", "resource:Java-integration-test-dev-helloApiGatewayV2_Java11", "functionname:Java-integration-test-dev-helloApiGatewayV2_Java11", "runtime:java11.0.9.1", "region:sa-east-1", "datadog_lambda:0.3.1", "cold_start:false"], "e": 1234567890}
{"m": "aws.lambda.enhanced.invocations", "v": 1.0, "t": ["memorysize:1024", "account_id:XXXX", "resource:Java-integration-test-dev-helloApiGatewayV2_Java11", "functionname:Java-integration-test-dev-helloApiGatewayV2_Java11", "runtime:java11.0.9.1", "region:sa-east-1", "datadog_lambda:0.3.1", "cold_start:false"], "e": 1234567890}
{"m": "aws.lambda.enhanced.invocations", "v": 1.0, "t": ["memorysize:1024", "account_id:XXXX", "resource:Java-integration-test-dev-helloApiGatewayV2_Java11", "functionname:Java-integration-test-dev-helloApiGatewayV2_Java11", "runtime:java11.0.9.1", "region:sa-east-1", "datadog_lambda:0.3.1", "cold_start:true"], "e": 1234567890}
{"traces": [[{"service": "aws.lambda", "name": "aws.lambda", "resource": "Java-integration-test-dev-helloApiGatewayV2_Java11", "trace_id": "xxxxx", "span_id": "xxxxx", "parent_id": "0", "start": 1234567890, "duration": 12345, "error": 0, "metrics": {"_dd.agent_psr": 1.0}, "meta": {"function_arn": "arn:aws:lambda:sa-east-1:123456789012:function:java-integration-test-dev-helloapigatewayv2_java11", "runtime-id": "00000000-0000-0000-0000-000000000000", "language": "jvm", "thread.name": "main", "request_id": "00000000-0000-0000-0000-000000000000", "datadog_lambda": "0.3.1", "thread.id": "1", "cold_start": "false", "resource_names": "Java-integration-test-dev-helloApiGatewayV2_Java11", "function_version": "$LATEST"}}]]}
{"traces": [[{"service": "aws.lambda", "name": "aws.lambda", "resource": "Java-integration-test-dev-helloApiGatewayV2_Java11", "trace_id": "xxxxx", "span_id": "xxxxx", "parent_id": "0", "start": 1234567890, "duration": 12345, "error": 0, "metrics": {"_dd.agent_psr": 1.0}, "meta": {"function_arn": "arn:aws:lambda:sa-east-1:123456789012:function:java-integration-test-dev-helloapigatewayv2_java11", "runtime-id": "00000000-0000-0000-0000-000000000000", "language": "jvm", "thread.name": "main", "request_id": "00000000-0000-0000-0000-000000000000", "datadog_lambda": "0.3.1", "thread.id": "1", "cold_start": "false", "resource_names": "Java-integration-test-dev-helloApiGatewayV2_Java11", "function_version": "$LATEST"}}]]}
{"traces": [[{"service": "aws.lambda", "name": "aws.lambda", "resource": "Java-integration-test-dev-helloApiGatewayV2_Java11", "trace_id": "xxxxx", "span_id": "xxxxx", "parent_id": "0", "start": 1234567890, "duration": 12345, "error": 0, "metrics": {"_dd.agent_psr": 1.0}, "meta": {"function_arn": "arn:aws:lambda:sa-east-1:123456789012:function:java-integration-test-dev-helloapigatewayv2_java11", "runtime-id": "00000000-0000-0000-0000-000000000000", "language": "jvm", "thread.name": "main", "request_id": "00000000-0000-0000-0000-000000000000", "datadog_lambda": "0.3.1", "thread.id": "1", "cold_start": "true", "resource_names": "Java-integration-test-dev-helloApiGatewayV2_Java11", "function_version": "$LATEST"}}]]}
{"m": "aws.lambda.enhanced.invocations", "v": 1.0, "t": ["memorysize:1024", "account_id:XXXX", "resource:Java-integration-test-dev-helloApiGatewayV2_Java11", "functionname:Java-integration-test-dev-helloApiGatewayV2_Java11", "region:sa-east-1", "datadog_lambda:0.3.2", "cold_start:false", "runtime:xxxx"], "e": 1234567890}
{"m": "aws.lambda.enhanced.invocations", "v": 1.0, "t": ["memorysize:1024", "account_id:XXXX", "resource:Java-integration-test-dev-helloApiGatewayV2_Java11", "functionname:Java-integration-test-dev-helloApiGatewayV2_Java11", "region:sa-east-1", "datadog_lambda:0.3.2", "cold_start:false", "runtime:xxxx"], "e": 1234567890}
{"m": "aws.lambda.enhanced.invocations", "v": 1.0, "t": ["memorysize:1024", "account_id:XXXX", "resource:Java-integration-test-dev-helloApiGatewayV2_Java11", "functionname:Java-integration-test-dev-helloApiGatewayV2_Java11", "region:sa-east-1", "datadog_lambda:0.3.2", "cold_start:true", "runtime:xxxx"], "e": 1234567890}
{"traces": [[{"service": "aws.lambda", "name": "aws.lambda", "resource": "Java-integration-test-dev-helloApiGatewayV2_Java11", "trace_id": "xxxxx", "span_id": "xxxxx", "parent_id": "0", "start": 1234567890, "duration": 12345, "error": 0, "metrics": {"_dd.agent_psr": 1.0}, "meta": {"functionname": "java-integration-test-dev-helloapigatewayv2_java11", "function_arn": "arn:aws:lambda:sa-east-1:123456789012:function:java-integration-test-dev-helloapigatewayv2_java11", "runtime-id": "00000000-0000-0000-0000-000000000000", "language": "jvm", "thread.name": "main", "request_id": "00000000-0000-0000-0000-000000000000", "datadog_lambda": "0.3.2", "thread.id": "1", "cold_start": "false", "resource_names": "Java-integration-test-dev-helloApiGatewayV2_Java11", "function_version": "$LATEST"}}]]}
{"traces": [[{"service": "aws.lambda", "name": "aws.lambda", "resource": "Java-integration-test-dev-helloApiGatewayV2_Java11", "trace_id": "xxxxx", "span_id": "xxxxx", "parent_id": "0", "start": 1234567890, "duration": 12345, "error": 0, "metrics": {"_dd.agent_psr": 1.0}, "meta": {"functionname": "java-integration-test-dev-helloapigatewayv2_java11", "function_arn": "arn:aws:lambda:sa-east-1:123456789012:function:java-integration-test-dev-helloapigatewayv2_java11", "runtime-id": "00000000-0000-0000-0000-000000000000", "language": "jvm", "thread.name": "main", "request_id": "00000000-0000-0000-0000-000000000000", "datadog_lambda": "0.3.2", "thread.id": "1", "cold_start": "false", "resource_names": "Java-integration-test-dev-helloApiGatewayV2_Java11", "function_version": "$LATEST"}}]]}
{"traces": [[{"service": "aws.lambda", "name": "aws.lambda", "resource": "Java-integration-test-dev-helloApiGatewayV2_Java11", "trace_id": "xxxxx", "span_id": "xxxxx", "parent_id": "0", "start": 1234567890, "duration": 12345, "error": 0, "metrics": {"_dd.agent_psr": 1.0}, "meta": {"functionname": "java-integration-test-dev-helloapigatewayv2_java11", "function_arn": "arn:aws:lambda:sa-east-1:123456789012:function:java-integration-test-dev-helloapigatewayv2_java11", "runtime-id": "00000000-0000-0000-0000-000000000000", "language": "jvm", "thread.name": "main", "request_id": "00000000-0000-0000-0000-000000000000", "datadog_lambda": "0.3.2", "thread.id": "1", "cold_start": "true", "resource_names": "Java-integration-test-dev-helloApiGatewayV2_Java11", "function_version": "$LATEST"}}]]}
14 changes: 7 additions & 7 deletions tests/testfunctions/snapshots/logs/helloApiGatewayV2_Java8.log
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ REPORT RequestId: XXXX Duration: XXXX ms Billed Duration: XXXX ms Memory Size: 1
START RequestId: XXXX Version: $LATEST
START RequestId: XXXX Version: $LATEST
START RequestId: XXXX Version: $LATEST
[dd.trace 1970-01-01 00:00:00 +0000] [dd-task-scheduler] INFO datadog.trace.agent.core.StatusLogger - DATADOG TRACER CONFIGURATION {"version":"0.80.0~a7d9f70a4","os_name":"Linux","os_version":"4.14.225-175.364.amzn2.x86_64","architecture":"amd64","lang":"jvm","lang_version":"1.8.0_282","jvm_vendor":"Amazon.com Inc.","jvm_version":"25.282-b08","java_class_version":"52.0","http_nonProxyHosts":"null","http_proxyHost":"null","enabled":true,"service":"lambdainternal.AWSLambda","agent_url":"http://localhost:8126","agent_error":true,"debug":false,"analytics_enabled":false,"sampling_rules":[{},{}],"priority_sampling_enabled":true,"logs_correlation_enabled":true,"profiling_enabled":false,"dd_version":"0.80.0~a7d9f70a4","health_checks_enabled":true,"configuration_file":"no config file present","runtime_id":"00000000-0000-0000-0000-000000000000","logging_settings":{"levelInBrackets":false,"dateTimeFormat":"'[dd.trace 'yyyy-MM-dd HH:mm:ss:SSS Z']'","logFile":"System.err","configurationFile":"simplelogger.properties","showShortLogName":false,"showDateTime":true,"showLogName":true,"showThreadName":true,"defaultLogLevel":"INFO","warnLevelString":"WARN","embedException":false}}
[dd.trace 1970-01-01 00:00:00 +0000] [dd-task-scheduler] INFO datadog.trace.agent.core.StatusLogger - DATADOG TRACER CONFIGURATION {"version":"0.80.0~a7d9f70a4","os_name":"Linux","os_version":"4.14.231-180.360.amzn2.x86_64","architecture":"amd64","lang":"jvm","lang_version":"1.8.0_292","jvm_vendor":"Amazon.com Inc.","jvm_version":"25.292-b10","java_class_version":"52.0","http_nonProxyHosts":"null","http_proxyHost":"null","enabled":true,"service":"lambdainternal.AWSLambda","agent_url":"http://localhost:8126","agent_error":true,"debug":false,"analytics_enabled":false,"sampling_rules":[{},{}],"priority_sampling_enabled":true,"logs_correlation_enabled":true,"profiling_enabled":false,"dd_version":"0.80.0~a7d9f70a4","health_checks_enabled":true,"configuration_file":"no config file present","runtime_id":"00000000-0000-0000-0000-000000000000","logging_settings":{"levelInBrackets":false,"dateTimeFormat":"'[dd.trace 'yyyy-MM-dd HH:mm:ss:SSS Z']'","logFile":"System.err","configurationFile":"simplelogger.properties","showShortLogName":false,"showDateTime":true,"showLogName":true,"showThreadName":true,"defaultLogLevel":"INFO","warnLevelString":"WARN","embedException":false}}
[dd.trace 1970-01-01 00:00:00 +0000] [main] INFO datadog.trace.agent.common.writer.WriterFactory - Detected serverless environment. Using PrintingWriter
{"level": "ERROR", "message": "datadog: The request passed to DDLambda contained null headers. Are you sure the handler signature matches the event provided?"}
{"level": "ERROR", "message": "datadog: The request passed to DDLambda contained null headers. Are you sure the handler signature matches the event provided?"}
{"m": "aws.lambda.enhanced.invocations", "v": 1.0, "t": ["memorysize:1024", "account_id:XXXX", "resource:Java-integration-test-dev-helloApiGatewayV2_Java8", "functionname:Java-integration-test-dev-helloApiGatewayV2_Java8", "runtime:java1.8.0_282", "region:sa-east-1", "datadog_lambda:0.3.1", "cold_start:false"], "e": 1234567890}
{"m": "aws.lambda.enhanced.invocations", "v": 1.0, "t": ["memorysize:1024", "account_id:XXXX", "resource:Java-integration-test-dev-helloApiGatewayV2_Java8", "functionname:Java-integration-test-dev-helloApiGatewayV2_Java8", "runtime:java1.8.0_282", "region:sa-east-1", "datadog_lambda:0.3.1", "cold_start:false"], "e": 1234567890}
{"m": "aws.lambda.enhanced.invocations", "v": 1.0, "t": ["memorysize:1024", "account_id:XXXX", "resource:Java-integration-test-dev-helloApiGatewayV2_Java8", "functionname:Java-integration-test-dev-helloApiGatewayV2_Java8", "runtime:java1.8.0_282", "region:sa-east-1", "datadog_lambda:0.3.1", "cold_start:true"], "e": 1234567890}
{"traces": [[{"service": "aws.lambda", "name": "aws.lambda", "resource": "Java-integration-test-dev-helloApiGatewayV2_Java8", "trace_id": "xxxxx", "span_id": "xxxxx", "parent_id": "0", "start": 1234567890, "duration": 12345, "error": 0, "metrics": {"_dd.agent_psr": 1.0}, "meta": {"function_arn": "arn:aws:lambda:sa-east-1:123456789012:function:java-integration-test-dev-helloapigatewayv2_java8", "runtime-id": "00000000-0000-0000-0000-000000000000", "language": "jvm", "thread.name": "main", "request_id": "00000000-0000-0000-0000-000000000000", "datadog_lambda": "0.3.1", "thread.id": "1", "cold_start": "false", "resource_names": "Java-integration-test-dev-helloApiGatewayV2_Java8", "function_version": "$LATEST"}}]]}
{"traces": [[{"service": "aws.lambda", "name": "aws.lambda", "resource": "Java-integration-test-dev-helloApiGatewayV2_Java8", "trace_id": "xxxxx", "span_id": "xxxxx", "parent_id": "0", "start": 1234567890, "duration": 12345, "error": 0, "metrics": {"_dd.agent_psr": 1.0}, "meta": {"function_arn": "arn:aws:lambda:sa-east-1:123456789012:function:java-integration-test-dev-helloapigatewayv2_java8", "runtime-id": "00000000-0000-0000-0000-000000000000", "language": "jvm", "thread.name": "main", "request_id": "00000000-0000-0000-0000-000000000000", "datadog_lambda": "0.3.1", "thread.id": "1", "cold_start": "false", "resource_names": "Java-integration-test-dev-helloApiGatewayV2_Java8", "function_version": "$LATEST"}}]]}
{"traces": [[{"service": "aws.lambda", "name": "aws.lambda", "resource": "Java-integration-test-dev-helloApiGatewayV2_Java8", "trace_id": "xxxxx", "span_id": "xxxxx", "parent_id": "0", "start": 1234567890, "duration": 12345, "error": 0, "metrics": {"_dd.agent_psr": 1.0}, "meta": {"function_arn": "arn:aws:lambda:sa-east-1:123456789012:function:java-integration-test-dev-helloapigatewayv2_java8", "runtime-id": "00000000-0000-0000-0000-000000000000", "language": "jvm", "thread.name": "main", "request_id": "00000000-0000-0000-0000-000000000000", "datadog_lambda": "0.3.1", "thread.id": "1", "cold_start": "true", "resource_names": "Java-integration-test-dev-helloApiGatewayV2_Java8", "function_version": "$LATEST"}}]]}
{"m": "aws.lambda.enhanced.invocations", "v": 1.0, "t": ["memorysize:1024", "account_id:XXXX", "resource:Java-integration-test-dev-helloApiGatewayV2_Java8", "functionname:Java-integration-test-dev-helloApiGatewayV2_Java8", "region:sa-east-1", "datadog_lambda:0.3.2", "cold_start:false", "runtime:xxxx"], "e": 1234567890}
{"m": "aws.lambda.enhanced.invocations", "v": 1.0, "t": ["memorysize:1024", "account_id:XXXX", "resource:Java-integration-test-dev-helloApiGatewayV2_Java8", "functionname:Java-integration-test-dev-helloApiGatewayV2_Java8", "region:sa-east-1", "datadog_lambda:0.3.2", "cold_start:false", "runtime:xxxx"], "e": 1234567890}
{"m": "aws.lambda.enhanced.invocations", "v": 1.0, "t": ["memorysize:1024", "account_id:XXXX", "resource:Java-integration-test-dev-helloApiGatewayV2_Java8", "functionname:Java-integration-test-dev-helloApiGatewayV2_Java8", "region:sa-east-1", "datadog_lambda:0.3.2", "cold_start:true", "runtime:xxxx"], "e": 1234567890}
{"traces": [[{"service": "aws.lambda", "name": "aws.lambda", "resource": "Java-integration-test-dev-helloApiGatewayV2_Java8", "trace_id": "xxxxx", "span_id": "xxxxx", "parent_id": "0", "start": 1234567890, "duration": 12345, "error": 0, "metrics": {"_dd.agent_psr": 1.0}, "meta": {"functionname": "java-integration-test-dev-helloapigatewayv2_java8", "function_arn": "arn:aws:lambda:sa-east-1:123456789012:function:java-integration-test-dev-helloapigatewayv2_java8", "runtime-id": "00000000-0000-0000-0000-000000000000", "language": "jvm", "thread.name": "main", "request_id": "00000000-0000-0000-0000-000000000000", "datadog_lambda": "0.3.2", "thread.id": "1", "cold_start": "false", "resource_names": "Java-integration-test-dev-helloApiGatewayV2_Java8", "function_version": "$LATEST"}}]]}
{"traces": [[{"service": "aws.lambda", "name": "aws.lambda", "resource": "Java-integration-test-dev-helloApiGatewayV2_Java8", "trace_id": "xxxxx", "span_id": "xxxxx", "parent_id": "0", "start": 1234567890, "duration": 12345, "error": 0, "metrics": {"_dd.agent_psr": 1.0}, "meta": {"functionname": "java-integration-test-dev-helloapigatewayv2_java8", "function_arn": "arn:aws:lambda:sa-east-1:123456789012:function:java-integration-test-dev-helloapigatewayv2_java8", "runtime-id": "00000000-0000-0000-0000-000000000000", "language": "jvm", "thread.name": "main", "request_id": "00000000-0000-0000-0000-000000000000", "datadog_lambda": "0.3.2", "thread.id": "1", "cold_start": "false", "resource_names": "Java-integration-test-dev-helloApiGatewayV2_Java8", "function_version": "$LATEST"}}]]}
{"traces": [[{"service": "aws.lambda", "name": "aws.lambda", "resource": "Java-integration-test-dev-helloApiGatewayV2_Java8", "trace_id": "xxxxx", "span_id": "xxxxx", "parent_id": "0", "start": 1234567890, "duration": 12345, "error": 0, "metrics": {"_dd.agent_psr": 1.0}, "meta": {"functionname": "java-integration-test-dev-helloapigatewayv2_java8", "function_arn": "arn:aws:lambda:sa-east-1:123456789012:function:java-integration-test-dev-helloapigatewayv2_java8", "runtime-id": "00000000-0000-0000-0000-000000000000", "language": "jvm", "thread.name": "main", "request_id": "00000000-0000-0000-0000-000000000000", "datadog_lambda": "0.3.2", "thread.id": "1", "cold_start": "true", "resource_names": "Java-integration-test-dev-helloApiGatewayV2_Java8", "function_version": "$LATEST"}}]]}
Loading