Skip to content

Commit 26d4012

Browse files
committed
Update doc to reflect relevant info
1 parent 5064b45 commit 26d4012

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/docs/getting-started/lambda/lambda-java-auto-instr.mdx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The AWS managed Lambda layer for ADOT Java Auto-instumentation Agent provides a
1515

1616
## Requirements
1717

18-
The Lambda layer supports the Java 11 (Corretto) Lambda runtime. It _does not_ support the Java 8 Lambda runtimes. For more information about supported Java versions, see the [OpenTelemetry Java documentation](https://github.com/open-telemetry/opentelemetry-java).
18+
The Lambda layer supports the Java 11 (Corretto) Lambda runtime. It _does not_ support the Java 8 Lambda runtimes. For more information about supported Java versions, see the [OpenTelemetry Java documentation](https://github.com/open-telemetry/opentelemetry-java#requirements).
1919

2020
Note: ADOT Lambda Layer for Java Auto-instrumentation Agent - Automatic instrumentation has a notable impact on startup time on AWS Lambda and you will generally need to use this along with provisioned concurrency and warmup requests to serve production requests without causing timeouts on initial requests while it initializes.
2121

@@ -55,21 +55,22 @@ For more on AWS X-Ray permissions for AWS Lambda, see the [AWS Lambda documentat
5555

5656
### Metric Instrumentation in your Lambda Function
5757

58-
**Note:** As of v1.6.0 of the OpenTelemetry Java Agent, metric exporting is disabled by default to preserve stability. To enable exporting metrics for use with backends like Amazon Managed Prometheus, set the environment variable `OTEL_METRICS_EXPORTER=otlp`.
59-
60-
Unlike traces, Metric auto instrumentation has not been supported in OpenTelemetry yet. You would have to manually instrument your code in your Lambda application in order to generate application metrics. We will be using the [OpenTelemetry Java Metrics API](https://github.com/open-telemetry/opentelemetry-java/tree/main/api/metrics/src/main/java/io/opentelemetry/api/metrics) to define our metrics. You can define your metric types in a MetricGenerator.java file.
58+
Metric auto instrumentation is supported in OpenTelemetry. You would have to instrument your code in your Lambda application in order to generate application metrics. We will be using the [OpenTelemetry Java Metrics API](https://github.com/open-telemetry/opentelemetry-java/tree/main/api/metrics/src/main/java/io/opentelemetry/api/metrics) to define our metrics. You can define your metric types in a MetricGenerator.java file. To enable exporting metrics for use with backends like Amazon Managed Prometheus, set the environment variable `OTEL_METRICS_EXPORTER=otlp`.
6159

6260
1. Import the OpenTelemetry Java Metrics API into your dependency file
6361
```
6462
dependencies {
65-
implementation platform("io.opentelemetry:opentelemetry-bom:1.6.0")
63+
implementation platform("io.opentelemetry:opentelemetry-bom:1.8.0")
6664
implementation('io.opentelemetry:opentelemetry-api')
6765
}
6866
```
6967
2. Create Metric instruments by using the OpenTelemetry Java Metrics API
7068
```
7169
// get meter
72-
Meter meter = GlobalMeterProvider.getMeter("aws-otel", "1.0");
70+
Meter meter = GlobalOpenTelemetry.getMeterProvider()
71+
.meterBuilder("aws-otel")
72+
.setInstrumentationVersion("1.0")
73+
.build();
7374
7475
// creating a Counter metric to count total API payload bytes sent
7576
LongUpDownCounter apiBytesSentCounter = meter
@@ -102,8 +103,6 @@ memoryObserver.observer(Runtime.getRuntime().totalMemory(), Attributes.empty());
102103
```
103104
4. The Lambda layer will take care of exporting the metrics to the Collector and then to AMP.
104105

105-
*Please note that the [OpenTelemetry Java Metrics API](https://github.com/open-telemetry/opentelemetry-java) is currently in alpha, there may be future breaking changes to the API.*
106-
107106
### Remove OpenTelemetry from your Lambda function
108107

109108
To disable OpenTelemetry for your Lambda function, remove the Lambda layer, remove the environment variable AWS_LAMBDA_EXEC_WRAPPER, and disable active tracing, as explained in the section above.
@@ -119,7 +118,7 @@ By default, the ADOT Lambda layer uses the [config.yaml](https://github.com/aws-
119118

120119
## Exporting Metrics to AMP
121120

122-
The layer is not configured by default to export Prometheus metrics to Amazon Managed Service for Prometheus (AMP) (https://docs.aws.amazon.com/prometheus/latest/userguide/what-is-Amazon-Managed-Service-Prometheus.html). To enable it:
121+
The layer is not configured by default to export Prometheus metrics, see Amazon Managed Service for Prometheus (AMP)(https://docs.aws.amazon.com/prometheus/latest/userguide/what-is-Amazon-Managed-Service-Prometheus.html). To enable it:
123122

124123
1. Upload a custom collector configuration file `collector.yaml` with your Lambda application, like the example shown below, with the `prometheusremotewriteexporter` and the `sigv4authextension` enabled. Set up the `endpoint` of your own AMP workspace, and `region` of the `sigv4authextension`.
125124
```

0 commit comments

Comments
 (0)