---
title: Upgrade Instrumentation for Java Lambda Functions
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Serverless > Serverless Monitoring Guides > Upgrade Instrumentation for
  Java Lambda Functions
---

# Upgrade Instrumentation for Java Lambda Functions

This document contains instructions for upgrading your Datadog for Java Lambda instrumentation. If you are setting up instrumentation for the first time, follow the [Java Lambda installation instructions](https://docs.datadoghq.com/serverless/installation/java.md) instead.

Datadog Lambda layers `dd-trace-java:5` and `Datadog-Extension:25` introduce the following changes to the process of setting up instrumentation on Java Lambda functions:

1. The [datadog-lambda-java](https://github.com/DataDog/datadog-lambda-java) library is deprecated and not required.
1. No code changes (such as the `DDLambda` wrapper) are required, except for custom instrumentation.
1. You can set up Datadog using the [Datadog CI](https://docs.datadoghq.com/serverless/installation/java.md?tab=datadogcli) and the [Datadog Serverless Plugin](https://docs.datadoghq.com/serverless/installation/java.md?tab=serverlessframework).

### Upgrade{% #upgrade %}

1. Remove `datadog-lambda-java` from `build.gradle` or `pom.xml`, as it is no longer required.
1. Remove `DDLambda` and the import statement from your function code.
1. Set environment variable `AWS_LAMBDA_EXEC_WRAPPER` to `/opt/datadog_wrapper`.
1. Increment the `dd-trace-java` version to `26` and `Datadog-Extension` to `94`.
1. If you are submitting custom metrics using the `DDLambda.metric()` helper function, use the standard [DogStatsD client for Java](https://docs.datadoghq.com/extend/dogstatsd.md?tab=hostagent&code-lang=java) and follow the [sample code](https://docs.datadoghq.com/serverless/custom_metrics.md?code-lang=java#with-the-datadog-lambda-extension) to submit a metric as a distribution. Note that [in Lambda, you can only use distributions](https://docs.datadoghq.com/serverless/custom_metrics.md#understanding-distribution-metrics).
