目录
输入和输出集成概述
Docker 输入插件允许您使用 Docker Engine API 从 Docker 容器中收集指标,从而增强容器化应用程序的可见性和监控。
Datadog Telegraf 插件能够将指标提交到 Datadog Metrics API,通过可靠的指标摄取过程,促进高效的监控和数据分析。
集成详情
Docker
Docker 输入插件用于从 Docker Engine API 收集有价值的指标,从而深入了解正在运行的容器。此插件利用官方 Docker 客户端与 Engine API 交互,允许用户监控各种容器状态、资源分配和性能指标。通过按名称和状态过滤容器的选项,以及可自定义的标签,此插件支持在各种环境中监控容器化应用程序的灵活性,无论是在本地系统上还是在 Kubernetes 等编排平台中。此外,它还通过要求访问 Docker 守护进程的权限来解决安全问题,并强调在容器化环境中部署时进行正确的配置。
Datadog
此插件写入 Datadog Metrics API,使用户能够发送指标以进行监控和性能分析。通过使用 Datadog API 密钥,用户可以将插件配置为与 Datadog 的 v1 API 建立连接。该插件支持各种配置选项,包括连接超时、HTTP 代理设置和数据压缩方法,确保适应不同的部署环境。将计数指标转换为速率的能力增强了 Telegraf 与 Datadog 代理的集成,这对于依赖实时性能指标的应用程序尤其有益。
配置
Docker
[[inputs.docker]]
## Docker Endpoint
## To use TCP, set endpoint = "tcp://[ip]:[port]"
## To use environment variables (ie, docker-machine), set endpoint = "ENV"
endpoint = "unix:///var/run/docker.sock"
## Set to true to collect Swarm metrics(desired_replicas, running_replicas)
## Note: configure this in one of the manager nodes in a Swarm cluster.
## configuring in multiple Swarm managers results in duplication of metrics.
gather_services = false
## Only collect metrics for these containers. Values will be appended to
## container_name_include.
## Deprecated (1.4.0), use container_name_include
container_names = []
## Set the source tag for the metrics to the container ID hostname, eg first 12 chars
source_tag = false
## Containers to include and exclude. Collect all if empty. Globs accepted.
container_name_include = []
container_name_exclude = []
## Container states to include and exclude. Globs accepted.
## When empty only containers in the "running" state will be captured.
# container_state_include = []
# container_state_exclude = []
## Objects to include for disk usage query
## Allowed values are "container", "image", "volume"
## When empty disk usage is excluded
storage_objects = []
## Timeout for docker list, info, and stats commands
timeout = "5s"
## Whether to report for each container per-device blkio (8:0, 8:1...),
## network (eth0, eth1, ...) and cpu (cpu0, cpu1, ...) stats or not.
## Usage of this setting is discouraged since it will be deprecated in favor of 'perdevice_include'.
## Default value is 'true' for backwards compatibility, please set it to 'false' so that 'perdevice_include' setting
## is honored.
perdevice = true
## Specifies for which classes a per-device metric should be issued
## Possible values are 'cpu' (cpu0, cpu1, ...), 'blkio' (8:0, 8:1, ...) and 'network' (eth0, eth1, ...)
## Please note that this setting has no effect if 'perdevice' is set to 'true'
# perdevice_include = ["cpu"]
## Whether to report for each container total blkio and network stats or not.
## Usage of this setting is discouraged since it will be deprecated in favor of 'total_include'.
## Default value is 'false' for backwards compatibility, please set it to 'true' so that 'total_include' setting
## is honored.
total = false
## Specifies for which classes a total metric should be issued. Total is an aggregated of the 'perdevice' values.
## Possible values are 'cpu', 'blkio' and 'network'
## Total 'cpu' is reported directly by Docker daemon, and 'network' and 'blkio' totals are aggregated by this plugin.
## Please note that this setting has no effect if 'total' is set to 'false'
# total_include = ["cpu", "blkio", "network"]
## docker labels to include and exclude as tags. Globs accepted.
## Note that an empty array for both will include all labels as tags
docker_label_include = []
docker_label_exclude = []
## Which environment variables should we use as a tag
tag_env = ["JAVA_HOME", "HEAP_SIZE"]
## Optional TLS Config
# tls_ca = "/etc/telegraf/ca.pem"
# tls_cert = "/etc/telegraf/cert.pem"
# tls_key = "/etc/telegraf/key.pem"
## Use TLS but skip chain & host verification
# insecure_skip_verify = false
Datadog
[[outputs.datadog]]
## Datadog API key
apikey = "my-secret-key"
## Connection timeout.
# timeout = "5s"
## Write URL override; useful for debugging.
## This plugin only supports the v1 API currently due to the authentication
## method used.
# url = "https://app.datadoghq.com/api/v1/series"
## Set http_proxy
# use_system_proxy = false
# http_proxy_url = "http://localhost:8888"
## Override the default (none) compression used to send data.
## Supports: "zlib", "none"
# compression = "none"
## When non-zero, converts count metrics submitted by inputs.statsd
## into rate, while dividing the metric value by this number.
## Note that in order for metrics to be submitted simultaenously alongside
## a Datadog agent, rate_interval has to match the interval used by the
## agent - which defaults to 10s
# rate_interval = 0s
输入和输出集成示例
Docker
-
监控容器化应用程序的性能:使用 Docker 输入插件来跟踪 Docker 容器中运行的应用程序的 CPU、内存、磁盘 I/O 和网络活动。通过收集这些指标,DevOps 团队可以主动管理资源分配、排除性能瓶颈,并确保跨不同环境的最佳应用程序性能。
-
与 Kubernetes 集成:利用此插件收集 Kubernetes 编排的 Docker 容器的指标。通过过滤掉不必要的 Kubernetes 标签并专注于关键指标,团队可以简化其监控解决方案并创建仪表板,从而深入了解 Kubernetes 集群中运行的微服务的整体健康状况。
-
容量规划和资源优化:使用 Docker 输入插件收集的指标来执行 Docker 部署的容量规划。分析使用模式有助于识别未充分利用的资源和过度配置的容器,从而指导基于实际使用趋势扩展或缩减的决策。
-
容器异常的自动警报:根据通过 Docker 插件收集的指标设置警报规则,以通知团队资源使用量异常峰值或服务中断。这种主动监控方法有助于维护服务可靠性并优化容器化应用程序的性能。
Datadog
-
实时基础设施监控:使用 Datadog 插件通过将 CPU 使用率和内存统计信息直接发送到 Datadog 来实时监控服务器指标。此集成允许 IT 团队在集中式仪表板中可视化和分析系统性能指标,从而能够主动响应任何新出现的问题,例如资源瓶颈或服务器过载。
-
应用程序性能跟踪:利用此插件将应用程序特定的指标(例如请求计数和错误率)提交到 Datadog。通过与应用程序监控工具集成,团队可以将基础设施指标与应用程序性能相关联,从而提供深入的见解,使他们能够优化代码性能并改善用户体验。
-
指标中的异常检测:配置 Datadog 插件以发送可以根据 Datadog 的机器学习功能检测到的异常模式触发警报和通知的指标。这种主动监控有助于团队在客户受到影响之前快速响应潜在的中断或性能下降。
-
与云服务集成:通过利用 Datadog 插件发送来自云资源的指标,IT 团队可以深入了解云应用程序性能。监控延迟和错误率等指标有助于确保满足服务级别协议 (SLA),并有助于优化跨云环境的资源分配。
反馈
感谢您成为我们社区的一份子!如果您有任何一般性反馈或在这些页面上发现了任何错误,我们欢迎并鼓励您提出意见。请在 InfluxDB 社区 Slack 中提交您的反馈。