DataDog/agent-github-action

Hostname retrieved as "none"

Closed this issue · 2 comments

Running the action on a GitHub Actions Workflow using the example from the README, it seems as if the agent is unable to pick the container hostname.

$ /usr/bin/docker exec -t datadog-agent agent hostname
none

$ /usr/bin/docker exec -t datadog-agent agent status
Hostnames
=========
  host_aliases: [...]
  hostname: none
  socket-fqdn: ...
  socket-hostname: ...
  hostname provider: configuration

As a result, Datadog events also show the incorrect hostname:

Screenshot 2022-05-04 at 12 54 11

Is there a way to manually set the hostname in the action?

Digging a bit further I realised this is actually the way the docker image is configured.
I was able to override it using extra_env. But is this really the default behaviour, and would it be worth mentioning it in the README to avoid surprises?

Sorry for the late reply, this agent idea is mostly to be used for CI in ephemeral machines not reporting the host is on purpose to avoid any issue with host metrics and billing for ephemeral machines