目录
输入和输出集成概述
NSQ Telegraf 插件从 NSQD 消息传递系统读取指标,从而实现实时数据处理和监控。
此插件使用 Prometheus 远程写入协议通过 HTTP 将指标从 Telegraf 发送到 Thanos,从而实现高效且可扩展地摄取到 Thanos Receive 组件中。
集成详情
NSQ
NSQ 插件与实时消息传递平台 NSQ 接口,从而可以从 NSQD 读取消息。此插件被归类为服务插件,这意味着它主动监听指标和事件,而不是定期轮询它们。为了强调可靠性,它通过跟踪未传递的消息直到输出确认它们为止来防止数据丢失。该插件允许配置,例如指定 NSQLookupd 端点、主题和通道,并且它支持多种数据格式,以实现数据处理的灵活性。
Thanos
Telegraf 的 HTTP 插件可以通过其兼容 Remote Write 的 Receive 组件将指标直接发送到 Thanos。通过将数据格式设置为 prometheusremotewrite,Telegraf 可以将指标序列化为本机 Prometheus 客户端使用的相同基于 protobuf 的格式。此设置实现了高吞吐量、低延迟的指标摄取到 Thanos 中,从而促进了大规模的集中式可观测性。这在混合环境中尤其有用,在这些环境中,Telegraf 从 Prometheus 本机范围之外的系统(例如 SNMP 设备、Windows 主机或自定义应用程序)收集指标,并将它们直接流式传输到 Thanos 以进行长期存储和全局查询。
配置
NSQ
# Read metrics from NSQD topic(s)
[[inputs.nsq_consumer]]
## Server option still works but is deprecated, we just prepend it to the nsqd array.
# server = "localhost:4150"
## An array representing the NSQD TCP HTTP Endpoints
nsqd = ["localhost:4150"]
## An array representing the NSQLookupd HTTP Endpoints
nsqlookupd = ["localhost:4161"]
topic = "telegraf"
channel = "consumer"
max_in_flight = 100
## Max undelivered messages
## This plugin uses tracking metrics, which ensure messages are read to
## outputs before acknowledging them to the original broker to ensure data
## is not lost. This option sets the maximum messages to read from the
## broker that have not been written by an output.
##
## This value needs to be picked with awareness of the agent's
## metric_batch_size value as well. Setting max undelivered messages too high
## can result in a constant stream of data batches to the output. While
## setting it too low may never flush the broker's messages.
# max_undelivered_messages = 1000
## Data format to consume.
## Each data format has its own unique set of configuration options, read
## more about them here:
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
data_format = "influx"
Thanos
[[outputs.http]]
## Thanos Receive endpoint for remote write
url = "http://thanos-receive.example.com/api/v1/receive"
## HTTP method
method = "POST"
## Data format set to Prometheus remote write
data_format = "prometheusremotewrite"
## Optional headers (authorization, etc.)
# [outputs.http.headers]
# Authorization = "Bearer YOUR_TOKEN"
## Optional TLS configuration
# tls_ca = "/path/to/ca.pem"
# tls_cert = "/path/to/cert.pem"
# tls_key = "/path/to/key.pem"
# insecure_skip_verify = false
## Request timeout
timeout = "10s"
输入和输出集成示例
NSQ
-
实时分析仪表板:将此插件与可视化工具集成,以创建一个仪表板,显示来自 NSQ 中各个主题的实时指标。通过订阅特定主题,用户可以动态监控系统健康状况和应用程序性能,从而及时洞察并及时响应任何异常情况。
-
事件驱动的自动化:将 NSQ 与无服务器架构结合使用,以根据传入的消息触发自动化工作流程。此用例可能涉及处理机器学习模型的数据或响应应用程序中的用户操作,从而通过快速处理来简化操作并增强用户体验。
-
多服务通信中心:使用 NSQ 插件充当分布式架构中不同微服务之间的集中式消息传递中心。通过使服务能够通过 NSQ 进行通信,开发人员可以确保可靠的消息传递,同时保持解耦的服务交互,从而显着提高可扩展性和弹性。
-
指标聚合以增强监控:实施 NSQ 插件以聚合来自多个来源的指标,然后再将它们发送到分析工具。此设置使企业能够整合来自各种应用程序和服务的数据,从而创建一个统一的视图,以便更好地进行决策和战略规划。
Thanos
-
无代理云监控:在云虚拟机上部署 Telegraf 代理以收集系统和应用程序指标,然后使用 Remote Write 将它们直接流式传输到 Thanos。这提供了集中式可观测性,而无需在每个位置都部署 Prometheus 节点。
-
可扩展的 Windows 主机监控:在 Windows 机器上使用 Telegraf 收集操作系统级别的指标,并通过 Remote Write 将它们发送到 Thanos Receive。这使得可以在异构环境中实现可观测性,而本机 Prometheus 仅在 Linux 上受支持。
-
跨区域指标联邦:多个地理区域中的 Telegraf 代理可以使用此插件将数据推送到区域本地的 Thanos Receiver。从那里,Thanos 可以全局去重和查询指标,从而减少延迟和网络出口成本。
-
将第三方数据集成到 Thanos 中:使用 Telegraf 输入从自定义遥测源(例如 REST API 或专有日志)收集指标,并通过 Remote Write 将它们转发到 Thanos。这会将非原生数据引入到兼容 Prometheus 的长期分析管道中。
反馈
感谢您成为我们社区的一份子!如果您有任何一般性反馈或在这些页面上发现任何错误,我们欢迎并鼓励您提出意见。请在 InfluxDB 社区 Slack 中提交您的反馈。