目录
强大的性能,无限的扩展能力
收集、组织和处理海量高速数据。当您将任何数据视为时间序列数据时,它都更有价值。InfluxDB 是排名第一的时间序列平台,旨在与 Telegraf 一起扩展。
查看入门方法
输入和输出集成概述
Amazon ECS 输入插件使 Telegraf 能够收集来自 AWS ECS 容器的指标,从而提供有关容器性能和资源使用情况的详细见解。
Telegraf SQL 插件允许您将 Telegraf 的指标直接存储到 MySQL 数据库中,从而更轻松地分析和可视化收集的指标。
集成详情
Amazon ECS
Telegraf 的 Amazon ECS 插件旨在从在 AWS Fargate 或 EC2 实例上运行的 ECS(弹性容器服务)任务中收集指标。通过利用 ECS 元数据和统计 API 端点(v2 和 v3),它可以获取有关任务中容器性能和运行状况的实时信息。此插件在与检查的工作负载相同的任务中运行,确保无缝访问元数据和统计信息。值得注意的是,它结合了 ECS 特有的功能,这些功能使其与 Docker 输入插件区分开来,例如处理独特的 ECS 元数据格式和统计信息。用户可以包含或排除特定容器,并调整要监视的容器状态,以及定义 ECS 标签的标签选项。这种灵活性允许定制的监控体验,以满足 ECS 环境的特定需求,从而增强对容器化应用程序的可观察性和控制。
MySQL
Telegraf 的 SQL 输出插件旨在通过基于传入指标动态创建表和列,将指标数据无缝写入 SQL 数据库。当配置为 MySQL 时,该插件利用 go-sql-driver/mysql,这需要启用 ANSI_QUOTES SQL 模式以确保正确处理带引号的标识符。这种动态模式创建方法确保每个指标都存储在其自己的表中,其结构源自其字段和标签,从而提供系统性能的详细、带时间戳的记录。该插件的灵活性使其能够处理高吞吐量环境,使其成为需要强大、精细的指标日志记录和历史数据分析场景的理想选择。
配置
Amazon ECS
[[inputs.ecs]]
# endpoint_url = ""
# container_name_include = []
# container_name_exclude = []
# container_status_include = []
# container_status_exclude = []
ecs_label_include = [ "com.amazonaws.ecs.*" ]
ecs_label_exclude = []
# timeout = "5s"
[[inputs.ecs]]
endpoint_url = "http://169.254.170.2"
# container_name_include = []
# container_name_exclude = []
# container_status_include = []
# container_status_exclude = []
ecs_label_include = [ "com.amazonaws.ecs.*" ]
ecs_label_exclude = []
# timeout = "5s"
MySQL
[[outputs.sql]]
## Database driver
## Valid options: mssql (Microsoft SQL Server), mysql (MySQL), pgx (Postgres),
## sqlite (SQLite3), snowflake (snowflake.com) clickhouse (ClickHouse)
driver = "mysql"
## Data source name
## The format of the data source name is different for each database driver.
## See the plugin readme for details.
data_source_name = "username:password@tcp(host:port)/dbname"
## Timestamp column name
timestamp_column = "timestamp"
## Table creation template
## Available template variables:
## {TABLE} - table name as a quoted identifier
## {TABLELITERAL} - table name as a quoted string literal
## {COLUMNS} - column definitions (list of quoted identifiers and types)
table_template = "CREATE TABLE {TABLE}({COLUMNS})"
## Table existence check template
## Available template variables:
## {TABLE} - tablename as a quoted identifier
table_exists_template = "SELECT 1 FROM {TABLE} LIMIT 1"
## Initialization SQL
init_sql = "SET sql_mode='ANSI_QUOTES';"
## Maximum amount of time a connection may be idle. "0s" means connections are
## never closed due to idle time.
connection_max_idle_time = "0s"
## Maximum amount of time a connection may be reused. "0s" means connections
## are never closed due to age.
connection_max_lifetime = "0s"
## Maximum number of connections in the idle connection pool. 0 means unlimited.
connection_max_idle = 2
## Maximum number of open connections to the database. 0 means unlimited.
connection_max_open = 0
## NOTE: Due to the way TOML is parsed, tables must be at the END of the
## plugin definition, otherwise additional config options are read as part of the
## table
## Metric type to SQL type conversion
## The values on the left are the data types Telegraf has and the values on
## the right are the data types Telegraf will use when sending to a database.
##
## The database values used must be data types the destination database
## understands. It is up to the user to ensure that the selected data type is
## available in the database they are using. Refer to your database
## documentation for what data types are available and supported.
#[outputs.sql.convert]
# integer = "INT"
# real = "DOUBLE"
# text = "TEXT"
# timestamp = "TIMESTAMP"
# defaultvalue = "TEXT"
# unsigned = "UNSIGNED"
# bool = "BOOL"
# ## This setting controls the behavior of the unsigned value. By default the
# ## setting will take the integer value and append the unsigned value to it. The other
# ## option is "literal", which will use the actual value the user provides to
# ## the unsigned option. This is useful for a database like ClickHouse where
# ## the unsigned value should use a value like "uint64".
# # conversion_style = "unsigned_suffix"
输入和输出集成示例
Amazon ECS
-
动态容器监控:使用 Amazon ECS 插件动态监控自动扩展 ECS 架构中的容器运行状况。随着新容器的启动或关闭,插件将自动调整其收集的指标,确保有效地捕获每个容器的性能数据,而无需手动配置。
-
自定义资源分配警报:实施 ECS 插件以建立每个容器的资源使用阈值。通过与通知系统集成,团队可以在容器的 CPU 或内存使用量超过预定义限制时收到警报,从而实现主动资源管理并保持应用程序性能。
-
成本优化仪表板:利用从 ECS 插件收集的指标创建仪表板,以可视化与每个容器关联的资源使用情况和成本。这种洞察力使组织能够识别未充分利用的资源,优化与其容器基础设施相关的成本,从而提高云运营的财务效率。
-
高级容器安全监控:结合安全工具使用此插件来监控 ECS 容器指标的异常情况。通过持续分析使用模式,可以检测到任何突然的峰值或异常行为,从而提示自动安全响应并维护系统完整性。
MySQL
-
实时 Web 分析存储:利用该插件捕获网站性能指标并将它们存储在 MySQL 中。此设置使团队能够监控用户交互、分析流量模式,并根据实时数据洞察动态调整站点功能。
-
物联网设备监控:利用该插件从物联网传感器网络收集指标并将它们记录到 MySQL 数据库中。此用例支持对设备运行状况和性能的持续监控,从而实现预测性维护和对异常情况的即时响应。
-
金融交易日志记录:记录具有精确时间戳的高频金融交易数据。这种方法支持强大的审计跟踪、实时欺诈检测以及全面的历史分析,以用于合规性和报告目的。
-
应用程序性能基准测试:将插件与应用程序性能监控系统集成,以将指标记录到 MySQL 中。这有助于随时间推移进行详细的基准测试和趋势分析,使组织能够识别性能瓶颈并有效地优化资源分配。
反馈
感谢您成为我们社区的一份子!如果您有任何一般反馈或在这些页面上发现任何错误,我们欢迎并鼓励您提出意见。请在 InfluxDB 社区 Slack 中提交您的反馈。
强大的性能,无限的扩展能力
收集、组织和处理海量高速数据。当您将任何数据视为时间序列数据时,它都更有价值。InfluxDB 是排名第一的时间序列平台,旨在与 Telegraf 一起扩展。
查看入门方法