Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dogstatsd] Hostname ignored for ecs hosts #3573

Open
tweakster opened this issue Nov 6, 2017 · 2 comments
Open

[dogstatsd] Hostname ignored for ecs hosts #3573

tweakster opened this issue Nov 6, 2017 · 2 comments
Assignees

Comments

@tweakster
Copy link

tweakster commented Nov 6, 2017

We are running a set of ecs clusters; 2 per env

In alerts the {{host.name}} is simple resolving to the ec2 id (eg i-0123456789abcdef0)

To give a clearer idea of which cluster and env the alert is coming from I tried setting some non standard hostnames: {cluster_name}-{ec2-id}.{domain}

None of these are getting passed by the datadog agent. It appears the problem is Platform.is_ecs_instance() in this line

Is there a reason for not allowing ecs hosts to use non standard hostnames?

@irabinovitch
Copy link
Contributor

Thanks for reaching out, and sorry for the delay in reply.

We introduced this shortly after Amazon launched ECS, as we found that in many cases ECS exposed inconsistent hostnames to containers. Sometimes it was the hostname of the host and sometimes the instance id. So we hard-coded it to one of the two based on customer feedback at the time.

While it looks like ECS has now improved its hostname logic to address this issue, reverting the behavior now would be a breaking
change for a large number of users who rely on this behavior in their alerts. We are currently evaluating whether to remove this logic in the next major release though.

In the mean time for users who prefer to alter the hostname, we allow configuration of the hostname directly in datadog.conf. The most popular way to do this in docker is via environment variables as demonstrated in this example here.

I hope this helps, let us know if you have any further questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants
@irabinovitch @derekwbrown @olivielpeau @hkaj @tweakster and others