目录
输入和输出集成概述
此插件使用 XML-RPC API 收集有关在 Supervisor 下运行的进程的信息。
Telegraf 的 SQL 插件有助于将指标存储在 SQL 数据库中。当配置为 Microsoft SQL Server 时,它支持特定的 DSN 格式和架构要求,从而实现与 SQL Server 的无缝集成。
集成详细信息
Supervisor
Telegraf 的 Supervisor 插件旨在通过其 XML-RPC API 收集有关 Supervisor 进程控制系统管理的进程的指标。该插件能够跟踪各种指标,包括进程状态和正常运行时间,并提供通过包含或排除列表配置要收集的指标的选项。此集成对于监控在 Supervisor 下运行的应用程序特别有用,可深入了解其运行状态和性能指标。最低测试 Supervisor 版本为 3.3.2,建议使用基本身份验证保护 HTTP 服务器以提高安全性。
Microsoft SQL Server
Telegraf 针对 Microsoft SQL Server 的 SQL 输出插件旨在通过动态创建与传入数据结构匹配的表和列来捕获和存储指标数据。此集成利用 go-mssqldb 驱动程序,该驱动程序通过包含服务器、端口和数据库详细信息的 DSN 遵循 SQL Server 连接协议。尽管该驱动程序由于单元测试有限而被认为是实验性的,但它为动态架构生成和数据插入提供了强大的支持,从而可以详细记录系统性能的时间戳记录。这种灵活性使其成为需要可靠且精细的指标日志记录的环境的宝贵工具,尽管其处于实验性状态。
配置
Supervisor
[[inputs.supervisor]]
## Url of supervisor's XML-RPC endpoint if basic auth enabled in supervisor http server,
## than you have to add credentials to url (ex. http://login:pass@localhost:9001/RPC2)
# url="http://localhost:9001/RPC2"
## With settings below you can manage gathering additional information about processes
## If both of them empty, then all additional information will be collected.
## Currently supported supported additional metrics are: pid, rc
# metrics_include = []
# metrics_exclude = ["pid", "rc"]
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"
输入和输出集成示例
Supervisor
-
集中式监控仪表板:实施此插件以将 Supervisor 指标直接馈送到集中式监控仪表板,使团队能够实时可视化其应用程序的运行状况和性能。此集成能够快速识别问题,帮助跟踪随时间推移的服务性能,并有助于根据观察到的趋势进行容量规划。
-
进程故障警报:利用 Supervisor 插件收集的指标来创建警报机制,以便在关键进程关闭或进入致命状态时通知工程师。通过在您的监控系统中设置阈值,团队可以主动响应潜在问题,最大限度地减少停机时间并确保系统可靠性。
-
进程状态的历史分析:存储随时间收集的指标,以分析进程状态变化和模式。通过检查历史数据,团队可以识别重复出现的问题,跟踪部署更改的影响,并根据进程趋势优化资源分配,从而提高整体系统性能。
-
与事件管理系统集成:配置 Supervisor 插件以在进程达到临界状态时自动向 PagerDuty 或 OpsGenie 等事件管理系统发送警报。此集成简化了事件响应流程,确保及时通知正确的团队成员,并可以立即采取行动。
Microsoft SQL Server
-
企业应用程序监控:利用该插件捕获在 SQL Server 上运行的企业应用程序的详细性能指标。此设置允许 IT 团队分析系统性能、跟踪事务处理时间并识别复杂的多层环境中的瓶颈。
-
动态基础设施审计:部署该插件以在 SQL Server 中创建基础设施更改和性能指标的动态审计日志。此用例非常适合需要实时监控和系统性能历史分析以进行合规性和优化的组织。
-
自动化性能基准测试:使用该插件持续记录和分析 SQL Server 数据库的性能指标。这实现了自动化基准测试,其中将历史数据与当前性能进行比较,有助于快速识别服务中的异常或降级。
-
集成 DevOps 仪表板:将该插件与 DevOps 监控工具集成,以将来自 SQL Server 的实时指标馈送到集中式仪表板。这提供了应用程序运行状况的整体视图,使团队能够将 SQL Server 性能与应用程序级事件相关联,从而实现更快的故障排除和主动维护。
反馈
感谢您成为我们社区的一份子!如果您有任何一般性反馈或在这些页面上发现了任何错误,我们欢迎并鼓励您提出意见。请在 InfluxDB 社区 Slack 中提交您的反馈。