MongoDB metrics
Collect metrics from the MongoDB database
status: stable
role: daemon
role: sidecar
delivery: at-least-once
acknowledgements: no
egress: batch
state: stateless
output: metrics
Requirements
User from endpoint should have enough privileges for running
serverStatus command.
Configuration
Example configurations
{
"sources": {
"my_source_id": {
"type": "mongodb_metrics",
"endpoints": [
"mongodb://localhost:27017"
]
}
}
}
[sources.my_source_id]
type = "mongodb_metrics"
endpoints = [ "mongodb://localhost:27017" ]
sources:
my_source_id:
type: mongodb_metrics
endpoints:
- mongodb://localhost:27017
{
"sources": {
"my_source_id": {
"type": "mongodb_metrics",
"endpoints": [
"mongodb://localhost:27017"
],
"namespace": "mongodb",
"scrape_interval_secs": 15
}
}
}
[sources.my_source_id]
type = "mongodb_metrics"
endpoints = [ "mongodb://localhost:27017" ]
namespace = "mongodb"
scrape_interval_secs = 15
sources:
my_source_id:
type: mongodb_metrics
endpoints:
- mongodb://localhost:27017
namespace: mongodb
scrape_interval_secs: 15
endpoints
required [string]A list of MongoDB instances to scrape.
Each endpoint must be in the Connection String URI Format.
namespace
optional string literalOverrides the default namespace for the metrics emitted by the source.
If set to an empty string, no namespace is added to the metrics.
By default, mongodb
is used.
default:
mongodb
Outputs
<component_id>
Default output stream of the component. Use this component’s ID as an input to downstream transforms and sinks.
Output Data
Metrics
assets_total
counterNumber of assertions raised since the MongoDB process started.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
type
The assertion type
bson_parse_error_total
counterThe total number of BSON parsing errors.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
connections
gaugeNumber of connections in some state.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
state
The connection state
extra_info_heap_usage_bytes
gaugeThe total size in bytes of heap space used by the database process.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
extra_info_page_faults
gaugeThe total number of page faults.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
instance_local_time
gaugeThe ISODate representing the current time, according to the server, in UTC.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
instance_uptime_estimate_seconds_total
gaugeThe uptime in seconds as calculated from MongoDB’s internal course-grained time keeping system.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
instance_uptime_seconds_total
gaugeThe number of seconds that the current MongoDB process has been active.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
memory
gaugeCurrent memory unsage.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
type
Memory type
mongod_global_lock_active_clients
gaugeNumber of connected clients and the read and write operations performed by these clients.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
type
Number type.
mongod_global_lock_current_queue
gaugeNumber of operations queued because of a lock.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
type
Number type.
mongod_global_lock_total_time_seconds
counterThe time since the database last started and created the globalLock. This is roughly equivalent to total server uptime.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
mongod_locks_time_acquiring_global_seconds_total
counterAmount of time that any database has spent waiting for the global lock.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
mode
Lock mode.
type
Lock type.
mongod_metrics_cursor_open
gaugeNumber of cursors.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
state
Cursor state.
mongod_metrics_cursor_timed_out_total
counterThe total number of cursors that have timed out since the server process started.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
mongod_metrics_document_total
counterDocument access and modification patterns.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
state
Document state.
mongod_metrics_get_last_error_wtime_num
gaugeThe total number of getLastError operations with a specified write concern.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
mongod_metrics_get_last_error_wtime_seconds_total
counterThe total amount of time that the mongod has spent performing getLastError operations.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
mongod_metrics_get_last_error_wtimeouts_total
counterThe number of times that write concern operations have timed out as a result of the wtimeout threshold to getLastError.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
mongod_metrics_operation_total
counterUpdate and query operations that MongoDB handles using special operation types.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
type
Operation type.
mongod_metrics_query_executor_total
counterData from query execution system.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
state
Query state.
mongod_metrics_record_moves_total
counterMoves reports the total number of times documents move within the on-disk representation of the MongoDB data set. Documents move as a result of operations that increase the size of the document beyond their allocated record size.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
mongod_metrics_repl_apply_batches_num_total
counterThe total number of batches applied across all databases.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
mongod_metrics_repl_apply_batches_seconds_total
counterThe total amount of time the mongod has spent applying operations from the oplog.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
mongod_metrics_repl_apply_ops_total
counterThe total number of oplog operations applied.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
mongod_metrics_repl_buffer_count
counterThe current number of operations in the oplog buffer.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
mongod_metrics_repl_buffer_max_size_bytes_total
counterThe maximum size of the buffer.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
mongod_metrics_repl_buffer_size_bytes
counterThe current size of the contents of the oplog buffer.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
mongod_metrics_repl_executor_queue
gaugeNumber of queued operations in the replication executor.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
type
Queue type.
mongod_metrics_repl_executor_unsignaled_events
gaugeNumber of unsignaled events in the replication executor.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
mongod_metrics_repl_network_bytes_total
counterThe total amount of data read from the replication sync source.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
mongod_metrics_repl_network_getmores_num_total
counterThe total number of getmore operations, which are operations that request an additional set of operations from the replication sync source.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
mongod_metrics_repl_network_getmores_seconds_total
counterThe total amount of time required to collect data from getmore operations.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
mongod_metrics_repl_network_ops_total
counterThe total number of operations read from the replication source.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
mongod_metrics_repl_network_readers_created_total
counterThe total number of oplog query processes created.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
mongod_metrics_ttl_deleted_documents_total
counterThe total number of documents deleted from collections with a ttl index.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
mongod_metrics_ttl_passes_total
counterThe number of times the background process removes documents from collections with a ttl index.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
mongod_op_latencies_histogram
gaugeLatency statistics.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
micros
Bucket.
type
Latency type.
mongod_op_latencies_latency
gaugeA 64-bit integer giving the total combined latency in microseconds.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
type
Latency type.
mongod_op_latencies_ops_total
gaugeA 64-bit integer giving the total number of operations performed on the collection since startup.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
type
Latency type.
mongod_storage_engine
gaugeThe name of the current storage engine.
endpoint
The absolute path of the originating file.
engine
Engine name.
host
The hostname of the MongoDB server.
mongod_wiredtiger_blockmanager_blocks_total
counterStatistics on the block manager operations.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
type
Operation type.
mongod_wiredtiger_blockmanager_bytes_total
counterStatistics on the block manager operations.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
type
Operation type.
mongod_wiredtiger_cache_bytes
gaugeStatistics on the cache and page evictions from the cache.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
type
Statistics type.
mongod_wiredtiger_cache_bytes_total
counterStatistics on the cache and page evictions from the cache.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
type
Statistics type.
mongod_wiredtiger_cache_evicted_total
counterStatistics on the cache and page evictions from the cache.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
type
Statistics type.
mongod_wiredtiger_cache_max_bytes
gaugeMaximum cache size.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
mongod_wiredtiger_cache_overhead_percent
gaugePercentage overhead.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
mongod_wiredtiger_cache_pages
gaugePages in the cache.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
type
Pages type.
mongod_wiredtiger_cache_pages_total
counterPages in the cache.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
type
Pages type.
mongod_wiredtiger_concurrent_transactions_available_tickets
gaugeInformation on the number of concurrent of read and write transactions allowed into the WiredTiger storage engine
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
type
Transactions type.
mongod_wiredtiger_concurrent_transactions_out_tickets
gaugeInformation on the number of concurrent of read and write transactions allowed into the WiredTiger storage engine
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
type
Transactions type.
mongod_wiredtiger_concurrent_transactions_total_tickets
gaugeInformation on the number of concurrent of read and write transactions allowed into the WiredTiger storage engine
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
type
Transactions type.
mongod_wiredtiger_log_bytes_total
counterStatistics on WiredTiger’s write ahead log (i.e. the journal).
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
type
Bytes type.
mongod_wiredtiger_log_operations_total
counterStatistics on WiredTiger’s write ahead log (i.e. the journal).
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
type
Operations type.
mongod_wiredtiger_log_records_scanned_total
counterStatistics on WiredTiger’s write ahead log (i.e. the journal).
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
type
Scanned records type.
mongod_wiredtiger_log_records_total
counterStatistics on WiredTiger’s write ahead log (i.e. the journal).
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
mongod_wiredtiger_session_open_sessions
counterOpen session count.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
mongod_wiredtiger_transactions_checkpoint_seconds
gaugeStatistics on transaction checkpoints and operations.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
type
Checkpoint type.
mongod_wiredtiger_transactions_checkpoint_seconds_total
counterStatistics on transaction checkpoints and operations.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
mongod_wiredtiger_transactions_running_checkpoints
counterStatistics on transaction checkpoints and operations.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
mongod_wiredtiger_transactions_total
counterStatistics on transaction checkpoints and operations.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
type
Transactions type.
mongodb_op_counters_repl_total
counterDatabase replication operations by type since the mongod instance last started.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
type
Counter type.
mongodb_op_counters_total
counterDatabase operations by type since the mongod instance last started.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
type
Counter type.
network_bytes_total
counterThe number of bytes that reflects the amount of network traffic.
endpoint
The absolute path of the originating file.
host
The hostname of the MongoDB server.
state
Bytes state.
Telemetry
Metrics
linkcollect_completed_total
counterThe total number of metrics collections completed for this component.
host
optional
The hostname of the system Vector is running on.
pid
optional
The process ID of the Vector instance.
collect_duration_seconds
histogramThe duration spent collecting of metrics for this component.
host
optional
The hostname of the system Vector is running on.
pid
optional
The process ID of the Vector instance.
component_discarded_events_total
counterThe number of events dropped by this component.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
host
optional
The hostname of the system Vector is running on.
intentional
True if the events were discarded intentionally, like a
filter
transform, or false if due to an error.pid
optional
The process ID of the Vector instance.
component_errors_total
counterThe total number of errors encountered by this component.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
error_type
The type of the error
host
optional
The hostname of the system Vector is running on.
pid
optional
The process ID of the Vector instance.
stage
The stage within the component at which the error occurred.
component_received_bytes_total
counterThe number of raw bytes accepted by this component from source origins.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
container_name
optional
The name of the container from which the data originated.
file
optional
The file from which the data originated.
host
optional
The hostname of the system Vector is running on.
mode
optional
The connection mode used by the component.
peer_addr
optional
The IP from which the data originated.
peer_path
optional
The pathname from which the data originated.
pid
optional
The process ID of the Vector instance.
pod_name
optional
The name of the pod from which the data originated.
uri
optional
The sanitized URI from which the data originated.
component_received_event_bytes_total
counterThe number of event bytes accepted by this component either from
tagged origins like file and uri, or cumulatively from other origins.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
container_name
optional
The name of the container from which the data originated.
file
optional
The file from which the data originated.
host
optional
The hostname of the system Vector is running on.
mode
optional
The connection mode used by the component.
peer_addr
optional
The IP from which the data originated.
peer_path
optional
The pathname from which the data originated.
pid
optional
The process ID of the Vector instance.
pod_name
optional
The name of the pod from which the data originated.
uri
optional
The sanitized URI from which the data originated.
component_received_events_count
histogramA histogram of the number of events passed in each internal batch in Vector’s internal topology.
Note that this is separate than sink-level batching. It is mostly useful for low level debugging performance issues in Vector due to small internal batches.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
container_name
optional
The name of the container from which the data originated.
file
optional
The file from which the data originated.
host
optional
The hostname of the system Vector is running on.
mode
optional
The connection mode used by the component.
peer_addr
optional
The IP from which the data originated.
peer_path
optional
The pathname from which the data originated.
pid
optional
The process ID of the Vector instance.
pod_name
optional
The name of the pod from which the data originated.
uri
optional
The sanitized URI from which the data originated.
component_received_events_total
counterThe number of events accepted by this component either from tagged
origins like file and uri, or cumulatively from other origins.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
container_name
optional
The name of the container from which the data originated.
file
optional
The file from which the data originated.
host
optional
The hostname of the system Vector is running on.
mode
optional
The connection mode used by the component.
peer_addr
optional
The IP from which the data originated.
peer_path
optional
The pathname from which the data originated.
pid
optional
The process ID of the Vector instance.
pod_name
optional
The name of the pod from which the data originated.
uri
optional
The sanitized URI from which the data originated.
component_sent_event_bytes_total
counterThe total number of event bytes emitted by this component.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
host
optional
The hostname of the system Vector is running on.
output
optional
The specific output of the component.
pid
optional
The process ID of the Vector instance.
component_sent_events_total
counterThe total number of events emitted by this component.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
host
optional
The hostname of the system Vector is running on.
output
optional
The specific output of the component.
pid
optional
The process ID of the Vector instance.
source_lag_time_seconds
histogramThe difference between the timestamp recorded in each event and the time when it was ingested, expressed as fractional seconds.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
host
optional
The hostname of the system Vector is running on.
pid
optional
The process ID of the Vector instance.
How it works
MongoDB serverStatus
command
The serverStatus command
returns a document that provides an overview of the database’s
state. The output fields vary depending on the version of
MongoDB, underlying operating system platform, the storage
engine, and the kind of node, including
mongos
, mongod
or
replica set
member.