This documentation has an index for AI agents at /llms.txt. A Markdown version of this page is available at https://explorer.opentelemetry.io/collector/components/contrib/mongodbreceiver.md.

MongoDB Receiver

OpenTelemetry Collector receiver · contrib distribution

This receiver fetches stats from a MongoDB instance using the golang mongo driver. Stats are collected via MongoDB's dbStats and serverStatus commands.

  • Component ID: contrib-mongodbreceiver
  • Name: mongodbreceiver
  • Type: receiver
  • Distribution: contrib
  • Repository: opentelemetry-collector-contrib

Stability

LevelSignals
betametrics
developmentlogs

Metrics

MetricTypeValue typeUnitStabilityEnabledAttributesDescription
mongodb.active.readssumint{reads}developmentnoThe number of read operations currently being processed.
mongodb.active.writessumint{writes}developmentnoThe number of write operations currently being processed.
mongodb.cache.operationssum (monotonic)int{operations}developmentyestype (string)The number of cache operations of the instance.
mongodb.collection.countsumint{collections}developmentyesdb.namespace (string)The number of collections.
mongodb.commands.rategaugedouble{command}/sdevelopmentnoThe number of commands executed per second.
mongodb.connection.countsumint{connections}developmentyesconnection_type (string), db.namespace (string)The number of connections.
mongodb.cursor.countsumint{cursors}developmentyesThe number of open cursors maintained for clients.
mongodb.cursor.timeout.countsumint{cursors}developmentyesThe number of cursors that have timed out.
mongodb.data.sizesumintBydevelopmentyesdb.namespace (string)The size of the collection. Data compression does not affect this value.
mongodb.database.countsumint{databases}developmentyesThe number of existing databases.
mongodb.deletes.rategaugedouble{delete}/sdevelopmentnoThe number of deletes executed per second.
mongodb.document.operation.countsumint{documents}developmentyesdb.namespace (string), operation (string)The number of document operations executed.
mongodb.extent.countsumint{extents}developmentyesdb.namespace (string)The number of extents.
mongodb.flushes.rategaugedouble{flush}/sdevelopmentnoThe number of flushes executed per second.
mongodb.getmores.rategaugedouble{getmore}/sdevelopmentnoThe number of getmores executed per second.
mongodb.global_lock.timesum (monotonic)intmsdevelopmentyesThe time the global lock has been held.
mongodb.healthgaugeint1developmentnoThe health status of the server. A value of '1' indicates healthy. A value of '0' indicates unhealthy.
mongodb.index.access.countsumint{accesses}developmentyescollection (string), db.namespace (string)The number of times an index has been accessed.
mongodb.index.countsumint{indexes}developmentyesdb.namespace (string)The number of indexes.
mongodb.index.sizesumintBydevelopmentyesdb.namespace (string)Sum of the space allocated to all indexes in the database, including free index space.
mongodb.inserts.rategaugedouble{insert}/sdevelopmentnoThe number of insertions executed per second.
mongodb.lock.acquire.countsum (monotonic)int{count}developmentnodb.namespace (string), lock_mode (string), lock_type (string)Number of times the lock was acquired in the specified mode.
mongodb.lock.acquire.timesum (monotonic)intusdevelopmentnodb.namespace (string), lock_mode (string), lock_type (string)Cumulative wait time for the lock acquisitions.
mongodb.lock.acquire.wait_countsum (monotonic)int{count}developmentnodb.namespace (string), lock_mode (string), lock_type (string)Number of times the lock acquisitions encountered waits because the locks were held in a conflicting mode.
mongodb.lock.deadlock.countsum (monotonic)int{count}developmentnodb.namespace (string), lock_mode (string), lock_type (string)Number of times the lock acquisitions encountered deadlocks.
mongodb.memory.usagesumintBydevelopmentyesdb.namespace (string), memory_type (string)The amount of memory used.
mongodb.network.io.receivesumintBydevelopmentyesThe number of bytes received.
mongodb.network.io.transmitsumintBydevelopmentyesThe number of by transmitted.
mongodb.network.request.countsumint{requests}developmentyesThe number of requests received by the server.
mongodb.object.countsumint{objects}developmentyesdb.namespace (string)The number of objects.
mongodb.operation.countsum (monotonic)int{operations}developmentyesoperation (string)The number of operations executed.
mongodb.operation.latency.timegaugeintusdevelopmentnooperation_latency (string)The latency of operations.
mongodb.operation.repl.countsum (monotonic)int{operations}developmentnooperation (string)The number of replicated operations executed.
mongodb.operation.timesum (monotonic)intmsdevelopmentyesoperation (string)The total time spent performing operations.
mongodb.page_faultssum (monotonic)int{faults}developmentnoThe number of page faults.
mongodb.queries.rategaugedouble{query}/sdevelopmentnoThe number of queries executed per second.
mongodb.repl_commands_per_secgaugedouble{command}/sdevelopmentnoThe number of replicated commands executed per second.
mongodb.repl_deletes_per_secgaugedouble{delete}/sdevelopmentnoThe number of replicated deletes executed per second.
mongodb.repl_getmores_per_secgaugedouble{getmore}/sdevelopmentnoThe number of replicated getmores executed per second.
mongodb.repl_inserts_per_secgaugedouble{insert}/sdevelopmentnoThe number of replicated insertions executed per second.
mongodb.repl_queries_per_secgaugedouble{query}/sdevelopmentnoThe number of replicated queries executed per second.
mongodb.repl_updates_per_secgaugedouble{update}/sdevelopmentnoThe number of replicated updates executed per second.
mongodb.session.countsumint{sessions}developmentyesThe total number of active sessions.
mongodb.storage.sizesum (monotonic)intBydevelopmentyesdb.namespace (string)The total amount of storage allocated to this collection. If collection data is compressed it reflects the compressed size.
mongodb.updates.rategaugedouble{update}/sdevelopmentnoThe number of updates executed per second.
mongodb.uptimesum (monotonic)intmsdevelopmentnoThe amount of time that the server has been running.
mongodb.wt.concurrent_transaction.ticket.in_usesumint{ticket}developmentnomongodb.wt.concurrent_transaction.ticket.type (string)The number of in-flight WiredTiger read/write concurrent-transaction tickets.
mongodb.wt.fsync.countsum (monotonic)int{fsync}developmentnoThe total number of fsync I/Os issued by the WiredTiger storage engine.
mongodb.wt.log.operation.countsum (monotonic)int{operation}developmentnomongodb.wt.log.operation.type (string)The total number of WiredTiger journal operations.
mongodb.wt.log.sync.timesum (monotonic)doublesdevelopmentnoThe cumulative time spent syncing the WiredTiger journal.
mongodb.wt.log.writesum (monotonic)intBydevelopmentnoThe total number of bytes written to the WiredTiger journal.
mongodb.wtcache.bytes.readsum (monotonic)intBydevelopmentnoThe number of bytes read into the WiredTiger cache.

Attributes

AttributeTypeDescription
client.addressstringHostname or address of the client.
client.portintTCP port used by the client.
collectionstringThe name of a collection.
connection_typestringThe status of the connection.
db.collection.namestringThe MongoDB collection being accessed within the database stated in db.namespace.
db.namespacestringThe name of a database.
db.operation.namestringThe name of the MongoDB command being executed (e.g. find, aggregate, insert).
db.query.textstringThe obfuscated MongoDB command statement.
db.system.namestringThe database management system (DBMS) product as identified by the client instrumentation.
lock_modestringThe mode of Lock which denotes the degree of access
lock_typestringThe Resource over which the Lock controls access
memory_typestringThe type of memory used.
mongodb.client.app.namestringThe identifier of the client application which ran the operation, as set by the driver's appName connection option.
mongodb.cursor.await_databoolWhether the tailable cursor waits for new data instead of returning immediately.
mongodb.cursor.idstringThe identifier of the cursor.
mongodb.cursor.no_timeoutboolWhether the cursor is configured not to time out when idle.
mongodb.cursor.originating_commandstringThe obfuscated command that originally created the cursor.
mongodb.cursor.returned_batchesintThe cumulative number of batches returned by the cursor.
mongodb.cursor.returned_documentsintThe cumulative number of documents returned by the cursor.
mongodb.cursor.tailableboolWhether the cursor is a tailable cursor.
mongodb.explain_plan.hashstringFNV-64a hash of the obfuscated explain plan structure, identifying the execution plan shape.
mongodb.explain_plan.textstringThe obfuscated query explain plan, if collection is enabled.
mongodb.lsid.idstringThe UUID portion of the logical session identifier associated with the MongoDB operation.
mongodb.operation.commentsliceThe comments attached to the MongoDB command. String comments are reported as-is; array comments are expanded into multiple entries; non-string values are reported as MongoDB Extended JSON.
mongodb.operation.cpu.timedoubleCPU time in seconds for this query execution.
mongodb.operation.docs_examinedintNumber of documents examined by this query execution.
mongodb.operation.docs_returnedintNumber of documents returned by this query execution.
mongodb.operation.durationdoubleThe duration of the MongoDB operation in seconds.
mongodb.operation.idstringIdentifier of the MongoDB operation.
mongodb.operation.keys_examinedintNumber of index keys examined by this query execution.
mongodb.operation.plan.summarystringSummary of the execution plan for the MongoDB operation.
mongodb.operation.prepared_read_conflict.countintThe number of times the MongoDB operation had to wait for a prepared transaction with a write to commit or abort.
mongodb.operation.response_lengthintResponse length in bytes for this query execution.
mongodb.operation.statestringSimplified state of the MongoDB operation.
mongodb.operation.typestringThe raw MongoDB operation type from $currentOp.op (e.g. query, insert, update, remove, getmore, command).
mongodb.operation.wait.detailsstringDetails about what the MongoDB operation is waiting on.
mongodb.operation.wait.typesliceThe set of wait conditions the MongoDB operation is currently blocked on. Possible values: lock (from waitingForLock), flow_control (from waitingForFlowControl), and latch (when waitingForLatch is a non-empty document). An empty slice indicates the operation is not waiting on any of these conditions.
mongodb.operation.write_conflict.countintThe number of times the MongoDB operation conflicted with another write operation on the same document.
mongodb.operation.yield.countintThe number of times the MongoDB operation yielded to allow other operations to complete.
mongodb.query.frameworkstringThe MongoDB query execution engine that processed this operation. Only present for operations that flow through the query subsystem (reads, read-modify-writes, and getMore continuations); absent for pure inserts, index management, and administrative commands. Known values include classic and sbe.
mongodb.query.truncatedboolWhether the value carried by db.query.text is a truncated rendering of the MongoDB command, as indicated by $truncated in the currentOp output.
mongodb.wt.concurrent_transaction.ticket.typestringThe WiredTiger concurrent-transaction ticket type.
mongodb.wt.log.operation.typestringThe WiredTiger journal operation type.
operationstringThe MongoDB operation being counted.
operation_latencystringThe MongoDB operation with regards to latency
typestringThe result of a cache request.
user.namestringName of the user associated with the operation.

Data

  • JSON (latest): /data/collector/components/contrib-mongodbreceiver/latest.json
  • JSON (pinned): /data/collector/components/contrib-mongodbreceiver/contrib-mongodbreceiver-17c03051faa1.json
  • Explore: /collector/components/contrib/mongodbreceiver