目录
强大的性能,无限的扩展能力
收集、组织和处理海量高速数据。当您将任何数据视为时间序列数据时,它会更有价值。InfluxDB 是排名第一的时间序列平台,旨在通过 Telegraf 进行扩展。
查看入门方法
输入和输出集成概述
Amazon ECS 输入插件使 Telegraf 能够从 AWS ECS 容器收集指标,从而提供有关容器性能和资源利用率的详细见解。
此插件使用参数化 SQL INSERT 语句将指标从 Telegraf 直接写入 MariaDB,从而提供了一种将指标存储在结构化关系表中的灵活方式。
集成详情
Amazon ECS
Telegraf 的 Amazon ECS 插件旨在从 AWS Fargate 或 EC2 实例上运行的 ECS(弹性容器服务)任务中收集指标。通过利用 ECS 元数据和统计 API 端点(v2 和 v3),它可以获取有关任务中容器性能和运行状况的实时信息。此插件在与检查的工作负载相同的任务中运行,确保无缝访问元数据和统计信息。值得注意的是,它融入了 ECS 特有的功能,这些功能使其与 Docker 输入插件区分开来,例如处理独特的 ECS 元数据格式和统计信息。用户可以包含或排除特定容器,并调整要监控的容器状态,以及为 ECS 标签定义标签选项。这种灵活性允许定制监控体验,使其与 ECS 环境的特定需求保持一致,从而增强对容器化应用程序的可观察性和控制。
MariaDB
Telegraf 中的 SQL 输出插件通过执行参数化 SQL 语句,能够将指标直接写入 SQL 兼容数据库(如 MariaDB)。凭借对 MySQL 驱动程序的支持,该插件与 MariaDB 无缝集成,可实现可靠的结构化指标存储。对于喜欢基于 SQL 的分析或想要将指标与业务数据一起存储以进行统一查询的用户来说,此设置非常理想。MariaDB 是 MySQL 的社区开发的、企业级的派生版本,强调性能、安全性和开放性。该插件支持将时间序列指标插入自定义架构,从而实现灵活的分析以及与使用 SQL 连接器的 BI 工具(如 Metabase 或 Grafana)的集成。
配置
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"
MariaDB
[[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})"
## SQL INSERT statement with placeholders. Telegraf will substitute values at runtime.
## table_template = "INSERT INTO metrics (timestamp, name, value, tags) VALUES (?, ?, ?, ?)"
## 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 容器指标中的异常情况。通过持续分析使用模式,可以检测到任何突然的峰值或不规则行为,从而提示自动安全响应并维护系统完整性。
MariaDB
-
商业智能集成:将应用程序性能指标直接存储到 MariaDB 中,并将其连接到 BI 工具(如 Metabase 或 Apache Superset)。此设置允许将运营数据与业务 KPI 混合,以实现统一的仪表板,从而提高跨部门的可见性。
-
具有历史指标的合规性报告:使用此插件将指标记录到 MariaDB 中,以用于审计和合规性用例。关系模型支持使用时间戳条目精确查询过去的绩效指标,从而支持监管文档。
-
基于 SQL 逻辑的自定义警报:将指标插入 MariaDB,并使用自定义 SQL 查询来定义警报阈值或条件。与 cron 作业或计划脚本相结合,这实现了传统指标平台无法实现的高级警报工作流程。
-
物联网传感器指标存储:通过 Telegraf 从物联网设备收集传感器数据,并使用规范化架构将其存储在 MariaDB 中。这种方法具有成本效益,并且可以很好地与现有的基于 SQL 的系统集成,以进行实时或历史分析。
反馈
感谢您成为我们社区的一份子!如果您有任何一般性反馈或在这些页面上发现任何错误,我们欢迎并鼓励您提出意见。请在 InfluxDB 社区 Slack 中提交您的反馈。
强大的性能,无限的扩展能力
收集、组织和处理海量高速数据。当您将任何数据视为时间序列数据时,它会更有价值。InfluxDB 是排名第一的时间序列平台,旨在通过 Telegraf 进行扩展。
查看入门方法