Skip to main content
Collect logs from a self-hosted MongoDB server β€” connections, slow queries, replication, and errors β€” with the OpenTelemetry Collector. The same Collector can also forward traces and metrics from your apps β€” see Connect OpenTelemetry Collector to Bronto.

Prerequisites

Configure the Collector

MongoDB 4.4+ writes one structured JSON object per line. Parse it with the json_parser operator:
/etc/otel/config.yaml
Set <REGION> to eu or us.

What you will see in Bronto

Open Search and filter by service.name = mongodb. Each entry carries a timestamp (t), severity (s), component (c β€” e.g. NETWORK, QUERY, REPL), context (ctx), and message (msg); slow operations include the command, namespace, and durationMillis under attr. The json_parser promotes these to searchable fields.

Troubleshooting

  • Older MongoDB (pre-4.4) writes plain text, not JSON. Drop the json_parser operator and let Bronto’s Custom Parser extract fields server-side.
  • Log volume: raising systemLog.verbosity greatly increases output β€” keep it low in production.
  • For general issues, see OTel Collector troubleshooting.

Alternative: Fluent Bit

If you already run Fluent Bit, tail the MongoDB log file and forward it over HTTP:
fluent-bit.conf
Set Format to json_lines, not json. See Connect Fluent Bit to Bronto for installation.