Project: Vector (Observability and Analysis / Observability)
File: 2020-08-31-3641-mongo-metrics.md

This RFC is to introduce a new metrics source to consume metrics from MongoDB database servers. The high level plan is to implement one source that collects metrics from MongoDB server instances. Background reading on MongoDB monitoring: https://docs.mongodb.com/manual/administration/monitoring/ This RFC will cover: A new source for MongoDB server metrics. This RFC will not cover: Other databases. Users want to collect, transform, and forward metrics to better observe how their MongoDB databases are performing. Build a single source called `mongodb_metrics` (name to be confirmed) to collect MongoDB metrics. We support all non-EOL'ed MongoDB versions. The recommended implementation is to use the Rust MongoDB client to connect the target database server by the address specified in configuration. Proposed client: https://github.com/mongodb/mongo-rust-driver https://crates.io/crates/mongodb We'd call the following on the server from the client upon connection: on each DB per collection per pool This should result in the following metrics being collected: `mongodb_up` -> Used as an uptime metric with 1 for successful collection and 0 for failed collection (gauge) `mongodbassertstotal` (counter) `mongodb_connections` (gauge) `mongodbconnectionsmetricscreatedtotal` (counter) `mongodbextrainfoheapusage_bytes` (gauge) `mongodbextrainfopagefaults` (gauge) `mongodbinstancelocal_time` (gauge) `mongodbinstanceuptimeestimateseconds_total` (counter) `mongodbinstanceuptimesecondstotal` (counter) `mongodb_memory` tagged with type (gauge) `mongodbmongodgloballockclient` tagged with type (gauge) `mongodbmongodgloballockcurrent_queue` tagged with type (gauge) `mongodbmongodgloballockratio` (gauge) `mongodbmongodgloballocktotal` (counter) `mongodbmongodlockstimeacquiringglobalseconds_total` tagged with database (counter) `mongodbmongodlockstimelockedglobalseconds_total` tagged with database and type (counter) `mongodbmongodlockstimelockedlocalseconds_total` tagged with database and type (counter) `mongodbmongodmetricscursoropen` tagged with state (gauge) `mongodbmongodmetricscursortimedouttotal` (counter) `mongodbmongodmetricsdocumenttotal` tagged with state (counter) `mongodbmongodmetricsgetlasterrorwtime_num` (gauge) `mongodbmongodmetricsgetlasterrorwtimesecondstotal` (counter) `mongodbmongodmetricsgetlasterrorwtimeouts_total` (counter) `mongodbmongodmetricsoperationtotal` tagged with type (counter) `mongodbmongodmetricsqueryexecutor_total` tagged with state (counter) `mongodbmongodmetricsrecordmoves_total` (counter) `mongodbmongodmetricsreplapplybatchesnum_total` (counter) `mongodbmongodmetricsreplapplybatchesseconds_total` (counter) `mongodbmongodmetricsreplapplyopstotal` (counter) `mongodbmongodmetricsreplbuffer_count` (gauge) `mongodbmongodmetricsreplbuffermaxsizebytestotal` (counter) `mongodbmongodmetricsreplbuffersizebytes` (gauge) `mongodbmongodmetricsreplexecutoreventwaiters` (gauge) `mongodbmongodmetricsreplexecutor_queue` tagged with type (gauge) `mongodbmongodmetricsreplexecutorunsignaledevents` (gauge) `mongodbmongodmetricsreplnetworkbytestotal` (counter) `mongodbmongodmetricsreplnetworkgetmoresnum_total` (counter) `mongodbmongodmetricsreplnetworkgetmoresseconds_total` (counter) `mongodbmongodmetricsreplnetworkopstotal` (counter) `mongodbmongodmetricsreplnetworkreaderscreated_total` (counter) `mongodbmongodmetricsreploploginsertbytes_total` (counter) `mongodbmongodmetricsreploploginsertnum_total` (counter) `mongodbmongodmetricsreploploginsertseconds_total` (counter) `mongodbmongodmetricsttldeleteddocumentstotal` (counter) `mongodbmongodmetricsttlpasses_total` (counter) `mongodbmongodoplatencieshistogram` tagged with micros and type (gauge) `mongodbmongodoplatencieslatency` tagged with type (gauge) `mongodbmongodoplatenciesops_total` tagged with type (gauge) `mongodbmongodstorage_engine` (gauge) `mongodbmongodwiredtigerblockmanagerblocks_total` tagged with type (counter) `mongodbmongodwiredtigerblockmanagerbytes_total` tagged with type (counter) `mongodbmongodwiredtigercachebytes` tagged with type (gauge) `mongodbmongodwiredtigercachebytes_total` tagged with type (counter) `mongodbmongodwiredtigercacheevicted_total` tagged with type (counter) `mongodbmongodwiredtigercachemax_bytes` (gauge) `mongodbmongodwiredtigercacheoverhead_percent` (gauge) `mongodbmongodwiredtigercachepages` tagged with type (gauge) `mongodbmongodwiredtigercachepages_total` tagged with type (counter) `mongodbmongodwiredtigerconcurrenttransactionsavailabletickets` tagged with type (gauge) `mongodbmongodwiredtigerconcurrenttransactionsouttickets` tagged with type (gauge) `mongodbmongodwiredtigerconcurrenttransactionstotaltickets` tagged with type (gauge) `mongodbmongodwiredtigerlogbytes_total` tagged with type (counter) `mongodbmongodwiredtigerlogoperations_total` tagged with type (counter) `mongodbmongodwiredtigerlogrecordsscannedtotal` (counter) `mongodbmongodwiredtigerlogrecords_total` tagged with type (counter) `mongodbmongodwiredtigersessionopen_cursors` (gauge) `mongodbmongodwiredtigersessionopen_sessions` (gauge) `mongodbmongodwiredtigertransactionscheckpoint_seconds` tagged with type (gauge) `mongodbmongodwiredtigertransactionscheckpointsecondstotal` (counter) `mongodbmongodwiredtigertransactionsrunning_checkpoints` (gauge) `mongodbmongodwiredtigertransactionstotal` tagged with type (counter) `mongodbnetworkbytes_total` tagged with state (counter) `mongodbnetworkmetricsnumrequests_total` (counter) `mongodbopcountersrepltotal` tagged with type (counter) `mongodbopcounters_total` tagged with type (counter) All metrics will also be tagged with the `endpoint` (stripped of user name & password if authentication is used) and `host`. The following additional source configuration will be added: ```toml [sources.mysourceid] type = "mongodb_metrics" # required endpoint = "mongodb://mongodb_exporter:s3cr3tpassw0rd@localhost:27017" # required - address of the MongoDBserver. scrapeintervalsecs = 15 # optional, default, seconds namespace = "mongodb" # optional, default is "mongodb", namespace to attach to metrics. ``` We will also expose the TLS settings and support `tls` in the `endpoint` URL. We'd also add a guide for doing this with MongoDB Authorization. MongoDB is a commonly adopted modern

Users frequently want to monitor its state and performance. Additionally, as part of Vector's vision to be the "one tool" for ingesting and shipping observability data, it makes sense to add as many sources as possible to reduce the likelihood that a user will not be able to ingest metrics from their tools. https://github.com/dcu/mongodb_exporter https://github.com/percona/mongodb_exporter https://github.com/influxdata/telegraf/tree/master/plugins/inputs/mongodb https://collectd.org/wiki/index.php/Plugin:MongoDB https://docs.datadoghq.com/integrations/mongo/?tab=host ```text gogcduration_seconds{quantile="0"} 0 gogcduration_seconds{quantile="0.25"} 0 gogcduration_seconds{quantile="0.5"} 0 gogcduration_seconds{quantile="0.75"} 0 gogcduration_seconds{quantile="1"} 0 gogcdurationsecondssum 0 gogcdurationsecondscount 0 go_goroutines 9 go_info{version="go1.15"} 1 gomemstatsalloc_bytes 2.585e+06 gomemstatsallocbytestotal 2.585e+06 gomemstatsbuckhashsys_bytes 1.445082e+06 gomemstatsfrees_total 2401 gomemstatsgccpufraction 0 gomemstatsgcsysbytes 4.171848e+06 gomemstatsheapallocbytes 2.585e+06 gomemstatsheapidlebytes 6.2349312e+07 gomemstatsheapinusebytes 4.13696e+06 gomemstatsheap_objects 17419 gomemstatsheapreleasedbytes 6.2316544e+07 gomemstatsheapsysbytes 6.6486272e+07 gomemstatslastgctime_seconds 0 gomemstatslookups_total 0 gomemstatsmallocs_total 19820 gomemstatsmcacheinusebytes 13888 gomemstatsmcachesysbytes 16384 gomemstatsmspaninusebytes 72216 gomemstatsmspansysbytes 81920 gomemstatsnextgcbytes 4.473924e+06 gomemstatsothersysbytes 1.052638e+06 gomemstatsstackinusebytes 622592 gomemstatsstacksysbytes 622592 gomemstatssys_bytes 7.3876736e+07 go_threads 8 mongodbassertstotal{type="msg"} 0 mongodbassertstotal{type="regular"} 0 mongodbassertstotal{type="rollovers"} 0 mongodbassertstotal{type="user"} 4 mongodbassertstotal{type="warning"} 0 mongodb_connections{state="active"} 2 mongodb_connections{state="available"} 201 mongodb_connections{state="current"} 3 mongodbconnectionsmetricscreatedtotal 3 mongodbexporterbuild_info{branch="",goversion="go1.15",revision="",version=""} 1 mongodbexporterlastscrapeduration_seconds 0.003769113 mongodbexporterlastscrapeerror 0 mongodbexporterscrapeerrorstotal 0 mongodbexporterscrapes_total 2 mongodbextrainfoheapusage_bytes 0 mongodbextrainfopagefaults_total 912 mongodbinstancelocal_time 1.600833548e+09 mongodbinstanceuptimeestimateseconds 35 mongodbinstanceuptime_seconds 35 mongodb_memory{type="mapped"} 0 mongodbmemory{type="mappedwith_journal"} 0 mongodb_memory{type="resident"} 36 mongodb_memory{type="virtual"} 6385 mongodbmongodgloballockclient{type="reader"} 0 mongodbmongodgloballockclient{type="writer"} 0 mongodbmongodgloballockcurrent_queue{type="reader"} 0 mongodbmongodgloballockcurrent_queue{type="writer"} 0 mongodbmongodgloballockratio 0 mongodbmongodgloballocktotal 0 mongodbmongodlockstimeacquiringglobalmicroseconds_total{database="Collection",type="read"} 0 mongodbmongodlockstimeacquiringglobalmicroseconds_total{database="Collection",type="write"} 0 mongodbmongodlockstimeacquiringglobalmicroseconds_total{database="Database",type="read"} 0 mongodbmongodlockstimeacquiringglobalmicroseconds_total{database="Database",type="write"} 0 mongodbmongodlockstimeacquiringglobalmicroseconds_total{database="Global",type="read"} 0 mongodbmongodlockstimeacquiringglobalmicroseconds_total{database="Global",type="write"} 0 mongodbmongodlockstimeacquiringglobalmicroseconds_total{database="Mutex",type="read"} 0 mongodbmongodlockstimeacquiringglobalmicroseconds_total{database="Mutex",type="write"} 0 mongodbmongodlockstimeacquiringglobalmicroseconds_total{database="ParallelBatchWriterMode",type="read"} 0 mongodbmongodlockstimeacquiringglobalmicroseconds_total{database="ParallelBatchWriterMode",type="write"} 0 mongodbmongodlockstimeacquiringglobalmicroseconds_total{database="ReplicationStateTransition",type="read"} 0 mongodbmongodlockstimeacquiringglobalmicroseconds_total{database="ReplicationStateTransition",type="write"} 0 mongodbmongodlockstimeacquiringglobalmicroseconds_total{database="oplog",type="read"} 0 mongodbmongodlockstimeacquiringglobalmicroseconds_total{database="oplog",type="write"} 0 mongodbmongodlockstimelockedglobalmicroseconds_total{database="Collection",type="read"} 0 mongodbmongodlockstimelockedglobalmicroseconds_total{database="Collection",type="write"} 0 mongodbmongodlockstimelockedglobalmicroseconds_total{database="Database",type="read"} 0 mongodbmongodlockstimelockedglobalmicroseconds_total{database="Database",type="write"} 0 mongodbmongodlockstimelockedglobalmicroseconds_total{database="Global",type="read"} 0 mongodbmongodlockstimelockedglobalmicroseconds_total{database="Global",type="write"} 0 mongodbmongodlockstimelockedglobalmicroseconds_total{database="Mutex",type="read"} 0 mongodbmongodlockstimelockedglobalmicroseconds_total{database="Mutex",type="write"} 0 mongodbmongodlockstimelockedglobalmicroseconds_total{database="ParallelBatchWriterMode",type="read"} 0 mongodbmongodlockstimelockedglobalmicroseconds_total{database="ParallelBatchWriterMode",type="write"} 0 mongodbmongodlockstimelockedglobalmicroseconds_total{database="ReplicationStateTransition",type="read"} 0 mongodbmongodlockstimelockedglobalmicroseconds_total{database="ReplicationStateTransition",type="write"} 0 mongodbmongodlockstimelockedglobalmicroseconds_total{database="oplog",type="read"} 0 mongodbmongodlockstimelockedglobalmicroseconds_total{database="oplog",type="write"} 0 mongodbmongodlockstimelockedlocalmicroseconds_total{database="Collection",type="read"} 0 mongodbmongodlockstimelockedlocalmicroseconds_total{database="Collection",type="write"} 0 mongodbmongodlockstimelockedlocalmicroseconds_total{database="Database",type="read"} 0 mongodbmongodlockstimelockedlocalmicroseconds_total{database="Database",type="write"} 0 mongodbmongodlockstimelockedlocalmicroseconds_total{database="Global",type="read"} 0 mongodbmongodlockstimelockedlocalmicroseconds_total{database="Global",type="write"} 0 mongodbmongodlockstimelockedlocalmicroseconds_total{database="Mutex",type="read"} 0 mongodbmongodlockstimelockedlocalmicroseconds_total{database="Mutex",type="write"} 0 mongodbmongodlockstimelockedlocalmicroseconds_total{database="ParallelBatchWriterMode",type="read"} 0 mongodbmongodlockstimelockedlocalmicroseconds_total{database="ParallelBatchWriterMode",type="write"} 0 mongodbmongodlockstimelockedlocalmicroseconds_total{database="ReplicationStateTransition",type="read"} 0 mongodbmongodlockstimelockedlocalmicroseconds_total{database="ReplicationStateTransition",type="write"} 0 mongodbmongodlockstimelockedlocalmicroseconds_total{database="oplog",type="read"} 0 mongodbmongodlockstimelockedlocalmicroseconds_total{database="oplog",type="write"} 0 mongodbmongodmetricscursoropen{state="noTimeout"} 0 mongodbmongodmetricscursoropen{state="pinned"} 0 mongodbmongodmetricscursoropen{state="total"} 0 mongodbmongodmetricscursortimedouttotal 0 mongodbmongodmetricsdocumenttotal{state="deleted"} 0 mongodbmongodmetricsdocumenttotal{state="inserted"} 0 mongodbmongodmetricsdocumenttotal{state="returned"} 0 mongodbmongodmetricsdocumenttotal{state="updated"} 0 mongodbmongodmetricsgetlasterrorwtimenumtotal 0 mongodbmongodmetricsgetlasterrorwtimetotalmilliseconds 0 mongodbmongodmetricsgetlasterrorwtimeouts_total 0 mongodbmongodmetricsoperationtotal{type="fastmod"} 0 mongodbmongodmetricsoperationtotal{type="idhack"} 0 mongodbmongodmetricsoperationtotal{type="scanandorder"} 0 mongodbmongodmetricsqueryexecutor_total{state="scanned"} 0 mongodbmongodmetricsqueryexecutortotal{state="scannedobjects"} 0 mongodbmongodmetricsrecordmoves_total 0 mongodbmongodmetricsreplapplybatchesnum_total 0 mongodbmongodmetricsreplapplybatchestotal_milliseconds 0 mongodbmongodmetricsreplapplyopstotal 0 mongodbmongodmetricsreplbuffer_count 0 mongodbmongodmetricsreplbuffermaxsize_bytes 0 mongodbmongodmetricsreplbuffersizebytes 0 mongodbmongodmetricsreplexecutoreventwaiters 0 mongodbmongodmetricsreplexecutor_queue{type="networkInProgress"} 0 mongodbmongodmetricsreplexecutor_queue{type="sleepers"} 0 mongodbmongodmetricsreplexecutorunsignaledevents 0 mongodbmongodmetricsreplnetworkbytestotal 0 mongodbmongodmetricsreplnetworkgetmoresnum_total 0 mongodbmongodmetricsreplnetworkgetmorestotal_milliseconds 0 mongodbmongodmetricsreplnetworkopstotal 0 mongodbmongodmetricsreplnetworkreaderscreated_total 0 mongodbmongodmetricsreploploginsertbytes_total 0 mongodbmongodmetricsreploploginsertnum_total 0 mongodbmongodmetricsreploploginserttotal_milliseconds 0 mongodbmongodmetricsttldeleteddocumentstotal 0 mongodbmongodmetricsttlpasses_total 0 mongodbmongodoplatencieshistogram{micros="128",type="command"} 2 mongodbmongodoplatencieshistogram{micros="16",type="command"} 4 mongodbmongodoplatencieshistogram{micros="256",type="command"} 1 mongodbmongodoplatencieshistogram{micros="32",type="command"} 3 mongodbmongodoplatencieslatency_total{type="command"} 1057 mongodbmongodoplatencieslatency_total{type="read"} 0 mongodbmongodoplatencieslatency_total{type="write"} 0 mongodbmongodoplatenciesops_total{type="command"} 10 mongodbmongodoplatenciesops_total{type="read"} 0 mongodbmongodoplatenciesops_total{type="write"} 0 mongodbmongodstorage_engine{engine="wiredTiger"} 1 mongodbmongodwiredtigerblockmanagerblockstotal{type="preloaded"} 0 mongodbmongodwiredtigerblockmanagerblocks_total{type="read"} 0 mongodbmongodwiredtigerblockmanagerblockstotal{type="readmapped"} 0 mongodbmongodwiredtigerblockmanagerblocks_total{type="written"} 0 mongodbmongodwiredtigerblockmanagerbytes_total{type="read"} 0 mongodbmongodwiredtigerblockmanagerbytestotal{type="readmapped"} 0 mongodbmongodwiredtigerblockmanagerbytes_total{type="written"} 0 mongodbmongodwiredtigercachebytes{type="dirty"} 27241 mongodbmongodwiredtigercachebytes{type="internal_pages"} 1912 mongodbmongodwiredtigercachebytes{type="leaf_pages"} 27242 mongodbmongodwiredtigercachebytes{type="total"} 29154 mongodbmongodwiredtigercachebytes_total{type="read"} 0 mongodbmongodwiredtigercachebytes_total{type="written"} 0 mongodbmongodwiredtigercacheevicted_total{type="modified"} 0 mongodbmongodwiredtigercacheevicted_total{type="unmodified"} 0 mongodbmongodwiredtigercachemax_bytes 1.6642998272e+10 mongodbmongodwiredtigercacheoverhead_percent 8 mongodbmongodwiredtigercachepages{type="dirty"} 7 mongodbmongodwiredtigercachepages{type="total"} 18 mongodbmongodwiredtigercachepages_total{type="read"} 0 mongodbmongodwiredtigercachepages_total{type="written"} 0 mongodbmongodwiredtigerconcurrenttransactionsavailabletickets{type="read"} 127 mongodbmongodwiredtigerconcurrenttransactionsavailabletickets{type="write"} 128 mongodbmongodwiredtigerconcurrenttransactionsouttickets{type="read"} 1 mongodbmongodwiredtigerconcurrenttransactionsouttickets{type="write"} 0 mongodbmongodwiredtigerconcurrenttransactionstotaltickets{type="read"} 128 mongodbmongodwiredtigerconcurrenttransactionstotaltickets{type="write"} 128 mongodbmongodwiredtigerlogbytes_total{type="payload"} 13165 mongodbmongodwiredtigerlogbytes_total{type="written"} 17792 mongodbmongodwiredtigerlogoperations_total{type="flush"} 327 mongodbmongodwiredtigerlogoperations_total{type="read"} 0 mongodbmongodwiredtigerlogoperations_total{type="scan"} 0 mongodbmongodwiredtigerlogoperationstotal{type="scandouble"} 0 mongodbmongodwiredtigerlogoperations_total{type="sync"} 13 mongodbmongodwiredtigerlogoperationstotal{type="syncdir"} 1 mongodbmongodwiredtigerlogoperations_total{type="write"} 44 mongodbmongodwiredtigerlogrecordsscannedtotal 0 mongodbmongodwiredtigerlogrecords_total{type="compressed"} 13 mongodbmongodwiredtigerlogrecords_total{type="uncompressed"} 16 mongodbmongodwiredtigersessionopencursorstotal 0 mongodbmongodwiredtigersessionopensessionstotal 15 mongodbmongodwiredtigertransactionscheckpoint_milliseconds{type="max"} 0 mongodbmongodwiredtigertransactionscheckpoint_milliseconds{type="min"} 0 mongodbmongodwiredtigertransactionscheckpointmillisecondstotal 0 mongodbmongodwiredtigertransactionsrunning_checkpoints 0 mongodbmongodwiredtigertransactionstotal{type="begins"} 12 mongodbmongodwiredtigertransactionstotal{type="checkpoints"} 0 mongodbmongodwiredtigertransactionstotal{type="committed"} 6 mongodbmongodwiredtigertransactionstotal{type="rolledback"} 6 mongodbnetworkbytestotal{state="inbytes"} 1981 mongodbnetworkbytestotal{state="outbytes"} 47869 mongodbnetworkmetricsnumrequests_total 14 mongodbopcountersrepltotal{type="command"} 0 mongodbopcountersrepltotal{type="delete"} 0 mongodbopcountersrepltotal{type="getmore"} 0 mongodbopcountersrepltotal{type="insert"} 0 mongodbopcountersrepltotal{type="query"} 0 mongodbopcountersrepltotal{type="update"} 0 mongodbopcounters_total{type="command"} 17 mongodbopcounters_total{type="delete"} 0 mongodbopcounters_total{type="getmore"} 0 mongodbopcounters_total{type="insert"} 0 mongodbopcounters_total{type="query"} 1 mongodbopcounters_total{type="update"} 0 mongodb_up 1 mongodbversioninfo{mongodb="4.4.0"} 1 promhttpmetrichandlerrequestsin_flight 1 promhttpmetrichandlerrequeststotal{code="200"} 0 promhttpmetrichandlerrequeststotal{code="500"} 0 promhttpmetrichandlerrequeststotal{code="503"} 0 ``` In Prometheus format. ```text gogcduration_seconds{quantile="0"} 2.8372e-05 gogcduration_seconds{quantile="0.25"} 2.8372e-05 gogcduration_seconds{quantile="0.5"} 0.00016285

0.00016426 gogcduration_seconds{quantile="1"} 0.00016426 gogcdurationsecondssum 0.000355482 gogcdurationsecondscount 3 go_goroutines 23 go_info{version="go1.14.5"} 1 gomemstatsalloc_bytes 7.146072e+06 gomemstatsallocbytestotal 1.0233104e+07 gomemstatsbuckhashsys_bytes 1.448715e+06 gomemstatsfrees_total 32884 gomemstatsgccpufraction 0.005923686998994504 gomemstatsgcsysbytes 3.57812e+06 gomemstatsheapallocbytes 7.146072e+06 gomemstatsheapidlebytes 5.7524224e+07 gomemstatsheapinusebytes 8.830976e+06 gomemstatsheap_objects 28822 gomemstatsheapreleasedbytes 5.738496e+07 gomemstatsheapsysbytes 6.63552e+07 gomemstatslastgctime_seconds 1.599788641219671e+09 gomemstatslookups_total 0 gomemstatsmallocs_total 61706 gomemstatsmcacheinusebytes 13888 gomemstatsmcachesysbytes 16384 gomemstatsmspaninusebytes 124712 gomemstatsmspansysbytes 131072 gomemstatsnextgcbytes 9.927312e+06 gomemstatsothersysbytes 1.985773e+06 gomemstatsstackinusebytes 753664 gomemstatsstacksysbytes 753664 gomemstatssys_bytes 7.4268928e+07 go_threads 14 mongodbactivereads{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 1 mongodbactivewrites{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbaggregatecommand_failed{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbaggregatecommand_total{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbassertmsg{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbassertregular{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbassertrollovers{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbassertuser{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 7 mongodbassertwarning{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbavailablereads{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 127 mongodbavailablewrites{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 128 mongodb_commands{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 20 mongodbcommandsper_sec{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbconnectionsavailable{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 838859 mongodbconnectionscurrent{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 1 mongodbconnectionstotal_created{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 1 mongodbcountcommand_failed{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbcountcommand_total{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 3 mongodbcursorno_timeout{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbcursornotimeoutcount{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbcursorpinned{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbcursorpinned_count{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbcursortimed_out{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbcursortimedoutcount{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbcursortotal{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbcursortotal_count{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbdeletecommand_failed{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbdeletecommand_total{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodb_deletes{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbdeletesper_sec{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbdistinctcommand_failed{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbdistinctcommand_total{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbdocumentdeleted{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbdocumentinserted{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbdocumentreturned{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbdocumentupdated{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbfindandmodifycommand_failed{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbfindandmodifycommand_total{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbfindcommand_failed{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbfindcommand_total{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 1 mongodb_flushes{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbflushesper_sec{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbflushestotaltimens{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbgetmorecommandfailed{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbgetmorecommandtotal{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodb_getmores{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbgetmoresper_sec{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbinsertcommand_failed{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbinsertcommand_total{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodb_inserts{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbinsertsper_sec{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbjumbochunks{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodblatencycommands{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 3679 mongodblatencycommands_count{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 13 mongodblatencyreads{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 368 mongodblatencyreads_count{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 3 mongodblatencywrites{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodblatencywrites_count{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbnetin_bytes{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 29 mongodbnetinbytescount{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 1191 mongodbnetout_bytes{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 4208 mongodbnetoutbytescount{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 126749 mongodbopenconnections{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 1 mongodboperationscanandorder{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodboperationwrite_conflicts{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbpagefaults{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbpercentcache_dirty{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbpercentcache_used{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodb_queries{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 1 mongodbqueriesper_sec{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbqueuedreads{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbqueuedwrites{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbresidentmegabytes{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 97 mongodbstoragefreelistsearchbucket_exhausted{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbstoragefreelistsearchrequests{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbstoragefreelistsearchscanned{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbtcmalloccentralcachefree_bytes{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 230960 mongodbtcmalloccurrentallocatedbytes{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 8.455176e+07 mongodbtcmalloccurrenttotalthreadcachebytes{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 682240 mongodbtcmallocheap_size{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 8.904704e+07 mongodbtcmallocmaxtotalthreadcachebytes{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 2.60046848e+08 mongodbtcmallocpageheapcommitcount{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 46 mongodbtcmallocpageheapcommittedbytes{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 8.904704e+07 mongodbtcmallocpageheapdecommitcount{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbtcmallocpageheapfreebytes{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 3.52256e+06 mongodbtcmallocpageheapreservecount{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 46 mongodbtcmallocpageheapscavengecount{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbtcmallocpageheaptotalcommit_bytes{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 8.904704e+07 mongodbtcmallocpageheaptotaldecommit_bytes{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbtcmallocpageheaptotalreserve_bytes{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 8.904704e+07 mongodbtcmallocpageheapunmappedbytes{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbtcmallocspinlocktotaldelay_ns{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbtcmallocthreadcachefree_bytes{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 682240 mongodbtcmalloctotalfreebytes{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 972720 mongodbtcmalloctransfercachefree_bytes{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 59520 mongodbtotalavailable{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbtotalcreated{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbtotaldocs_scanned{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbtotalin_use{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbtotalkeys_scanned{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbtotalrefreshing{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbtotaltickets_reads{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 128 mongodbtotaltickets_writes{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 128 mongodbttldeletes{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbttldeletespersec{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbttlpasses{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbttlpassespersec{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbupdatecommand_failed{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbupdatecommand_total{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodb_updates{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbupdatesper_sec{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbuptimens{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 4.7167e+10 mongodbvsizemegabytes{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 1547 mongodbwtcacheappthreadspagereadcount{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbwtcacheappthreadspagereadtime{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbwtcacheappthreadspagewritecount{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbwtcachebytesreadinto{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbwtcachebyteswrittenfrom{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbwtcachecurrent_bytes{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 28138 mongodbwtcacheinternalpagesevicted{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbwtcachemaxbytesconfigured{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 5.06462208e+08 mongodbwtcachemodifiedpagesevicted{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbwtcachepagesevictedbyappthread{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbwtcachepagesqueuedfor_eviction{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbwtcachepagesreadinto{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbwtcachepagesrequestedfrom{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 225 mongodbwtcacheserverevictingpages{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbwtcachetrackeddirtybytes{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 26225 mongodbwtcacheunmodifiedpagesevicted{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 mongodbwtcacheworkerthreadevictingpages{host="mba.local",hostname="127.0.0.1:27017",version="4.4.0"} 0 ``` Additional maintenance and integration testing burden of a new source We could not add the source directly to Vector and instead instruct users to run Telegraf's `mongodb` input or Prometheus' `mongodb_exporter` and point Vector at the resulting data. This would leverage the already supported inputs from those projects. I decided against this as it would be in contrast with one of the listed principles of Vector: One Tool. All Data. - One simple tool gets your logs, metrics, and traces (coming soon) from A to B. [Vector principles](https://vector.dev/docs/about/what-is-vector/#who-should-use-vector) On the same page, it is mentioned that Vector should be a replacement for Telegraf. You SHOULD use Vector to replace Logstash, Fluent*, Telegraf, Beats, or similar tools. If users are already running Telegraf or the Prometheus MongoDB Exporter though, they could opt for this path. We need to work out if we need to classify the type of Mongo instance (mongos, replicaset member, or standalone mongod) on connection and use that to return the appropriate metrics for that type of node. Incremental steps that execute this change. Generally this is in the form of: [ ] Submit a PR with the initial source implementation