Closed benmurden closed 2 years ago
Try adding processors in your otel config. processors: resourcedetection/ecs: detectors: [env,ecs] override: false timeout: 2s
That looks like it would do the trick. https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/resourcedetectionprocessor/README.md#amazon-ecs
Queries the Task Metadata Endpoint (TMDE) to record information about the current ECS Task.
Thanks for pointing me in the right direction!
Sorry to comment on an old issue, but I've added the processor and it's not working as I expected. It successfully sends my ECS instance info to Prometheus, but it only exists in the target_info
metric. How can I get that info to exist in all my metrics so I can use it in my queries? Can I also add custom labels/kv-pairs when using the processor?
I figured out i need
resource_to_telemetry_conversion:
enabled: true
in my prometheusremotewrite
exporter.
How can we label metrics with unique instance names when running on ECS Fargate with ADOT as a sidecar?
Each task in a service will use the same target config (e.g.
0.0.0.0:8080
), meaning that the metrics from all instances are mixed when they reach Prometheus - there are no labels that separate them.Environment Using the following ADOT config, deploy ADOT as a sidecar to an ECS Fargate service which scales to at least two tasks and provides its own metrics.
What did you expect to see? Different
instance
labels per task on ECS Fargate.Additional context Note that the
awsecscontainermetrics
have distinct labels per task whenresource_to_telemetry_conversion
is enabled, this is not the problem. We are specifically asking about a way of labelling metrics - that come from applications we don't control - according to their task so they can be distinguished from one another.We believe one way this might be solved is to deploy ADOT as a separate service and collect metrics using Service Discovery instead, which would give us unique IP addresses. However, we're interested in knowing if we have missed something with the sidecar setup.