My agents were writing their traces to a remote server, and that wasn't the worst of it
- agents
- observability
- infrastructure
This week, I took stock of one of my agents’ habits: they were writing the traces of their activity to a database on a remote server, rather than on the machine where they run. Every write went through an SSH tunnel.
Nobody had decided this. It became the default path, one agent after another.
What the distance has cost since July:
- Outages: five tunnel drops, one of them lasting several hours with no alert at all. During these drops, trace writes failed.
- Time on every call: about 160 ms per request, for some 8,100 writes a day.
- Workarounds: three more SSH connections to the same server to stay under the session limit, and six local buffering mechanisms written to survive the database being unavailable.
- Slow searches: when I asked Claude to dig through the history of my conversations with the agents, it went to search on the other server rather than reading locally.
Yet the review showed that the distance wasn’t the most expensive part. The traces lived in a corner of the production database, next to the business data, and they inherited its rules: permissions granted table by table, the owner account off-limits to agents, 100 connections shared with production. The worst incident, about ten hours of downtime, came from orphaned queries that saturated those shared connections. A local database wouldn’t have prevented it.
The lesson comes down to two separate decisions. An agent’s traces live next to the agent; the remote server receives a copy if needed. And they have their own database, not a spot in the production one. When you let agents choose for themselves where to write, you have to check regularly what they’ve chosen.