---
title: Group Lambda functions under a single OTel entity
source: https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/opentelemetry/otel-service-name-lambda
---

When you instrument Lambda functions with an OpenTelemetry (OTel) layer, the `OTEL_SERVICE_NAME` environment variable controls which entity your function's telemetry is attributed to in New Relic. By default each function reports as a separate entity. Setting the same `OTEL_SERVICE_NAME` on multiple functions groups all of their telemetry under a single entity.

No application code changes are required. The OTel Lambda layer handles instrumentation automatically — you only configure the environment variables that control where the data goes.

## Prerequisites

-   A New Relic account with an [API key](https://docs.newrelic.com/docs/apis/intro-apis/introduction-new-relic-apis/).
-   Lambda functions instrumented with the [New Relic OTel Lambda layer](https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/opentelemetry/lambda-opentelemetry-java).

## Set the OTel entity name

Set `OTEL_SERVICE_NAME` as a Lambda environment variable:

```
OTEL_SERVICE_NAME = my-service-name
```

All telemetry from that function is attributed to an OTel entity named `my-service-name` in New Relic. If no entity with that name exists, one is created automatically.

> #### ⚠️ IMPORTANT
>
> `OTEL_SERVICE_NAME` is not permanent. If you update the value and redeploy, the function begins reporting under the new entity name from that point forward. New Relic does not migrate prior history — the old entity retains its data but stops receiving new telemetry.

## Group Lambda functions under a single entity

To group two or more Lambda functions under a single OTel entity, give every function the same `OTEL_SERVICE_NAME` value. That is the only configuration required.

```
# Function A (us-east-1)
OTEL_SERVICE_NAME = payment-service

# Function B (eu-west-1)
OTEL_SERVICE_NAME = payment-service
```

Both functions now report into a single `payment-service` entity in New Relic.

## Entity behavior

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

> #### ⚠️ IMPORTANT
>
> Changing `OTEL_SERVICE_NAME` creates a new OTel 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 `OTEL_SERVICE_NAME`. All of these functions report into a single OTel 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 `OTEL_SERVICE_NAME` create **separate** OTel entities — one per runtime. The grouping does not cross runtime boundaries. This is expected OTel behavior — entity identity includes the language type, not just the service name.

## Entity name changes

| Scenario                                   | Result                                                                                        |
| ------------------------------------------ | --------------------------------------------------------------------------------------------- |
| Set `OTEL_SERVICE_NAME` for the first time | New entity created; telemetry flows into it immediately                                       |
| Update `OTEL_SERVICE_NAME` and redeploy    | New entity created for the new name; old entity retains history but stops receiving telemetry |
| Remove `OTEL_SERVICE_NAME`                 | Function reverts to reporting under the Lambda function name (`AWS_LAMBDA_FUNCTION_NAME`)     |

## Preserve faas.name in collector processors [#preserve-faas-name]

> #### ⚠️ CAUTION
>
> `faas.name` is auto-populated for Lambda by the OTel layer — do not drop it (delete or rename it). New Relic uses it to recognize the parent (SERVER) span as a Lambda invocation. Dropping it causes:
>
> -   The parent span to be excluded from metric synthesis
> -   Incomplete or incorrect transaction counts
> -   The entity resolving as `EXT|SERVICE` instead of a Lambda entity — breaking the group-by feature and `cloud.resource_id` tagging and filtering

## Related docs

-   [Trace your Java Lambda functions with New Relic and OpenTelemetry](https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/opentelemetry/lambda-opentelemetry-java)
-   [Trace your .NET Lambda functions with New Relic and OpenTelemetry](https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/opentelemetry/lambda-opentelemetry-dotnet)
-   [NEW_RELIC_APP_NAME for Lambda functions in APM mode](https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/instrument-lambda-function/app-name-apm-lambda)
