目录
强大的性能,无限的扩展能力
收集、组织和处理海量高速数据。 当您将任何数据视为时间序列数据时,它都更有价值。 借助 InfluxDB,第一的时间序列平台,旨在与 Telegraf 一起扩展。
查看入门方法
输入和输出集成概述
Telegraf 的 Nginx 插件旨在收集来自 Nginx Web 服务器的状态指标,从而提供对服务器运行指标的实时洞察。
Telegraf 的 SQL 插件有助于将指标存储在 SQL 数据库中。 当配置为 Microsoft SQL Server 时,它支持特定的 DSN 格式和架构要求,从而可以与 SQL Server 无缝集成。
集成详情
Nginx
此插件从 Nginx 收集状态指标。 它利用 ngx_http_stub_status_module 收集与服务器性能相关的基本指标。 该插件提供了对活动连接、处理的请求以及各种指标当前状态的宝贵洞察。 此实时数据对于监控 Web 服务器性能和确保最佳运行至关重要。 该配置允许用户指定 Nginx 状态端点的 URL、设置超时以及在必要时配置 TLS 设置。
Microsoft SQL Server
Telegraf 的 Microsoft SQL Server SQL 输出插件旨在通过动态创建与传入数据结构匹配的表和列来捕获和存储指标数据。 此集成利用 go-mssqldb 驱动程序,该驱动程序通过包含服务器、端口和数据库详细信息的 DSN 遵循 SQL Server 连接协议。 尽管由于单元测试有限,该驱动程序被认为是实验性的,但它为动态架构生成和数据插入提供了强大的支持,从而能够详细记录系统性能的时间戳记录。 尽管其状态为实验性,但这种灵活性使其成为需要可靠和精细指标记录的环境的宝贵工具。
配置
Nginx
[[inputs.nginx]]
## An array of Nginx stub_status URI to gather stats.
urls = ["http://localhost/server_status"]
## Optional TLS Config
# tls_ca = "/etc/telegraf/ca.pem"
# tls_cert = "/etc/telegraf/cert.pem"
# tls_key = "/etc/telegraf/key.pem"
## Use TLS but skip chain & host verification
# insecure_skip_verify = false
## HTTP response timeout (default: 5s)
response_timeout = "5s"
Microsoft SQL Server
[[outputs.sql]]
## Database driver
## Valid options: mssql (Microsoft SQL Server), mysql (MySQL), pgx (Postgres),
## sqlite (SQLite3), snowflake (snowflake.com), clickhouse (ClickHouse)
driver = "mssql"
## Data source name
## For Microsoft SQL Server, the DSN typically includes the server, port, username, password, and database name.
## Example DSN: "sqlserver://username:password@localhost:1433?database=telegraf"
data_source_name = "sqlserver://username:password@localhost:1433?database=telegraf"
## 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} - table name as a quoted identifier
table_exists_template = "SELECT 1 FROM {TABLE} LIMIT 1"
## Initialization SQL (optional)
init_sql = ""
## 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
## Metric type to SQL type conversion
## You can customize the mapping if needed.
#[outputs.sql.convert]
# integer = "INT"
# real = "DOUBLE"
# text = "TEXT"
# timestamp = "TIMESTAMP"
# defaultvalue = "TEXT"
# unsigned = "UNSIGNED"
# bool = "BOOL"
输入和输出集成示例
Nginx
-
Web 性能监控:使用 Nginx 插件从基础设施中的各种 Nginx 服务器收集性能指标。 通过在实时仪表板中可视化这些指标,团队可以跟踪性能趋势、识别瓶颈并增强 Web 应用程序的用户体验。 实施此类监控使企业能够在其影响最终用户之前主动解决性能问题。
-
负载均衡器监控:将此插件与您的负载均衡器集成,以跟踪后端 Nginx 服务器的性能。 通过收集“活动连接”和“处理的请求”等统计信息,您的运营团队可以确保流量以最佳方式流动,并且没有单个服务器不堪重负。 这种主动的负载均衡方法可防止服务停机并增强用户体验。
-
自动化警报系统:将 Nginx 插件与警报服务结合使用,以便在服务器指标超出预定义阈值时自动通知您的团队。 例如,如果活动连接数过高,系统可以触发警报,以便立即采取纠正措施,从而保持服务质量和可靠性。
-
历史数据分析:将 Nginx 插件收集的指标存储在时间序列数据库中,以分析历史性能趋势。 此分析可以揭示高流量或性能不佳的时期,从而可以根据数据驱动的决策来扩展和优化基础设施。 通过了解过去的趋势,组织可以更好地为未来的需求做好准备。
Microsoft SQL Server
-
企业应用程序监控:利用该插件捕获在 SQL Server 上运行的企业应用程序的详细性能指标。 此设置允许 IT 团队分析系统性能、跟踪事务时间并识别复杂、多层环境中的瓶颈。
-
动态基础设施审计:部署该插件以在 SQL Server 中创建基础设施变更和性能指标的动态审计日志。 此用例非常适合需要实时监控和历史分析系统性能以实现合规性和优化的组织。
-
自动化性能基准测试:使用该插件持续记录和分析 SQL Server 数据库的性能指标。 这实现了自动化基准测试,将历史数据与当前性能进行比较,有助于快速识别服务中的异常或降级。
-
集成 DevOps 仪表板:将该插件与 DevOps 监控工具集成,以将来自 SQL Server 的实时指标馈送到集中式仪表板中。 这提供了应用程序健康状况的整体视图,使团队能够将 SQL Server 性能与应用程序级事件相关联,从而实现更快的故障排除和主动维护。
反馈
感谢您成为我们社区的一份子! 如果您有任何一般性反馈或在这些页面上发现了任何错误,我们欢迎并鼓励您提出意见。 请在 InfluxDB 社区 Slack 中提交您的反馈。
强大的性能,无限的扩展能力
收集、组织和处理海量高速数据。 当您将任何数据视为时间序列数据时,它都更有价值。 借助 InfluxDB,第一的时间序列平台,旨在与 Telegraf 一起扩展。
查看入门方法