文档文档

PgBouncer 输入插件

此插件从 PgBouncer 负载均衡器 实例收集指标。请查看 文档 以了解可用指标及其含义。

此插件需要 PgBouncer v1.5+。

引入于: Telegraf v1.8.0 标签: server, web 操作系统支持: all

全局配置选项

插件支持其他全局和插件配置设置,用于修改指标、标签和字段,创建别名以及配置插件顺序等任务。更多详情请参阅 CONFIGURATION.md

配置

# Read metrics from one or many pgbouncer servers
[[inputs.pgbouncer]]
  ## specify address via a url matching:
  ##   postgres://[pqgotest[:password]]@host:port[/dbname]\
  ##       ?sslmode=[disable|verify-ca|verify-full]
  ## or a simple string:
  ##   host=localhost port=5432 user=pqgotest password=... sslmode=... dbname=app_production
  ##
  ## All connection parameters are optional.
  ##
  address = "host=localhost user=pgbouncer sslmode=disable"

  ## Specify which "show" commands to gather metrics for.
  ## Choose from: "stats", "pools", "lists", "databases"
  # show_commands = ["stats", "pools"]

要指定 address,可以使用 PostgreSQL 连接字符串

host=/run/postgresql port=6432 user=telegraf database=pgbouncer

或者使用以下形式的 URL

postgres://[pqgotest[:password]]@host:port[/dbname]?sslmode=[disable|verify-ca|verify-full]

所有连接参数都是可选的。

如果没有 dbname 参数,驱动程序将默认使用与用户同名的数据库。dbname 仅用于与服务器实例化连接,并不限制对查询数据库的访问。

Metrics

  • pgbouncer

    • 标签 (tags)
      • db
      • 服务器
    • 字段 (fields)
      • avg_query_count
      • avg_query_time
      • avg_wait_time
      • avg_xact_count
      • avg_xact_time
      • total_query_count
      • total_query_time
      • total_received
      • total_sent
      • total_wait_time
      • total_xact_count
      • total_xact_time
  • pgbouncer_pools

    • 标签 (tags)
      • db
      • pool_mode
      • 服务器
      • user
    • 字段 (fields)
      • cl_active
      • cl_waiting
      • maxwait
      • maxwait_us
      • sv_active
      • sv_idle
      • sv_login
      • sv_tested
      • sv_used
  • pgbouncer_lists

    • 标签 (tags)
      • db
      • 服务器
      • user
    • 字段 (fields)
      • 数据库
      • users
      • pools
      • free_clients
      • used_clients
      • login_clients
      • free_servers
      • used_servers
      • dns_names
      • dns_zones
      • dns_queries
  • pgbouncer_databases

    • 标签 (tags)
      • db
      • pg_dbname
      • 服务器
      • user
    • 字段 (fields)
      • current_connections
      • pool_size
      • min_pool_size
      • reserve_pool
      • max_connections
      • paused
      • disabled

示例输出

pgbouncer,db=pgbouncer,server=host\=debian-buster-postgres\ user\=dbn\ port\=6432\ dbname\=pgbouncer\  avg_query_count=0i,avg_query_time=0i,avg_wait_time=0i,avg_xact_count=0i,avg_xact_time=0i,total_query_count=26i,total_query_time=0i,total_received=0i,total_sent=0i,total_wait_time=0i,total_xact_count=26i,total_xact_time=0i 1581569936000000000
pgbouncer_pools,db=pgbouncer,pool_mode=statement,server=host\=debian-buster-postgres\ user\=dbn\ port\=6432\ dbname\=pgbouncer\ ,user=pgbouncer cl_active=1i,cl_waiting=0i,maxwait=0i,maxwait_us=0i,sv_active=0i,sv_idle=0i,sv_login=0i,sv_tested=0i,sv_used=0i 1581569936000000000
pgbouncer_lists,db=pgbouncer,server=host\=debian-buster-postgres\ user\=dbn\ port\=6432\ dbname\=pgbouncer\ ,user=pgbouncer databases=1i,dns_names=0i,dns_queries=0i,dns_zones=0i,free_clients=47i,free_servers=0i,login_clients=0i,pools=1i,used_clients=3i,used_servers=0i,users=4i 1581569936000000000
pgbouncer_databases,db=pgbouncer,pg_dbname=pgbouncer,server=host\=debian-buster-postgres\ user\=dbn\ port\=6432\ dbname\=pgbouncer\ name=pgbouncer disabled=0i,pool_size=2i,current_connections=0i,min_pool_size=0i,reserve_pool=0i,max_connections=0i,paused=0i 1581569936000000000
pgbouncer_databases,db=postgres,pg_dbname=postgres,server=host\=debian-buster-postgres\ user\=dbn\ port\=6432\ dbname\=pgbouncer\ name=postgres current_connections=0i,disabled=0i,pool_size=20i,min_pool_size=0i,reserve_pool=0i,paused=0i,max_connections=0i 1581569936000000000

此页面是否有帮助?

感谢您的反馈!


InfluxDB 3.8 新特性

InfluxDB 3.8 和 InfluxDB 3 Explorer 1.6 的主要增强功能。

查看博客文章

InfluxDB 3.8 现已适用于 Core 和 Enterprise 版本,同时发布了 InfluxDB 3 Explorer UI 的 1.6 版本。本次发布着重于操作成熟度,以及如何更轻松地部署、管理和可靠地运行 InfluxDB。

更多信息,请查看

InfluxDB Docker 的 latest 标签将指向 InfluxDB 3 Core

在 **2026 年 2 月 3 日**,InfluxDB Docker 镜像的 latest 标签将指向 InfluxDB 3 Core。为避免意外升级,请在您的 Docker 部署中使用特定的版本标签。

如果使用 Docker 来安装和运行 InfluxDB,latest 标签将指向 InfluxDB 3 Core。为避免意外升级,请在您的 Docker 部署中使用特定的版本标签。例如,如果使用 Docker 运行 InfluxDB v2,请将 latest 版本标签替换为 Docker pull 命令中的特定版本标签 — 例如

docker pull influxdb:2