MongoDB Metrics Source
The Vector mongodb_metrics
source
collects metrics from MongoDB.
Requirements
Configuration
- Common
- Advanced
- vector.toml
- vector.yaml
- vector.json
[sources.my_source_id]type = "mongodb_metrics" # requiredendpoints = ["mongodb://localhost:27017"] # requiredscrape_interval_secs = 15 # optional, default, seconds
- commonrequired[string]
endpoints
MongoDB Connection String URI Format
- View examples
- optionalstring
namespace
The namespace of metrics. Disabled if empty.
- Syntax:
literal
- Default:
"mongodb"
- Syntax:
- commonoptionaluint
scrape_interval_secs
The interval between scrapes.
- Default:
15
(seconds)
- Default:
Output
This component outputs the following metric events:
- counter
assets_total
Number of assertions raised since the MongoDB process started. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.type
- The assertion type
- counter
bson_parse_error_total
The total number of BSON parsing errors. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- gauge
connections
Number of connections in some state. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.state
- The connection state
- gauge
extra_info_heap_usage_bytes
The total size in bytes of heap space used by the database process. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- gauge
extra_info_page_faults
The total number of page faults. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- gauge
instance_local_time
The ISODate representing the current time, according to the server, in UTC. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- gauge
instance_uptime_estimate_seconds_total
The uptime in seconds as calculated from MongoDB’s internal course-grained time keeping system. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- gauge
instance_uptime_seconds_total
The number of seconds that the current MongoDB process has been active. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- gauge
memory
Current memory unsage. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.type
- Memory type
- gauge
mongod_global_lock_active_clients
Number of connected clients and the read and write operations performed by these clients. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.type
- Number type.
- gauge
mongod_global_lock_current_queue
Number of operations queued because of a lock. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.type
- Number type.
- counter
mongod_global_lock_total_time_seconds
The time since the database last started and created the globalLock. This is roughly equivalent to total server uptime. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- counter
mongod_locks_time_acquiring_global_seconds_total
Amount of time that any database has spent waiting for the global lock. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.mode
- Lock mode.type
- Lock type.
- gauge
mongod_metrics_cursor_open
Number of cursors. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.state
- Cursor state.
- counter
mongod_metrics_cursor_timed_out_total
The total number of cursors that have timed out since the server process started. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- counter
mongod_metrics_document_total
Document access and modification patterns. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.state
- Document state.
- gauge
mongod_metrics_get_last_error_wtime_num
The total number of getLastError operations with a specified write concern. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- counter
mongod_metrics_get_last_error_wtime_seconds_total
The total amount of time that the mongod has spent performing getLastError operations. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- counter
mongod_metrics_get_last_error_wtimeouts_total
The number of times that write concern operations have timed out as a result of the wtimeout threshold to getLastError. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- counter
mongod_metrics_operation_total
Update and query operations that MongoDB handles using special operation types. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.type
- Operation type.
- counter
mongod_metrics_query_executor_total
Data from query execution system. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.state
- Query state.
- counter
mongod_metrics_record_moves_total
Moves 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. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- counter
mongod_metrics_repl_apply_batches_num_total
The total number of batches applied across all databases. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- counter
mongod_metrics_repl_apply_batches_seconds_total
The total amount of time the mongod has spent applying operations from the oplog. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- counter
mongod_metrics_repl_apply_ops_total
The total number of oplog operations applied. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- counter
mongod_metrics_repl_buffer_count
The current number of operations in the oplog buffer. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- counter
mongod_metrics_repl_buffer_max_size_bytes_total
The maximum size of the buffer. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- counter
mongod_metrics_repl_buffer_size_bytes
The current size of the contents of the oplog buffer. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- gauge
mongod_metrics_repl_executor_queue
Number of queued operations in the replication executor. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.type
- Queue type.
- gauge
mongod_metrics_repl_executor_unsignaled_events
Number of unsignaled events in the replication executor. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- counter
mongod_metrics_repl_network_bytes_total
The total amount of data read from the replication sync source. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- counter
mongod_metrics_repl_network_getmores_num_total
The total number of getmore operations, which are operations that request an additional set of operations from the replication sync source. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- counter
mongod_metrics_repl_network_getmores_seconds_total
The total amount of time required to collect data from getmore operations. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- counter
mongod_metrics_repl_network_ops_total
The total number of operations read from the replication source. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- counter
mongod_metrics_repl_network_readers_created_total
The total number of oplog query processes created. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- counter
mongod_metrics_ttl_deleted_documents_total
The total number of documents deleted from collections with a ttl index. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- counter
mongod_metrics_ttl_passes_total
The number of times the background process removes documents from collections with a ttl index. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- gauge
mongod_op_latencies_histogram
Latency statistics. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.micros
- Bucket.type
- Latency type.
- gauge
mongod_op_latencies_latency
A 64-bit integer giving the total combined latency in microseconds. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.type
- Latency type.
- gauge
mongod_op_latencies_ops_total
A 64-bit integer giving the total number of operations performed on the collection since startup. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.type
- Latency type.
- gauge
mongod_storage_engine
The name of the current storage engine. This metric includes the following tags:
endpoint
- The absolute path of the originating file.engine
- Engine name.host
- The hostname of the MongoDB server.
- counter
mongod_wiredtiger_blockmanager_blocks_total
Statistics on the block manager operations. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.type
- Operation type.
- counter
mongod_wiredtiger_blockmanager_bytes_total
Statistics on the block manager operations. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.type
- Operation type.
- gauge
mongod_wiredtiger_cache_bytes
Statistics on the cache and page evictions from the cache. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.type
- Statistics type.
- counter
mongod_wiredtiger_cache_bytes_total
Statistics on the cache and page evictions from the cache. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.type
- Statistics type.
- counter
mongod_wiredtiger_cache_evicted_total
Statistics on the cache and page evictions from the cache. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.type
- Statistics type.
- gauge
mongod_wiredtiger_cache_max_bytes
Maximum cache size. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- gauge
mongod_wiredtiger_cache_overhead_percent
Percentage overhead. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- gauge
mongod_wiredtiger_cache_pages
Pages in the cache. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.type
- Pages type.
- counter
mongod_wiredtiger_cache_pages_total
Pages in the cache. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.type
- Pages type.
- gauge
mongod_wiredtiger_concurrent_transactions_available_tickets
Information on the number of concurrent of read and write transactions allowed into the WiredTiger storage engine This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.type
- Transactions type.
- gauge
mongod_wiredtiger_concurrent_transactions_out_tickets
Information on the number of concurrent of read and write transactions allowed into the WiredTiger storage engine This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.type
- Transactions type.
- gauge
mongod_wiredtiger_concurrent_transactions_total_tickets
Information on the number of concurrent of read and write transactions allowed into the WiredTiger storage engine This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.type
- Transactions type.
- counter
mongod_wiredtiger_log_bytes_total
Statistics on WiredTiger’s write ahead log (i.e. the journal). This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.type
- Bytes type.
- counter
mongod_wiredtiger_log_operations_total
Statistics on WiredTiger’s write ahead log (i.e. the journal). This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.type
- Operations type.
- counter
mongod_wiredtiger_log_records_scanned_total
Statistics on WiredTiger’s write ahead log (i.e. the journal). This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.type
- Scanned records type.
- counter
mongod_wiredtiger_log_records_total
Statistics on WiredTiger’s write ahead log (i.e. the journal). This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- counter
mongod_wiredtiger_session_open_sessions
Open session count. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- gauge
mongod_wiredtiger_transactions_checkpoint_seconds
Statistics on transaction checkpoints and operations. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.type
- Checkpoint type.
- counter
mongod_wiredtiger_transactions_checkpoint_seconds_total
Statistics on transaction checkpoints and operations. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- counter
mongod_wiredtiger_transactions_running_checkpoints
Statistics on transaction checkpoints and operations. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- counter
mongod_wiredtiger_transactions_total
Statistics on transaction checkpoints and operations. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.type
- Transactions type.
- counter
network_bytes_total
The number of bytes that reflects the amount of network traffic. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.state
- Bytes state.
- counter
network_metrics_num_requests_total
The total number of distinct requests that the server has received. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
- counter
mongodb_op_counters_repl_total
Database replication operations by type since the mongod instance last started. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.type
- Counter type.
- counter
mongodb_op_counters_total
Database operations by type since the mongod instance last started. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.type
- Counter type.
- gauge
up
If the MongoDB server is up or not. This metric includes the following tags:
endpoint
- The absolute path of the originating file.host
- The hostname of the MongoDB server.
Telemetry
This component provides the following metrics that can be retrieved through
the internal_metrics
source. See the
metrics section in the
monitoring page for more info.
- counter
events_in_total
The number of events accepted by this component either from tagged origin like file and uri, or cumulatively from other origins. This metric includes the following tags:
component_kind
- The Vector component kind.component_name
- The Vector component ID.component_type
- The Vector component type.container_name
- The name of the container from which the event originates.file
- The file from which the event originates.instance
- The Vector instance identified by host and port.job
- The name of the job producing Vector metrics.mode
- The connection mode used by the component.peer_addr
- The IP from which the event originates.peer_path
- The pathname from which the event originates.pod_name
- The name of the pod from which the event originates.uri
- The sanitized uri from which the event originates.
- counter
collect_completed_total
The total number of metrics collections completed for this component. This metric includes the following tags:
instance
- The Vector instance identified by host and port.job
- The name of the job producing Vector metrics.
- histogram
collect_duration_nanoseconds
The duration spent collecting of metrics for this component. This metric includes the following tags:
instance
- The Vector instance identified by host and port.job
- The name of the job producing Vector metrics.
- counter
events_out_total
The total number of events emitted by this component. This metric includes the following tags:
component_kind
- The Vector component kind.component_name
- The Vector component ID.component_type
- The Vector component type.instance
- The Vector instance identified by host and port.job
- The name of the job producing Vector metrics.
- counter
request_errors_total
The total number of requests errors for this component. This metric includes the following tags:
instance
- The Vector instance identified by host and port.job
- The name of the job producing Vector metrics.
- counter
parse_errors_total
The total number of errors parsing metrics for this component. This metric includes the following tags:
instance
- The Vector instance identified by host and port.job
- The name of the job producing Vector metrics.
How It Works
Context
By default, the mongodb_metrics
source will augment events with helpful
context keys as shown in the "Output" section.
serverStatus
command
MongoDB 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.
State
This component is stateless, meaning its behavior is consistent across each input.