目录
输入和输出集成概述
Kinesis 插件使您可以从 Kinesis 数据流中读取数据,支持各种数据格式和配置。
此插件使用 HTTP 将 Telegraf 指标直接发送到 Grafana 的 Mimir 数据库,为 Prometheus 兼容指标提供可扩展且高效的长期存储和分析。
集成详情
Kinesis
Kinesis Telegraf 插件旨在从 Amazon Kinesis 数据流中读取数据,使用户能够实时收集指标。作为服务输入插件,它的运行方式是监听传入数据,而不是按固定时间间隔轮询。配置指定了各种选项,包括 AWS 区域、流名称、身份验证凭据和数据格式。它支持跟踪未送达的消息以防止数据丢失,用户可以利用 DynamoDB 来维护上次处理记录的检查点。此插件对于需要可靠且可扩展的流处理以及其他监控需求的应用特别有用。
Mimir
Grafana Mimir 支持 Prometheus Remote Write 协议,使 Telegraf 收集的指标能够高效地摄取到 Mimir 集群中,以实现大规模、长期存储。此集成利用 Prometheus 成熟的标准,允许用户将 Telegraf 广泛的数据收集功能与 Mimir 的高级功能(例如查询联合、多租户、高可用性和经济高效的存储)相结合。Grafana Mimir 的架构经过优化,可以处理大量指标数据并提供快速查询响应,使其成为复杂监控环境和分布式系统的理想选择。
配置
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"
Mimir
[[outputs.http]]
url = "http://data-load-balancer-backend-1:9009/api/v1/push"
data_format = "prometheusremotewrite"
username = "*****"
password = "******"
[outputs.http.headers]
Content-Type = "application/x-protobuf"
Content-Encoding = "snappy"
X-Scope-OrgID = "****"
输入和输出集成示例
Kinesis
-
使用 Kinesis 进行实时数据处理:此用例涉及将 Kinesis 插件与监控仪表板集成,以实时分析传入的数据指标。例如,应用程序可以从多个服务使用日志并在视觉上呈现它们,使运营团队能够快速识别趋势并对异常做出反应。
-
无服务器日志聚合:在无服务器架构中使用此插件,其中 Kinesis 流聚合来自各种微服务的日志。该插件可以创建指标,帮助检测系统中的问题,通过第三方集成自动化警报流程,使团队能够最大限度地减少停机时间并提高可靠性。
-
基于流指标的动态扩展:实施一种解决方案,其中 Kinesis 插件使用的流指标可用于动态调整资源。例如,如果处理的记录数激增,则可以触发相应的横向扩展操作来处理增加的负载,从而确保最佳的资源分配和性能。
-
带检查点的到 S3 的数据管道:创建一个强大的数据管道,其中 Kinesis 流数据通过 Telegraf Kinesis 插件处理,检查点存储在 DynamoDB 中。这种方法可以确保数据一致性和可靠性,因为它管理已处理数据的状态,从而实现与下游数据湖或存储解决方案的无缝集成。
Mimir
-
企业级 Kubernetes 监控:将 Telegraf 与 Grafana Mimir 集成,以从企业级 Kubernetes 集群流式传输指标。这实现了全面的可见性、改进的资源分配以及跨数百个集群的主动故障排除,从而利用了 Mimir 的水平可扩展性和高可用性。
-
多租户 SaaS 应用可观测性:使用此插件将来自不同 SaaS 租户的指标集中到 Grafana Mimir 中,从而实现租户隔离和基于资源使用情况的准确计费。这种方法提供了可靠的可观测性、高效的成本管理和安全的多租户支持。
-
全球边缘网络性能跟踪:将来自全球分布式边缘服务器的延迟和可用性指标流式传输到 Grafana Mimir。组织可以快速识别性能下降或中断,利用 Mimir 的快速查询功能来确保最佳的服务可靠性和用户体验。
-
高容量微服务的实时分析:在高容量微服务架构中实施 Telegraf 指标收集,将数据馈送到 Grafana Mimir 以进行实时分析和异常检测。Mimir 强大的查询功能使团队能够检测异常并快速响应,从而保持高服务可用性和性能。
反馈
感谢您成为我们社区的一份子!如果您有任何一般性反馈或在这些页面上发现了任何错误,我们欢迎并鼓励您提出意见。请在 InfluxDB 社区 Slack 中提交您的反馈。