目录
强大的性能,无限的扩展能力
收集、组织和处理海量高速数据。 当您将任何数据视为时间序列数据时,它会更有价值。 借助 InfluxDB,排名第一的时间序列平台,旨在与 Telegraf 一起扩展。
查看入门方法
输入和输出集成概述
此插件与 Apache HTTP 服务器的 mod_status 接口连接,以收集和报告服务器的性能指标。
Telegraf 的 SQL 插件有助于将指标存储在 SQL 数据库中。 当配置为 Microsoft SQL Server 时,它支持特定的 DSN 格式和架构要求,从而允许与 SQL Server 无缝集成。
集成详情
Apache
Apache 插件使用 Apache HTTP 服务器的 mod_status 模块收集服务器性能信息。 它依赖于 mod_status 功能,该功能必须在 Apache 配置中显式启用才能访问机器可读的状态页面。 此插件允许用户获取多个与 Apache 运行性能相关的指标,包括工作进程状态、连接统计信息和服务器负载,从而有助于实时有效地监控和排除 Web 服务器性能故障。
Microsoft SQL Server
Telegraf 针对 Microsoft SQL Server 的 SQL 输出插件旨在通过动态创建与传入数据结构匹配的表和列来捕获和存储指标数据。 此集成利用 go-mssqldb 驱动程序,该驱动程序通过包含服务器、端口和数据库详细信息的 DSN 遵循 SQL Server 连接协议。 尽管由于单元测试有限,该驱动程序被认为是实验性的,但它为动态架构生成和数据插入提供了强大的支持,从而可以详细记录系统性能的时间戳记录。 尽管其状态为实验性,但这种灵活性使其成为需要可靠且精细的指标日志记录环境的宝贵工具。
配置
Apache
[[inputs.apache]]
## An array of URLs to gather from, must be directed at the machine
## readable version of the mod_status page including the auto query string.
## Default is "http://localhost/server-status?auto".
urls = ["http://localhost/server-status?auto"]
## Credentials for basic HTTP authentication.
# username = "myuser"
# password = "mypassword"
## Maximum time to receive response.
# response_timeout = "5s"
## 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
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"
输入和输出集成示例
Apache
-
实时性能监控:使用 Apache 输入插件设置实时仪表板,显示 Apache 服务器的关键性能指标。 通过可视化 BusyWorkers 和负载平均值等指标,您可以快速识别性能瓶颈和服务器运行状况问题,从而帮助主动管理 Web 流量负载。
-
服务器问题自动警报:实施基于此插件收集的指标的警报,以便在性能下降时通知管理员。 例如,如果
BusyWorkers
指标超过特定阈值,则可以触发自动警报,确保及时响应事件,以维护正常运行时间和服务的可靠性。 -
历史性能分析:将 Apache 插件收集的数据与长期存储解决方案相结合,以跟踪一段时间内的性能趋势。 累积的数据有助于了解使用模式、预测资源需求,并做出有关服务器扩展或优化的明智决策。
-
跨系统监控:使用 Telegraf 将从 Apache 收集的指标与来自 Web 堆栈其他组件的指标集成,以将数据发送到集中式监控解决方案。 这种整体视图可以简化不同技术之间的故障排除和协调,从而确保整个系统的最佳性能。
Microsoft SQL Server
-
企业应用程序监控:利用该插件捕获从 SQL Server 上运行的企业应用程序的详细性能指标。 此设置允许 IT 团队分析系统性能、跟踪事务时间并识别复杂的多层环境中的瓶颈。
-
动态基础设施审计:部署该插件以在 SQL Server 中创建基础设施更改和性能指标的动态审计日志。 此用例非常适合需要实时监控和系统性能历史分析以进行合规性和优化的组织。
-
自动性能基准测试:使用该插件持续记录和分析 SQL Server 数据库的性能指标。 这实现了自动基准测试,将历史数据与当前性能进行比较,从而帮助快速识别服务中的异常或降级。
-
集成 DevOps 仪表板:将该插件与 DevOps 监控工具集成,以将来自 SQL Server 的实时指标馈送到集中式仪表板中。 这提供了应用程序运行状况的整体视图,使团队能够将 SQL Server 性能与应用程序级别的事件相关联,从而实现更快的故障排除和主动维护。
反馈
感谢您成为我们社区的一份子! 如果您有任何一般性反馈或在这些页面上发现了任何错误,我们欢迎并鼓励您提出意见。 请在 InfluxDB 社区 Slack 中提交您的反馈。
强大的性能,无限的扩展能力
收集、组织和处理海量高速数据。 当您将任何数据视为时间序列数据时,它会更有价值。 借助 InfluxDB,排名第一的时间序列平台,旨在与 Telegraf 一起扩展。
查看入门方法