目录
输入和输出集成概述
AMQP Consumer 输入插件允许您从兼容 AMQP 0-9-1 的消息代理(如 RabbitMQ)中提取数据,从而实现无缝数据收集以进行监控和分析。
AWS Timestream Telegraf 插件使用户能够将指标直接发送到 Amazon 的 Timestream 服务,该服务专为时间序列数据管理而设计。此插件为身份验证、数据组织和保留设置提供了各种配置选项。
集成详情
AMQP
此插件为 AMQP 0-9-1 提供了一个消费者,RabbitMQ 是其一个突出的实现。AMQP(高级消息队列协议)最初是为了实现网络中不同系统之间可靠的、可互操作的消息传递而开发的。该插件使用配置的队列和绑定键从主题交换中读取指标,从而提供了一种灵活高效的方式来从兼容 AMQP 的消息传递系统中收集数据。这使用户能够利用现有的 RabbitMQ 实现来有效地监控其应用程序,方法是捕获详细的指标以进行分析和告警。
AWS Timestream
此插件旨在高效地将指标写入 Amazon 的 Timestream 服务,Timestream 服务是一个针对物联网和运营应用程序优化的时间序列数据库。借助此插件,Telegraf 可以发送从各种来源收集的数据,并支持身份验证、数据组织和保留管理方面的灵活配置。它使用凭证链进行身份验证,允许各种方法,如 Web 身份、承担角色和共享配置文件。用户可以定义指标在 Timestream 中的组织方式——是使用单个表还是多个表,以及控制磁存储和内存存储的保留期等方面。一个关键特性是它能够处理多指标记录,从而实现高效的数据摄取,并有助于减少多次写入的开销。在错误处理方面,该插件包括用于解决与数据写入期间的 AWS 错误相关的常见问题的机制,例如用于节流的重试逻辑以及根据需要创建表的能力。
配置
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"
AWS Timestream
[[outputs.timestream]]
## Amazon Region
region = "us-east-1"
## Amazon Credentials
## Credentials are loaded in the following order:
## 1) Web identity provider credentials via STS if role_arn and web_identity_token_file are specified
## 2) Assumed credentials via STS if role_arn is specified
## 3) explicit credentials from 'access_key' and 'secret_key'
## 4) shared profile from 'profile'
## 5) environment variables
## 6) shared credentials file
## 7) EC2 Instance Profile
#access_key = ""
#secret_key = ""
#token = ""
#role_arn = ""
#web_identity_token_file = ""
#role_session_name = ""
#profile = ""
#shared_credential_file = ""
## Endpoint to make request against, the correct endpoint is automatically
## determined and this option should only be set if you wish to override the
## default.
## ex: endpoint_url = "http://localhost:8000"
# endpoint_url = ""
## Timestream database where the metrics will be inserted.
## The database must exist prior to starting Telegraf.
database_name = "yourDatabaseNameHere"
## Specifies if the plugin should describe the Timestream database upon starting
## to validate if it has access necessary permissions, connection, etc., as a safety check.
## If the describe operation fails, the plugin will not start
## and therefore the Telegraf agent will not start.
describe_database_on_start = false
## Specifies how the data is organized in Timestream.
## Valid values are: single-table, multi-table.
## When mapping_mode is set to single-table, all of the data is stored in a single table.
## When mapping_mode is set to multi-table, the data is organized and stored in multiple tables.
## The default is multi-table.
mapping_mode = "multi-table"
## Specifies if the plugin should create the table, if the table does not exist.
create_table_if_not_exists = true
## Specifies the Timestream table magnetic store retention period in days.
## Check Timestream documentation for more details.
## NOTE: This property is valid when create_table_if_not_exists = true.
create_table_magnetic_store_retention_period_in_days = 365
## Specifies the Timestream table memory store retention period in hours.
## Check Timestream documentation for more details.
## NOTE: This property is valid when create_table_if_not_exists = true.
create_table_memory_store_retention_period_in_hours = 24
## Specifies how the data is written into Timestream.
## Valid values are: true, false
## When use_multi_measure_records is set to true, all of the tags and fields are stored
## as a single row in a Timestream table.
## When use_multi_measure_record is set to false, Timestream stores each field in a
## separate table row, thereby storing the tags multiple times (once for each field).
## The recommended setting is true.
## The default is false.
use_multi_measure_records = "false"
## Specifies the measure_name to use when sending multi-measure records.
## NOTE: This property is valid when use_multi_measure_records=true and mapping_mode=multi-table
measure_name_for_multi_measure_records = "telegraf_measure"
## Specifies the name of the table to write data into
## NOTE: This property is valid when mapping_mode=single-table.
# single_table_name = ""
## Specifies the name of dimension when all of the data is being stored in a single table
## and the measurement name is transformed into the dimension value
## (see Mapping data from Influx to Timestream for details)
## NOTE: This property is valid when mapping_mode=single-table.
# single_table_dimension_name_for_telegraf_measurement_name = "namespace"
## Only valid and optional if create_table_if_not_exists = true
## Specifies the Timestream table tags.
## Check Timestream documentation for more details
# create_table_tags = { "foo" = "bar", "environment" = "dev"}
## Specify the maximum number of parallel go routines to ingest/write data
## If not specified, defaulted to 1 go routines
max_write_go_routines = 25
## Please see README.md to know how line protocol data is mapped to Timestream
##
输入和输出集成示例
AMQP
-
集成应用程序指标与 AMQP:使用 AMQP Consumer 插件来收集发布到 RabbitMQ 交换机的应用程序指标。通过配置插件以侦听特定的队列,团队可以深入了解应用程序性能、跟踪请求速率、错误计数和延迟指标,所有这些都是实时的。此设置不仅有助于异常检测,还为容量规划和系统优化提供有价值的数据。
-
事件驱动的监控:每当应用程序内满足某些条件时,配置 AMQP Consumer 以触发特定的监控事件。例如,如果收到指示高错误率的消息,插件可以将此数据馈送到监控工具,生成警报或扩展事件。这种集成可以提高对问题的响应能力并自动化部分操作工作流程。
-
跨平台数据聚合:利用 AMQP Consumer 插件来整合来自分布在不同平台上的各种应用程序的指标。通过使用 RabbitMQ 作为集中式消息代理,组织可以统一其监控数据,从而通过 Telegraf 实现全面的分析和仪表板,从而在异构环境中保持可见性。
-
实时日志处理:扩展 AMQP Consumer 的使用范围,以捕获发送到 RabbitMQ 交换机的日志数据,实时处理日志以进行监控和告警。此应用程序通过分析日志模式、趋势和异常情况(在发生时),确保及时检测和解决操作问题。
AWS Timestream
-
物联网数据指标:使用 Timestream 插件将来自物联网设备的实时指标发送到 Timestream,从而可以快速分析和可视化传感器数据。通过将设备读数组织成时间序列格式,用户可以跟踪趋势、识别异常情况,并根据设备性能简化运营决策。
-
应用程序性能监控:将 Timestream 与应用程序监控工具一起使用,以发送有关服务性能随时间变化的指标。这种集成使工程师能够对应用程序性能执行历史分析,将其与业务指标相关联,并根据随时间变化的使用模式优化资源分配。
-
自动化数据归档:配置 Timestream 插件以将数据写入 Timestream,同时管理保留期。此设置可以自动化归档策略,确保根据预定义的标准保留旧数据。这对于合规性和历史分析特别有用,使企业能够以最少的人工干预来维护其数据生命周期。
-
多应用程序指标聚合:利用 Timestream 插件将来自多个应用程序的指标聚合到 Timestream 中。通过创建统一的性能指标数据库,组织可以获得跨各种服务的整体洞察力,从而提高系统范围性能的可见性,并促进跨应用程序故障排除。
反馈
感谢您成为我们社区的一份子!如果您有任何一般性反馈或在这些页面上发现了任何错误,我们欢迎并鼓励您提供意见。请在InfluxDB 社区 Slack中提交您的反馈。