diff --git a/docs/instrumentation-list.yaml b/docs/instrumentation-list.yaml index fae731f13678..54f3fdb3a714 100644 --- a/docs/instrumentation-list.yaml +++ b/docs/instrumentation-list.yaml @@ -923,6 +923,7 @@ libraries: - name: aws-lambda-core-1.0 description: | 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. + 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`. source_path: instrumentation/aws-lambda/aws-lambda-core-1.0 scope: name: io.opentelemetry.aws-lambda-core-1.0 @@ -945,7 +946,7 @@ libraries: type: STRING - name: aws-lambda-events-2.2 description: | - Provides full instrumentation of the Lambda library, including standard and custom event types, from `aws-lambda-java-events` 2.2+. + 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. source_path: instrumentation/aws-lambda/aws-lambda-events-2.2 scope: name: io.opentelemetry.aws-lambda-events-2.2 @@ -960,6 +961,11 @@ libraries: description: Flush timeout in milliseconds. type: int default: 10000 + - name: otel.instrumentation.http.known-methods + description: | + Configures the instrumentation to recognize an alternative set of HTTP request methods. All other methods will be treated as `_OTHER`. + type: list + default: CONNECT,DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT,TRACE telemetry: - when: default spans: @@ -984,6 +990,8 @@ libraries: - name: user_agent.original type: STRING - name: aws-lambda-events-3.11 + description: | + 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. source_path: instrumentation/aws-lambda/aws-lambda-events-3.11 scope: name: io.opentelemetry.aws-lambda-events-3.11 @@ -991,6 +999,42 @@ libraries: library: - com.amazonaws:aws-lambda-java-events:3.11.0 - com.amazonaws:aws-lambda-java-core:1.0.0 + configurations: + - name: otel.instrumentation.aws-lambda.flush-timeout + description: Flush timeout in milliseconds. + type: int + default: 10000 + telemetry: + - when: default + spans: + - span_kind: CONSUMER + attributes: + - name: messaging.destination.name + type: STRING + - name: messaging.message.id + type: STRING + - name: messaging.operation + type: STRING + - name: messaging.system + type: STRING + - span_kind: SERVER + attributes: + - name: cloud.account.id + type: STRING + - name: cloud.resource_id + type: STRING + - name: faas.invocation_id + type: STRING + - name: faas.trigger + type: STRING + - name: http.request.method + type: STRING + - name: http.response.status_code + type: LONG + - name: url.full + type: STRING + - name: user_agent.original + type: STRING - name: aws-sdk-1.11 description: | 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: target_versions: library: - org.apache.kafka:kafka-clients:2.6.0 + configurations: + - name: otel.instrumentation.messaging.experimental.capture-headers + description: A comma-separated list of header names to capture as span attributes. + type: list + default: '' + - name: otel.instrumentation.messaging.experimental.receive-telemetry.enabled + description: | + Enables experimental receive telemetry, which will cause consumers to start a new trace, with only a span link connecting it to the producer trace. + type: boolean + default: false - name: kafka-streams-0.11 source_path: instrumentation/kafka/kafka-streams-0.11 scope: diff --git a/instrumentation-docs/instrumentations.sh b/instrumentation-docs/instrumentations.sh index 5c210128c2e5..46a136bf24a8 100755 --- a/instrumentation-docs/instrumentations.sh +++ b/instrumentation-docs/instrumentations.sh @@ -117,6 +117,7 @@ readonly INSTRUMENTATIONS=( "openai:openai-java-1.1:javaagent:test" "aws-lambda:aws-lambda-core-1.0:javaagent:test" "aws-lambda:aws-lambda-events-2.2:javaagent:test" + "aws-lambda:aws-lambda-events-3.11:library:test" "cassandra:cassandra-3.0:javaagent:test" "cassandra:cassandra-3.0:javaagent:testStableSemconv" "cassandra:cassandra-4.0:javaagent:test" diff --git a/instrumentation/aws-lambda/README.md b/instrumentation/aws-lambda/README.md index 9173db38f84b..83d3a7f98bc2 100644 --- a/instrumentation/aws-lambda/README.md +++ b/instrumentation/aws-lambda/README.md @@ -7,5 +7,8 @@ We provide two packages for instrumenting AWS lambda functions. `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. -- [aws-lambda-events-2.2](./aws-lambda-events-2.2/library) provides full instrumentation of the Lambda library, including standard - and custom event types, from `aws-lambda-java-events` 2.2+. +- [aws-lambda-events-2.2](./aws-lambda-events-2.2/library) (Library instrumentation is deprecated) provides instrumentation of the Lambda library, + including standard and custom event types, from `aws-lambda-java-events` 2.2+. + +- [aws-lambda-events-3.11](./aws-lambda-events-2.2/library) provides instrumentation of the Lambda library, including standard and custom event + types, from `aws-lambda-java-events` 3.11+. diff --git a/instrumentation/aws-lambda/aws-lambda-core-1.0/metadata.yaml b/instrumentation/aws-lambda/aws-lambda-core-1.0/metadata.yaml index bd5ba34b9aec..97e231491514 100644 --- a/instrumentation/aws-lambda/aws-lambda-core-1.0/metadata.yaml +++ b/instrumentation/aws-lambda/aws-lambda-core-1.0/metadata.yaml @@ -4,6 +4,10 @@ description: > 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. + + 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`. configurations: - name: otel.instrumentation.aws-lambda.flush-timeout type: int diff --git a/instrumentation/aws-lambda/aws-lambda-events-2.2/metadata.yaml b/instrumentation/aws-lambda/aws-lambda-events-2.2/metadata.yaml index 3dc33adf8ec7..9217c340114c 100644 --- a/instrumentation/aws-lambda/aws-lambda-events-2.2/metadata.yaml +++ b/instrumentation/aws-lambda/aws-lambda-events-2.2/metadata.yaml @@ -1,9 +1,15 @@ description: > - Provides full instrumentation of the Lambda library, including standard and custom event types, - from `aws-lambda-java-events` 2.2+. + 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. configurations: - name: otel.instrumentation.aws-lambda.flush-timeout type: int default: 10000 description: Flush timeout in milliseconds. - + - name: otel.instrumentation.http.known-methods + description: > + Configures the instrumentation to recognize an alternative set of HTTP request methods. All + other methods will be treated as `_OTHER`. + type: list + default: "CONNECT,DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT,TRACE" diff --git a/instrumentation/aws-lambda/aws-lambda-events-3.11/library/build.gradle.kts b/instrumentation/aws-lambda/aws-lambda-events-3.11/library/build.gradle.kts index 7e63bb6e53bf..d21c0b8ebfba 100644 --- a/instrumentation/aws-lambda/aws-lambda-events-3.11/library/build.gradle.kts +++ b/instrumentation/aws-lambda/aws-lambda-events-3.11/library/build.gradle.kts @@ -22,9 +22,15 @@ dependencies { testImplementation("uk.org.webcompere:system-stubs-jupiter") } -tasks.withType().configureEach { - // required on jdk17 - jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED") - jvmArgs("--add-opens=java.base/java.util=ALL-UNNAMED") - jvmArgs("-XX:+IgnoreUnrecognizedVMOptions") +tasks { + withType().configureEach { + // required on jdk17 + jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED") + jvmArgs("--add-opens=java.base/java.util=ALL-UNNAMED") + jvmArgs("-XX:+IgnoreUnrecognizedVMOptions") + } + + test { + systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") + } } diff --git a/instrumentation/aws-lambda/aws-lambda-events-3.11/metadata.yaml b/instrumentation/aws-lambda/aws-lambda-events-3.11/metadata.yaml new file mode 100644 index 000000000000..3cf6a3e821d0 --- /dev/null +++ b/instrumentation/aws-lambda/aws-lambda-events-3.11/metadata.yaml @@ -0,0 +1,9 @@ +description: > + 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. +configurations: + - name: otel.instrumentation.aws-lambda.flush-timeout + type: int + default: 10000 + description: Flush timeout in milliseconds. +