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: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repositories {
}

dependencies {
implementation 'com.amazonaws:aws-lambda-java-log4j2:1.4.0'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does aws-lambda-java-core itself have a dependency on log4j?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not have any dependencies.
https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-core

Here is the full dependency graph

./gradlew -q dependencies --configuration runtimeClasspath

------------------------------------------------------------
Root project - datadog-lambda-java
------------------------------------------------------------

runtimeClasspath - Runtime classpath of source set 'main'.
+--- com.amazonaws:aws-lambda-java-core:1.2.1
+--- com.amazonaws:aws-lambda-java-events:3.10.0
|    \--- joda-time:joda-time:2.6
+--- com.google.code.gson:gson:2.8.9
+--- org.apache.httpcomponents:httpclient:4.5.13
|    +--- org.apache.httpcomponents:httpcore:4.4.13
|    +--- commons-logging:commons-logging:1.2
|    \--- commons-codec:commons-codec:1.11
+--- com.squareup.okhttp3:okhttp:4.9.2
|    +--- com.squareup.okio:okio:2.8.0
|    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.4.0 -> 1.4.10
|    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.4.10
|    |    |    \--- org.jetbrains:annotations:13.0 -> 22.0.0
|    |    \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.4.0 -> 1.4.10
|    \--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10 (*)
+--- org.apache.commons:commons-lang3:3.12.0
+--- org.slf4j:slf4j-log4j12:1.7.32
|    +--- org.slf4j:slf4j-api:1.7.32
|    \--- log4j:log4j:1.2.17
+--- org.jetbrains:annotations:22.0.0
+--- io.opentracing:opentracing-api:0.33.0
+--- io.opentracing:opentracing-util:0.33.0
|    +--- io.opentracing:opentracing-api:0.33.0
|    \--- io.opentracing:opentracing-noop:0.33.0
|         \--- io.opentracing:opentracing-api:0.33.0
+--- com.datadoghq:dd-trace-api:0.90.0
\--- com.datadoghq:java-dogstatsd-client:3.0.0
     \--- com.github.jnr:jnr-unixsocket:0.36
          +--- com.github.jnr:jnr-ffi:2.1.16
          |    +--- com.github.jnr:jffi:1.2.23
          |    +--- org.ow2.asm:asm:7.1
          |    +--- org.ow2.asm:asm-commons:7.1
          |    |    +--- org.ow2.asm:asm:7.1
          |    |    +--- org.ow2.asm:asm-tree:7.1
          |    |    |    \--- org.ow2.asm:asm:7.1
          |    |    \--- org.ow2.asm:asm-analysis:7.1
          |    |         \--- org.ow2.asm:asm-tree:7.1 (*)
          |    +--- org.ow2.asm:asm-analysis:7.1 (*)
          |    +--- org.ow2.asm:asm-tree:7.1 (*)
          |    +--- org.ow2.asm:asm-util:7.1
          |    |    +--- org.ow2.asm:asm:7.1
          |    |    +--- org.ow2.asm:asm-tree:7.1 (*)
          |    |    \--- org.ow2.asm:asm-analysis:7.1 (*)
          |    +--- com.github.jnr:jnr-a64asm:1.0.0
          |    \--- com.github.jnr:jnr-x86asm:1.0.2
          +--- com.github.jnr:jnr-constants:0.9.17
          +--- com.github.jnr:jnr-enxio:0.30
          |    +--- com.github.jnr:jnr-constants:0.9.17
          |    \--- com.github.jnr:jnr-ffi:2.1.16 (*)
          \--- com.github.jnr:jnr-posix:3.0.61
               +--- com.github.jnr:jnr-ffi:2.1.16 (*)
               \--- com.github.jnr:jnr-constants:0.9.17

(*) - dependencies omitted (listed previously)

implementation 'com.amazonaws:aws-lambda-java-core:1.2.1'
implementation 'com.amazonaws:aws-lambda-java-events:3.10.0'
compileOnly 'com.amazonaws:aws-java-sdk-kinesis:1.12.100'
implementation 'com.google.code.gson:gson:2.8.9'
Expand All @@ -39,6 +39,7 @@ dependencies {

// Use JUnit test framework
testImplementation 'junit:junit:4.13.2'
//log4j imported for running unit tests. Doesn't get bundled with the build artifact.
testImplementation 'org.apache.logging.log4j:log4j-api:2.17.0'
testImplementation 'org.apache.logging.log4j:log4j-core:2.17.0'
testImplementation 'com.github.stefanbirkner:system-rules:1.19.0'
Expand All @@ -52,7 +53,7 @@ sourceCompatibility = 1.8
targetCompatibility = 1.8

group = 'com.datadoghq'
version= '1.4.2'
version= '1.4.3'
archivesBaseName = "datadog-lambda-java"
description = "datadog-lambda-java"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ START RequestId: XXXX Version: $LATEST
[dd.trace 1970-01-01 00:00:00 +0000] [main] INFO datadog.trace.agent.common.writer.WriterFactory - Detected serverless environment. Serverless extension has not been detected, 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", "region:sa-east-1", "datadog_lambda:1.4.0", "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:1.4.0", "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:1.4.0", "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, "_sample_rate": 1, "thread.id": 1}, "meta": {"language": "jvm", "thread.name": "main", "cold_start": "false", "resource_names": "Java-integration-test-dev-helloApiGatewayV2_Java11", "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", "request_id": "00000000-0000-0000-0000-000000000000", "datadog_lambda": "1.4.0", "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, "_sample_rate": 1, "thread.id": 1}, "meta": {"language": "jvm", "thread.name": "main", "cold_start": "false", "resource_names": "Java-integration-test-dev-helloApiGatewayV2_Java11", "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", "request_id": "00000000-0000-0000-0000-000000000000", "datadog_lambda": "1.4.0", "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, "_sample_rate": 1, "thread.id": 1}, "meta": {"language": "jvm", "thread.name": "main", "cold_start": "true", "resource_names": "Java-integration-test-dev-helloApiGatewayV2_Java11", "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", "request_id": "00000000-0000-0000-0000-000000000000", "datadog_lambda": "1.4.0", "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:1.4.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:1.4.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:1.4.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, "_sample_rate": 1, "thread.id": 1}, "meta": {"language": "jvm", "thread.name": "main", "cold_start": "false", "resource_names": "Java-integration-test-dev-helloApiGatewayV2_Java11", "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", "request_id": "00000000-0000-0000-0000-000000000000", "datadog_lambda": "1.4.2", "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, "_sample_rate": 1, "thread.id": 1}, "meta": {"language": "jvm", "thread.name": "main", "cold_start": "false", "resource_names": "Java-integration-test-dev-helloApiGatewayV2_Java11", "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", "request_id": "00000000-0000-0000-0000-000000000000", "datadog_lambda": "1.4.2", "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, "_sample_rate": 1, "thread.id": 1}, "meta": {"language": "jvm", "thread.name": "main", "cold_start": "true", "resource_names": "Java-integration-test-dev-helloApiGatewayV2_Java11", "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", "request_id": "00000000-0000-0000-0000-000000000000", "datadog_lambda": "1.4.2", "function_version": "$LATEST"}}]]}
12 changes: 6 additions & 6 deletions tests/testfunctions/snapshots/logs/helloApiGatewayV2_Java8.log
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ START RequestId: XXXX Version: $LATEST
[dd.trace 1970-01-01 00:00:00 +0000] [main] INFO datadog.trace.agent.common.writer.WriterFactory - Detected serverless environment. Serverless extension has not been detected, 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", "region:sa-east-1", "datadog_lambda:1.4.0", "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:1.4.0", "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:1.4.0", "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, "_sample_rate": 1, "thread.id": 1}, "meta": {"language": "jvm", "thread.name": "main", "cold_start": "false", "resource_names": "Java-integration-test-dev-helloApiGatewayV2_Java8", "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", "request_id": "00000000-0000-0000-0000-000000000000", "datadog_lambda": "1.4.0", "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, "_sample_rate": 1, "thread.id": 1}, "meta": {"language": "jvm", "thread.name": "main", "cold_start": "false", "resource_names": "Java-integration-test-dev-helloApiGatewayV2_Java8", "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", "request_id": "00000000-0000-0000-0000-000000000000", "datadog_lambda": "1.4.0", "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, "_sample_rate": 1, "thread.id": 1}, "meta": {"language": "jvm", "thread.name": "main", "cold_start": "true", "resource_names": "Java-integration-test-dev-helloApiGatewayV2_Java8", "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", "request_id": "00000000-0000-0000-0000-000000000000", "datadog_lambda": "1.4.0", "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:1.4.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:1.4.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:1.4.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, "_sample_rate": 1, "thread.id": 1}, "meta": {"language": "jvm", "thread.name": "main", "cold_start": "false", "resource_names": "Java-integration-test-dev-helloApiGatewayV2_Java8", "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", "request_id": "00000000-0000-0000-0000-000000000000", "datadog_lambda": "1.4.2", "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, "_sample_rate": 1, "thread.id": 1}, "meta": {"language": "jvm", "thread.name": "main", "cold_start": "false", "resource_names": "Java-integration-test-dev-helloApiGatewayV2_Java8", "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", "request_id": "00000000-0000-0000-0000-000000000000", "datadog_lambda": "1.4.2", "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, "_sample_rate": 1, "thread.id": 1}, "meta": {"language": "jvm", "thread.name": "main", "cold_start": "true", "resource_names": "Java-integration-test-dev-helloApiGatewayV2_Java8", "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", "request_id": "00000000-0000-0000-0000-000000000000", "datadog_lambda": "1.4.2", "function_version": "$LATEST"}}]]}
Loading