目录
输入和输出集成概述
AMQP Consumer 输入插件允许您从符合 AMQP 0-9-1 标准的消息代理(如 RabbitMQ)摄取数据,从而实现无缝数据收集,以用于监控和分析。
Google BigQuery 插件允许 Telegraf 将指标写入 Google Cloud BigQuery,从而为遥测数据提供强大的数据分析能力。
集成详情
AMQP
此插件为使用 AMQP 0-9-1 提供了消费者,RabbitMQ 是其突出的实现之一。AMQP,或高级消息队列协议,最初是为了在网络中不同的系统之间实现可靠、可互操作的消息传递而开发的。该插件使用配置的队列和绑定键从主题交换中读取指标,从而提供了一种灵活高效的方式来从符合 AMQP 标准的消息传递系统中收集数据。这使用户能够通过捕获详细的指标进行分析和警报,从而有效地利用现有的 RabbitMQ 实现来监控其应用程序。
Google BigQuery
Telegraf 的 Google BigQuery 插件实现了与 Google Cloud 的 BigQuery 服务的无缝集成,BigQuery 服务是一个流行的数据仓库和分析平台。此插件有助于将 Telegraf 收集的指标传输到 BigQuery 数据集中,从而使用户可以更轻松地执行分析并从其遥测数据中生成见解。它需要通过服务帐户或用户凭据进行身份验证,并且旨在处理各种数据类型,确保用户在将指标存储在 BigQuery 表中时可以保持指标的完整性和准确性。配置选项允许围绕数据集规范和处理指标进行自定义,包括管理指标名称中的连字符,流式插入不支持连字符。此插件对于利用 BigQuery 的可扩展性和强大的查询功能来分析大量监控数据的组织特别有用。
配置
AMQP
[[inputs.amqp_consumer]]
## Brokers to consume from. If multiple brokers are specified a random broker
## will be selected anytime a connection is established. This can be
## helpful for load balancing when not using a dedicated load balancer.
brokers = ["amqp://localhost:5672/influxdb"]
## Authentication credentials for the PLAIN auth_method.
# username = ""
# password = ""
## Name of the exchange to declare. If unset, no exchange will be declared.
exchange = "telegraf"
## Exchange type; common types are "direct", "fanout", "topic", "header", "x-consistent-hash".
# exchange_type = "topic"
## If true, exchange will be passively declared.
# exchange_passive = false
## Exchange durability can be either "transient" or "durable".
# exchange_durability = "durable"
## Additional exchange arguments.
# exchange_arguments = { }
# exchange_arguments = {"hash_property" = "timestamp"}
## AMQP queue name.
queue = "telegraf"
## AMQP queue durability can be "transient" or "durable".
queue_durability = "durable"
## If true, queue will be passively declared.
# queue_passive = false
## Additional arguments when consuming from Queue
# queue_consume_arguments = { }
# queue_consume_arguments = {"x-stream-offset" = "first"}
## A binding between the exchange and queue using this binding key is
## created. If unset, no binding is created.
binding_key = "#"
## Maximum number of messages server should give to the worker.
# prefetch_count = 50
## 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
## Timeout for establishing the connection to a broker
# timeout = "30s"
## Auth method. PLAIN and EXTERNAL are supported
## Using EXTERNAL requires enabling the rabbitmq_auth_mechanism_ssl plugin as
## described here: https://rabbitmq.cn/plugins.html
# auth_method = "PLAIN"
## 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
## Content encoding for message payloads, can be set to
## "gzip", "identity" or "auto"
## - Use "gzip" to decode gzip
## - Use "identity" to apply no encoding
## - Use "auto" determine the encoding using the ContentEncoding header
# content_encoding = "identity"
## Maximum size of decoded message.
## Acceptable units are B, KiB, KB, MiB, MB...
## Without quotes and units, interpreted as size in bytes.
# max_decompression_size = "500MB"
## 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"
Google BigQuery
# Configuration for Google Cloud BigQuery to send entries
[[outputs.bigquery]]
## Credentials File
credentials_file = "/path/to/service/account/key.json"
## Google Cloud Platform Project
# project = ""
## The namespace for the metric descriptor
dataset = "telegraf"
## Timeout for BigQuery operations.
# timeout = "5s"
## Character to replace hyphens on Metric name
# replace_hyphen_to = "_"
## Write all metrics in a single compact table
# compact_table = ""
输入和输出集成示例
AMQP
-
将应用程序指标与 AMQP 集成:使用 AMQP Consumer 插件收集发布到 RabbitMQ 交换机的应用程序指标。通过配置插件以侦听特定队列,团队可以深入了解应用程序性能,跟踪请求速率、错误计数和延迟指标,所有这些都是实时的。这种设置不仅有助于异常检测,而且还为容量规划和系统优化提供有价值的数据。
-
事件驱动的监控:每当应用程序中满足某些条件时,配置 AMQP Consumer 以触发特定的监控事件。例如,如果收到指示高错误率的消息,插件可以将此数据馈送到监控工具中,从而生成警报或扩展事件。这种集成可以提高对问题的响应速度并自动化部分运营工作流程。
-
跨平台数据聚合:利用 AMQP Consumer 插件整合来自分布在不同平台上的各种应用程序的指标。通过使用 RabbitMQ 作为集中式消息代理,组织可以统一其监控数据,从而允许通过 Telegraf 进行全面的分析和仪表板,从而在异构环境中保持可见性。
-
实时日志处理:扩展 AMQP Consumer 的用途以捕获发送到 RabbitMQ 交换机的日志数据,实时处理日志以用于监控和警报目的。此应用程序确保通过分析日志模式、趋势和异常(在发生时)来快速检测和解决运营问题。
Google BigQuery
-
实时分析仪表板:利用 Google BigQuery 插件将实时指标馈送到 Google Cloud 上托管的自定义分析仪表板中。这种设置将使团队能够实时可视化性能数据,从而深入了解系统运行状况和使用模式。通过使用 BigQuery 的查询功能,用户可以轻松创建量身定制的报告和仪表板以满足其特定需求,从而增强决策过程。
-
成本管理和优化分析:利用该插件自动将来自各种服务的成本相关指标发送到 BigQuery。分析这些数据可以帮助企业识别不必要的费用并优化资源使用。通过在 BigQuery 中执行聚合和转换查询,组织可以创建准确的预测并有效地管理其云支出。
-
监控数据上的跨团队协作:使组织内不同的团队能够使用 BigQuery 共享其监控数据。借助此 Telegraf 插件,团队可以将其指标推送到中央 BigQuery 实例,从而促进协作。这种数据共享方法鼓励最佳实践和跨职能意识,从而共同改进系统性能和可靠性。
-
用于容量规划的历史分析:通过使用 BigQuery 插件,公司可以收集和存储对容量规划至关重要的历史指标数据。分析随时间变化的趋势可以帮助预测系统需求并主动扩展基础设施。组织可以创建时序分析并识别为其长期战略决策提供信息的模式。
反馈
感谢您成为我们社区的一份子!如果您有任何一般性反馈或在这些页面上发现任何错误,我们欢迎并鼓励您提供意见。请在 InfluxDB 社区 Slack 中提交您的反馈。