目录
输入和输出集成概述
此插件允许用户从分布式环境中的 Hashicorp Nomad 代理收集指标。
Graphite 插件使用户能够通过 TCP 将 Telegraf 收集的指标发送到 Graphite。此集成允许使用 Graphite 强大的功能高效地存储和可视化时序数据。
集成详情
Hashicorp Nomad
Hashicorp Nomad 输入插件旨在从集群中的每个 Nomad 代理收集指标。通过在每个节点上部署 Telegraf,它可以连接到本地 Nomad 代理,通常在 ‘http://127.0.0.1:4646’ 上可用。通过这种设置,用户可以系统地收集和监控与其 Nomad 环境的性能和状态相关的指标,确保他们保持健康高效的集群运行状态。此插件实现了对 Nomad 运行方面的可见性,这对于维护可靠的云基础设施至关重要。
Graphite
此插件通过原始 TCP 将指标写入 Graphite,从而实现 Telegraf 收集的指标与 Graphite 生态系统的无缝集成。借助此插件,用户可以配置多个 TCP 端点以进行负载均衡,从而确保指标传输的高可用性和可靠性。使用前缀自定义指标命名以及利用各种模板选项,增强了数据在 Graphite 中表示方式的灵活性。此外,对 Graphite 标签的支持以及对指标名称进行严格清理的选项,实现了强大的数据管理,满足了用户的各种需求。对于希望利用 Graphite 强大的指标存储和可视化功能,同时保持对数据表示方式控制的组织来说,此功能至关重要。
配置
Hashicorp Nomad
[[inputs.nomad]]
## URL for the Nomad agent
# url = "http://127.0.0.1:4646"
## Set response_timeout (default 5 seconds)
# response_timeout = "5s"
## Optional TLS Config
# tls_ca = /path/to/cafile
# tls_cert = /path/to/certfile
# tls_key = /path/to/keyfile
Graphite
# Configuration for Graphite server to send metrics to
[[outputs.graphite]]
## TCP endpoint for your graphite instance.
## If multiple endpoints are configured, the output will be load balanced.
## Only one of the endpoints will be written to with each iteration.
servers = ["localhost:2003"]
## Local address to bind when connecting to the server
## If empty or not set, the local address is automatically chosen.
# local_address = ""
## Prefix metrics name
prefix = ""
## Graphite output template
## see https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
template = "host.tags.measurement.field"
## Strict sanitization regex
## This is the default sanitization regex that is used on data passed to the
## graphite serializer. Users can add additional characters here if required.
## Be aware that the characters, '/' '@' '*' are always replaced with '_',
## '..' is replaced with '.', and '\' is removed even if added to the
## following regex.
# graphite_strict_sanitize_regex = '[^a-zA-Z0-9-:._=\p{L}]'
## Enable Graphite tags support
# graphite_tag_support = false
## Applied sanitization mode when graphite tag support is enabled.
## * strict - uses the regex specified above
## * compatible - allows for greater number of characters
# graphite_tag_sanitize_mode = "strict"
## Character for separating metric name and field for Graphite tags
# graphite_separator = "."
## Graphite templates patterns
## 1. Template for cpu
## 2. Template for disk*
## 3. Default template
# templates = [
# "cpu tags.measurement.host.field",
# "disk* measurement.field",
# "host.measurement.tags.field"
#]
## timeout in seconds for the write connection to graphite
# timeout = "2s"
## 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
输入和输出集成示例
Hashicorp Nomad
-
集群健康监控:使用 Hashicorp Nomad 插件聚合 Nomad 部署中所有节点的指标。通过监控分配状态、作业性能和资源利用率等健康指标,运营团队可以深入了解其部署的整体健康状况,快速识别和解决问题,并根据实时数据优化资源分配。
-
作业执行的性能分析:利用 Nomad 提供的指标来分析作业执行时间和资源消耗。此用例使开发人员能够有效地调整作业参数、优化任务性能并展示随时间变化的趋势,最终提高效率并降低资源分配成本。
-
关键条件警报:基于从 Nomad 代理抓取的指标实施警报机制。通过为 CPU 使用率或作业分配失败等关键指标设置阈值,团队可以在潜在问题升级之前主动响应,从而确保在 Nomad 平台上运行的应用程序具有更高的正常运行时间和可靠性。
-
与可视化工具集成:使用 Hashicorp Nomad 插件收集的数据来馈送到可视化工具,以实现实时仪表板。此设置允许团队一目了然地监控集群工作负载、作业状态和系统性能,从而根据对 Nomad 环境的可视化洞察,促进更好的决策和战略规划。
Graphite
-
动态指标可视化:Graphite 插件可用于将来自各种来源(例如应用程序性能数据或服务器健康指标)的实时指标馈送到 Graphite 中。这种动态集成允许团队创建交互式仪表板,可视化关键绩效指标、跟踪随时间变化的趋势,并做出数据驱动的决策来增强系统性能。
-
负载均衡指标收集:通过在插件中配置多个 TCP 端点,组织可以实施指标传输的负载均衡。此用例确保指标交付既有弹性又高效,从而降低高流量期间数据丢失的风险,并保持向 Graphite 可靠的信息流。
-
自定义指标标记:借助对 Graphite 标签的支持,用户可以使用 Graphite 插件来增强其指标的粒度。使用相关信息(例如应用程序环境或服务类型)标记指标,可以进行更精细的查询和分析,使团队能够深入研究特定感兴趣的领域,以获得更好的运营洞察。
-
增强的数据清理:利用插件的严格清理选项,用户可以确保其指标名称符合 Graphite 的要求。这种主动措施消除了指标名称中无效字符可能引起的问题,从而实现更清洁的数据管理和更准确的可视化。
反馈
感谢您成为我们社区的一份子!如果您有任何一般性反馈或在这些页面上发现任何错误,我们欢迎并鼓励您提出意见。请在 InfluxDB 社区 Slack 中提交您的反馈。