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.
- Lambda functions instrumented with the New Relic OTel Lambda layer.
Set the OTel entity name
Set OTEL_SERVICE_NAME as a Lambda environment variable:
OTEL_SERVICE_NAME = my-service-nameAll 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-serviceBoth 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 | New entity created; telemetry flows into it immediately |
Update | New entity created for the new name; old entity retains history but stops receiving telemetry |
Remove | Function reverts to reporting under the Lambda function name ( |
Preserve faas.name in collector processors
Prudence
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|SERVICEinstead of a Lambda entity — breaking the group-by feature andcloud.resource_idtagging and filtering