Skip to content

Commit f5256cf

Browse files
authored
Metadata for aws lambda events 3.11 (#14514)
1 parent 136efcb commit f5256cf

File tree

7 files changed

+94
-11
lines changed

7 files changed

+94
-11
lines changed

docs/instrumentation-list.yaml

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,7 @@ libraries:
923923
- name: aws-lambda-core-1.0
924924
description: |
925925
Provides lightweight instrumentation of the Lambda core library, supporting all versions. It generates FaaS SERVER spans with the `faas.invocation_id` attribute. Use this package if you only use `RequestStreamHandler` or know you don't use any event classes from `aws-lambda-java-events`. This also includes when you are using `aws-serverless-java-container` to run e.g., a Spring Boot application on Lambda.
926+
For custom wrappers when using library instrumentation, you can configure the `OTEL_INSTRUMENTATION_AWS_LAMBDA_HANDLER` environment variable to contain your lambda handler method (in the format `package.ClassName::methodName`) and use one of wrappers as your lambda `Handler`.
926927
source_path: instrumentation/aws-lambda/aws-lambda-core-1.0
927928
scope:
928929
name: io.opentelemetry.aws-lambda-core-1.0
@@ -945,7 +946,7 @@ libraries:
945946
type: STRING
946947
- name: aws-lambda-events-2.2
947948
description: |
948-
Provides full instrumentation of the Lambda library, including standard and custom event types, from `aws-lambda-java-events` 2.2+.
949+
This version of the library instrumentation is deprecated, please use the `aws-lambda-events-3.11` library instrumentation instead. This instrumentation builds on top of the `aws-lambda-core-1.0` instrumentation, expanding support to cover the Lambda library, including standard and custom event types.
949950
source_path: instrumentation/aws-lambda/aws-lambda-events-2.2
950951
scope:
951952
name: io.opentelemetry.aws-lambda-events-2.2
@@ -960,6 +961,11 @@ libraries:
960961
description: Flush timeout in milliseconds.
961962
type: int
962963
default: 10000
964+
- name: otel.instrumentation.http.known-methods
965+
description: |
966+
Configures the instrumentation to recognize an alternative set of HTTP request methods. All other methods will be treated as `_OTHER`.
967+
type: list
968+
default: CONNECT,DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT,TRACE
963969
telemetry:
964970
- when: default
965971
spans:
@@ -984,13 +990,51 @@ libraries:
984990
- name: user_agent.original
985991
type: STRING
986992
- name: aws-lambda-events-3.11
993+
description: |
994+
This instrumentation builds on top of the `aws-lambda-core-1.0` instrumentation, expanding support to cover the Lambda library, including standard and custom event types.
987995
source_path: instrumentation/aws-lambda/aws-lambda-events-3.11
988996
scope:
989997
name: io.opentelemetry.aws-lambda-events-3.11
990998
target_versions:
991999
library:
9921000
- com.amazonaws:aws-lambda-java-events:3.11.0
9931001
- com.amazonaws:aws-lambda-java-core:1.0.0
1002+
configurations:
1003+
- name: otel.instrumentation.aws-lambda.flush-timeout
1004+
description: Flush timeout in milliseconds.
1005+
type: int
1006+
default: 10000
1007+
telemetry:
1008+
- when: default
1009+
spans:
1010+
- span_kind: CONSUMER
1011+
attributes:
1012+
- name: messaging.destination.name
1013+
type: STRING
1014+
- name: messaging.message.id
1015+
type: STRING
1016+
- name: messaging.operation
1017+
type: STRING
1018+
- name: messaging.system
1019+
type: STRING
1020+
- span_kind: SERVER
1021+
attributes:
1022+
- name: cloud.account.id
1023+
type: STRING
1024+
- name: cloud.resource_id
1025+
type: STRING
1026+
- name: faas.invocation_id
1027+
type: STRING
1028+
- name: faas.trigger
1029+
type: STRING
1030+
- name: http.request.method
1031+
type: STRING
1032+
- name: http.response.status_code
1033+
type: LONG
1034+
- name: url.full
1035+
type: STRING
1036+
- name: user_agent.original
1037+
type: STRING
9941038
- name: aws-sdk-1.11
9951039
description: |
9961040
This instrumentation covers the AWS SDK 1.11+ client library, enabling messaging and client spans and metrics for calls to AWS services including DynamoDB, EC2, Kinesis, Lambda, RDS, S3, secrets manager, SNS/SQS and step functions.
@@ -3964,6 +4008,16 @@ libraries:
39644008
target_versions:
39654009
library:
39664010
- org.apache.kafka:kafka-clients:2.6.0
4011+
configurations:
4012+
- name: otel.instrumentation.messaging.experimental.capture-headers
4013+
description: A comma-separated list of header names to capture as span attributes.
4014+
type: list
4015+
default: ''
4016+
- name: otel.instrumentation.messaging.experimental.receive-telemetry.enabled
4017+
description: |
4018+
Enables experimental receive telemetry, which will cause consumers to start a new trace, with only a span link connecting it to the producer trace.
4019+
type: boolean
4020+
default: false
39674021
- name: kafka-streams-0.11
39684022
source_path: instrumentation/kafka/kafka-streams-0.11
39694023
scope:

instrumentation-docs/instrumentations.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ readonly INSTRUMENTATIONS=(
117117
"openai:openai-java-1.1:javaagent:test"
118118
"aws-lambda:aws-lambda-core-1.0:javaagent:test"
119119
"aws-lambda:aws-lambda-events-2.2:javaagent:test"
120+
"aws-lambda:aws-lambda-events-3.11:library:test"
120121
"cassandra:cassandra-3.0:javaagent:test"
121122
"cassandra:cassandra-3.0:javaagent:testStableSemconv"
122123
"cassandra:cassandra-4.0:javaagent:test"

instrumentation/aws-lambda/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@ We provide two packages for instrumenting AWS lambda functions.
77
`aws-lambda-java-events`. This also includes when you are using `aws-serverless-java-container` to run e.g., a
88
Spring Boot application on Lambda.
99

10-
- [aws-lambda-events-2.2](./aws-lambda-events-2.2/library) provides full instrumentation of the Lambda library, including standard
11-
and custom event types, from `aws-lambda-java-events` 2.2+.
10+
- [aws-lambda-events-2.2](./aws-lambda-events-2.2/library) (Library instrumentation is deprecated) provides instrumentation of the Lambda library,
11+
including standard and custom event types, from `aws-lambda-java-events` 2.2+.
12+
13+
- [aws-lambda-events-3.11](./aws-lambda-events-2.2/library) provides instrumentation of the Lambda library, including standard and custom event
14+
types, from `aws-lambda-java-events` 3.11+.

instrumentation/aws-lambda/aws-lambda-core-1.0/metadata.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ description: >
44
use `RequestStreamHandler` or know you don't use any event classes from `aws-lambda-java-events`.
55
This also includes when you are using `aws-serverless-java-container` to run e.g., a Spring Boot
66
application on Lambda.
7+
8+
For custom wrappers when using library instrumentation, you can configure the `OTEL_INSTRUMENTATION_AWS_LAMBDA_HANDLER`
9+
environment variable to contain your lambda handler method (in the format `package.ClassName::methodName`) and use
10+
one of wrappers as your lambda `Handler`.
711
configurations:
812
- name: otel.instrumentation.aws-lambda.flush-timeout
913
type: int
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
description: >
2-
Provides full instrumentation of the Lambda library, including standard and custom event types,
3-
from `aws-lambda-java-events` 2.2+.
2+
This version of the library instrumentation is deprecated, please use the `aws-lambda-events-3.11`
3+
library instrumentation instead. This instrumentation builds on top of the `aws-lambda-core-1.0`
4+
instrumentation, expanding support to cover the Lambda library, including standard and custom event types.
45
configurations:
56
- name: otel.instrumentation.aws-lambda.flush-timeout
67
type: int
78
default: 10000
89
description: Flush timeout in milliseconds.
9-
10+
- name: otel.instrumentation.http.known-methods
11+
description: >
12+
Configures the instrumentation to recognize an alternative set of HTTP request methods. All
13+
other methods will be treated as `_OTHER`.
14+
type: list
15+
default: "CONNECT,DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT,TRACE"

instrumentation/aws-lambda/aws-lambda-events-3.11/library/build.gradle.kts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,15 @@ dependencies {
2222
testImplementation("uk.org.webcompere:system-stubs-jupiter")
2323
}
2424

25-
tasks.withType<Test>().configureEach {
26-
// required on jdk17
27-
jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
28-
jvmArgs("--add-opens=java.base/java.util=ALL-UNNAMED")
29-
jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
25+
tasks {
26+
withType<Test>().configureEach {
27+
// required on jdk17
28+
jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
29+
jvmArgs("--add-opens=java.base/java.util=ALL-UNNAMED")
30+
jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
31+
}
32+
33+
test {
34+
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
35+
}
3036
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
description: >
2+
This instrumentation builds on top of the `aws-lambda-core-1.0` instrumentation, expanding support
3+
to cover the Lambda library, including standard and custom event types.
4+
configurations:
5+
- name: otel.instrumentation.aws-lambda.flush-timeout
6+
type: int
7+
default: 10000
8+
description: Flush timeout in milliseconds.
9+

0 commit comments

Comments
 (0)