How to format Fly live logs?

Hi… As a small initial tangent, this may or may not be the new mascot for the Monitoring side of Fly.io…

(Their house illustrator has a really impressively broad style.)

Anyway, here’s the relevant part of the docs:

The init program […] gather[s] process output from stdout and redirects it to a socket.

Outside of the Machine, on the [physical] host, we take that output and send it to Vector via yet another socket. Vector ships logs (your app’s output) to an internal NATS cluster. Clients can subscribe to specific topics, and NATS sends the requested data to those subscribers.

This is the “everything is a stream of bytes” approach, in other words: it’s up to the process (Deno, in this case) to turn whatever it wants to log into strings.

Hope this helps a little!


Aside: There is some discussion over on the Quickwit thread about ways to retroactively parse JSON—at the end of the stdout → Vector → NATS → ⋯ chain. Each entry is a string all along, but perhaps with structure-aware indexing of any detected JSON fields · at the very end. It looks like those would/will require you to serialize your objects to fit on a single line, however.

2 Likes