简体   繁体   中英

Not able to see metrics on datadog sent by statsd

I am trying to integrate statsd+datadog.

  • I have launched the dd-agent container with -e DD_DOGSTATSD_NON_LOCAL_TRAFFIC="true", and apiKey is also correct (container logs confirm this)
  • I am using the official code example to test the integration
  • On datadog dashboard, in metrics explorer, I see data coming in for datadog.dogstatsd.client.metrics

Problem

  • But not able to find the exact metrics I am pushing anywhere on datadog dashboard, how to see the metrics I pushed via statsd?
  • How can I see this graph as shown from official documentation (image below)

在此处输入图像描述

I was finally able to solve the problem by explicitly opening udp port of my docker container, ie -

-p 8125:8125/udp

full docker run command with necessary env vars and correct port binding would be

docker run --name dd-agent -e DD_API_KEY=<the-api-key> -e DD_SITE="datadoghq.com" -e DD_DOGSTATSD_NON_LOCAL_TRAFFIC="true" -p 8125:8125/udp gcr.io/datadoghq/agent:7

For future reference, here's the official doc from the console:

If you plan on sending custom metrics via dogstatsd

By default dogstatsd will only listening to localhost, you need to add -e DD_DOGSTATSD_NON_LOCAL_TRAFFIC=true option to the container's parameters to listen to dogstatsd packets from other containers (required to send custom metrics). Then bind the container's statsd port to the hosts's IP by adding the -p 8125:8125/udp option to the container's parameters. Then, configure your client library to send UDP packets to the hosts's IP.

Ref: https://app.datadoghq.com/account/settings#agent/docker

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM