目录
输入和输出集成概述
Jenkins 插件通过其 API 从 Jenkins 实例收集有关作业和节点的关键信息,从而促进全面的监控和分析。
Telegraf 的 SQL 插件有助于将指标存储在 SQL 数据库中。 当配置为 Microsoft SQL Server 时,它支持特定的 DSN 格式和架构要求,从而可以与 SQL Server 无缝集成。
集成详情
Jenkins
Jenkins Telegraf 插件允许用户从 Jenkins 实例收集指标,而无需在 Jenkins 本身安装任何额外的插件。 通过利用 Jenkins API,该插件检索有关 Jenkins 环境中运行的节点和作业的信息。 这种集成提供了 Jenkins 基础设施的全面概述,包括可用于监控和分析的实时指标。 主要功能包括用于作业和节点选择的可配置过滤器、可选的 TLS 安全设置以及有效管理请求超时和连接限制的能力。 这使其成为依赖 Jenkins 进行持续集成和交付的团队的必备工具,确保他们拥有维护最佳性能和可靠性所需的洞察力。
Microsoft SQL Server
Telegraf 的 Microsoft SQL Server SQL 输出插件旨在通过动态创建与传入数据结构匹配的表和列来捕获和存储指标数据。 此集成利用 go-mssqldb 驱动程序,该驱动程序通过包含服务器、端口和数据库详细信息的 DSN 遵循 SQL Server 连接协议。 尽管该驱动程序由于单元测试有限而被认为是实验性的,但它为动态模式生成和数据插入提供了强大的支持,从而可以详细记录系统性能的时间戳记录。 尽管其处于实验性状态,但这种灵活性使其成为需要可靠且精细的指标记录的环境的宝贵工具。
配置
Jenkins
[[inputs.jenkins]]
## The Jenkins URL in the format "schema://host:port"
url = "http://my-jenkins-instance:8080"
# username = "admin"
# password = "admin"
## Set response_timeout
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 SSL but skip chain & host verification
# insecure_skip_verify = false
## Optional Max Job Build Age filter
## Default 1 hour, ignore builds older than max_build_age
# max_build_age = "1h"
## Optional Sub Job Depth filter
## Jenkins can have unlimited layer of sub jobs
## This config will limit the layers of pulling, default value 0 means
## unlimited pulling until no more sub jobs
# max_subjob_depth = 0
## Optional Sub Job Per Layer
## In workflow-multibranch-plugin, each branch will be created as a sub job.
## This config will limit to call only the lasted branches in each layer,
## empty will use default value 10
# max_subjob_per_layer = 10
## Jobs to include or exclude from gathering
## When using both lists, job_exclude has priority.
## Wildcards are supported: [ "jobA/*", "jobB/subjob1/*"]
# job_include = [ "*" ]
# job_exclude = [ ]
## Nodes to include or exclude from gathering
## When using both lists, node_exclude has priority.
# node_include = [ "*" ]
# node_exclude = [ ]
## Worker pool for jenkins plugin only
## Empty this field will use default value 5
# max_connections = 5
## When set to true will add node labels as a comma-separated tag. If none,
## are found, then a tag with the value of 'none' is used. Finally, if a
## label contains a comma it is replaced with an underscore.
# node_labels_as_tag = 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"
输入和输出集成示例
Jenkins
-
持续集成监控:使用 Jenkins 插件通过收集作业持续时间和失败率的指标来监控持续集成管道的性能。 这可以帮助团队识别管道中的瓶颈并提高整体构建效率。
-
资源分配分析:利用 Jenkins 节点指标来评估不同代理之间的资源使用情况。 通过了解资源的分配方式,团队可以优化其 Jenkins 架构,可能重新分配代理或调整作业配置以获得更好的性能。
-
作业执行趋势:分析历史作业性能指标以识别作业执行随时间变化的趋势。 有了这些数据,团队可以在潜在问题扩大之前主动解决,并根据需要调整作业或其配置。
-
作业失败警报:实施利用 Jenkins 作业指标的警报,以便在作业失败时通知团队成员。 这种主动方法可以提高操作意识并加快对失败的响应时间,从而确保有效监控关键作业。
Microsoft SQL Server
-
企业应用程序监控:利用该插件捕获在 SQL Server 上运行的企业应用程序的详细性能指标。 此设置允许 IT 团队分析系统性能、跟踪事务时间并识别复杂的多层环境中的瓶颈。
-
动态基础设施审计:部署该插件以在 SQL Server 中创建基础设施变更和性能指标的动态审计日志。 此用例非常适合需要实时监控和系统性能历史分析以实现合规性和优化的组织。
-
自动化性能基准测试:使用该插件持续记录和分析 SQL Server 数据库的性能指标。 这实现了自动化基准测试,其中将历史数据与当前性能进行比较,从而有助于快速识别异常或服务降级。
-
集成 DevOps 仪表板:将该插件与 DevOps 监控工具集成,以将 SQL Server 的实时指标馈送到集中式仪表板中。 这提供了应用程序运行状况的整体视图,使团队可以将 SQL Server 性能与应用程序级事件相关联,从而实现更快的故障排除和主动维护。
反馈
感谢您成为我们社区的一份子! 如果您有任何一般性反馈或在这些页面上发现了任何错误,我们欢迎并鼓励您提出意见。 请在 InfluxDB 社区 Slack 中提交您的反馈。