22.10.2025

Elephantshark - PostgreSQL network traffic analysis

Elephantshark is a lightweight tool for monitoring, analyzing, and debugging PostgreSQL network traffic. It helps developers and administrators understand how clients, drivers, and ORMs interact with PostgreSQL servers, proxies, and connection pools.
It can also track traffic between standby and primary servers, as well as between subscribers and publishers in replication systems.

GitHub: neondatabase-labs/elephantshark

Features

Elephantshark was designed as a “listening” and analysis tool for Postgres traffic without needing to modify the database or applications. It allows you to:

Elephantshark can be used as a diagnostic tool when setting up infrastructure, performing migrations, or debugging unstable connections.

Installation

To install Elephantshark, clone the repository and build the binary from source:

git clone https://github.com/neondatabase-labs/elephantshark.git cd elephantshark cargo build --release

The compiled binary will be located at

target/release/elephantshark

. You can also download prebuilt releases (if available) from GitHub Releases.

Usage examples

Start analyzing traffic on a specific interface or port:

sudo elephantshark --interface eth0 --port 5432

Or read a previously saved .pcap file:

elephantshark --file traffic.pcap

Why try Elephantshark

Conclusion

Elephantshark is a “network microscope” for PostgreSQL. It helps you see how your application communicates with the database, find weak points, and improve overall stability. If you manage infrastructure, build database drivers, or simply want to understand PostgreSQL networking more deeply - Elephantshark is an excellent tool to have in your toolkit.

Frequently Asked Questions (FAQ)