目录
输入和输出集成概述
Jenkins 插件通过其 API 从 Jenkins 实例收集关于作业和节点的关键信息,从而促进全面的监控和分析。
OpenTSDB 插件促进了 Telegraf 与 OpenTSDB 的集成,允许用户无缝地将时序指标推送到 OpenTSDB 后端。
集成详情
Jenkins
Jenkins Telegraf 插件允许用户从 Jenkins 实例收集指标,而无需在 Jenkins 本身安装任何额外的插件。通过利用 Jenkins API,该插件检索有关 Jenkins 环境中运行的节点和作业的信息。这种集成提供了 Jenkins 基础设施的全面概览,包括可用于监控和分析的实时指标。主要功能包括用于作业和节点选择的可配置过滤器、可选的 TLS 安全设置以及有效管理请求超时和连接限制的能力。这使其成为依赖 Jenkins 进行持续集成和交付的团队的重要工具,确保他们拥有保持最佳性能和可靠性所需的洞察力。
OpenTSDB
OpenTSDB 插件旨在通过 telnet 或 HTTP 模式将指标发送到 OpenTSDB 实例。随着 OpenTSDB 2.0 的推出,推荐的指标发送方法是通过 HTTP API,它允许通过配置 ‘http_batch_size’ 来批量处理指标。该插件支持多个配置选项,包括指标前缀、服务器主机和端口规范、用于反向代理的 URI 路径自定义以及用于诊断与 OpenTSDB 通信问题的调试选项。此插件在生成时序数据并且需要将其高效存储在像 OpenTSDB 这样的可扩展时序数据库中的场景中尤其有用,使其适用于广泛的监控和分析应用。
配置
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
OpenTSDB
[[outputs.opentsdb]]
## prefix for metrics keys
prefix = "my.specific.prefix."
## DNS name of the OpenTSDB server
## Using "opentsdb.example.com" or "tcp://opentsdb.example.com" will use the
## telnet API. "http://opentsdb.example.com" will use the Http API.
host = "opentsdb.example.com"
## Port of the OpenTSDB server
port = 4242
## Number of data points to send to OpenTSDB in Http requests.
## Not used with telnet API.
http_batch_size = 50
## URI Path for Http requests to OpenTSDB.
## Used in cases where OpenTSDB is located behind a reverse proxy.
http_path = "/api/put"
## Debug true - Prints OpenTSDB communication
debug = false
## Separator separates measurement name from field
separator = "_"
输入和输出集成示例
Jenkins
-
持续集成监控:使用 Jenkins 插件通过收集作业持续时间和失败率的指标来监控持续集成管道的性能。这可以帮助团队识别管道中的瓶颈并提高整体构建效率。
-
资源分配分析:利用 Jenkins 节点指标来评估不同代理之间的资源使用情况。通过了解资源的分配方式,团队可以优化其 Jenkins 架构,可能重新分配代理或调整作业配置以获得更好的性能。
-
作业执行趋势:分析历史作业性能指标以识别作业执行随时间变化的趋势。通过这些数据,团队可以在潜在问题扩大之前主动解决,根据需要对作业或其配置进行调整。
-
作业失败警报:实施利用 Jenkins 作业指标的警报,以便在作业失败时通知团队成员。这种主动方法可以增强操作意识并加快对失败的响应时间,确保有效监控关键作业。
OpenTSDB
-
实时基础设施监控:利用 OpenTSDB 插件来收集和存储来自各种基础设施组件的指标。通过配置插件将指标推送到 OpenTSDB,组织可以获得其基础设施健康状况和随时间变化的性能的集中视图。
-
自定义应用程序指标跟踪:将 OpenTSDB 插件集成到自定义应用程序中,以跟踪关键性能指标 (KPI),例如响应时间、错误率和用户交互。这种设置允许开发人员和产品团队可视化应用程序性能趋势并做出数据驱动的决策。
-
自动化异常检测:结合机器学习算法利用该插件来自动检测发送到 OpenTSDB 的时序数据中的异常。通过持续监控传入的指标,系统可以训练模型,在潜在问题影响应用程序性能之前向用户发出警报。
-
历史数据分析:使用 OpenTSDB 插件存储和分析历史性能数据,用于容量规划和趋势分析。这提供了对系统行为随时间变化的宝贵洞察,帮助团队了解使用模式并为未来增长做好准备。
反馈
感谢您成为我们社区的一份子!如果您有任何一般性反馈或在这些页面上发现了任何错误,我们欢迎并鼓励您提出意见。请在 InfluxDB 社区 Slack 中提交您的反馈。