Monitoring MongoDB Logs with ClickStack

service:
  pipelines:
    logs/mongodb-demo:
      receivers: [filelog/mongodb]
      processors:
        - memory_limiter
        - transform
        - batch
      exporters:
        - clickhouse
EOF
```

Run ClickStack with demo configuration

#### Run ClickStack with demo configuration[​](#run-demo "Direct link to Run ClickStack with demo configuration")

Run ClickStack with the demo logs and configuration:

```
docker run --name clickstack-demo \
  -p 8080:8080 -p 4317:4317 -p 4318:4318 \
  -e CUSTOM_OTELCOL_CONFIG_FILE=/etc/otelcol-contrib/custom.config.yaml \
  -v "$(pwd)/mongodb-demo.yaml:/etc/otelcol-contrib/custom.config.yaml:ro" \
  -v "$(pwd)/mongod.log:/tmp/mongodb-demo/mongod.log:ro" \
  clickhouse/clickstack-all-in-one:latest
```

## Verify logs in HyperDX[​](#verify-demo-logs "Direct link to Verify logs in HyperDX")

Once ClickStack is running:

1. Open [HyperDX](http://localhost:8080/) and log in to your account (you may need to create an account first)
2. Navigate to the Search view and set the source to `Logs`
3. Set the time range to include **2026-03-09 00:00:00 - 2026-03-10 00:00:00 (UTC)**

## Dashboards and visualization[​](#dashboards "Direct link to Dashboards and visualization")

Download the dashboard configuration

#### [Download](/docs/examples/mongodb-logs-dashboard.json) the dashboard configuration[​](#download "Direct link to download")

Import pre-built dashboard

#### Import pre-built dashboard[​](#import-dashboard "Direct link to Import pre-built dashboard")

1. Open HyperDX and navigate to the Dashboards section.
2. Click "Import Dashboard" in the upper right corner under the ellipses.

3. Upload the mongodb-logs-dashboard.json file and click finish import.

The dashboard will be created with all visualizations pre-configured

#### The dashboard will be created with all visualizations pre-configured[​](#created-dashboard "Direct link to The dashboard will be created with all visualizations pre-configured")

For the demo dataset, set the time range to include **2026-03-09 00:00:00 - 2026-03-10 00:00:00 (UTC)**.

## Troubleshooting[​](#troubleshooting "Direct link to Troubleshooting")

### No logs appearing in HyperDX[​](#no-logs "Direct link to No logs appearing in HyperDX")

Verify the effective config includes your filelog receiver:

```
docker exec <container> cat /etc/otel/supervisor-data/effective.yaml | grep -A 10 filelog
```

Check for errors in the collector logs:

```
docker exec <container> cat /etc/otel/supervisor-data/agent.log
```

### Logs not parsing correctly[​](#logs-not-parsing "Direct link to Logs not parsing correctly")

Verify MongoDB is outputting JSON logs (4.4+):

```
tail -1 /var/log/mongodb/mongod.log | python3 -m json.tool
```

If the output is not valid JSON, your MongoDB version may be using the legacy text log format (pre-4.4). You'll need to replace the `json_parser` operator with a `regex_parser`, or upgrade to MongoDB 4.4+.

## Next steps[​](#next-steps "Direct link to Next steps")

- Set up [alerts](/docs/use-cases/observability/clickstack/alerts) for critical events (error spikes, slow query thresholds)
- Create additional [dashboards](/docs/use-cases/observability/clickstack/dashboards) for specific use cases (replica set monitoring, connection tracking)

## Going to production[​](#going-to-production "Direct link to Going to production")

This guide extends ClickStack's built-in OpenTelemetry Collector for quick setup. For production deployments, we recommend running your own OTel Collector and sending data to ClickStack's OTLP endpoint. See [Sending OpenTelemetry data](/docs/use-cases/observability/clickstack/ingesting-data/opentelemetry) for production configuration.

- [Integration with existing MongoDB](#existing-mongodb)
  - [Prerequisites](#prerequisites)- [Demo dataset](#demo-dataset)- [Verify logs in HyperDX](#verify-demo-logs)- [Dashboards and visualization](#dashboards)- [Troubleshooting](#troubleshooting)
          - [No logs appearing in HyperDX](#no-logs)- [Logs not parsing correctly](#logs-not-parsing)- [Next steps](#next-steps)- [Going to production](#going-to-production)

Was this page helpful?