내용으로 건너뛰기

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

질문됨 일 년 전231회 조회

1개 답변
-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

답변함 일 년 전

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

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

관련 콘텐츠