目录
输入和输出集成概述
StatsD 输入插件通过在后台运行侦听器服务来捕获来自 StatsD 服务器的指标,从而实现全面的性能监控和指标聚合。
AWS Timestream Telegraf 插件使用户能够将指标直接发送到 Amazon 的 Timestream 服务,该服务专为时序数据管理而设计。 该插件为身份验证、数据组织和保留设置提供了多种配置选项。
集成详情
StatsD
StatsD 输入插件旨在通过在 Telegraf 处于活动状态时运行后台 StatsD 侦听器服务来收集来自 StatsD 服务器的指标。 此插件利用原始 Etsy 实施建立的 StatsD 消息格式,该格式允许各种类型的指标,包括计量器、计数器、集合、计时、直方图和分布。 StatsD 插件的功能扩展到解析标签,并使用支持 InfluxDB 标记系统的功能扩展标准协议。 它可以处理通过不同协议(UDP 或 TCP)发送的消息,有效管理多个指标,并为最佳指标处理提供高级配置,例如百分位数计算和数据转换模板。 这种灵活性使用户能够全面跟踪应用程序性能,使其成为强大监控设置的重要工具。
AWS Timestream
此插件旨在高效地将指标写入 Amazon 的 Timestream 服务,这是一种针对物联网和运营应用程序优化的时序数据库。 借助此插件,Telegraf 可以发送从各种来源收集的数据,并支持灵活的身份验证、数据组织和保留管理配置。 它利用凭证链进行身份验证,允许各种方法,例如 Web 身份、承担角色和共享配置文件。 用户可以定义指标在 Timestream 中的组织方式 - 是使用单个表还是多个表,以及对磁存储和内存存储的保留期限等方面的控制。 一个关键特性是它能够处理多指标记录,从而实现高效的数据摄取并有助于减少多次写入的开销。 在错误处理方面,该插件包含用于解决与数据写入期间 AWS 错误相关的常见问题的机制,例如用于限制的重试逻辑以及根据需要创建表的能力。
配置
StatsD
[[inputs.statsd]]
## Protocol, must be "tcp", "udp4", "udp6" or "udp" (default=udp)
protocol = "udp"
## MaxTCPConnection - applicable when protocol is set to tcp (default=250)
max_tcp_connections = 250
## Enable TCP keep alive probes (default=false)
tcp_keep_alive = false
## Specifies the keep-alive period for an active network connection.
## Only applies to TCP sockets and will be ignored if tcp_keep_alive is false.
## Defaults to the OS configuration.
# tcp_keep_alive_period = "2h"
## Address and port to host UDP listener on
service_address = ":8125"
## The following configuration options control when telegraf clears it's cache
## of previous values. If set to false, then telegraf will only clear it's
## cache when the daemon is restarted.
## Reset gauges every interval (default=true)
delete_gauges = true
## Reset counters every interval (default=true)
delete_counters = true
## Reset sets every interval (default=true)
delete_sets = true
## Reset timings & histograms every interval (default=true)
delete_timings = true
## Enable aggregation temporality adds temporality=delta or temporality=commulative tag, and
## start_time field, which adds the start time of the metric accumulation.
## You should use this when using OpenTelemetry output.
# enable_aggregation_temporality = false
## Percentiles to calculate for timing & histogram stats.
percentiles = [50.0, 90.0, 99.0, 99.9, 99.95, 100.0]
## separator to use between elements of a statsd metric
metric_separator = "_"
## Parses tags in the datadog statsd format
## http://docs.datadoghq.com/guides/dogstatsd/
## deprecated in 1.10; use datadog_extensions option instead
parse_data_dog_tags = false
## Parses extensions to statsd in the datadog statsd format
## currently supports metrics and datadog tags.
## http://docs.datadoghq.com/guides/dogstatsd/
datadog_extensions = false
## Parses distributions metric as specified in the datadog statsd format
## https://docs.datadoghq.com/developers/metrics/types/?tab=distribution#definition
datadog_distributions = false
## Keep or drop the container id as tag. Included as optional field
## in DogStatsD protocol v1.2 if source is running in Kubernetes
## https://docs.datadoghq.com/developers/dogstatsd/datagram_shell/?tab=metrics#dogstatsd-protocol-v12
datadog_keep_container_tag = false
## Statsd data translation templates, more info can be read here:
## https://github.com/influxdata/telegraf/blob/master/docs/TEMPLATE_PATTERN.md
# templates = [
# "cpu.* measurement*"
# ]
## Number of UDP messages allowed to queue up, once filled,
## the statsd server will start dropping packets
allowed_pending_messages = 10000
## Number of worker threads used to parse the incoming messages.
# number_workers_threads = 5
## Number of timing/histogram values to track per-measurement in the
## calculation of percentiles. Raising this limit increases the accuracy
## of percentiles but also increases the memory usage and cpu time.
percentile_limit = 1000
## Maximum socket buffer size in bytes, once the buffer fills up, metrics
## will start dropping. Defaults to the OS default.
# read_buffer_size = 65535
## Max duration (TTL) for each metric to stay cached/reported without being updated.
# max_ttl = "10h"
## Sanitize name method
## By default, telegraf will pass names directly as they are received.
## However, upstream statsd now does sanitization of names which can be
## enabled by using the "upstream" method option. This option will a) replace
## white space with '_', replace '/' with '-', and remove characters not
## matching 'a-zA-Z_\-0-9\.;='.
#sanitize_name_method = ""
## Replace dots (.) with underscore (_) and dashes (-) with
## double underscore (__) in metric names.
# convert_names = false
## Convert all numeric counters to float
## Enabling this would ensure that both counters and guages are both emitted
## as floats.
# float_counters = false
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
##
输入和输出集成示例
StatsD
-
实时应用程序性能监控:利用 StatsD 输入插件实时监控应用程序性能指标。 通过配置您的应用程序向 StatsD 服务器发送各种指标,团队可以利用此插件动态分析性能瓶颈、跟踪用户活动并确保资源优化。 历史指标和实时指标的结合可以实现主动故障排除,并提高问题解决过程的响应速度。
-
跟踪 Web 应用程序中的用户参与度指标:使用 StatsD 插件收集用户参与度统计信息,例如页面浏览量、点击事件和交互时间。 通过将这些指标发送到 StatsD 服务器,企业可以深入了解用户行为,从而能够根据定量反馈做出数据驱动的决策,以改善用户体验和界面设计。 这可以显着提高营销策略和产品开发工作的有效性。
-
基础设施健康监控:部署 StatsD 插件以监控服务器基础设施的健康状况,方法是跟踪资源利用率、服务器响应时间和网络性能等指标。 通过此设置,DevOps 团队可以详细了解系统性能,从而有效地在问题升级之前预测问题。 这使得能够采用主动的基础设施管理方法,最大限度地减少停机时间并确保最佳的服务交付。
-
创建全面的服务仪表板:将 StatsD 与可视化工具集成,以创建全面的仪表板,反映整个架构中服务的状态和健康状况。 例如,结合通过 StatsD 记录的来自多个服务的数据可以将原始指标转换为可操作的见解,从而展示系统性能随时间变化的趋势。 这种能力使利益相关者能够保持监督并根据可视化数据集推动决策,从而提高整体运营透明度。
AWS Timestream
-
物联网数据指标:使用 Timestream 插件将来自物联网设备的实时指标发送到 Timestream,从而可以快速分析和可视化传感器数据。 通过将设备读数组织成时序格式,用户可以跟踪趋势、识别异常并根据设备性能简化运营决策。
-
应用程序性能监控:将 Timestream 与应用程序监控工具结合使用,以发送有关服务性能随时间变化的指标。 这种集成使工程师能够执行应用程序性能的历史分析,将其与业务指标相关联,并根据随时间查看的使用模式优化资源分配。
-
自动化数据归档:配置 Timestream 插件以将数据写入 Timestream,同时管理保留期限。 此设置可以自动化归档策略,确保根据预定义标准保存旧数据。 这对于合规性和历史分析尤其有用,使企业能够以最少的人工干预来维护其数据生命周期。
-
多应用指标聚合:利用 Timestream 插件将来自多个应用程序的指标聚合到 Timestream 中。 通过创建统一的性能指标数据库,组织可以全面了解各种服务,从而提高系统范围性能的可见性并促进跨应用程序故障排除。
反馈
感谢您成为我们社区的一份子! 如果您有任何一般反馈或在这些页面上发现任何错误,我们欢迎并鼓励您提出意见。 请在InfluxDB 社区 Slack中提交您的反馈。