Skip to content

Setting the Application Name in CloudWatch's Application Map when using OTEL

0

I've instrumented two applications with OTEL: an ECS service and a Lambda function. The ECS service will be displayed with its service name in the Application Map, while the Lambda function will just receive StandaloneLambda.

How can I assign a name here? The OTEL_SERVICE_NAME is not respected here.

If I click on the app, the underlying Lambda will show its name, though.

Application Map

asked a year ago222 views

1 Answer
-1

To assign a custom name for your Lambda function in the CloudWatch Application Map, you need to use the OTEL_RESOURCE_ATTRIBUTES environment variable rather than OTEL_SERVICE_NAME.

For Lambda functions, you can add this environment variable with a value that includes the Application attribute:

OTEL_RESOURCE_ATTRIBUTES="Application=YourCustomAppName,Owner=Test,aws.application_signals.metric_resource_keys=Application&Owner"

This will allow you to define a custom application name that will be displayed in the Application Map instead of the default "StandaloneLambda" label.

Similarly, for your ECS service, you can add the OTEL_RESOURCE_ATTRIBUTES to the TaskDefinition:

{
"name": "my-app",
...
"environment": [
{
"name": "OTEL_RESOURCE_ATTRIBUTES",
"value": "service.name=$YOUR_SVC_NAME,Application=YourCustomAppName,Owner=Test,aws.application_signals.metric_resource_keys=Application&Owner"
}, 
...
]
}

The CloudWatch agent determines the service name from various sources in priority order, with Application Signals instrumentation being the highest priority. By setting these attributes correctly, you can control how your applications appear in the Application Map.
Sources
View your application topology and monitor operational health with the CloudWatch application map - Amazon CloudWatch
Using the CloudWatch agent with related telemetry - Amazon CloudWatch

answered a year ago

  • I've set this up as mentioned, but the Lambda function still appears as StandaloneLambda

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.