DataDog / datadog-agent

Main repository for Datadog Agent
https://docs.datadoghq.com/
Apache License 2.0
2.89k stars 1.21k forks source link

Agent host is none when running in ECS Fargate #12406

Open eddycharly opened 2 years ago

eddycharly commented 2 years ago

I'm running the DD agent in a task container on ECS Fargate, however the agent shows with host none in the infrastructure list.

image

Is there a configuration option to get an host for each running agent in my tasks ?

iniinikoski commented 2 years ago

Hmm - is this even possible... As there are no hosts in Fargate...

eddycharly commented 2 years ago

I guess it appears in the list because it sends traces and the host label is not set ?

eddycharly commented 2 years ago

FWIW, I followed the doc here https://docs.datadoghq.com/fr/integrations/ecs_fargate

danroestorf commented 1 year ago

I see the same thing. Would be nice if there was a value. Looking at logs you can see that there is no host set.

I'm busy debugging an issue where my Datadog APM on ECS Fargate randomly stopped working with no changes on my side. Only change was the 7.40.0 release, but sadly reverting back to 7.39.x isn't working either.

In my logs I can see Trace agent running on host and it is empty.

12/21/2022, 10:47:37 AM | 2022-12-21 18:47:37 UTC \| TRACE \| INFO \| (run.go:207 in Run) \| Trace agent running on host
12/21/2022, 10:47:37 AM | 2022-12-21 18:47:37 UTC \| TRACE \| INFO \| (pkg/tagger/remote/tagger.go:349 in func1) \| tagger stream established successfully
12/21/2022, 10:47:37 AM | 2022-12-21 18:47:37 UTC \| TRACE \| INFO \| (pkg/tagger/remote/tagger.go:112 in Init) \| remote tagger initialized successfully
12/21/2022, 10:47:37 AM | 2022-12-21 18:47:37 UTC \| CORE \| INFO \| (pkg/metadata/host/host.go:164 in getNetworkMeta) \| could not get network metadata: could not detect network ID
12/21/2022, 10:47:37 AM | 2022-12-21 18:47:37 UTC \| CORE \| INFO \| (pkg/metadata/host/host_tags.go:130 in GetHostTags) \| Unable to get host tags from source: gce - using cached host tags
12/21/2022, 10:47:37 AM | 2022-12-21 18:47:37 UTC \| CORE \| WARN \| (pkg/util/cloudproviders/gce/gce_tags.go:50 in getCachedTags) \| unable to get tags from gce and cache is empty: GCE metadata API error: Get "http://169.254.169.254/computeMetadata/v1/?recursive=true": dial tcp 169.254.169.254:80: connect: invalid argument
fo-fo commented 1 year ago

Seeing the same issue. The agent logs shows this:

2023-06-14 03:51:02 UTC | CORE | INFO | (cmd/agent/subcommands/run/command.go:310 in startAgent) | Starting Datadog Agent v7.45.0
2023-06-14 03:51:02 UTC | CORE | INFO | (cmd/agent/subcommands/run/command.go:373 in startAgent) | Hostname is: