-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Can't attach host tags to metrics on AWS Fargate #2288
Comments
I talked to support and the DD team about this on Slack a couple weeks ago, and the reason this isn't working as you expect is that you (just like me) are incorrectly assuming that host tags are applied BEFORE the metrics are sent to DD. In fact, the host tag metrics are added AFTER the dogstatsd process has sent the metrics to the API. This happens by the DD service creating a "host object" for each datadog agent process and associating tags with it. Then when processing the statsd metrics it checks if they are associated with any host objects and they inherit those tags. Since there's no "host object" when running the agent with The team suggested using the docker labels approach ( For now, I have resorted to explicitly sending the tags we care about on all of our metrics. Hopefully the auto-tagging will work itself out soon. It's worth noting that if you're using the Python client library to emit stats from inside the container you can set Here's my Slack convo with their product team that has more info: https://datadoghq.slack.com/archives/C4JREERCY/p1534910557000100 |
Thanks for the issue! We are working on making this work via Docker labels (rather than env vars) in 6.5.1, which is in testing now. |
@borgstrom @mikezvi #!/bin/bash
if [[ -n "${ECS_FARGATE}" ]]; then
taskid=$(curl 169.254.170.2/v2/metadata | sed -r 's/^.*"TaskARN":".*:task\/([A-z0-9\-]+?)".*$/\1/')
export DD_HOSTNAME=$taskid
fi
/init |
@skobaken7 i'm finding that the while using your solution of a custom entrypoint.sh works i think perhaps that the datadog agent should still set a hostname on fargate for DogStatsD relayed metrics but still drop all |
Thanks for the workaround @skobaken7. I hope Datadog would address this issue officially, it's' been open for quite a while already with Fargate-usage skyrocketing... The agent works so well "out of the box" anyway in so many cases, it's unfortunate that this kind of trickery is needed... |
Hi all! As commented here: #3159 (comment) Please reach out to our support team ([email protected]) if you'd like to open another feature request that you think is relevant. Simon |
Hi! Not sure if anyone is still following this issue, but it has been more-or-less fixed as of agent 7.29.1. More related enhancements were released with 7.35.0. You might need an updated tracing component if the metrics you want are APM metrics. |
@kwolff-chwy I'm not sure how this is fixed, this exact issue continues to persist (On ECS fargate) unless you manually set the hostname. Am I missing something? |
This is still an issue in the latest version of the container |
Would this be an issue if we ran sidecar datadog agents on non-Fargate ECS tasks? |
Describe what happened:
I launched datadog-agent container in a ECS task( cf. https://www.datadoghq.com/blog/monitor-aws-fargate/) and attaching host tags by environment variable DD_TAGS.
My app sent custom metrics via dogstatsd.
This metrics are not found in metrics explorer when filtering by host tags.
Describe what you expected:
Metrics Explorer shows metrics with host tags sent from Fargate container.
Steps to reproduce the issue:
Described above.
Additional environment details (Operating System, Cloud provider, etc):
It seems that associating metrics and host tags fails because host is empty on Fargate.
https://github.com/DataDog/datadog-agent/pull/1182/files#diff-1d9d99d196299ff9a78c3e928058494aR111
The text was updated successfully, but these errors were encountered: