目录
输入和输出集成概述
Docker 输入插件允许您使用 Docker Engine API 从 Docker 容器收集指标,从而增强容器化应用程序的可视性和监控。
Sumo Logic 插件旨在促进将指标从 Telegraf 发送到 Sumo Logic 的 HTTP 源。通过利用此插件,用户可以在 Sumo Logic 平台中分析其指标数据,利用各种输出数据格式。
集成详情
Docker
Telegraf 的 Docker 输入插件从 Docker Engine API 收集有价值的指标,从而深入了解正在运行的容器。此插件利用官方 Docker 客户端与 Engine API 交互,允许用户监控各种容器状态、资源分配和性能指标。该插件具有按名称和状态筛选容器的选项,以及可自定义的标签,支持在各种环境中(无论是在本地系统上还是在 Kubernetes 等编排平台中)监控容器化应用程序的灵活性。此外,它还通过要求访问 Docker 守护程序的权限来解决安全问题,并强调在容器化环境中部署时进行正确配置。
Sumo Logic
此插件有助于将指标传输到 Sumo Logic 的 HTTP 源,并采用指定的数据格式用于 HTTP 消息。Telegraf(版本必须为 1.16.0 或更高版本)可以发送以多种格式编码的指标,包括 graphite
、carbon2
和 prometheus
。这些格式对应于 Sumo Logic 识别的不同内容类型,确保指标得到正确解释以进行分析。与 Sumo Logic 集成使用户能够利用全面的分析平台,从而从其指标数据中获得丰富的可视化效果和见解。该插件提供配置选项,例如设置 HTTP 指标源的 URL、选择数据格式以及指定其他参数(如超时和请求大小),这些选项增强了数据监控工作流程的灵活性和控制力。
配置
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
Sumo Logic
[[outputs.sumologic]]
## Unique URL generated for your HTTP Metrics Source.
## This is the address to send metrics to.
# url = "https://events.sumologic.net/receiver/v1/http/"
## Data format to be used for sending metrics.
## This will set the "Content-Type" header accordingly.
## Currently supported formats:
## * graphite - for Content-Type of application/vnd.sumologic.graphite
## * carbon2 - for Content-Type of application/vnd.sumologic.carbon2
## * prometheus - for Content-Type of application/vnd.sumologic.prometheus
##
## More information can be found at:
## https://help.sumologic.com/03Send-Data/Sources/02Sources-for-Hosted-Collectors/HTTP-Source/Upload-Metrics-to-an-HTTP-Source#content-type-headers-for-metrics
##
## NOTE:
## When unset, telegraf will by default use the influx serializer which is currently unsupported
## in HTTP Source.
data_format = "carbon2"
## Timeout used for HTTP request
# timeout = "5s"
## Max HTTP request body size in bytes before compression (if applied).
## By default 1MB is recommended.
## NOTE:
## Bear in mind that in some serializer a metric even though serialized to multiple
## lines cannot be split any further so setting this very low might not work
## as expected.
# max_request_body_size = 1000000
## Additional, Sumo specific options.
## Full list can be found here:
## https://help.sumologic.com/03Send-Data/Sources/02Sources-for-Hosted-Collectors/HTTP-Source/Upload-Metrics-to-an-HTTP-Source#supported-http-headers
## Desired source name.
## Useful if you want to override the source name configured for the source.
# source_name = ""
## Desired host name.
## Useful if you want to override the source host configured for the source.
# source_host = ""
## Desired source category.
## Useful if you want to override the source category configured for the source.
# source_category = ""
## Comma-separated key=value list of dimensions to apply to every metric.
## Custom dimensions will allow you to query your metrics at a more granular level.
# dimensions = ""
</code></pre>
输入和输出集成示例
Docker
-
监控容器化应用程序的性能:使用 Docker 输入插件,以便跟踪在 Docker 容器中运行的应用程序的 CPU、内存、磁盘 I/O 和网络活动。通过收集这些指标,DevOps 团队可以主动管理资源分配、排除性能瓶颈并确保跨不同环境的最佳应用程序性能。
-
与 Kubernetes 集成:利用此插件从 Kubernetes 编排的 Docker 容器收集指标。通过筛选掉不必要的 Kubernetes 标签并专注于关键指标,团队可以简化其监控解决方案并创建仪表板,以深入了解 Kubernetes 集群中运行的微服务的整体运行状况。
-
容量规划和资源优化:使用 Docker 输入插件收集的指标对 Docker 部署执行容量规划。分析使用模式有助于识别未充分利用的资源和过度配置的容器,从而指导根据实际使用趋势扩展或缩减的决策。
-
容器异常的自动警报:根据通过 Docker 插件收集的指标设置警报规则,以通知团队资源使用率异常飙升或服务中断。这种主动监控方法有助于维护服务可靠性并优化容器化应用程序的性能。
Sumo Logic
-
实时系统监控仪表板:利用 Sumo Logic 插件将服务器的性能指标持续馈送到 Sumo Logic 仪表板中。此设置允许技术团队实时可视化系统运行状况和负载,从而通过详细的图表和指标更快地识别任何性能瓶颈或系统故障。
-
自动警报系统:配置插件以发送在 Sumo Logic 中触发警报的指标,以用于特定阈值,例如 CPU 使用率或内存消耗。通过设置自动警报,团队可以在问题升级为严重故障之前主动解决问题,从而显着提高响应时间和整体系统可靠性。
-
跨系统指标聚合:跨不同环境(开发、测试、生产)集成多个 Telegraf 实例,并使用此插件将所有指标汇集到中央 Sumo Logic 实例。这种聚合实现了跨环境的全面分析,从而有助于在软件开发生命周期中进行更好的监控和明智的决策。
-
具有维度跟踪的自定义指标:使用 Sumo Logic 插件发送自定义指标,其中包括标识基础设施各个方面的维度(例如,环境、服务类型)。这种精细的跟踪允许进行更定制的分析,使您的团队能够剖析跨不同应用程序层或业务功能的性能。
反馈
感谢您成为我们社区的一份子!如果您有任何一般性反馈或在这些页面上发现任何错误,我们欢迎并鼓励您提出意见。请在InfluxDB 社区 Slack 中提交您的反馈。