You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

OTel Collector在ECS Fargate中无法设置Datadog统一标签问题排查

Troubleshooting OTel Collector Service.Name Not Showing in Datadog (ECS Fargate)

Common Causes & Fixes

1. Processor Order is Incorrect

The resourcedetection processor must run before the transform processor. If transform executes first, the aws.ecs.task.family attribute won’t exist yet to map to service.name.

Correct Pipeline Order:

service:
  pipelines:
    traces:
      processors: [resourcedetection, transform, ...]

2. Transform is Targeting Spans Instead of Resource Attributes

Datadog relies on resource-level attributes for standard tags like service.name, not span-level attributes. Your transform config should modify the resource, not span context.

Working Transform Config:

processors:
  transform:
    error_mode: ignore
    resource:
      statements:
        - set(attributes["service.name"], attributes["aws.ecs.task.family"])
        # Add mappings for service.version and deployment.environment here
        # Example: set(attributes["deployment.environment"], attributes["aws.ecs.cluster"])

3. Resourcedetection Processor Isn’t Collecting the Attribute

Verify the aws.ecs.task.family attribute is being pulled by the ECS detector. Use the debug exporter to inspect resource attributes:

exporters:
  debug:
    verbosity: detailed

Add the debug exporter to your pipeline and check collector logs. If the attribute is missing, ensure the ECS detector is enabled:

processors:
  resourcedetection:
    detectors: ["ecs"]
    ecs: {}

4. Datadog Exporter is Overriding Service.Name

If your Datadog exporter config has a hardcoded service field, it will override the resource-level service.name. Remove this line if present:

exporters:
  datadog:
    api_key: "${DD_API_KEY}"
    # service: "hardcoded-service-name"  # Remove this line

5. ECS Metadata Access Issues

In Fargate, the OTel Collector needs access to the ECS task metadata endpoint (enabled by default). Ensure your task execution role doesn’t restrict access to this endpoint (no extra permissions are typically required).

Additional Notes

  • For service.version, source it from an ECS task tag, environment variable, or task definition parameter. Use the env detector in resourcedetection to pull environment variables, then map via transform.
  • For deployment.environment, common sources are the ECS cluster name, environment variables, or task tags.

内容的提问来源于stack exchange,提问作者markrin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.15 06:53:21