目录
输入和输出集成概述
Kinesis 插件使您能够从 Kinesis 数据流中读取数据,支持各种数据格式和配置。
此插件允许使用 Metrics API 将指标发送到 New Relic Insights,从而实现对应用程序性能的有效监控和分析。
集成详情
Kinesis
Kinesis Telegraf 插件旨在从 Amazon Kinesis 数据流中读取数据,使用户能够实时收集指标。作为服务输入插件,它通过监听传入数据而不是定期轮询来运行。配置指定了各种选项,包括 AWS 区域、流名称、身份验证凭据和数据格式。它支持跟踪未传递的消息以防止数据丢失,用户可以利用 DynamoDB 来维护上次处理记录的检查点。此插件对于需要可靠且可扩展的流处理以及其他监控需求的应用程序特别有用。
New Relic
此插件利用 Metrics API 将指标写入 New Relic Insights,Metrics API 提供了一种将时间序列数据发送到 New Relic 平台的强大机制。用户必须首先获取 Insights API 密钥,以验证和授权其数据提交。该插件旨在促进与 New Relic 的监控和分析功能的轻松集成,支持各种指标类型,并允许高效的数据处理。核心功能包括为指标添加前缀以更好地识别、API 请求的可自定义超时以及支持代理设置以增强连接性。用户必须根据自己的需求配置这些选项,以实现数据无缝流入 New Relic,从而进行全面的实时分析和洞察。
配置
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"
New Relic
[[outputs.newrelic]]
## The 'insights_key' parameter requires a NR license key.
## New Relic recommends you create one
## with a convenient name such as TELEGRAF_INSERT_KEY.
## reference: https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/#ingest-license-key
# insights_key = "New Relic License Key Here"
## Prefix to add to add to metric name for easy identification.
## This is very useful if your metric names are ambiguous.
# metric_prefix = ""
## Timeout for writes to the New Relic API.
# timeout = "15s"
## HTTP Proxy override. If unset use values from the standard
## proxy environment variables to determine proxy, if any.
# http_proxy = "http://corporate.proxy:3128"
## Metric URL override to enable geographic location endpoints.
# If not set use values from the standard
# metric_url = "https://metric-api.newrelic.com/metric/v1"
输入和输出集成示例
Kinesis
-
使用 Kinesis 进行实时数据处理:此用例涉及将 Kinesis 插件与监控仪表板集成,以实时分析传入的数据指标。例如,应用程序可以从多个服务消耗日志并以可视方式呈现它们,使运营团队能够快速识别趋势并对发生的异常做出反应。
-
Serverless 日志聚合:在 Serverless 架构中使用此插件,其中 Kinesis 流聚合来自各种微服务的日志。该插件可以创建有助于检测系统中问题的指标,通过第三方集成自动化警报流程,使团队能够最大限度地减少停机时间并提高可靠性。
-
基于流指标的动态扩展:实施一种解决方案,其中 Kinesis 插件消耗的流指标可用于动态调整资源。例如,如果处理的记录数激增,则可以触发相应的扩展操作来处理增加的负载,从而确保最佳的资源分配和性能。
-
使用检查点的数据管道到 S3:创建一个强大的数据管道,其中 Kinesis 流数据通过 Telegraf Kinesis 插件处理,检查点存储在 DynamoDB 中。这种方法可以确保数据一致性和可靠性,因为它管理已处理数据的状态,从而实现与下游数据湖或存储解决方案的无缝集成。
New Relic
-
应用程序性能监控:使用 New Relic Telegraf 插件将 Web 服务的应用程序性能指标发送到 New Relic Insights。通过集成此插件,开发人员可以收集诸如响应时间、错误率和吞吐量之类的数据,使团队能够实时监控应用程序健康状况并在问题影响用户之前快速解决问题。此设置促进了对应用程序性能和用户体验的主动管理。
-
基础设施指标聚合:利用此插件聚合来自各种服务器的系统级指标(CPU 使用率、内存消耗等)并将其发送到 New Relic。这有助于系统管理员保持对基础设施性能的全面视图,从而促进容量规划并识别潜在的瓶颈。通过在 New Relic 中集中指标,团队可以可视化随时间变化的趋势,并就资源分配做出明智的决策。
-
多租户应用程序的动态指标命名:使用 metric_prefix 选项实现动态前缀,以区分多租户应用程序中的不同租户。通过配置插件以在指标名称中包含每个租户的唯一标识符,团队可以分析每个租户的使用模式和性能指标。这提供了对租户行为的宝贵见解,支持定制优化并提高跨不同客户群的服务质量。
-
实时异常检测:将 New Relic 插件与警报机制结合使用,以基于异常指标模式触发通知。通过发送诸如请求计数和响应时间之类的指标,团队可以在 New Relic 中设置阈值,当阈值被突破时,将自动提醒相关方。这种用户驱动的方法支持对潜在问题做出即时响应,防止问题升级为更大的事件。
反馈
感谢您成为我们社区的一份子!如果您有任何一般性反馈或在这些页面上发现任何错误,我们欢迎并鼓励您提出意见。请在 InfluxDB 社区 Slack 中提交您的反馈。