美文网首页
IT类翻译 -- Datadog Agent是啥?它消耗什么资源

IT类翻译 -- Datadog Agent是啥?它消耗什么资源

作者: 瞎猫与死耗子 | 来源:发表于2016-03-01 10:30 被阅读0次

# What is the Datadog Agent? What resources does it consume?

# Datadog Agent是啥?它消耗什么资源?

原文地址:http://help.datadoghq.com/hc/en-us/articles/203034929-What-is-the-Datadog-Agent-What-resources-does-it-consume

Dustin Lawler

2015年04月18日

**Introduction**

**简介**

The Datadog Agent is lightweight piece of software that runson your hosts. Its job is to faithfully collect events and metrics and bringthem to Datadog on your behalf so that you can do something useful with yourmonitoring and performance data.

Datadog Agent是运行在你主机上的一款轻量级软件。它的作用就是忠心耿耿的为你收集event和metrics,传到Datadog中,以便你可以利用这些监控和运行数据来做点什么。

The source code for the Datadog Agent can be [foundhere](https://github.com/DataDog/dd-agent).

[戳这里](https://github.com/DataDog/dd-agent)获得DatadogAgent的源代码。

![enter image description here](http://help.datadoghq.com/hc/en-us/article_attachments/202186415/Agent_Architecture_-_B.jpg)

**Agent Architecture**

**Datadog Agent的架构**

The agent is composed of 4 major components, each written inPython running as a separate process:

- Collector (agent.py) - The collector runs checks on thecurrent machine for whatever integrations you have, it captures system metricslike memory and CPU.

- Dogstatsd (dogstatsd.py) - This is a StatsD backendserver, it's responsible for aggregating local metrics sent [from yourcode](http://help.datadoghq.com/hc/en-us/articles/203765485-How-do-I-submit-custom-metrics-What-s-their-overhead-)

- Forwarder (ddagent.py) - The forwader is pushed data fromboth dogstatsd and the collector and queues it up to be sent to Datadog.

- SupervisorD This is all controlled by a single [supervisorprocess](http://supervisord.org/). We keep this separate so you don’t have tohave the overhead of each application if you don’t want to run all parts(though we generally recommend you do).

Datadog Agent主要由四个用Python编写的组件构成,每个组件都是单独运行的进程。

- Collector(agent.py)--无论你的agent是如何组建的,Collector都会去检查当前运行的机器,抓取系统metrics,如内存和CPU数据。

-Dogstatsd(dogstatsd.py)--这是StatsD的后台服务器,它致力于收集从你代码中发送出去的本地metrics。

- Forwarder(ddagent.py)--Forwarder负责把Dogstatsd和Collector收集到的数据推到一个队列中,这些数据将会被发往Datadog。

- SupervisorD --由一个单独的[管理进程](http://supervisord.org/)控制。我们把它与其他的组件分隔开来,因此如果你因为担心资源消耗而不想运行所有组件的话(虽然我们建议你这么做),那么你可以单独运行它。

To learn about extending agent checks or writing your own[see here](http://help.datadoghq.com/hc/en-us/articles/204679545-I-d-like-to-write-my-own-extend-one-of-your-integrations-to-include-additional-metrics-Is-this-possible-).

学习如何在现有基础上,扩展agent的检查内容,或者编写一套自己的版本,[请戳这里](http://help.datadoghq.com/hc/en-us/articles/204679545-I-d-like-to-write-my-own-extend-one-of-your-integrations-to-include-additional-metrics-Is-this-possible-)。

**Agent Overhead**

**Datadog Agent消耗的资源**

In terms of resource consumption the Datadog agent consumesroughly:

- Resident memory (actual RAM used): 50MB

- CPU Runtime: less than 1% of averaged runtime

- Disk:

- Linux 120MB

- Windows: 60MB

- Network: 10-50 KB of bandwidth per minute

Datadog Agent的资源消耗大致如下:

-常驻内存:50MB

- CPU时间:平均小于1%

-硬盘空间:

Linux:120MB

Windows:60MB

-带宽占用:每分钟10-50 KB

The stats listed above are based on an EC2 m1.large instancerunning for 10+ days.

上述数据基于一个运行了十多天的EC2 m1.large实例。

Supervision, Privileges and Network Ports

监控、权限和网络端口

Supervisord runs a master process as root and forks allsubprocesses as the user dd-agent. The agent configuration resides at/etc/dd-agent/datadog.conf and /etc/dd-agent/conf.d. All configuration must bereadable by dd-agent. The recommended permissions are 0600 since configurationfiles contain your API key and other credentials needed to access metrics (e.g.mysql, postgresql metrics).

Supervisord作为一个主控根进程运行,可以fork所有的子进程如userdd-agent,其配置文件在/etc/dd-agent/datadog.conf和/etc/dd-agent/conf.d下可以找到。所有的配置对dd-agent来说都必须可读。推荐使用权限0600,因为配置文件中包含你的APIkey,以及其它访问metrics(如mysql,postgresqlmetrics)所需的证书。

The following ports are open for normal operations:

- forwarder tcp/17123for normal operations and tcp/17124 if graphite support is turned on

- dogstatsd udp/8125

以下端口对一般操作开放:

-为一般操作提供的forwarder tcp/17123端口和启用了graphite服务时的tcp/17124端口

- dogstatsd udp/8125

All listening processes are bound by default to 127.0.0.1and/or ::1 on v 3.4.1 and greater of the agent. In earlier versions, they werebound to 0.0.0.0 (i.e. all interfaces).

在3.4.1或以上版本中,所有监听进程都默认绑定127.0.0.1和/或者::1。而早期版本中,他们则绑定0.0.0.0(例如所有的接口)。

For information on running the Agent through a proxy pleasesee here; for which ranges to allow, see here.

关于如果通过代理运行agent,[请戳这里](http://help.datadoghq.com/hc/en-us/articles/203765295);关于允许的范围,[请看这里](http://help.datadoghq.com/hc/en-us/articles/203037979)。

**The Collector**

This is where all standard metrics are gathered, every 15seconds.

The collector also supports the execution of python-based,user-provided checks, stored in /etc/dd-agent/checks.d. User-provided checksmust inherit from the AgentCheck abstract class defined inc[hecks/init.py](https://github.com/DataDog/dd-agent/blob/master/checks/__init__.py).

**Collector**

这是收集所有metrics的地方,每十五秒收集一次。

Collector也支持运行基于python的用户定义的检查内容。这些内容应存储于/etc/dd-agent/checks.d下。用户定义的检查内容必须从抽象类AgentCheck继承,这个类定义在[checks/init.py](https://github.com/DataDog/dd-agent/blob/master/checks/__init__.py)中。

**The Forwarder**

The forwarder listens over HTTP for incoming requests tobuffer and forward over HTTPS to Datadog HQ. Bufferring allows for networksplits to not affect metric reporting. Metrics will be buffered in memory untila limit in size or number of outstanding requests to send is reached.Afterwards the oldest metrics will be discarded to keep the forwarder's memoryfootprint manageable.

**Forwarder**

Forwarder监听并缓存进来的HTTP请求,接着通过HTTPS转发到Datadog中心。缓存请求使得网络可以一分为二,不影响metrics的上报。Metrics将被缓存在内存中,直到达到必须发送的大小或数目。接着,最老的数据包就会被丢弃,以此确保forwarder有足够的存储空间。

**DogStatsD**

DogStatsD is a python implementation of [etsy'sstatsD](https://github.com/etsy/statsd) metric aggregation daemon. It is usedto receive and roll up arbitrary metrics over UDP, thus allowing custom code tobe instrumented without adding latency to the mix.

Learn more about dogstatsd.

**DogStatsD**

DogStatsD是用python实现的[estystatsD](https://github.com/etsy/statsd) metric整合进程,用于通过UDP协议接收和积累任意的metrics,这样我们就可以度量自定义代码,而不会增加延迟。

Learn more about[dogstatsd](http://help.datadoghq.com/hc/en-us/articles/203765485-How-do-I-submit-custom-metrics-What-s-their-overhead-).

关于dgostatsd的更多信息[请看这里](http://help.datadoghq.com/hc/en-us/articles/203765485-How-do-I-submit-custom-metrics-What-s-their-overhead-)。

**Agent Benefits**

**Agent的优点**

To understand the value of using the Datadog agent,reference the following articles:

- https://www.datadoghq.com/2013/10/dont-fear-the-agent/

- http://dtdg.co/1J03U0V

想要了解使用Datadog agent究竟有什么好处,可以参考下面的两篇文章:

- https://www.datadoghq.com/2013/10/dont-fear-the-agent/

- http://dtdg.co/1J03U0V

ְ��s��

相关文章

  • IT类翻译 -- Datadog Agent是啥?它消耗什么资源

    # What is the Datadog Agent? What resources does it consu...

  • Docker监控

    Cadvisor是Google用来监测单节点的资源信息的监控工具。它的资源消耗也比较低。但是,它有它的局限性,它只...

  • 对象销毁的优化技巧tip

    对象的销毁虽然消耗资源不多,但累积起来也是不容忽视的。通常当容器类持有大量对象时,其销毁时的资源消耗就非常明显。同...

  • iOS开发-优化(对象销毁)

    对象的销毁虽然消耗资源不多,但累积起来也是不容忽视的。通常当容器类持有大量对象时,其销毁时的资源消耗就非常明显。同...

  • 时间战场

    如果未来时间作为一种稀缺资源且被广泛认可。那健身人群将分为两类,一类消耗个人时间,一类消耗多人时间。 即: 一类不...

  • 个人随笔之单例模式

    为什么使用单例模式? 确保某一个类只有一个实例,避免产生多个对象消耗过多的资源, 如要访问IO和 数据库等资源 ...

  • 2018-09-01小白学区块链——网络带宽NET资源

    前面我们了解了EOS系统里三大类资源被应用程序消耗的RAM内存,今天我们就来了解一下需要消耗的网络带宽NET资源。...

  • Docker里一些常用的技术

    �Datadog公司分析报告:数以千计的公司使用Datadog来跟踪基础架构,所以他们公司的数据值得信任! 使用最...

  • Android 中的Context

    什么是Context Context是一个抽象基类,我们通过它访问当前包的资源(getResources、getA...

  • java多线程(六)线程池

    什么是线程池,为什么要线程池降低资源消耗,降低创建和销毁的资源消耗提高响应速度:线程的创建时间为T1,执行时间为T...

网友评论

      本文标题:IT类翻译 -- Datadog Agent是啥?它消耗什么资源

      本文链接:https://www.haomeiwen.com/subject/nlngkttx.html