使用應用程式追蹤資料識別 Amazon ECS 最佳化機會
Amazon ECS 與 AWS Distro for OpenTelemetry 整合,以從您的應用程式中收集追蹤資料。Amazon ECS 使用 AWS Distro for OpenTelemetry 附屬容器,以收集追踪資料並將其路由到 AWS X-Ray。如需詳細資訊,請參閱在 Amazon ECS 中設定 AWS Distro for OpenTelemetry Collector
若要 AWS Distro for OpenTelemetry Collector 將追蹤資料傳送至 AWS X-Ray,則必須將應用程式設定為建立追蹤資料。如需詳細資訊,請參閱《AWS X-Ray 開發人員指南》中的檢測您的 AWS X-Ray 應用程式。
AWS Distro for OpenTelemetry 與 AWS X-Ray 整合所需的 IAM 許可
Amazon ECS 與 AWS Distro for OpenTelemetry 進行整合,需要建立任務角色,並在任務定義中指定該角色。建議設定 AWS Distro for OpenTelemetry 邊車容器,將容器日誌路由至 CloudWatch Logs。
重要
如果您還使用 AWS Distro for OpenTelemetry 收集應用程式指標,請確保任務 IAM 角色也包含該整合所需的許可。如需更多詳細資訊,請參閱 使用應用程式指標關聯 Amazon ECS 應用程式效能。
建立角色後,請建立包含下列許可的政策,然後將該政策連接至該角色。
logs:PutLogEventslogs:CreateLogGrouplogs:CreateLogStreamlogs:DescribeLogStreamslogs:DescribeLogGroupslogs:PutRetentionPolicyxray:PutTraceSegmentsxray:PutTelemetryRecordsxray:GetSamplingRulesxray:GetSamplingTargetsxray:GetSamplingStatisticSummariesssm:GetParameters