Skip to content

Commit b87ecd6

Browse files
committed
PMM-13477 Support MongoDB 8.0
1 parent 959dc79 commit b87ecd6

File tree

3 files changed

+34
-5
lines changed

3 files changed

+34
-5
lines changed

exporter/metrics.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ var (
5252
prefixes = [][]string{
5353
{"serverStatus.wiredTiger.transaction", "ss_wt_txn"},
5454
{"serverStatus.wiredTiger", "ss_wt"},
55+
{"serverStatus.queues.execution", "ss_wt_concurrentTransactions"},
5556
{"serverStatus", "ss"},
5657
{"replSetGetStatus", "rs"},
5758
{"systemMetrics", "sys"},
@@ -105,6 +106,7 @@ var (
105106
"serverStatus.opcountersRepl.": "legacy_op_type",
106107
"serverStatus.transactions.commitTypes.": "commit_type",
107108
"serverStatus.wiredTiger.concurrentTransactions.": "txn_rw_type",
109+
"serverStatus.queues.execution.": "txn_rw_type",
108110
"serverStatus.wiredTiger.perf.": "perf_bucket",
109111
"systemMetrics.disks.": "device_name",
110112
}

exporter/replset_status_collector.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,21 @@ func (d *replSetGetStatusCollector) collect(ch chan<- prometheus.Metric) {
8585
logger.Debug("replSetGetStatus result:")
8686
debugResult(logger, m)
8787

88-
for _, metric := range makeMetrics("replset", m, d.topologyInfo.baseLabels(), d.compatibleMode) {
88+
for _, metric := range makeMetrics("", m, d.topologyInfo.baseLabels(), d.compatibleMode) {
8989
ch <- metric
9090
}
91-
if d.compatibleMode && strings.HasPrefix(d.version.VersionString, "8.") {
92-
logger.Infof("collecting compatibility metrics for version %s", d.version.VersionString)
93-
metrics := replSetMetrics(m, logger)
94-
for _, metric := range metrics {
91+
92+
if strings.HasPrefix(d.version.VersionString, "8.") {
93+
for _, metric := range makeMetrics("rs", m, d.topologyInfo.baseLabels(), d.compatibleMode) {
9594
ch <- metric
9695
}
96+
if d.compatibleMode {
97+
logger.Infof("collecting compatibility metrics for version %s", d.version.VersionString)
98+
metrics := replSetMetrics(m, logger)
99+
for _, metric := range metrics {
100+
ch <- metric
101+
}
102+
}
97103
}
98104
}
99105

exporter/v1_compatibility.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,22 @@ func conversions() []conversion {
473473
oldName: "mongodb_mongod_wiredtiger_transactions_checkpoint_milliseconds_total",
474474
newName: "mongodb_ss_wt_txn_transaction_checkpoint_total_time_msecs",
475475
},
476+
{
477+
oldName: "mongodb_mongod_wiredtiger_transactions_checkpoint_milliseconds_total",
478+
newName: "mongodb_ss_wt_checkpoint_total_time_msecs",
479+
},
476480
{
477481
oldName: "mongodb_mongod_wiredtiger_transactions_running_checkpoints",
478482
newName: "mongodb_ss_wt_txn_transaction_checkpoint_currently_running",
479483
},
484+
{
485+
oldName: "mongodb_mongod_wiredtiger_transactions_running_checkpoints",
486+
newName: "mongodb_ss_wt_checkpoint_currently_running",
487+
},
488+
{
489+
oldName: "mongodb_ss_tcmalloc_tcmalloc_thread_cache_free_bytes",
490+
newName: "mongodb_ss_tcmalloc_tcmalloc_thread_cache_free",
491+
},
480492
{
481493
oldName: "mongodb_mongod_wiredtiger_transactions_total",
482494
prefix: "mongodb_ss_wt_txn_transactions",
@@ -577,6 +589,15 @@ func conversions() []conversion {
577589
"max_time_msecs": "max",
578590
},
579591
},
592+
{
593+
oldName: "mongodb_mongod_wiredtiger_transactions_checkpoint_milliseconds",
594+
prefix: "mongodb_ss_wt_checkpoint",
595+
suffixLabel: "type",
596+
suffixMapping: map[string]string{
597+
"min_time_msecs": "min",
598+
"max_time_msecs": "max",
599+
},
600+
},
580601
{
581602
oldName: "mongodb_mongod_global_lock_current_queue",
582603
prefix: "mongodb_mongod_global_lock_current_queue",

0 commit comments

Comments
 (0)