All Integrations
Databasesmongodb-exporter + profiler

MongoDB Integration

Collection metrics, oplog replication health, index usage analysis, and slow query detection across your MongoDB replica sets and sharded clusters.

Setup

How It Works

01

Create a Monitoring User

Create a MongoDB user with the clusterMonitor and dbStats roles. TigerOps only needs read access to monitoring views — no access to application collections.

02

Enable Profiling

Set db.setProfilingLevel(1, { slowms: 100 }) to capture slow operations. TigerOps ingests the system.profile collection and normalizes query shapes automatically.

03

Deploy mongodb-exporter

Run the TigerOps mongodb-exporter container. It connects via the MongoDB driver, collects serverStatus, replSetGetStatus, dbStats, and collStats on your configured interval.

04

Correlate Ops with Traces

TigerOps links MongoDB slow operations to application service spans, so you can trace a slow API response all the way to the specific MongoDB aggregation pipeline causing it.

Capabilities

What You Get Out of the Box

Collection-Level Metrics

Per-collection document counts, storage size, index size, and operation counts from dbStats and collStats. Identify which collections dominate your storage and IOPS.

Oplog Replication Monitoring

Track oplog window size, replication lag per secondary, and oplog application rate. TigerOps alerts when lag threatens your recovery point objective.

Index Usage Analysis

Track which indexes are used, which are never accessed, and which queries perform collection scans. TigerOps surfaces index candidates for your most expensive queries.

Slow Query Detection

Ingest and normalize MongoDB system.profile entries. TigerOps groups queries by shape, ranks by total time impact, and links slow queries to upstream request traces.

WiredTiger Cache Metrics

Monitor WiredTiger cache usage, eviction rate, dirty bytes, and checkpoint throughput. TigerOps alerts when cache pressure degrades query performance.

Replica Set Health

Election counts, heartbeat latency, and member state changes across your replica set. TigerOps pages on-call when a secondary falls too far behind the primary.

Configuration

mongod.conf with Metrics Enabled

Enable diagnostics logging and configure the TigerOps exporter for your MongoDB deployment.

mongod.conf
# mongod.conf — enable diagnostics for TigerOps monitoring

systemLog:
  destination: file
  path: /var/log/mongodb/mongod.log
  logAppend: true
  # Structured JSON logging for TigerOps log ingestion
  component:
    command:
      verbosity: 1

operationProfiling:
  # Capture operations slower than 100ms
  slowOpThresholdMs: 100
  mode: slowOp

# Enable diagnostic data collection (FTDC)
# TigerOps reads /var/lib/mongodb/diagnostic.data/
diagnosticDataCollectionEnabled: true
diagnosticDataCollectionPeriodMillis: 1000

---
# MongoDB setup — create TigerOps monitoring user
use admin
db.createUser({
  user: "tigerops_monitor",
  pwd: "your-secure-password",
  roles: [
    { role: "clusterMonitor", db: "admin" },
    { role: "read", db: "local" }
  ]
})

---
# TigerOps mongodb-exporter — docker run
docker run -d \
  --name tigerops-mongodb-exporter \
  -e MONGODB_URI="mongodb://tigerops_monitor:password@mongo:27017/admin?ssl=true" \
  -e TIGEROPS_ENDPOINT="https://ingest.atatus.net/api/v1/write" \
  -e TIGEROPS_API_KEY="${TIGEROPS_API_KEY}" \
  -e MONGODB_COLLECT_ALL_COLLECTIONS=true \
  -e MONGODB_COLLECT_OPLOG=true \
  atatus/mongodb-exporter:latest
FAQ

Common Questions

Does TigerOps support MongoDB Atlas?

Yes. MongoDB Atlas exposes metrics via the Atlas Monitoring API. TigerOps polls this API using your Atlas API key and integrates the metrics alongside your self-hosted MongoDB deployments for unified visibility.

What MongoDB versions are supported?

TigerOps supports MongoDB 4.4 through 7.x for self-hosted deployments and all currently supported MongoDB Atlas tiers. The exporter uses the MongoDB driver and is compatible with both replica sets and sharded clusters.

How does TigerOps handle MongoDB sharded clusters?

The TigerOps exporter connects to mongos routers and individual shard replica sets. It collects both router-level metrics (connections, query routing) and per-shard metrics (oplogs, collection stats) for complete cluster visibility.

Can TigerOps detect missing indexes automatically?

Yes. TigerOps analyzes collection scan counts from serverStatus alongside query shapes from the profiler. When it detects repeated collection scans on a large collection, it generates an index recommendation with the suggested key pattern.

Does the monitoring user need access to application data?

No. The clusterMonitor role provides access to serverStatus, replSetGetStatus, and aggregate statistics only. The dbStats and collStats commands return size and count statistics without exposing any document content.

Get Started

Complete MongoDB Observability in Minutes

Oplog health, slow queries, index recommendations, and replica set monitoring. All correlated with your application traces.