Varnish 输入插件
此插件使用 varnishstat 命令从本地 Varnish HTTP Cache 实例收集统计信息。
此插件要求 varnishstat 可执行文件已安装在系统上,并且 Telegraf 可以执行它。此外,该插件需要 Varnish v6.0.2+。
引入于: Telegraf v0.13.1 标签: server, web 操作系统支持: freebsd, linux, macos
全局配置选项
插件支持其他全局和插件配置设置,用于修改指标、标签和字段,创建别名以及配置插件顺序等任务。更多详情请参阅 CONFIGURATION.md。
配置
# A plugin to collect stats from Varnish HTTP Cache
# This plugin ONLY supports non-Windows
[[inputs.varnish]]
## If running as a restricted user you can prepend sudo for additional access:
#use_sudo = false
## The default location of the varnishstat binary can be overridden with:
binary = "/usr/bin/varnishstat"
## Additional custom arguments for the varnishstat command
# binary_args = ["-f", "MAIN.*"]
## The default location of the varnishadm binary can be overridden with:
adm_binary = "/usr/bin/varnishadm"
## Custom arguments for the varnishadm command
# adm_binary_args = [""]
## Metric version defaults to metric_version=1, use metric_version=2 for removal of nonactive vcls
## Varnish 6.0.2 and newer is required for metric_version=2.
metric_version = 1
## Additional regexps to override builtin conversion of varnish metrics into telegraf metrics.
## Regexp group "_vcl" is used for extracting the VCL name. Metrics that contain nonactive VCL's are skipped.
## Regexp group "_field" overrides the field name. Other named regexp groups are used as tags.
# regexps = ['^XCNT\.(?P<_vcl>[\w\-]*)(\.)*(?P<group>[\w\-.+]*)\.(?P<_field>[\w\-.+]*)\.val']
## By default, telegraf gather stats for 3 metric points.
## Setting stats will override the defaults shown below.
## Glob matching can be used, ie, stats = ["MAIN.*"]
## stats may also be set to ["*"], which will collect all stats
stats = ["MAIN.cache_hit", "MAIN.cache_miss", "MAIN.uptime"]
## Optional name for the varnish instance (or working directory) to query
## Usually append after -n in varnish cli
# instance_name = instanceName
## Timeout for varnishstat command
# timeout = "1s"权限
请注意,此插件会引用 varnishstat 和 varnishadm,它们可能需要额外的权限才能成功执行。根据运行此插件的 telegraf 用户的用户/组权限,您可能需要更改组成员身份、设置 facls 或使用 sudo。
组的成员身份 (推荐)
$ groups telegraf
telegraf : telegraf
$ usermod -a -G varnish telegraf
$ groups telegraf
telegraf : telegraf varnish扩展文件系统 ACL
$ getfacl /var/lib/varnish/<hostname>/_.vsm
# file: var/lib/varnish/<hostname>/_.vsm
# owner: root
# group: root
user::rw-
group::r--
other::---
$ setfacl -m u:telegraf:r /var/lib/varnish/<hostname>/_.vsm
$ getfacl /var/lib/varnish/<hostname>/_.vsm
# file: var/lib/varnish/<hostname>/_.vsm
# owner: root
# group: root
user::rw-
user:telegraf:r--
group::r--
mask::r--
other::---Sudo 权限
如果使用此方法,则需要在 telegraf 配置中添加以下内容
[[inputs.varnish]]
use_sudo = true您还需要更新您的 sudoers 文件
$ visudo
# Add the following line:
Cmnd_Alias VARNISHSTAT = /usr/bin/varnishstat
telegraf ALL=(ALL) NOPASSWD: VARNISHSTAT
Defaults!VARNISHSTAT !logfile, !syslog, !pam_session请使用您认为最合适的解决方案。
Metrics
版本 1
这是 varnish 提供的完整统计信息列表。统计信息将按其大写前缀(例如 MAIN、MEMPOOL 等)进行分组。在输出中,前缀将用作标签,并从字段名中移除。
- varnish
- MAIN.uptime (uint64, count, 子进程正常运行时间)
- MAIN.sess_conn (uint64, count, 已接受的会话)
- MAIN.sess_drop (uint64, count, 已拒绝的会话)
- MAIN.sess_fail (uint64, count, 会话接受失败)
- MAIN.sess_pipe_overflow (uint64, count, 会话管道溢出)
- MAIN.client_req_400 (uint64, count, 收到的客户端请求)
- MAIN.client_req_411 (uint64, count, 收到的客户端请求)
- MAIN.client_req_413 (uint64, count, 收到的客户端请求)
- MAIN.client_req_417 (uint64, count, 收到的客户端请求)
- MAIN.client_req (uint64, count, 有效的客户端请求)
- MAIN.cache_hit (uint64, count, 缓存命中)
- MAIN.cache_hitpass (uint64, count, 缓存命中,用于)
- MAIN.cache_miss (uint64, count, 缓存未命中)
- MAIN.backend_conn (uint64, count, 后端连接成功)
- MAIN.backend_unhealthy (uint64, count, 后端连接不健康)
- MAIN.backend_busy (uint64, count, 后端连接过忙)
- MAIN.backend_fail (uint64, count, 后端连接失败)
- MAIN.backend_reuse (uint64, count, 后端连接重用)
- MAIN.backend_toolate (uint64, count, 后端连接已过时)
- MAIN.backend_recycle (uint64, count, 后端连接回收)
- MAIN.backend_retry (uint64, count, 后端连接重试)
- MAIN.fetch_head (uint64, count, 获取头部,无主体)
- MAIN.fetch_length (uint64, count, 获取主体,带长度)
- MAIN.fetch_chunked (uint64, count, 获取主体,分块传输)
- MAIN.fetch_eof (uint64, count, 获取主体,EOF)
- MAIN.fetch_bad (uint64, count, 获取主体,T- E 错误)
- MAIN.fetch_close (uint64, count, 获取主体,请求关闭)
- MAIN.fetch_oldhttp (uint64, count, 获取主体,旧 HTTP 版本)
- MAIN.fetch_zero (uint64, count, 获取主体,零长度)
- MAIN.fetch_1xx (uint64, count, 获取头部,无主体)
- MAIN.fetch_204 (uint64, count, 获取头部,无主体)
- MAIN.fetch_304 (uint64, count, 获取头部,无主体)
- MAIN.fetch_failed (uint64, count, 获取失败(全部)
- MAIN.fetch_no_thread (uint64, count, 获取失败(无线程)
- MAIN.pools (uint64, count, 线程池数量)
- MAIN.threads (uint64, count, 总线程数)
- MAIN.threads_limited (uint64, count, 达到最大线程数)
- MAIN.threads_created (uint64, count, 创建的线程数)
- MAIN.threads_destroyed (uint64, count, 销毁的线程数)
- MAIN.threads_failed (uint64, count, 线程创建失败)
- MAIN.thread_queue_len (uint64, count, 会话队列长度)
- MAIN.busy_sleep (uint64, count, 请求休眠次数)
- MAIN.busy_wakeup (uint64, count, 请求唤醒次数)
- MAIN.sess_queued (uint64, count, 等待会话队列)
- MAIN.sess_dropped (uint64, count, 被拒绝的会话)
- MAIN.n_object (uint64, count, 创建的对象结构数)
- MAIN.n_vampireobject (uint64, count, 未恢复的对象数)
- MAIN.n_objectcore (uint64, count, 创建的 objectcore 结构数)
- MAIN.n_objecthead (uint64, count, 创建的 objecthead 结构数)
- MAIN.n_waitinglist (uint64, count, 创建的 waitinglist 结构数)
- MAIN.n_backend (uint64, count, 后端数量)
- MAIN.n_expired (uint64, count, 过期对象数量)
- MAIN.n_lru_nuked (uint64, count, LRU 淘汰数量)
- MAIN.n_lru_moved (uint64, count, LRU 移动数量)
- MAIN.losthdr (uint64, count, HTTP 头溢出)
- MAIN.s_sess (uint64, count, 总会话数)
- MAIN.s_req (uint64, count, 总请求数)
- MAIN.s_pipe (uint64, count, 总管道会话数)
- MAIN.s_pass (uint64, count, 总通过的请求数)
- MAIN.s_fetch (uint64, count, 总后端获取次数)
- MAIN.s_synth (uint64, count, 总合成响应数)
- MAIN.s_req_hdrbytes (uint64, count, 请求头字节数)
- MAIN.s_req_bodybytes (uint64, count, 请求体字节数)
- MAIN.s_resp_hdrbytes (uint64, count, 响应头字节数)
- MAIN.s_resp_bodybytes (uint64, count, 响应体字节数)
- MAIN.s_pipe_hdrbytes (uint64, count, 管道请求头字节数)
- MAIN.s_pipe_in (uint64, count, 管道流入字节数)
- MAIN.s_pipe_out (uint64, count, 管道流出字节数)
- MAIN.sess_closed (uint64, count, 已关闭的会话)
- MAIN.sess_pipeline (uint64, count, 会话管道)
- MAIN.sess_readahead (uint64, count, 会话预读)
- MAIN.sess_herd (uint64, count, 会话拥挤)
- MAIN.shm_records (uint64, count, SHM 记录数)
- MAIN.shm_writes (uint64, count, SHM 写入次数)
- MAIN.shm_flushes (uint64, count, SHM flush 原因)
- MAIN.shm_cont (uint64, count, SHM MTX 争用)
- MAIN.shm_cycles (uint64, count, SHM 周期性)
- MAIN.sms_nreq (uint64, count, SMS 分配器请求次数)
- MAIN.sms_nobj (uint64, count, SMS 待处理分配数)
- MAIN.sms_nbytes (uint64, count, SMS 待处理字节数)
- MAIN.sms_balloc (uint64, count, SMS 已分配字节数)
- MAIN.sms_bfree (uint64, count, SMS 已释放字节数)
- MAIN.backend_req (uint64, count, 已发起的后端请求数)
- MAIN.n_vcl (uint64, count, 已加载的 VCL 数量)
- MAIN.n_vcl_avail (uint64, count, 可用的 VCL 数量)
- MAIN.n_vcl_discard (uint64, count, 已丢弃的 VCL 数量)
- MAIN.bans (uint64, count, Ban 数量)
- MAIN.bans_completed (uint64, count, 已完成的 Ban 数量)
- MAIN.bans_obj (uint64, count, Ban 对象数量)
- MAIN.bans_req (uint64, count, Ban 请求数量)
- MAIN.bans_added (uint64, count, 添加的 Ban 数量)
- MAIN.bans_deleted (uint64, count, 删除的 Ban 数量)
- MAIN.bans_tested (uint64, count, 测试过的 Ban 数量)
- MAIN.bans_obj_killed (uint64, count, 被 Ban 杀死的对象数量)
- MAIN.bans_lurker_tested (uint64, count, Lurker 测试过的 Ban 数量)
- MAIN.bans_tests_tested (uint64, count, Ban 测试测试次数)
- MAIN.bans_lurker_tests_tested (uint64, count, Lurker Ban 测试测试次数)
- MAIN.bans_lurker_obj_killed (uint64, count, 被 Lurker Ban 杀死的对象数量)
- MAIN.bans_dups (uint64, count, 被 Ban 超越的 Ban 数量)
- MAIN.bans_lurker_contention (uint64, count, Lurker 让步次数)
- MAIN.bans_persisted_bytes (uint64, count, Ban 持久化使用的字节数)
- MAIN.bans_persisted_fragmentation (uint64, count, Ban 持久化碎片字节数)
- MAIN.n_purges (uint64, count, purge 操作数量)
- MAIN.n_obj_purged (uint64, count, 被 purge 的对象数量)
- MAIN.exp_mailed (uint64, count, 发送的对象的数量)
- MAIN.exp_received (uint64, count, 接收到的对象的数量)
- MAIN.hcb_nolock (uint64, count, 无锁 HCB 查找次数)
- MAIN.hcb_lock (uint64, count, 加锁 HCB 查找次数)
- MAIN.hcb_insert (uint64, count, HCB 插入次数)
- MAIN.esi_errors (uint64, count, ESI 解析错误次数)
- MAIN.esi_warnings (uint64, count, ESI 解析警告次数)
- MAIN.vmods (uint64, count, 已加载的 VMOD 数量)
- MAIN.n_gzip (uint64, count, Gzip 操作次数)
- MAIN.n_gunzip (uint64, count, Gunzip 操作次数)
- MAIN.vsm_free (uint64, count, 空闲 VSM 空间)
- MAIN.vsm_used (uint64, count, 使用的 VSM 空间)
- MAIN.vsm_cooling (uint64, count, 冷却中的 VSM 空间)
- MAIN.vsm_overflow (uint64, count, VSM 溢出空间)
- MAIN.vsm_overflowed (uint64, count, 已溢出的 VSM 空间)
- MGT.uptime (uint64, count, 管理进程正常运行时间)
- MGT.child_start (uint64, count, 子进程已启动)
- MGT.child_exit (uint64, count, 子进程正常退出)
- MGT.child_stop (uint64, count, 子进程意外停止)
- MGT.child_died (uint64, count, 子进程已终止)
- MGT.child_dump (uint64, count, 子进程 core dump)
- MGT.child_panic (uint64, count, 子进程 panic)
- MEMPOOL.vbc.live (uint64, count, 使用中)
- MEMPOOL.vbc.pool (uint64, count, 池中)
- MEMPOOL.vbc.sz_wanted (uint64, count, 请求大小)
- MEMPOOL.vbc.sz_needed (uint64, count, 分配大小)
- MEMPOOL.vbc.allocs (uint64, count, 分配次数)
- MEMPOOL.vbc.frees (uint64, count, 释放次数)
- MEMPOOL.vbc.recycle (uint64, count, 从池中回收次数)
- MEMPOOL.vbc.timeout (uint64, count, 超时次数)
- MEMPOOL.vbc.toosmall (uint64, count, 过小次数)
- MEMPOOL.vbc.surplus (uint64, count, 过多次数)
- MEMPOOL.vbc.randry (uint64, count, 池耗尽次数)
- MEMPOOL.busyobj.live (uint64, count, 使用中)
- MEMPOOL.busyobj.pool (uint64, count, 池中)
- MEMPOOL.busyobj.sz_wanted (uint64, count, 请求大小)
- MEMPOOL.busyobj.sz_needed (uint64, count, 分配大小)
- MEMPOOL.busyobj.allocs (uint64, count, 分配次数)
- MEMPOOL.busyobj.frees (uint64, count, 释放次数)
- MEMPOOL.busyobj.recycle (uint64, count, 从池中回收次数)
- MEMPOOL.busyobj.timeout (uint64, count, 超时次数)
- MEMPOOL.busyobj.toosmall (uint64, count, 过小次数)
- MEMPOOL.busyobj.surplus (uint64, count, 过多次数)
- MEMPOOL.busyobj.randry (uint64, count, 池耗尽次数)
- MEMPOOL.req0.live (uint64, count, 使用中)
- MEMPOOL.req0.pool (uint64, count, 池中)
- MEMPOOL.req0.sz_wanted (uint64, count, 请求大小)
- MEMPOOL.req0.sz_needed (uint64, count, 分配大小)
- MEMPOOL.req0.allocs (uint64, count, 分配次数)
- MEMPOOL.req0.frees (uint64, count, 释放次数)
- MEMPOOL.req0.recycle (uint64, count, 从池中回收次数)
- MEMPOOL.req0.timeout (uint64, count, 超时次数)
- MEMPOOL.req0.toosmall (uint64, count, 过小次数)
- MEMPOOL.req0.surplus (uint64, count, 过多次数)
- MEMPOOL.req0.randry (uint64, count, 池耗尽次数)
- MEMPOOL.sess0.live (uint64, count, 使用中)
- MEMPOOL.sess0.pool (uint64, count, 池中)
- MEMPOOL.sess0.sz_wanted (uint64, count, 请求大小)
- MEMPOOL.sess0.sz_needed (uint64, count, 分配大小)
- MEMPOOL.sess0.allocs (uint64, count, 分配次数)
- MEMPOOL.sess0.frees (uint64, count, 释放次数)
- MEMPOOL.sess0.recycle (uint64, count, 从池中回收次数)
- MEMPOOL.sess0.timeout (uint64, count, 超时次数)
- MEMPOOL.sess0.toosmall (uint64, count, 过小次数)
- MEMPOOL.sess0.surplus (uint64, count, 过多次数)
- MEMPOOL.sess0.randry (uint64, count, 池耗尽次数)
- MEMPOOL.req1.live (uint64, count, 使用中)
- MEMPOOL.req1.pool (uint64, count, 池中)
- MEMPOOL.req1.sz_wanted (uint64, count, 请求大小)
- MEMPOOL.req1.sz_needed (uint64, count, 分配大小)
- MEMPOOL.req1.allocs (uint64, count, 分配次数)
- MEMPOOL.req1.frees (uint64, count, 释放次数)
- MEMPOOL.req1.recycle (uint64, count, 从池中回收次数)
- MEMPOOL.req1.timeout (uint64, count, 超时次数)
- MEMPOOL.req1.toosmall (uint64, count, 过小次数)
- MEMPOOL.req1.surplus (uint64, count, 过多次数)
- MEMPOOL.req1.randry (uint64, count, 池耗尽次数)
- MEMPOOL.sess1.live (uint64, count, 使用中)
- MEMPOOL.sess1.pool (uint64, count, 池中)
- MEMPOOL.sess1.sz_wanted (uint64, count, 请求大小)
- MEMPOOL.sess1.sz_needed (uint64, count, 分配大小)
- MEMPOOL.sess1.allocs (uint64, count, 分配次数)
- MEMPOOL.sess1.frees (uint64, count, 释放次数)
- MEMPOOL.sess1.recycle (uint64, count, 从池中回收次数)
- MEMPOOL.sess1.timeout (uint64, count, 超时次数)
- MEMPOOL.sess1.toosmall (uint64, count, 过小次数)
- MEMPOOL.sess1.surplus (uint64, count, 过多次数)
- MEMPOOL.sess1.randry (uint64, count, 池耗尽次数)
- SMA.s0.c_req (uint64, count, 分配器请求次数)
- SMA.s0.c_fail (uint64, count, 分配器失败次数)
- SMA.s0.c_bytes (uint64, count, 已分配字节数)
- SMA.s0.c_freed (uint64, count, 已释放字节数)
- SMA.s0.g_alloc (uint64, count, 待处理分配数)
- SMA.s0.g_bytes (uint64, count, 待处理字节数)
- SMA.s0.g_space (uint64, count, 可用字节数)
- SMA.Transient.c_req (uint64, count, 分配器请求次数)
- SMA.Transient.c_fail (uint64, count, 分配器失败次数)
- SMA.Transient.c_bytes (uint64, count, 已分配字节数)
- SMA.Transient.c_freed (uint64, count, 已释放字节数)
- SMA.Transient.g_alloc (uint64, count, 待处理分配数)
- SMA.Transient.g_bytes (uint64, count, 待处理字节数)
- SMA.Transient.g_space (uint64, count, 可用字节数)
- VBE.default(127.0.0.1,,8080).vcls (uint64, count, VCL 引用次数)
- VBE.default(127.0.0.1,,8080).happy (uint64, count, 健康探测成功次数)
- VBE.default(127.0.0.1,,8080).bereq_hdrbytes (uint64, count, 请求头字节数)
- VBE.default(127.0.0.1,,8080).bereq_bodybytes (uint64, count, 请求体字节数)
- VBE.default(127.0.0.1,,8080).beresp_hdrbytes (uint64, count, 响应头字节数)
- VBE.default(127.0.0.1,,8080).beresp_bodybytes (uint64, count, 响应体字节数)
- VBE.default(127.0.0.1,,8080).pipe_hdrbytes (uint64, count, 管道请求头字节数)
- VBE.default(127.0.0.1,,8080).pipe_out (uint64, count, 管道流出字节数)
- VBE.default(127.0.0.1,,8080).pipe_in (uint64, count, 管道流入字节数)
- LCK.sms.creat (uint64, count, 创建的锁数量)
- LCK.sms.destroy (uint64, count, 销毁的锁数量)
- LCK.sms.locks (uint64, count, 锁操作次数)
- LCK.smp.creat (uint64, count, 创建的锁数量)
- LCK.smp.destroy (uint64, count, 销毁的锁数量)
- LCK.smp.locks (uint64, count, 锁操作次数)
- LCK.sma.creat (uint64, count, 创建的锁数量)
- LCK.sma.destroy (uint64, count, 销毁的锁数量)
- LCK.sma.locks (uint64, count, 锁操作次数)
- LCK.smf.creat (uint64, count, 创建的锁数量)
- LCK.smf.destroy (uint64, count, 销毁的锁数量)
- LCK.smf.locks (uint64, count, 锁操作次数)
- LCK.hsl.creat (uint64, count, 创建的锁数量)
- LCK.hsl.destroy (uint64, count, 销毁的锁数量)
- LCK.hsl.locks (uint64, count, 锁操作次数)
- LCK.hcb.creat (uint64, count, 创建的锁数量)
- LCK.hcb.destroy (uint64, count, 销毁的锁数量)
- LCK.hcb.locks (uint64, count, 锁操作次数)
- LCK.hcl.creat (uint64, count, 创建的锁数量)
- LCK.hcl.destroy (uint64, count, 销毁的锁数量)
- LCK.hcl.locks (uint64, count, 锁操作次数)
- LCK.vcl.creat (uint64, count, 创建的锁数量)
- LCK.vcl.destroy (uint64, count, 销毁的锁数量)
- LCK.vcl.locks (uint64, count, 锁操作次数)
- LCK.sessmem.creat (uint64, count, 创建的锁数量)
- LCK.sessmem.destroy (uint64, count, 销毁的锁数量)
- LCK.sessmem.locks (uint64, count, 锁操作次数)
- LCK.sess.creat (uint64, count, 创建的锁数量)
- LCK.sess.destroy (uint64, count, 销毁的锁数量)
- LCK.sess.locks (uint64, count, 锁操作次数)
- LCK.wstat.creat (uint64, count, 创建的锁数量)
- LCK.wstat.destroy (uint64, count, 销毁的锁数量)
- LCK.wstat.locks (uint64, count, 锁操作次数)
- LCK.herder.creat (uint64, count, 创建的锁数量)
- LCK.herder.destroy (uint64, count, 销毁的锁数量)
- LCK.herder.locks (uint64, count, 锁操作次数)
- LCK.wq.creat (uint64, count, 创建的锁数量)
- LCK.wq.destroy (uint64, count, 销毁的锁数量)
- LCK.wq.locks (uint64, count, 锁操作次数)
- LCK.objhdr.creat (uint64, count, 创建的锁数量)
- LCK.objhdr.destroy (uint64, count, 销毁的锁数量)
- LCK.objhdr.locks (uint64, count, 锁操作次数)
- LCK.exp.creat (uint64, count, 创建的锁数量)
- LCK.exp.destroy (uint64, count, 销毁的锁数量)
- LCK.exp.locks (uint64, count, 锁操作次数)
- LCK.lru.creat (uint64, count, 创建的锁数量)
- LCK.lru.destroy (uint64, count, 销毁的锁数量)
- LCK.lru.locks (uint64, count, 锁操作次数)
- LCK.cli.creat (uint64, count, 创建的锁数量)
- LCK.cli.destroy (uint64, count, 销毁的锁数量)
- LCK.cli.locks (uint64, count, 锁操作次数)
- LCK.ban.creat (uint64, count, 创建的锁数量)
- LCK.ban.destroy (uint64, count, 销毁的锁数量)
- LCK.ban.locks (uint64, count, 锁操作次数)
- LCK.vbp.creat (uint64, count, 创建的锁数量)
- LCK.vbp.destroy (uint64, count, 销毁的锁数量)
- LCK.vbp.locks (uint64, count, 锁操作次数)
- LCK.backend.creat (uint64, count, 创建的锁数量)
- LCK.backend.destroy (uint64, count, 销毁的锁数量)
- LCK.backend.locks (uint64, count, 锁操作次数)
- LCK.vcapace.creat (uint64, count, 创建的锁数量)
- LCK.vcapace.destroy (uint64, count, 销毁的锁数量)
- LCK.vcapace.locks (uint64, count, 锁操作次数)
- LCK.nbusyobj.creat (uint64, count, 创建的锁数量)
- LCK.nbusyobj.destroy (uint64, count, 销毁的锁数量)
- LCK.nbusyobj.locks (uint64, count, 锁操作次数)
- LCK.busyobj.creat (uint64, count, 创建的锁数量)
- LCK.busyobj.destroy (uint64, count, 销毁的锁数量)
- LCK.busyobj.locks (uint64, count, 锁操作次数)
- LCK.mempool.creat (uint64, count, 创建的锁数量)
- LCK.mempool.destroy (uint64, count, 销毁的锁数量)
- LCK.mempool.locks (uint64, count, 锁操作次数)
- LCK.vxid.creat (uint64, count, 创建的锁数量)
- LCK.vxid.destroy (uint64, count, 销毁的锁数量)
- LCK.vxid.locks (uint64, count, 锁操作次数)
- LCK.pipestat.creat (uint64, count, 创建的锁数量)
- LCK.pipestat.destroy (uint64, count, 销毁的锁数量)
- LCK.pipestat.locks (uint64, count, 锁操作次数)
标签
如上所述,varnish 统计信息的 prefix 将用作其“section”标签。因此,section 标签可能具有以下值之一:
- section
- MAIN
- MGT
- MEMPOOL
- SMA
- VBE
- LCK
版本 2
当启用了 metric_version=2 时,插件会运行 varnishstat -j 命令并解析 JSON 输出以生成指标。
插件使用 varnishadm vcl.list -j 命令行来查找活动的 VCL。与非活动 VCL 相关的指标将从监控中排除。
示例输出
版本 1 示例
varnish,host=rpercy-VirtualBox,section=MAIN cache_hit=0i,cache_miss=0i,uptime=8416i 1462765437090957980版本 2 示例
varnish,host=kozel.local,section=MAIN n_vampireobject=0i 1631121567000000000
varnish,backend=server_test1,host=kozel.local,section=VBE fail_eacces=0i 1631121567000000000
varnish,backend=default,host=kozel.local,section=VBE req=0i 1631121567000000000
varnish,host=kozel.local,section=MAIN client_req_400=0i 1631121567000000000
varnish,host=kozel.local,section=MAIN shm_cycles=10i 1631121567000000000
varnish,backend=default,host=kozel.local,section=VBE pipe_hdrbytes=0i 1631121567000000000您可以使用 aggregators.merge 将指标合并到一个具有多个字段的指标中,以实现最节省内存和网络传输的格式。
[[aggregators.merge]]
drop_original = true输出将是
varnish,host=kozel.local,section=MAIN backend_busy=0i,backend_conn=19i,backend_fail=0i,backend_recycle=8i,backend_req=19i,backend_retry=0i,backend_reuse=0i,backend_unhealthy=0i,bans=1i,bans_added=1i,bans_completed=1i,bans_deleted=0i,bans_dups=0i,bans_lurker_contention=0i,bans_lurker_obj_killed=0i,bans_lurker_obj_killed_cutoff=0i,bans_lurker_tested=0i,bans_lurker_tests_tested=0i,bans_obj=0i,bans_obj_killed=0i,bans_persisted_bytes=16i,bans_persisted_fragmentation=0i,bans_req=0i,bans_tested=0i,bans_tests_tested=0i,busy_killed=0i,busy_sleep=0i,busy_wakeup=0i,cache_hit=643999i,cache_hit_grace=22i,cache_hitmiss=0i,cache_hitpass=0i,cache_miss=1i,client_req=644000i,client_req_400=0i,client_req_417=0i,client_resp_500=0i,esi_errors=0i,esi_warnings=0i,exp_mailed=37i,exp_received=37i,fetch_1xx=0i,fetch_204=0i,fetch_304=2i,fetch_bad=0i,fetch_chunked=6i,fetch_eof=0i,fetch_failed=0i,fetch_head=0i,fetch_length=11i,fetch_no_thread=0i,fetch_none=0i,hcb_insert=1i,hcb_lock=1i,hcb_nolock=644000i,losthdr=0i,n_backend=19i,n_expired=1i,n_gunzip=289204i,n_gzip=0i,n_lru_limited=0i,n_lru_moved=843i,n_lru_nuked=0i,n_obj_purged=0i,n_object=0i,n_objectcore=40i,n_objecthead=40i,n_purges=0i,n_test_gunzip=6i,n_vampireobject=0i,n_vcl=7i,n_vcl_avail=7i,n_vcl_discard=0i,pools=2i,req_dropped=0i,s_fetch=1i,s_pass=0i,s_pipe=0i,s_pipe_hdrbytes=0i,s_pipe_in=0i,s_pipe_out=0i,s_req_bodybytes=0i,s_req_hdrbytes=54740000i,s_resp_bodybytes=341618192i,s_resp_hdrbytes=190035576i,s_sess=651038i,s_synth=0i,sc_overload=0i,sc_pipe_overflow=0i,sc_range_short=0i,sc_rem_close=7038i,sc_req_close=0i,sc_req_http10=644000i,sc_req_http20=0i,sc_resp_close=0i,sc_rx_bad=0i,sc_rx_body=0i,sc_rx_junk=0i,sc_rx_overflow=0i,sc_rx_timeout=0i,sc_tx_eof=0i,sc_tx_error=0i,sc_tx_pipe=0i,sc_vcl_failure=0i,sess_closed=644000i,sess_closed_err=644000i,sess_conn=651038i,sess_drop=0i,sess_dropped=0i,sess_fail=0i,sess_fail_ebadf=0i,sess_fail_econnaborted=0i,sess_fail_eintr=0i,sess_fail_emfile=0i,sess_fail_enomem=0i,sess_fail_other=0i,sess_herd=11i,sess_queued=0i,sess_readahead=0i,shm_cont=3572i,shm_cycles=10i,shm_flushes=0i,shm_records=30727866i,shm_writes=4661979i,summs=2225754i,thread_queue_len=0i,threads=200i,threads_created=200i,threads_destroyed=0i,threads_failed=0i,threads_limited=0i,uptime=4416326i,vcl_fail=0i,vmods=2i,ws_backend_overflow=0i,ws_client_overflow=0i,ws_session_overflow=0i,ws_thread_overflow=0i 1631121675000000000
varnish,backend=default,host=kozel.local,section=VBE bereq_bodybytes=0i,bereq_hdrbytes=0i,beresp_bodybytes=0i,beresp_hdrbytes=0i,busy=0i,conn=0i,fail=0i,fail_eacces=0i,fail_eaddrnotavail=0i,fail_econnrefused=0i,fail_enetunreach=0i,fail_etimedout=0i,fail_other=0i,happy=9223372036854775807i,helddown=0i,pipe_hdrbytes=0i,pipe_in=0i,pipe_out=0i,req=0i,unhealthy=0i 1631121675000000000
varnish,backend=server1,host=kozel.local,section=VBE bereq_bodybytes=0i,bereq_hdrbytes=0i,beresp_bodybytes=0i,beresp_hdrbytes=0i,busy=0i,conn=0i,fail=0i,fail_eacces=0i,fail_eaddrnotavail=0i,fail_econnrefused=30609i,fail_enetunreach=0i,fail_etimedout=0i,fail_other=0i,happy=0i,helddown=3i,pipe_hdrbytes=0i,pipe_in=0i,pipe_out=0i,req=0i,unhealthy=0i 1631121675000000000
varnish,backend=server2,host=kozel.local,section=VBE bereq_bodybytes=0i,bereq_hdrbytes=0i,beresp_bodybytes=0i,beresp_hdrbytes=0i,busy=0i,conn=0i,fail=0i,fail_eacces=0i,fail_eaddrnotavail=0i,fail_econnrefused=30609i,fail_enetunreach=0i,fail_etimedout=0i,fail_other=0i,happy=0i,helddown=3i,pipe_hdrbytes=0i,pipe_in=0i,pipe_out=0i,req=0i,unhealthy=0i 1631121675000000000
varnish,backend=server_test1,host=kozel.local,section=VBE bereq_bodybytes=0i,bereq_hdrbytes=0i,beresp_bodybytes=0i,beresp_hdrbytes=0i,busy=0i,conn=0i,fail=0i,fail_eacces=0i,fail_eaddrnotavail=0i,fail_econnrefused=49345i,fail_enetunreach=0i,fail_etimedout=0i,fail_other=0i,happy=0i,helddown=2i,pipe_hdrbytes=0i,pipe_in=0i,pipe_out=0i,req=0i,unhealthy=0i 1631121675000000000此页面是否有帮助?
感谢您的反馈!
支持和反馈
感谢您成为我们社区的一员!我们欢迎并鼓励您对 Telegraf 和本文档提出反馈和 bug 报告。要获取支持,请使用以下资源
具有年度合同或支持合同的客户可以 联系 InfluxData 支持。