Prerequisites
- A Bronto account and API key (how to create one)
- MongoDB writing logs to a file (
systemLog.destination: file). The default path is/var/log/mongodb/mongod.log - An OpenTelemetry Collector (recommended) or Fluent Bit installed on the same host
Configure the Collector
MongoDB 4.4+ writes one structured JSON object per line. Parse it with thejson_parser operator:
/etc/otel/config.yaml
<REGION> to eu or us.
What you will see in Bronto
Open Search and filter byservice.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_parseroperator and let Bronto’s Custom Parser extract fields server-side. - Log volume: raising
systemLog.verbositygreatly 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
json_lines, not json. See Connect Fluent Bit to Bronto for installation.
