Docs
DocumentationQuery ReferenceAPI Reference
Open Console→→
DocumentationQuery ReferenceAPI Reference

Platform overview

What is Axiom?QuickstartArchitectureFeatures
Fundamentals
Datasets
Edge deployments
Limits
Performance
Optimize usage
Requirements
Semantic conventions
Glossary
Tour
SecurityRoadmap

Send data

Reference architecturesMethods

Understand data

Console
Query
Builder
Editor
Query results
Visualize
Traces
Metrics
Correlations
Save queries
Stream
Dashboard
Create
Elements
Create
Configure
Element types
Gauge
Heatmap
Log stream
Monitor list
Note
Pie chart
Scatter plot
Statistic
Table
Time series
Sections
Configure
Filter
Annotate
Monitor
Overview
View status
Configure
Examples
Monitor types
Anomaly
Match
Threshold
Alerting
Overview
Configure
Notifier types
Custom Webhook
Discord
Email
Microsoft Teams
Opsgenie
PagerDuty
Slack
Manage
Datasets
Overview
Views
Virtual fields
Access
RBAC
Tokens
CLI
Organization
Audit log
Settings
Usage and billing
Profile
Extend
Overview
AWS Lambda
AWS PrivateLink
Cloudflare Workers
Cloudflare Logpush
Convex
Grafana
Hex
Netlify
Supabase
Tailscale
Terraform
Vercel
Intelligence
Overview
Spotlight
AI agents
Overview
MCP Server
Query cost limits
Agent-created orgs
Skills
Overview
Axiom alerting
Build dashboards
Control costs
Query metrics
SRE
Translate SPL to APL
Splunk
Overview
Splunk app
Install and configure
Commands
Examples
Portal
How it works
Set up standard mode
Set up transparent mode
Observability Cloud
SPL command support
Examples
Monitor and troubleshoot

Use cases

ObservabilityProduct analytics
LLM observability
Overview
Use Axiom AI SDK
Manual instrumentation
GenAI attributes
Redaction policies

Miscellaneous

LLMs
Overview
List of docs pages
Full docs
Query reference
FAQs
Legal
Acceptable use policy
Cookies
Data processing
HIPAA
Partner agreement
Partner program guide
Privacy policy
SLA
Terms of service
Terms of use

Send PgBouncer metrics to Axiom

This page explains how to send PgBouncer metrics to Axiom using pgbouncer_exporter and the OpenTelemetry Collector.

PgBouncer tracks detailed pool and query statistics, but it only exposes them through its admin console (SHOW STATS, SHOW POOLS) over the PostgreSQL wire protocol — there’s no native Prometheus or OTLP endpoint. To send these metrics to Axiom, run the Prometheus community’s pgbouncer_exporter next to PgBouncer, and an OpenTelemetry Collector that scrapes the exporter and forwards the metrics to Axiom.

Info

The Prometheus receiver is part of the contrib distribution of the OpenTelemetry Collector (otelcol-contrib). It isn’t included in the core distribution.

Prerequisites

  • Create an Axiom account.
  • Create a dataset in Axiom where you send your data.
  • Create an API token in Axiom with permissions to ingest data to the dataset you have created.
Info

When you create the dataset, select Metrics as the dataset type. Metrics require their own dedicated dataset. For more information, see Create dataset.

Expose PgBouncer stats with pgbouncer_exporter

In pgbouncer.ini, allow a user to read stats and let the exporter connect:

INI
stats_users = stats
ignore_startup_parameters = extra_float_digits

Then run the exporter, pointing it at PgBouncer’s special pgbouncer admin database:

shell
docker run -d -p 9127:9127 prometheuscommunity/pgbouncer-exporter \
  --pgBouncer.connectionString="postgres://stats:PASSWORD@pgbouncer:6432/pgbouncer?sslmode=disable"

Replace the connection string with your PgBouncer host, port, and stats user. You can also set it with the PGBOUNCER_EXPORTER_CONNECTION_STRING environment variable. The exporter then serves metrics at http://localhost:9127/metrics.

Configure the OpenTelemetry Collector

Add a Prometheus receiver that scrapes the exporter and an OTLP/HTTP exporter that sends data to Axiom:

YAML
receivers:
  prometheus:
    config:
      scrape_configs:
        - job_name: pgbouncer
          scrape_interval: 15s
          static_configs:
            - targets: ["pgbouncer-exporter:9127"] # host:port of pgbouncer_exporter

processors:
  memory_limiter:
    check_interval: 1s
    limit_percentage: 80
    spike_limit_percentage: 25
  batch:
    send_batch_max_size: 8192

exporters:
  otlphttp:
    compression: zstd
    endpoint: https://AXIOM_DOMAIN
    headers:
      authorization: Bearer API_TOKEN
      x-axiom-metrics-dataset: DATASET_NAME

service:
  pipelines:
    metrics:
      receivers:
        - prometheus
      processors:
        - memory_limiter
        - batch
      exporters:
        - otlphttp
Info

Replace AXIOM_DOMAIN with the base domain of your edge deployment. For more information, see Edge deployments.

Replace API_TOKEN with the Axiom API token you have generated. For added security, store the API token in an environment variable.

Replace DATASET_NAME with the name of the Axiom dataset where you send your data.

For metrics, use the x-axiom-metrics-dataset header instead of x-axiom-dataset.

Query your metrics

Once data is flowing, query your PgBouncer metrics like any other OTel metrics in Axiom. Pool metrics carry database and user tags. For example, to chart active client connections per database:

MPL
`DATASET_NAME`:`pgbouncer_pools_client_active_connections`
| align to $__interval using last
| group by `database` using sum

For more information, see Metrics.

Was this page helpful?
Suggest edits on GitHub
On this page
Expose PgBouncer stats with pgbouncer_exporterConfigure the OpenTelemetry CollectorQuery your metrics