lasect

lasect / pg_turret

Public

postgres extension for streaming logs

95
2
100% credibility
Found Mar 12, 2026 at 40 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
Rust
AI Summary

pg_turret is a PostgreSQL extension that intercepts database logs in real-time, structures them as JSON, and forwards them to external monitoring services like HTTP endpoints.

How It Works

1
📖 Discover pg_turret

You hear about pg_turret, a handy tool that grabs your database logs right away and sends them neatly to your monitoring dashboard.

2
🛠️ Add to your database

You follow easy steps to include pg_turret in your database setup so it can start listening for logs.

3
🔧 Turn it on

You activate pg_turret inside your database with a simple command, and it quietly starts capturing important events without slowing things down.

4
⚙️ Choose what to send

You pick which kinds of logs to include, like warnings or errors, and tell it where to deliver them, such as your log viewer service.

5
👀 Watch logs flow

Your database logs now stream out automatically in tidy batches, ready for your monitoring tools to display.

6
📊 Check your dashboard

You see structured log details pop up in real-time on your observability platform, complete with timestamps and details.

🎉 Troubleshoot easily

With all your database events organized and accessible, spotting and fixing issues feels quick and effortless.

Sign up to see the full architecture

5 more

Sign Up Free

Star Growth

See how this repo grew from 40 to 95 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is pg_turret?

pg_turret is a Rust-powered PostgreSQL extension (13-17) that hooks into the database's logging pipeline to capture and stream structured JSON logs in real-time to HTTP endpoints or future adapters like Datadog and Sentry. It solves the hassle of parsing log files or deploying sidecar agents by turning Postgres into a direct event source for observability stacks. Install via Cargo and pgrx, load with `shared_preload_libraries`, then `CREATE EXTENSION pg_turret;`—configure via GUCs for filters, batches, and retries.

Why is it gaining traction?

Unlike external github postgres exporters or log tailers, it runs inside Postgres with background workers for zero-overhead export, batched delivery, regex filtering, and gzip compression. Developers dig the extensible adapter system and SQL-exposed metrics like `get_logs_captured_count()` for monitoring buffer health. It fits neatly into postgres extensions lists alongside postgis or pg_trgm, especially in github postgres docker setups.

Who should use this?

SREs and DBAs running Postgres in Kubernetes via github postgres helm chart or operator, needing real-time logs to tools without extra pods. Teams building postgres github docker images who want built-in streaming over dblink-style hacks or vscode extensions for local dev. Avoid if you're on managed services blocking extensions.

Verdict

Promising early experiment for postgres extension fans—solid README, pgrx tests, and HTTP adapter work out of the box—but 24 stars and 1.0% credibility scream "prototype, not prod-ready." Try it in staging if you hate log shippers; watch for more adapters.

(187 words)

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.