目录
强大的性能,无限的扩展能力
收集、组织和处理海量高速数据。 当您将任何数据视为时间序列数据时,它都更有价值。 借助 InfluxDB,第一的时间序列平台,旨在与 Telegraf 一起扩展。
查看入门方法
输入和输出集成概述
Jenkins 插件通过其 API 从 Jenkins 实例收集有关作业和节点的重要信息,从而促进全面的监控和分析。
Loki 插件允许用户将日志发送到 Loki 以进行聚合和查询,从而利用 Loki 高效的存储能力。
集成详情
Jenkins
Jenkins Telegraf 插件允许用户从 Jenkins 实例收集指标,而无需在 Jenkins 本身安装任何额外的插件。 通过利用 Jenkins API,该插件检索有关 Jenkins 环境中运行的节点和作业的信息。 这种集成提供了 Jenkins 基础设施的全面概览,包括可用于监控和分析的实时指标。 主要功能包括用于作业和节点选择的可配置过滤器、可选的 TLS 安全设置以及有效管理请求超时和连接限制的能力。 这使其成为依赖 Jenkins 进行持续集成和交付的团队的重要工具,确保他们拥有保持最佳性能和可靠性所需的洞察力。
Loki
此 Loki 插件与 Grafana Loki 集成,Grafana Loki 是一个强大的日志聚合系统。 通过以与 Loki 兼容的格式发送日志,此插件可以高效地存储和查询日志。 每个日志条目都以键值格式结构化,其中键表示字段名称,值表示相应的日志信息。 通过时间戳对日志进行排序可确保日志流在通过 Loki 查询时保持时间顺序。 此插件对密钥的支持使其更容易安全地管理身份验证参数,而 HTTP 标头、gzip 编码和 TLS 配置的选项增强了日志传输的适应性和安全性,从而满足各种部署需求。
配置
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
Loki
[[outputs.loki]]
## The domain of Loki
domain = "https://loki.domain.tld"
## Endpoint to write api
# endpoint = "/loki/api/v1/push"
## Connection timeout, defaults to "5s" if not set.
# timeout = "5s"
## Basic auth credential
# username = "loki"
# password = "pass"
## Additional HTTP headers
# http_headers = {"X-Scope-OrgID" = "1"}
## If the request must be gzip encoded
# gzip_request = false
## Optional TLS Config
# tls_ca = "/etc/telegraf/ca.pem"
# tls_cert = "/etc/telegraf/cert.pem"
# tls_key = "/etc/telegraf/key.pem"
## Sanitize Tag Names
## If true, all tag names will have invalid characters replaced with
## underscores that do not match the regex: ^[a-zA-Z_:][a-zA-Z0-9_:]*.
# sanitize_label_names = false
## Metric Name Label
## Label to use for the metric name to when sending metrics. If set to an
## empty string, this will not add the label. This is NOT suggested as there
## is no way to differentiate between multiple metrics.
# metric_name_label = "__name"
输入和输出集成示例
Jenkins
-
持续集成监控:使用 Jenkins 插件通过收集作业持续时间和失败率的指标来监控持续集成管道的性能。 这可以帮助团队识别管道中的瓶颈并提高整体构建效率。
-
资源分配分析:利用 Jenkins 节点指标来评估不同代理之间的资源使用情况。 通过了解资源的分配方式,团队可以优化其 Jenkins 架构,从而有可能重新分配代理或调整作业配置以获得更好的性能。
-
作业执行趋势:分析历史作业性能指标,以识别作业执行随时间变化的趋势。 通过这些数据,团队可以在潜在问题扩大之前主动解决,并根据需要调整作业或其配置。
-
作业失败警报:实施利用 Jenkins 作业指标的警报,以便在作业失败时通知团队成员。 这种主动方法可以提高运营意识并加快对失败的响应时间,确保有效监控关键作业。
Loki
-
微服务的集中日志记录:利用 Loki 插件从 Kubernetes 集群中运行的多个微服务收集日志。 通过将日志定向到集中的 Loki 实例,开发人员可以在一个位置监控、搜索和分析来自所有服务的日志,从而更轻松地进行故障排除和性能监控。 这种设置简化了操作,并支持对分布式应用程序中问题的快速响应。
-
实时日志异常检测:将 Loki 与监控工具结合使用,以实时分析日志输出中可能表明系统错误或安全威胁的异常模式。 在日志流上实施异常检测使团队能够主动识别和响应事件,从而提高系统可靠性和增强安全态势。
-
使用 Gzip 压缩增强日志处理:配置 Loki 插件以利用 gzip 压缩进行日志传输。 这种方法可以减少带宽使用并提高传输速度,这在网络带宽可能受到限制的环境中尤其有利。 它对于高容量日志记录应用程序特别有用,在这些应用程序中,每个字节都很重要并且性能至关重要。
-
使用自定义标头进行多租户支持:利用添加自定义 HTTP 标头的功能来隔离多租户应用程序环境中来自不同租户的日志。 通过使用 Loki 插件为每个租户发送不同的标头,运营商可以确保正确的日志管理并符合数据隔离要求,使其成为 SaaS 应用程序的通用解决方案。
反馈
感谢您成为我们社区的一份子! 如果您有任何一般反馈或在这些页面上发现任何错误,我们欢迎并鼓励您提出意见。 请在 InfluxDB 社区 Slack 中提交您的反馈。
强大的性能,无限的扩展能力
收集、组织和处理海量高速数据。 当您将任何数据视为时间序列数据时,它都更有价值。 借助 InfluxDB,第一的时间序列平台,旨在与 Telegraf 一起扩展。
查看入门方法