
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
https://circleci.com/gh/prometheus-community/pgbouncer_exporter.svg?style=svg](https://circleci.com/gh/prometheus-community/pgbouncer_exporter)
Prometheus的PgBouncer导出器,用于收集PgBouncer指标并在9127/metrics端点暴露。
执行以下命令构建并运行:
make build ./pgbouncer_exporter <flags>
查看所有可用配置标志:
./pgbouncer_exporter -h
pgbouncer_exporter需要PgBouncer配置忽略一个PostgreSQL驱动连接参数。在pgbouncer.ini中需包含以下选项:
ignore_startup_parameters = extra_float_digits
docker run docker.xuanyuan.run/prometheuscommunity/pgbouncer-exporter <flags>
连接到PgBouncer实例并暴露指标端口:
docker run -d -p 9127:9127 --name pgbouncer-exporter docker.xuanyuan.run/prometheuscommunity/pgbouncer-exporter --pgbouncer.connection-string="postgres://user:password@pgbouncer-host:6432/pgbouncer?sslmode=disable"
| PgBouncer列 | Prometheus指标 | 描述 |
|---|---|---|
| stats_total_query_count | pgbouncer_stats_queries_pooled_total | 池化的SQL查询总数 |
| stats.total_query_time | pgbouncer_stats_queries_duration_seconds_total | PgBouncer主动连接PostgreSQL执行查询所花费的总秒数 |
| stats.total_received | pgbouncer_stats_received_bytes_total | PgBouncer接收的网络流量总字节数 |
| stats.total_requests | pgbouncer_stats_queries_total | PgBouncer池化的SQL请求总数(单位:请求) |
| stats.total_sent | pgbouncer_stats_sent_bytes_total | PgBouncer发送的网络流量总字节数 |
| stats.total_wait_time | pgbouncer_stats_client_wait_seconds_total | 客户端等待服务器的时间(单位:秒) |
| stats.total_xact_count | pgbouncer_stats_sql_transactions_pooled_total | 池化的SQL事务总数 |
| stats.total_xact_time | pgbouncer_stats_server_in_transaction_seconds_total | PgBouncer连接PostgreSQL处于事务中的总秒数(包括事务中空闲或执行查询) |
| pools.cl_active | pgbouncer_pools_client_active_connections | 链接到服务器连接并能处理查询的客户端连接数(单位:连接) |
| pools.cl_waiting | pgbouncer_pools_client_waiting_connections | 等待服务器连接的客户端连接数(单位:连接) |
| pools.sv_active | pgbouncer_pools_server_active_connections | 链接到客户端连接的服务器连接数(单位:连接) |
| pools.sv_idle | pgbouncer_pools_server_idle_connections | 空闲且准备处理客户端查询的服务器连接数(单位:连接) |
| pools.sv_used | pgbouncer_pools_server_used_connections | 空闲时间超过server_check_delay、需执行server_check_query的服务器连接数(单位:连接) |
| pools.sv_tested | pgbouncer_pools_server_testing_connections | 正在运行server_reset_query或server_check_query的服务器连接数(单位:连接) |
| pools.sv_login | pgbouncer_pools_server_login_connections | 正在登录过程中的服务器连接数(单位:连接) |
| pools.maxwait | pgbouncer_pools_client_maxwait_seconds | 最旧未服务客户端连接的存在时间(单位:秒) |
| config.max_client_conn | pgbouncer_config_max_client_connections | 配置的最大客户端连接数 |
| config.max_user_connections | pgbouncer_config_max_user_connections | 配置的每用户最大服务器连接数 |
pgbouncer导出器支持TLS和基本认证。
如需使用TLS和/或基本认证,需通过--web.config.file参数传递配置文件。文件格式详见https://github.com/prometheus/exporter-toolkit/blob/master/docs/web-configuration.md%E3%80%82
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务