Loading…
Topic
NATS
2 posts about NATS. Every summary links to the original.
- 2 posts
- 1 company
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
Newest first
Posts
Multiple Logs for Resiliency
An unexpected network outage can make an application misbehave while also removing crucial log data from the normal Fly.io pipeline. The post traces that pipeline from application STDOUT through Fly.io, NATS, the Log Shipper, Vector, and a third-party provider, then presents two ways to add redundancy. One strategy broadcasts framework logs to a separate file on each machine, preferably on a persistent volume with rotation; a Rails example uses ActiveSupport::Logger.broadcast. The other runs a separate app that subscribes directly to NATS, parses messages, and writes selected fields to disk, with a Fly authentication token and provisions for reconnection and error handling. File copies are more failsafe but raw and harder to fetch, while a custom shipper can produce more usable data but is less bulletproof.
Shipping Logs
Shipping Logs describes how Fly.io application stdout moves through the platform and how to centralize and retain it beyond Fly.io’s log lifetime. Apps run in Firecracker VMs, where an injected Rust init process captures stdout and sends it through host-side Go code to Vector, which publishes the logs to an internal NATS cluster; Flaps limits access to an organization’s logs. The Fly Log Shipper runs Vector as a NATS client and forwards organization-wide streams to a configured sink such as Logtail, Loki, Datadog, or Cloudwatch, using secrets for provider credentials. Deployment involves launching the image, removing the generated services section, adding an internal port, and running fly deploy. A SUBJECT environment variable can narrow collection with NATS subjects such as logs.sandwich.>, covering an app across regions and instances.
Related topics
All topics →Weekly digest
The best engineering reads, once a week.