---
title: Group Lambda functions under a single APM entity
source: https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/instrument-lambda-function/app-name-apm-lambda
---

`NEW_RELIC_APP_NAME` is a Lambda environment variable that controls which APM entity your function's telemetry is attributed to in New Relic. When set, telemetry from your Lambda function appears under a named APM entity of your choice instead of defaulting to the Lambda function name.

## How it works

When `NEW_RELIC_APM_LAMBDA_MODE` is `true`, the New Relic Lambda Extension makes an APM `connect` call at each cold start. It uses `NEW_RELIC_APP_NAME` (or falls back to `AWS_LAMBDA_FUNCTION_NAME` if it is not set) as the `app_name` in that call. The APM collector resolves or creates an entity for that name and returns its GUID. All telemetry produced during that invocation is tagged with that GUID and appears under the named entity in New Relic.

## Configuration

Set `NEW_RELIC_APP_NAME` as a Lambda environment variable. No code changes are required — the extension handles it automatically at cold start.

```
NEW_RELIC_APP_NAME = my-entity-name
```

## Supported runtimes

`NEW_RELIC_APP_NAME` is supported across all APM-mode Lambda runtimes - Python, Node.js, Java, Ruby. .NET, and Go.

| Runtime    | Supported |
| ---------- | --------- |
| PythonYes  |           |
| Node.jsYes |           |
| JavaYes    |           |
| RubyYes    |           |
| .NETYes    |           |
| GoYes      |           |

## Entity behavior

Functions sharing the same `NEW_RELIC_APP_NAME` value and New Relic account are grouped under a single APM entity in the New Relic UI.

If the name you set matches an existing APM entity — for example, one already created by a non-Lambda service — telemetry from your Lambda function merges into that entity automatically. There is no separate entity created.

> #### ⚠️ IMPORTANT
>
> Changing `NEW_RELIC_APP_NAME` creates a new APM entity. Historical data associated with the previous name is not migrated to the new entity.

## Multi-region reporting

Multiple Lambda functions deployed across different AWS regions can share the same `NEW_RELIC_APP_NAME`. All of these functions report into a single APM entity, regardless of which region they are deployed in.

To distinguish individual functions or region-specific deployments within the grouped entity, filter by the `tags.aws.arn` attribute in NRQL or use the tag filter bar in the entity view.

## Cross-runtime reporting

Lambda functions using different runtimes (for example, a Python function and a Node.js function) that share the same `NEW_RELIC_APP_NAME` create separate APM entities — one per runtime. The grouping does not cross runtime boundaries.

## Same app name across Lambda and non-Lambda services

If a Lambda function and a non-Lambda APM service (for example, a traditional web application or microservice) are both configured with the same `NEW_RELIC_APP_NAME`, they report into the **same** APM entity.

This can be intentional: if you want a unified view of a service that runs on both Lambda and server-based infrastructure, sharing the name allows all telemetry — transactions, errors, throughput — to appear in one place.

However, if done unintentionally, it can cause confusion. Metrics, error rates, and throughput from the Lambda function and the non-Lambda service are combined, which may make it harder to diagnose issues or understand performance independently.

## Entity lifecycle and tag expiration

When a Lambda function stops reporting, its APM entity is not immediately removed. Entity tags (including `aws.arn`) expire after approximately 1–2 days of no incoming telemetry. The entity itself may persist longer depending on your account's retention settings.

## Troubleshoot

**Telemetry still appears under the function name after setting `NEW_RELIC_APP_NAME`**

-   Confirm the variable is set at the Lambda environment level, not only in application code.
-   Check CloudWatch logs for `[NR_EXT]` APM connect entries — the `app_name` field should reflect your custom value.
-   Ensure the New Relic Lambda Extension version in your layer supports this feature.

**Two separate entities exist for the same function**

This is expected when `NEW_RELIC_APP_NAME` is added or changed after the function was already reporting. The old entity retains its historical data; all new telemetry goes to the new entity.

**Two Lambda functions with the same app name show as separate entities**

This is expected behavior when the runtimes differ (for example, Python vs. Node.js). Functions sharing the same runtime and the same `NEW_RELIC_APP_NAME` will report into one entity.
