目录
输入和输出集成概述
Webhooks 插件允许 Telegraf 通过 webhooks 接收和处理来自各种外部服务的 HTTP 请求。 此插件使用户能够收集实时指标和事件,并将它们集成到其监控解决方案中。
Graphite 插件使用户能够通过 TCP 将 Telegraf 收集的指标发送到 Graphite。 此集成允许使用 Graphite 的强大功能高效地存储和可视化时序数据。
集成详情
Webhooks
此 Telegraf 插件旨在通过启动一个 HTTP 服务器来充当 webhook 侦听器,该服务器注册多个 webhook 端点。 它提供了一种通过捕获发送到定义路径的 HTTP 请求来收集来自各种服务事件的方法。 每个服务都可以配置其特定的身份验证详细信息和请求处理选项。 该插件的突出之处在于允许与任何 Telegraf 输出插件集成,使其在事件驱动的架构中具有通用性。 通过实现高效的事件接收,它为实时监控和响应系统开辟了可能性,这对于需要即时事件处理和处理的现代应用程序至关重要。
Graphite
此插件通过原始 TCP 将指标写入 Graphite,从而允许将 Telegraf 收集的指标无缝集成到 Graphite 生态系统中。 使用此插件,用户可以配置多个 TCP 端点以进行负载均衡,从而确保指标传输的高可用性和可靠性。 使用前缀自定义指标命名和利用各种模板选项的能力增强了数据在 Graphite 中表示方式的灵活性。 此外,对 Graphite 标签的支持以及对指标名称进行严格清理的选项允许进行强大的数据管理,以满足用户的各种需求。 对于希望利用 Graphite 强大的指标存储和可视化功能,同时保持对数据表示的控制的组织来说,此功能至关重要。
配置
Webhooks
[[inputs.webhooks]]
## Address and port to host Webhook listener on
service_address = ":1619"
## Maximum duration before timing out read of the request
# read_timeout = "10s"
## Maximum duration before timing out write of the response
# write_timeout = "10s"
[inputs.webhooks.filestack]
path = "/filestack"
## HTTP basic auth
#username = ""
#password = ""
[inputs.webhooks.github]
path = "/github"
# secret = ""
## HTTP basic auth
#username = ""
#password = ""
[inputs.webhooks.mandrill]
path = "/mandrill"
## HTTP basic auth
#username = ""
#password = ""
[inputs.webhooks.rollbar]
path = "/rollbar"
## HTTP basic auth
#username = ""
#password = ""
[inputs.webhooks.papertrail]
path = "/papertrail"
## HTTP basic auth
#username = ""
#password = ""
[inputs.webhooks.particle]
path = "/particle"
## HTTP basic auth
#username = ""
#password = ""
[inputs.webhooks.artifactory]
path = "/artifactory"
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
输入和输出集成示例
Webhooks
-
来自 Github 的实时通知:将 Webhooks 输入插件与 Github 集成,以接收有关事件的实时通知,例如拉取请求、提交和问题。 这使开发团队能够立即监控其存储库中的关键更改和更新,从而提高协作和响应时间。
-
使用 Rollbar 进行自动化警报:使用此插件监听 Rollbar 报告的错误,使团队能够快速响应生产中的错误和问题。 通过将这些警报转发到集中式监控系统,团队可以根据严重程度确定响应优先级并防止停机时间升级。
-
来自 Filestack 的性能监控:捕获来自 Filestack 的事件,以跟踪文件上传、转换和错误。 此设置帮助企业了解用户与文件管理流程的交互、优化工作流程并确保文件服务的高可用性。
-
使用 Papertrail 进行集中式日志记录:通过 webhooks 绑定发送到 Papertrail 的所有日志,使您能够整合日志记录策略。 通过实时日志转发,团队可以高效地分析趋势和异常,确保他们保持对关键操作的可见性。
Graphite
-
动态指标可视化:Graphite 插件可用于将来自各种来源(例如应用程序性能数据或服务器健康指标)的实时指标馈送到 Graphite 中。 这种动态集成使团队能够创建交互式仪表板,以可视化关键绩效指标、随时间推移跟踪趋势并做出数据驱动的决策以增强系统性能。
-
负载均衡的指标收集:通过在插件中配置多个 TCP 端点,组织可以为指标传输实现负载均衡。 此用例确保指标交付既有弹性又高效,从而降低了高流量期间数据丢失的风险,并保持了到 Graphite 的可靠信息流。
-
自定义指标标记:借助对 Graphite 标签的支持,用户可以使用 Graphite 插件来增强其指标的粒度。 使用相关信息(例如应用程序环境或服务类型)标记指标可以进行更精细的查询和分析,使团队能够深入研究特定感兴趣的领域,以获得更好的运营见解。
-
增强的数据清理:利用插件的严格清理选项,用户可以确保其指标名称符合 Graphite 的要求。 这种主动措施消除了指标名称中无效字符引起的潜在问题,从而实现了更清洁的数据管理和更准确的可视化。
反馈
感谢您成为我们社区的一份子! 如果您有任何一般性反馈或在这些页面上发现任何错误,我们欢迎并鼓励您提出意见。 请在 InfluxDB 社区 Slack 中提交您的反馈。