The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
type Metrics struct {
// contains filtered or unexported fields
}
Metrics tracks observability for the boundary -> agent -> coderd audit log
pipeline.
Audit logs from boundary workspaces pass through several async buffers
before reaching coderd, and any stage can silently drop data. These
metrics make that loss visible so operators/devs can:
Bubble up data loss: a non-zero drop rate means audit logs are being
lost, which may have auditing implications.
Identify the bottleneck: the reason label pinpoints where drops
occur: boundary's internal buffers, the agent's channel, or the
RPC to coderd.
Tune buffer sizes: sustained "buffer_full" drops indicate the
agent's channel (or boundary's batch buffer) is too small for the
workload. Combined with batches_forwarded_total you can compute a
drop rate: drops / (drops + forwards).
Detect batch forwarding issues: "forward_failed" drops increase when
the agent cannot reach coderd.
Drops are captured at two stages:
Agent-side: the agent's channel buffer overflows (reason
"buffer_full") or the RPC forward to coderd fails (reason
"forward_failed").
Boundary-reported: boundary self-reports drops via BoundaryStatus
messages (reasons "boundary_channel_full", "boundary_batch_full").
These arrive on the next successful flush from boundary.
There are circumstances where metrics could be lost e.g., agent restarts,
boundary crashes, or the agent shuts down when the DRPC connection is down.
type Server struct {
// contains filtered or unexported fields
}
Server listens on a Unix socket for boundary log messages and buffers them
for forwarding to coderd. The socket server and the forwarder are decoupled:
- Start() creates the socket and accepts a connection from boundary
- RunForwarder() drains the buffer and sends logs to coderd via AgentAPI
Start begins listening for connections on the Unix socket, and handles new
connections in a separate goroutine. Incoming logs from connections are
buffered until RunForwarder drains them.