目录
输入和输出集成概述
Kinesis 插件使您能够从 Kinesis 数据流中读取数据,支持各种数据格式和配置。
OpenTSDB 插件促进了 Telegraf 与 OpenTSDB 的集成,允许用户无缝地将时序指标推送到 OpenTSDB 后端。
集成详情
Kinesis
Kinesis Telegraf 插件旨在从 Amazon Kinesis 数据流中读取数据,使用户能够实时收集指标。 作为一个服务输入插件,它通过监听传入数据而不是定期轮询来运行。 配置指定了各种选项,包括 AWS 区域、流名称、身份验证凭据和数据格式。 它支持跟踪未传递的消息以防止数据丢失,并且用户可以利用 DynamoDB 来维护最后处理记录的检查点。 此插件对于需要可靠且可扩展的流处理以及其他监控需求的应用程序特别有用。
OpenTSDB
OpenTSDB 插件旨在通过 telnet 或 HTTP 模式将指标发送到 OpenTSDB 实例。 随着 OpenTSDB 2.0 的推出,推荐的指标发送方法是通过 HTTP API,它允许通过配置“http_batch_size”来批量处理指标。 该插件支持多种配置选项,包括指标前缀、服务器主机和端口规范、反向代理的 URI 路径自定义以及用于诊断与 OpenTSDB 通信问题的调试选项。 此插件在生成时序数据并需要将其有效存储在可扩展的时序数据库(如 OpenTSDB)中的场景中特别有用,使其适用于广泛的监控和分析应用程序。
配置
Kinesis
# Configuration for the AWS Kinesis input.
[[inputs.kinesis_consumer]]
## Amazon REGION of kinesis endpoint.
region = "ap-southeast-2"
## 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 = ""
## Kinesis StreamName must exist prior to starting telegraf.
streamname = "StreamName"
## Shard iterator type (only 'TRIM_HORIZON' and 'LATEST' currently supported)
# shard_iterator_type = "TRIM_HORIZON"
## 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"
##
## The content encoding of the data from kinesis
## If you are processing a cloudwatch logs kinesis stream then set this to "gzip"
## as AWS compresses cloudwatch log data before it is sent to kinesis (aws
## also base64 encodes the zip byte data before pushing to the stream. The base64 decoding
## is done automatically by the golang sdk, as data is read from kinesis)
##
# content_encoding = "identity"
## Optional
## Configuration for a dynamodb checkpoint
[inputs.kinesis_consumer.checkpoint_dynamodb]
## unique name for this consumer
app_name = "default"
table_name = "default"
OpenTSDB
[[outputs.opentsdb]]
## prefix for metrics keys
prefix = "my.specific.prefix."
## DNS name of the OpenTSDB server
## Using "opentsdb.example.com" or "tcp://opentsdb.example.com" will use the
## telnet API. "http://opentsdb.example.com" will use the Http API.
host = "opentsdb.example.com"
## Port of the OpenTSDB server
port = 4242
## Number of data points to send to OpenTSDB in Http requests.
## Not used with telnet API.
http_batch_size = 50
## URI Path for Http requests to OpenTSDB.
## Used in cases where OpenTSDB is located behind a reverse proxy.
http_path = "/api/put"
## Debug true - Prints OpenTSDB communication
debug = false
## Separator separates measurement name from field
separator = "_"
输入和输出集成示例
Kinesis
-
使用 Kinesis 进行实时数据处理:此用例涉及将 Kinesis 插件与监控仪表板集成,以实时分析传入的数据指标。 例如,应用程序可以从多个服务中提取日志并以可视化方式呈现,从而使运营团队能够快速识别趋势并对出现的异常做出反应。
-
无服务器日志聚合:在无服务器架构中使用此插件,其中 Kinesis 流聚合来自各种微服务的日志。 该插件可以创建指标,帮助检测系统中的问题,通过第三方集成自动化警报流程,使团队能够最大限度地减少停机时间并提高可靠性。
-
基于流指标的动态扩展:实施一种解决方案,其中 Kinesis 插件使用的流指标可用于动态调整资源。 例如,如果处理的记录数量激增,则可以触发相应的扩展操作来处理增加的负载,从而确保最佳的资源分配和性能。
-
使用检查点到 S3 的数据管道:创建一个强大的数据管道,其中 Kinesis 流数据通过 Telegraf Kinesis 插件处理,检查点存储在 DynamoDB 中。 这种方法可以确保数据一致性和可靠性,因为它管理已处理数据的状态,从而实现与下游数据湖或存储解决方案的无缝集成。
OpenTSDB
-
实时基础设施监控:使用 OpenTSDB 插件收集和存储来自各种基础设施组件的指标。 通过配置插件将指标推送到 OpenTSDB,组织可以获得其基础设施健康状况和性能随时间变化的集中视图。
-
自定义应用程序指标跟踪:将 OpenTSDB 插件集成到自定义应用程序中,以跟踪关键绩效指标 (KPI),例如响应时间、错误率和用户交互。 这种设置允许开发人员和产品团队可视化应用程序性能趋势并做出数据驱动的决策。
-
自动异常检测:结合机器学习算法利用该插件自动检测发送到 OpenTSDB 的时序数据中的异常。 通过持续监控传入的指标,系统可以训练模型,以便在潜在问题影响应用程序性能之前向用户发出警报。
-
历史数据分析:使用 OpenTSDB 插件存储和分析历史性能数据,用于容量规划和趋势分析。 这为系统随时间推移的行为提供了宝贵的见解,帮助团队了解使用模式并为未来的增长做好准备。
反馈
感谢您成为我们社区的一份子! 如果您有任何一般性反馈或在这些页面上发现任何错误,我们欢迎并鼓励您提出意见。 请在 InfluxDB 社区 Slack 中提交您的反馈。