// PART 06
Logs and metrics
Logs tell you what happened; metrics tell you what is happening. Both are already organized for you — this page is the map, plus the conventions the parsing pipeline relies on.
Log directory organization
The logging system organizes output by component within the
./botserver-stack/logs/ directory. System logs from the main botserver
application appear in the system subdirectory. Storage service operations are
captured in the drive subdirectory. Database activity from PostgreSQL goes to
the tables subdirectory. The cache subdirectory contains logs from the caching
layer. LLM server interactions are recorded in the llm subdirectory.
Additional services have their own logging locations: email service logs in
the email subdirectory, identity and authentication events in the directory
subdirectory, vector database operations in the vectordb subdirectory, and
video meeting activities in the meet subdirectory. In production containers
the same layout lives under /opt/gbo/logs/ (stdout.log is the botserver
service log).
Log format conventions
botserver generates logs in a standard format: timestamp in ISO 8601 with
millisecond precision, the log level, the module path identifying the code
location, and the message. This structured format enables automated parsing
while remaining human-readable for direct inspection. The log filter is set
with RUST_LOG (use info in production; debug is a support tool).
# The first two commands on any incident
grep -E " E | W " botserver.log | tail -20
sudo incus exec bot -- tail -200 /opt/gbo/logs/stdout.log | grep -iE "error|panic|migration"
Drive-file events carry the [drive_monitor] prefix and browser-side errors
arrive with the CLIENT: prefix in botserver logs.
The metrics surface
The platform exposes operational metrics through two read-only endpoints: the
canonical Prometheus scrape endpoint GET /metrics (text/plain; version=0.0.4) and the legacy GET /api/metrics. Both require a Bearer
token; the RBAC route catalogue lists each as a read-only GET permission.
Available metrics track log event counts by severity level, error totals
broken down by service, currently active session counts, total messages
processed since startup, and LLM response latency measurements.
Office applications contribute first-party metrics to the same collector. The open/save/export/slide/recalc marks in the browser are instrumentation only and carry no document content or user, tenant or file ids.
| Metric family | Meaning |
|---|---|
office_recalc_duration_ms_{count,sum,max} |
spreadsheet recalculations observed and their duration |
office_export_duration_ms_{count,sum,max} |
office export operations observed and their duration |
office_workbook_memory_bytes |
resident memory per workbook (label is an opaque hash) |
http_request_duration_ms_{count,sum,max} |
HTTP requests observed per route and their latency |
The operations database
Three tables back the Analytics → Operations panels and are yours to query:
ops_request_metrics— request counters per endpoint class and status class, flushed by the server’s ops middleware every 30 seconds; the middleware also records each boot as a row inops_deploy_markers.llm_metrics— one row per model call with success,ttft_ms,latency_msand error text.- Queue tables (
agent_runs,subagent_runs,handoff_queue,email_offline_queue) — depth, running and dead letters per queue.
Retention is a disk lever: ops_request_metrics keeps 30 days by default and
pruning it early is safe — it never touches product data.
Alert routing
Burn-rate alerts (from ops/slo.yaml) go to the on-call channel of the scope
owner with the runbook link attached; each alert names exactly one runbook.
Acknowledging an alert without opening its runbook is not an acknowledgement.