对于 AI 代理:可在 https://www.mongodb.com/zh-cn/docs/llms.txt 获取文档索引—通过在任何 URL 路径后添加 .md 可获取所有页面的 Markdown 版本。
Docs 菜单

mongot 的指标参考

mongot 进程会暴露 Prometheus 指标,用以描述其在各个核心操作领域的运行状况和性能。本参考页面介绍了与日常监控和疑难排除相关的关键指标。要获取完整的指标集,请在 http://<mongot-host>:9946/metrics 处刮取 mongot Prometheus 指标终结点。

要查看 mongot 暴露的原始指标,请向以下 mongot Prometheus 指标终结点发送 HTTP GET 请求:

http://<mongot-host>:9946/metrics

在此终结点中:

  • <mongot-host>mongot 进程的主机名或 IP 地址。

  • 9946 是指标终结点的默认端口。要配置指标终结点端口,请参阅 mongot 配置文件中的 metrics.address 设置。

  • /metrics 是指标终结点的路径。

/metrics 终结点以纯 Prometheus 文本格式返回指标。要随时监控 mongot 指标,请将 Prometheus 实例配置为抓取此终结点。

重要

/metrics 终结点默认不需要身份验证。对于生产部署,请在网络层限制访问。

mongot 指标名称使用一致的命名模式:

  • 所有指标名称均以 mongot_ 前缀开头。

  • 指标名称通常遵循模式 mongot_<area>_<measurement>[_<unit>],其中:

    • <area> 表示指标所属的子系统或组件,例如 processjvmreplicationindex

    • <measurement> 指示正在测量的内容,例如 cpu_usageheap_memoryindex_size

    • <unit> (可选)指示指标的单位或计数器语义。这个可选后缀指示指标的测量单位,例如 secondsbytesms,或指标所代表的计数器类型,例如 totaleventsoperations

      注意

      某些指标名称后缀不反映指标的实际报告单位。例如,mongot_index_stats_query_latency_seconds 的后缀为 _seconds,但 mongot 以毫秒为单位报告指标,如指标输出中的 timeUnit=milliseconds 标签所示。要确认每个指标的单位,请查看下面指标参考表中的 Unit 值。

除了指标名称,mongot 指标还可以包括标签(也称为维度)。标签区分共享相同基础指标名称的多个时间序列。例如,指标可能使用标签来标识 statestatusindex typequantile 或特定的 index

对于某些指标,您必须将指标解释为指标名称及其标签的组合,而不是单独的指标名称。例如,mongot_replication_mongodb_indexManagerState 使用 state 标签曝光每个复制状态的一个系列,例如 STEADY_STATEFAILED。其中恰好有一个标记系列的值为 1。每索引指标使用类似的标签,例如 generationId_logStringindexId_logString,以区分不同的索引。

对于分布指标,指标名称的后缀表示 Prometheus 系列类型:

  • 直方图可公开 _bucket_count_sum_max

  • 摘要公开 _count_sum_max。某些摘要还包括分位数标签,例如 {quantile="0.5"}

下表描述了出现在 mongot 指标中的常用标签。

标签名称
指标范围
Possible Values

name

所有执行程序池

executorMetrics

Scope

跨切面

jvm, replication , lucene

generationId_logString, indexId_logString

大多数 mongot_index_stats_* 系列

内部不透明 ID(日志使用的每索引标识符)

indexFeatureVersion

许多索引指标

3, 56 (磁盘索引格式)

indexType

索引和初始同步指标

search, vector_searchvector_search_auto_embedding(仅在配置自动嵌入时)

numPartitions

索引大小和文档指标

1 用于自管理

timeUnit

延迟摘要指标

seconds, milliseconds , microseconds

quantile

汇总指标

0.5, 0.75 , 0.9 , 0.99

state

indexManagerState

STEADY_STATE, INITIAL_SYNC, INITIAL_SYNC_BACKOFF, INITIALIZING, FAILED, FAILED_EXCEEDED, SHUT_DOWN, STEADY_STATE_SHUT_DOWN

status

indexStatusCode

STEADY, INITIAL_SYNC, FAILED, RECOVERING_NON_TRANSIENT, RECOVERING_TRANSIENT, STALE, NOT_STARTED, DOES_NOT_EXIST, UNKNOWN

clientName

mongot_mongoClient_connectionPool_*

mongot steady state sync, mongot initial sync and session refreshmongot metadata servicemongot periodic optime fetchermongot database metadata resolvermongot server info resolvermongot Lease Manager mongo clientmongot AutoEmbedding Materialized View Writer (仅在启用自动嵌入时)

使用进程和 Java虚拟机(JVM) 指标来确认 mongot 正常运行,并确定堆或垃圾回收压力。

衡量标准
类型
单位
说明

mongot_process_uptime_seconds

仪表盘

秒数

Java虚拟机的运行时间。

mongot_process_start_time_seconds

仪表盘

unix 秒

自 Unix 纪元以来的进程开始时间。

mongot_process_cpu_time_ns_total

计数器

纳秒

Java 虚拟机进程使用的“CPU 时间”。使用 rate() 获取实时 CPU 消耗。

mongot_process_cpu_usage

仪表盘

0-1

Java 虚拟机进程的“最近 CPU 使用率”。该值已规范化为 0 到 1 的范围,其中 1 表示完全 CPU 利用率。

衡量标准
类型
单位
说明

mongot_jvm_memory_used_bytes

仪表盘

字节

已用内存量。标签:area=heap|nonheapid=<pool> (例如,G1 Eden Space、G1 Old Gen、G1 Survivor Space、Metaspace)。

mongot_jvm_memory_committed_bytes

仪表盘

字节

为 Java 虚拟机提供的内存量。

mongot_jvm_memory_max_bytes

仪表盘

字节

可使用的最大内存。对于堆,id="G1 Old Gen" 携带 -Xmx

mongot_jvm_buffer_count_buffers

仪表盘

数数

NIO 缓冲池计数。标签:id=direct|mapped

mongot_jvm_buffer_memory_used_bytes

仪表盘

字节

Java虚拟机(JVM)用于 NIO 缓存池的内存。

mongot_jvm_buffer_total_capacity_bytes

仪表盘

字节

NIO 缓冲池容量。

衡量标准
类型
单位
说明

mongot_jvm_gc_pause_seconds

总结

秒数

GC 暂停时间。无分位数标签。对于最长的最近暂停,请使用 mongot_jvm_gc_pause_seconds_max

mongot_jvm_gc_concurrent_phase_time_seconds

总结

秒数

在并发 GC 阶段花费的时间。

mongot_jvm_gc_live_data_size_bytes

仪表盘

字节

回收后长寿命堆内存池的大小。要监视内存压力的“活堆”。

mongot_jvm_gc_max_data_size_bytes

仪表盘

字节

长期堆内存池的最大大小。

mongot_jvm_gc_memory_allocated_bytes_total

计数器

字节

GC 之间年轻堆内存池大小增加。

mongot_jvm_gc_memory_promoted_bytes_total

计数器

字节

从年轻一代促进到老一代。

使用系统指标监控可能影响 mongot 的主机级别 CPU、磁盘、内存、分页和网络状况。

衡量标准
类型
单位
说明

mongot_system_cpu_count

仪表盘

数数

Java虚拟机(JVM)可用的处理器。

mongot_system_cpu_usage

仪表盘

0-1

最近系统 CPU 使用率。该值已规范化为 0 到 1 的范围,其中 1 表示完全 CPU 利用率。

mongot_system_load_average_1m

仪表盘

无单位

操作系统 1 分钟负载平均值。

衡量标准
类型
单位
说明

mongot_system_disk_space_data_path_free_bytes

仪表盘

字节

mongot dataPath 卷上释放磁盘空间。对此指标发出警报。

mongot_system_disk_space_data_path_total_bytes

仪表盘

字节

dataPath 卷上的总硬盘空间。用于计算可用百分比。

mongot_system_disk_space_free_bytes, mongot_system_disk_space_total_bytes

仪表盘

字节

整个文件系统的可用和总磁盘空间(与 data_path 的范围不同)。

mongot_system_disk_readBytes_bytes

仪表盘

字节

每个设备从磁盘读取的字节数。标签:name=<device> (例如:/dev/vda)。

mongot_system_disk_writeBytes_bytes

仪表盘

字节

每个设备写入的字节数。

mongot_system_disk_reads_events

仪表盘

数数

每个设备的读取 I/O 计数。对于读取 IOPS,请使用 rate()

mongot_system_disk_writes_events

仪表盘

数数

每个设备的写入 I/O 计数。

mongot_system_disk_currentQueueLength_tasks

仪表盘

数数

每个设备的磁盘队列长度(进行中的 I/O)。

mongot_system_disk_transferTime_ms

仪表盘

毫秒

每个设备的阅读或写入时间。

衡量标准
类型
单位
说明

mongot_system_memory_phys_total_bytes

仪表盘

字节

主机上的总物理内存。

mongot_system_memory_phys_available_bytes

仪表盘

字节

可用物理内存。

mongot_system_memory_phys_inUse_bytes

仪表盘

字节

使用中的物理内存。

mongot_system_memory_virt_inUse_bytes

仪表盘

字节

使用中的物理内存和虚拟内存总量。

mongot_system_memory_virt_swap_inUse_bytes, mongot_system_memory_virt_swap_available_bytes , mongot_system_memory_virt_swap_total_bytes

仪表盘

字节

交换状态。

mongot_system_memory_virt_swap_pagesIn_operations, mongot_system_memory_virt_swap_pagesOut_operations

仪表盘

数数

交换进/出活动。

mongot_system_memory_memoryMappings_objects

仪表盘

数数

内存映射数量(与 Lucene mmap 计数相关)。

mongot_system_memory_pageSize_bytes

仪表盘

字节

系统页面大小。

衡量标准
类型
单位
说明

mongot_system_process_majorPageFaults_operations

仪表盘

数数

主要页面错误。将此指标与存储类咨询阈值一起使用。

mongot_system_process_minorPageFaults_operations

仪表盘

数数

较小的页面错误。

衡量标准
类型
单位
说明

mongot_system_netstat_bytesRecv_bytes, mongot_system_netstat_bytesSent_bytes

仪表盘

字节

每个接口接收和发送的字节数 (name=eth0)。

mongot_system_netstat_packetsRecv_events, mongot_system_netstat_packetsSent_events

仪表盘

数数

收发的数据包。

mongot_system_netstat_inErrors_events, mongot_system_netstat_outErrors_events , mongot_system_netstat_inDrops_events , mongot_system_netstat_collisions_events

仪表盘

数数

错误、删除和冲突计数器。

mongot_system_netstat_speed

仪表盘

位/秒

协商的接口速度。

使用复制指标来确定 mongot 是否健康、正常同步并与 mongod 保持同步。

衡量标准
类型
单位
说明

mongot_replication_manager

仪表盘

0/1

1 当复制管理器处于活动状态时。

mongot_replication_mongodb_manager

仪表盘

0/1

1 当 MongoDB 支持的复制管理器处于活动状态时。标签:type=normal

mongot_replicationIndexManager_transitionState_total

计数器

数数

状态过渡。标签:fromStatetoState。用于检测重新同步(INITIALIZINGSTEADY_STATE 过渡)。

衡量标准
类型
单位
说明

mongot_replication_sessionRefresher_sessions

仪表盘

数数

活动会话。

mongot_replication_sessionRefresher_refreshes_total

计数器

数数

总会话刷新。

mongot_replication_sessionRefresher_failedSessionRefreshes_total

计数器

数数

刷新失败。

mongot_replication_sessionRefresher_sessionRefreshDurations_seconds

总结

秒数

刷新持续时间分布。

衡量标准
类型
单位
说明

mongot_replicationOptimeUpdaterError_total

计数器

数数

Optime-更新错误。

mongot_replicationOptimeUpdater_executor_*

多个

不适用

optime 更新程序的执行程序指标。

mongot 每个索引发出以下指标,并包含 generationId_logStringindexId_logString 标签以识别特定索引。按这些标签过滤以检查特定索引,或跨标签聚合以了解整个集群的行为。

衡量标准
类型
单位
说明

mongot_index_stats_indexStatusCode

仪表盘

0/1

每索引状态。在 status 标签值中进行独热编码:STEADYINITIAL_SYNCFAILEDRECOVERING_NON_TRANSIENTRECOVERING_TRANSIENTSTALENOT_STARTEDDOES_NOT_EXISTUNKNOWN

mongot_index_stats_indexFeatureVersion

仪表盘

数字

磁盘索引格式版本。示例,3

mongot_index_stats_indexSizeBytes

仪表盘

字节

索引的磁盘总大小。

mongot_index_stats_largestIndexFileSizeBytes

仪表盘

字节

索引中最大的单个文件。

mongot_index_stats_numFilesInIndex

仪表盘

数数

Lucene 区段文件数。

mongot_index_stats_numLuceneDocs

仪表盘

数数

索引中的 Lucene 文档。

mongot_index_stats_numLuceneMaxDocs

仪表盘

数数

最大 Lucene 文档 ID(包括已删除但未合并的文档)。

mongot_index_stats_numLuceneFields

仪表盘

数数

索引的 Lucene 字段数。

mongot_index_stats_segment_count

仪表盘

数数

Lucene 段数。

mongot_index_stats_requiredMemoryBytes

仪表盘

字节

索引的估计所需内存。

衡量标准
类型
单位
说明

mongot_index_stats_indexing_replicationLagMs

仪表盘

毫秒

每个索引的复制延迟,以毫秒为单位。单位在指标名称中 (Ms)。除非您想转换为秒,否则请勿在 PromQL 中除以 1000。

mongot_index_stats_indexing_replicationOpTime

仪表盘

BSON 时间戳

最后应用的复制 optime(数字编码)。

mongot_index_stats_indexing_maxPossibleReplicationOpTime

仪表盘

BSON 时间戳

mongod 提示设置的预付上限。

mongot_index_stats_indexing_insert_total, mongot_index_stats_indexing_update_total , mongot_index_stats_indexing_delete_total

计数器

数数

索引操作计数。标签:indexType=search

mongot_index_stats_indexing_totalBytesProcessed_total

计数器

字节

索引处理的总字节数。

mongot_index_stats_indexing_vectorFieldsIndexed_total

计数器

数数

已索引的向量字段。

mongot_index_stats_indexing_commitDurations_seconds

总结

秒 (timeUnit=milliseconds)

每个索引提交持续时间。

mongot_index_stats_indexing_indexingBatchDurations_seconds

总结

秒数

批处理持续时间分布。

mongot_index_stats_indexing_largeChangeStreamEvents_total

计数器

数数

过大的变更流事件。标签:threshold=10MiB|12MiB|14MiB|15MiB

mongot_index_stats_indexing_invalidGeometryField_total

计数器

数数

因几何无效而被拒绝的文档。

mongot_index_stats_indexing_sortableStringTruncated_total

计数器

数数

截断的可排序字符串。

mongot_index_stats_indexing_initialSyncExceptions_total

计数器

数数

初始同步期间发生异常。

mongot_index_stats_indexing_steadyStateExceptions_total

计数器

数数

稳态异常。

mongot_index_stats_indexing_consecutiveInitialSyncResyncExceptions

仪表盘

数数

此索引的连续初始同步再同步异常。

衡量标准
类型
单位
说明

mongot_index_stats_query_totalQueries_total

计数器

数数

对索引发出的总查询数。

mongot_index_stats_query_totalHitsCount_total

计数器

数数

返回的总命中数。

mongot_index_stats_query_failedQueries_total

计数器

数数

失败的查询。

mongot_index_stats_query_internallyFailedQueries_total, mongot_index_stats_query_invalidQueries_total , mongot_index_stats_query_npeQueries_total , mongot_index_stats_query_lenientFailures_total

计数器

数数

特定的故障类计数器。

mongot_index_stats_query_searchResultBatchLatencies_seconds

总结

秒 (timeUnit=milliseconds)

搜索批处理延迟。这是标题查询延迟指标。

mongot_index_stats_query_luceneTopDocsSearchLatencies_seconds

总结

秒 (timeUnit=milliseconds)

Lucene TopDocs 搜索内部的延迟。使用此指标区分 Lucene 内部延迟与总延迟。

mongot_index_stats_query_vectorResultLatencies_seconds

总结

秒 (timeUnit=milliseconds)

向量搜索结果延迟。

mongot_index_stats_query_vectorSearchInitialTopDocsLatencyTimer_seconds, mongot_index_stats_query_vectorSearchGetMoreTopDocsLatencyTimer_seconds

总结

秒 (timeUnit=milliseconds)

向量搜索延迟阶段。

mongot_index_stats_query_tokenFacetsStateRefreshLatency_seconds

总结

秒 (timeUnit=milliseconds)

分面(Facet)状态刷新延迟。

mongot_index_stats_query_batchDataSize, mongot_index_stats_query_batchDocumentCount

总结

字节 / 计数

每批处理负载大小和文档数。

mongot_index_stats_query_limitPerQuery

直方图

count (le=10|50|100|200|500|1000|+Inf)

$search$vectorSearch 限制的分布。

mongot_index_stats_query_numCandidatesPerQuery

直方图

数数

每次查询的向量候选者,按量化分桶。

mongot_index_stats_query_getMoreCommandCalls_total, mongot_index_stats_query_getMoreCommandCallsPerQuery

计数器/摘要

数数

getMore 调用次数。

mongot_index_stats_query_batchWithTies_total

计数器

数数

具有分数平层的结果批处理。

mongot_index_stats_query_benefitFromIndexSortCount_total

计数器

数数

受益于索引排序优化的查询。

mongot_index_stats_query_extractableLimitQueries_total, mongot_index_stats_query_extractableLimitSecondBatchQueries_total

计数器

数数

限制提取优化已触发。

mongot_index_stats_query_phantomSearcherCleanupCount_total

计数器

数数

Phantom-searcher 清理。

mongot_index_stats_query_orphanedDeletedDocsRatio

总结

比率

返回结果中的删除文档比例。

mongot_index_stats_query_noProgressBatches_total

计数器

数数

未取得任何进展的批处理。

mongot_index_stats_query_vectorCommandCalls_total, mongot_index_stats_query_vectorRescoringFailureCount_total , mongot_index_stats_query_vectorSearchQueriesOverSearchIndexes_total

计数器

数数

向量特定计数器。

mongot_index_stats_query_feature_total

计数器

数数

每次查询功能使用。标签:name=<feature>。例如:compoundtextphrasenearvectorSearchknnBetaautoEmbedding (仅在启用自动嵌入时)。

mongot_index_stats_query_failedExplainQueryAggregate_total

计数器

数数

失败的 $explain 聚合。

衡量标准
类型
单位
说明

mongot_replication_mongodb_indexManagerState

仪表盘

0/1

复制状态的标准信号。mongot 对此指标进行独热编码,这意味着正好一个 state 标签是 1.0。状态:STEADY_STATEINITIAL_SYNCINITIAL_SYNC_BACKOFFINITIALIZINGFAILEDFAILED_EXCEEDEDSHUT_DOWNSTEADY_STATE_SHUT_DOWN

mongot_index_stats_replication_steadyState_batchTotalApplicableBytes, mongot_index_stats_replication_steadyState_batchTotalApplicableDocuments

总结

字节 / 计数

稳态批处理大小。

mongot_index_stats_replication_steadyState_decodingBatchDurations_seconds

总结

秒数

稳态解码持续时间。

mongot_index_stats_replication_steadyState_getMoreDurations_seconds

总结

秒数

稳态状态 getMore 持续时间。

mongot_index_stats_replication_initialSync_changeStream_*

总结

初始同步变更流阶段指标(镜像稳定状态)。

mongot_index_stats_replication_initialSync_collScan_*

总结

初始同步集合扫描阶段指标。

衡量标准
类型
单位
说明

mongot_index_stats_luceneIndexRefresher_refreshDurations_seconds

总结

秒 (timeUnit=milliseconds)

Lucene IndexReader 刷新延迟。

mongot 接受来自 mongod 的以下命名命令集:

  • buildinfo

  • getMore

  • hello

  • isMaster

  • ismaster

  • killCursors

  • manageSearchIndex

  • ping

  • planShardedSearch

  • search

  • vectorSearch

对于每个命令,mongot 都会公开以下指标,其中 <name> 是命令名称的占位符:

模式
类型
说明

mongot_command_<name>CommandFailure_total

计数器

命令失败次数。

mongot_command_<name>CommandTotalLatency_seconds

总结

包括序列化的端到端延迟。

mongot_command_<name>CommandSerializationLatency_seconds

总结

序列化延迟(子集;不是所有命令)。

提示

监控跨索引的搜索和向量搜索延迟

mongot_command_searchCommandTotalLatency_secondsmongot_command_vectorSearchCommandTotalLatency_seconds 是用于监控 $search$vectorSearch 延迟聚合的主要指标。这些指标显示所有索引的所有 searchvectorSearch 命令的延迟聚合。

使用索引调度器和分派器指标来识别复制和索引管道中的积压、饱和和缓慢工作。

衡量标准
类型
单位
说明

mongot_indexing_steadyStateChangeStream_batchesInProgressTotal

仪表盘

数数

当前正在应用的批处理。标签:indexType=search|vector_search| vector_search_auto_embedding (仅在启用自动嵌入时)。

mongot_indexing_steadyStateChangeStream_batchesInProgressTotalDurations_seconds

总结

秒数

运行中批处理的持续时间分布。

mongot_indexing_steadyStateChangeStream_getMoreDurations_seconds

总结

秒数

getMore 往返分布。

mongot_indexing_steadyStateChangeStream_getMoresInFlight

仪表盘

数数

getMore 请求在途。

mongot_indexing_steadyStateChangeStream_getMoresScheduled

仪表盘

数数

indexType 调度的 getMore 请求。

mongot_indexing_steadyStateChangeStream_getMoresSchedulingDurations_seconds

总结

秒数

getMore 安排延迟。

mongot_indexing_steadyStateChangeStream_preprocessingBatchDurations_seconds

总结

秒数

每批处理的预处理时间。

mongot_indexing_steadyStateChangeStream_witnessedChangeStreamUpdates_total

计数器

数数

已观察到的变更流事件总数。标签:Scope=replication

mongot_indexing_steadyStateChangeStream_applicableChangeStreamUpdates_total

计数器

数数

mongot 认为适用的事件。

mongot_indexing_steadyStateChangeStream_dispatcher

仪表盘

0/1

调度器状态。标签:Scope=replicationclient=synchronous-batch

mongot_indexing_steadyStateChangeStream_skippedChangeStreamDocumentsWithoutMetadataNamespace_total

计数器

数数

因元数据缺失而跳过的事件。

mongot_indexing_steadyStateChangeStream_unexpectedBatchFailures_total

计数器

数数

批处理失败出乎意料。

mongot_indexing_steadyStateChangeStream_rescheduledEmbeddingGetMores_total

计数器

数数

重新安排嵌入 getMores。此指标仅在配置自动嵌入时可用。

mongot_indexing_changeStreamModeSelector_failedSamplingAttemptsCounter_total

计数器

数数

变更流模式采样尝试失败。

索引工作调度器指标监控索引批处理的排队和执行。

衡量标准
类型
单位
说明

mongot_indexingWorkScheduler_queuedBatchesTotal, mongot_indexingWorkScheduler_queuedEventsTotal

仪表盘

数数

调度员队列深度。

mongot_indexingWorkScheduler_enqueueCalls_total, mongot_indexingWorkScheduler_dequeueCalls_total

计数器

数数

入队和出队计数。

mongot_indexingWorkScheduler_indexingBatchDistribution

总结

数数

批处理大小的分布。标签:Scope=replication

mongot_indexingWorkScheduler_indexingBatchDurations_seconds

总结

秒数

批处理时长。

mongot_indexingWorkScheduler_indexingBatchSchedulingDurations_seconds

总结

秒数

调度开销。

解码工作调度程序指标监控变更流批处理解码的队列和执行。

衡量标准
类型
单位
说明

mongot_decodingWorkScheduler_queuedBatchesTotal, mongot_decodingWorkScheduler_queuedEventsTotal

仪表盘

数数

调度员队列深度。

mongot_decodingWorkScheduler_enqueueCalls_total, mongot_decodingWorkScheduler_dequeueCalls_total

计数器

数数

入队和出队计数。

mongot_decodingWorkScheduler_decodingBatchDistribution

总结

数数

批处理大小的分布。标签:Scope=replication

mongot_decodingWorkScheduler_decodingBatchDurations_seconds

总结

秒数

批处理时长。

mongot_decodingWorkScheduler_decodingBatchSchedulingDurations_seconds

总结

秒数

调度开销。

使用这些指标来追踪索引启动工作、恢复和目录状态。

注意

某些 mongot 指标是阶段特定的,仅在对应的代码路径活跃时才会填充。例如,在索引处于初始同步状态时,稳态复制指标(如 mongot_index_stats_indexing_replicationLagMsmongot_index_stats_replication_steadyState_* 系列)不会填充。相反,初始同步特定指标(如 mongot_initialsync_*mongot_index_stats_replication_initialSync_*)仅在初始同步运行或已运行时才相关。

衡量标准
类型
单位
说明

mongot_initialsync_queue_queuedSyncs

仪表盘

数数

已排队的初始同步。标签:indexType

mongot_initialsync_queue_requeuedEmbeddingInitialSyncs_total

计数器

数数

已重新排队的嵌入初始同步。此指标仅在配置自动嵌入时可用。

mongot_initialsync_dispatcher_inProgressSyncs

仪表盘

数数

正在进行初始同步。标签:indexType

mongot_initialsync_dispatcher_queuedSyncs

仪表盘

数数

初始同步已在分发器排队。

mongot_initialsync_dispatcher_inProgressResumedSyncs

仪表盘

数数

从检查点恢复的进行中同步。

mongot_initialsync_dispatcher_collectionScan

仪表盘

0/1

活动集合扫描模式。标签:scan_type=id_order|natural_order

mongot_initialsync_dispatcher_completedSyncDuration_seconds

总结

秒数

完成同步持续时间分布。

mongot_initialsync_dispatcher_syncDuration_seconds

总结

秒数

正在进行的同步持续时间。

mongot_initialsync_dispatcher_inProgressInitialSyncDurationMin_seconds, mongot_initialsync_dispatcher_inProgressInitialSyncDurationMax_seconds , mongot_initialsync_dispatcher_inProgressInitialSyncDurationSum_seconds

仪表盘

秒数

进行中初始同步持续时间的最小值、最大值和总和。

mongot_initialsync_dispatcher_unreadableDroppedIndexes_total

计数器

数数

因为无法读取它们的磁盘段而将其删除。

mongot_initialsync_dispatcher_unreadableIndexRecoveries_total

计数器

数数

在不可读区段后恢复。标签:unreadableIndexCause=corruptIndex|incompatibleCodec| incompatibleIndexFormat

衡量标准
类型
单位
说明

mongot_lifecycle_indexesInInitializedState

仪表盘

数数

目前处于初始化状态的索引。

mongot_lifecycle_indexInitializationDuration_seconds

总结

秒数

初始化持续时间。

mongot_lifecycle_failedDownloadIndexes_total

计数器

数数

失败的索引下载。

mongot_lifecycle_failedDropIndexes_total

计数器

数数

失败的索引删除。

mongot_lifecycle_failedInitializationIndexes_total

计数器

数数

失败的索引初始化。

衡量标准
类型
单位
说明

mongot_configState_indexesInCatalog

仪表盘

数数

当前在目录中的索引。标签:Scope=replicationindexFormatVersion

mongot_configState_indexesPhasingOut

仪表盘

数数

正在阶段性淘汰的索引。

mongot_configState_stagedIndexes

仪表盘

数数

已分阶但尚未激活的索引。

mongot_configState_indexesInCatalogFeatureVersionFour, mongot_configState_indexesPhasingOutFeatureVersionFour , mongot_configState_stagedIndexesFeatureVersionFour

仪表盘

数数

功能版本 4 特定的等效项。

使用这些指标来监控开放游标状态,并检测因其磁盘段无法读取而 mongot 删除或恢复的索引。

衡量标准
类型
单位
说明

mongot_cursorManager_trackedCursors

仪表盘

数数

当前追踪的开启游标。

mongot_indexFactory_unreadableDroppedIndexes_total

计数器

数数

索引已删除,因为其段无法读取。

mongot_indexFactory_unreadableIndexRecoveries_total

计数器

数数

不可读区段后的恢复。标签:unreadableIndexCause

使用这些指标监控 Lucene 段合并活动,包括进行中的合并数量和大小、合并输入和输出大小、合并持续时间以及被磁盘利用合并策略丢弃的合并。

衡量标准
类型
单位
说明

mongot_mergeScheduler_currentlyRunningMerges

仪表盘

数数

活动合并。标签:Scope=lucene

mongot_mergeScheduler_currentlyMergingDocs

仪表盘

数数

当前正在合并的文档。

mongot_mergeScheduler_numMerges_total

计数器

数数

自启动以来执行的合并总数。

mongot_mergeScheduler_numSegmentsMerged_total

计数器

数数

合并折叠的段。

mongot_mergeScheduler_mergeSize

总结

字节

合并输入大小的分布。

mongot_mergeScheduler_mergeResultSize

总结

字节

合并输出大小的分布。

mongot_mergeScheduler_mergedDocs

总结

数数

每合并分布的文档。

mongot_mergeScheduler_mergeTime_seconds

总结

秒数

合并持续时间分布。

mongot_diskUtilizationAwarenessMergePolicy_discardedMerge_total

计数器

数数

被磁盘利用率意识策略丢弃的合并。

mongotmongod 打开多个命名连接池,并为每个连接池添加 clientName 标签,以标识每个连接池的角色。下表列出了可能的 clientName 标签值及其对应角色:

clientName
用途

mongot steady state sync

稳态变更流复制。

mongot initial sync and session refresh

初始同步和会话刷新。在 mongod currentOp 中看到的 appName

mongot metadata service

内部元数据服务。

mongot periodic optime fetcher

optime 拉取。

mongot database metadata resolver

数据库元数据查找。

mongot server info resolver

服务器信息查询。

mongot Lease Manager mongo client

租赁经理。

mongot AutoEmbedding Materialized View Writer

自动嵌入写入。此连接池仅在配置自动嵌入时显示。

下表列出了 mongot 连接池的可用指标:

衡量标准
类型
单位
说明

mongot_mongoClient_connectionPool_connections

仪表盘

数数

当前开启的连接在连接池中。

mongot_mongoClient_connectionPool_connectionsCheckedOut

仪表盘

数数

当前已检出的连接。

mongot_mongoClient_connectionPool_maxSize

仪表盘

数数

配置的最大连接池大小。

mongot_mongoClient_connectionPool_minSize

仪表盘

数数

配置的最小连接池大小。

mongot_mongoClientBuilder_successfulOpenSSLDynamicLinking_total

计数器

数数

成功的原生 OpenSSL 链接尝试。

mongot_mongoClientBuilder_failedOpenSSLDynamicLinking_total

计数器

数数

原生 OpenSSL 链接尝试失败。

使用这些指标监控同义词同步活动,包括集合扫描、扫描和同步持续时间、队列深度以及同义词同步过程中遇到的异常。

衡量标准
类型
单位
说明

mongot_synonymSync_collScans_total

计数器

数数

为同义词执行的总集合扫描。

mongot_synonymSync_collScansTriggeredByChangeStream_total

计数器

数数

由变更流事件触发的同义词扫描。

mongot_synonymSync_collScanDurations_seconds

总结

秒数

扫描持续时间分布。

mongot_synonymSync_syncDurations_seconds

总结

秒数

同步持续时间分布。

mongot_synonymSync_queueDepth

仪表盘

数数

当前同义词同步队列深度。

mongot_synonymSync_exceptions_total

计数器

数数

同步异常

使用这些指标来监控 mongot 用于运行背景工作的命名执行程序池。每个池都会暴露一组相同的子指标,并以池名为前缀,以便您可以跨所有池追踪线程活动、池大小、队列深度、任务吞吐量和每个任务的执行时间。

下表列出每个执行程序池暴露的子指标,其中 <pool> 是池名前缀。所有执行程序池子指标都带有标签 name="executorMetrics"

子指标后缀
类型
说明

<pool>_active_threads

仪表盘

当前执行任务的线程。

<pool>_pool_core_threads, <pool>_pool_max_threads , <pool>_pool_size_threads

仪表盘

池大小设置。

<pool>_queued_tasks

仪表盘

等待线程的任务—饱和信号。

<pool>_queue_remaining_tasks

仪表盘

剩余队列容量。

<pool>_completed_tasks_total

计数器

自启动以来完成的任务。

<pool>_idle_seconds

总结

线程在任务之间花费的空闲时间。

<pool>_seconds

总结

每个任务的执行时间。

<pool>_scheduled_once_total, <pool>_scheduled_repetitively_total

计数器

定时任务计数(用于安排池)。

下表列出所有可用的命名执行程序池及其各自的用途的前缀:

执行程序池前缀
它运行的内容

mongot_blobstore_lifecycle_executor

Blob 存储生命周期工作。

mongot_blocking_server_worker_executor

阻塞 gRPC 服务器工作线程。

mongot_change_stream_mode_selector_executor

变更流模式选择。

mongot_change_stream_sync_dispatcher_executor

变更流同步分派(稳定状态下最繁忙的一个)。

mongot_config_monitor_executor

配置监控轮询。

mongot_decoding_executor

解码管道工作人员。

mongot_disk_monitor_executor

磁盘监控轮询。

mongot_grpc_health_check_executor

gRPC 健康检查计时器。

mongot_idle_cursor_killer_executor

空闲游标回收。

mongot_index_commit_executor

索引提交操作。

mongot_index_lifecycle_executor

每个索引生命周期工作。

mongot_index_refresh_executor

Lucene IndexReader 刷新。

mongot_indexing_work_executor

索引管道工作人员(在稳定状态下最繁忙的索引池)。

mongot_indexing_lifecycle_executor

索引生命周期工作。

mongot_indexing_auto_embedding_executor

自动嵌入索引路径。此执行程序池仅在配置自动嵌入时显示。

mongot_init_lifecycle_executor

初始化时间生命周期工作。

mongot_mat_view_commit_executor, mongot_mat_view_leader_heartbeat_executor , mongot_mat_view_optime_updater_executor , mongot_mat_view_status_refresh_executor , mongot_materialized_view_lifecycle_executor

物化视图追踪和生命周期。这些指标仅在配置自动嵌入或其他物化视图支持的功能时才可用。

mongot_replicationOptimeUpdater_executor

optime 更新程序(后台)。

mongot_session_refresh_executor

会话刷新器。

mongot_system_metrics_updater_executor

系统指标更新程序。

提示

监视所有执行程序池的饱和度

要监控所有执行程序池的饱和度,请运行以下 PromQL 查询:

max by (pool) (
label_replace(
{__name__=~"mongot_.+_executor_queued_tasks"},
"pool", "$1", "__name__", "mongot_(.+)_executor_queued_tasks"
)
)

此查询返回每个执行程序池的队列任务计数。

mongot 中嵌入的 Prometheus 服务器可用以下指标:

衡量标准
类型
单位
说明

mongot_prometheus_server_scraping_timer_seconds

总结

秒 (timeUnit=milliseconds)

mongot 组装 /metrics 响应所需的时间。此处的持续增长意味着指标显示本身正在变慢。

仅在启用特定功能时,以下指标系列才会出现在 /metrics 输出中。

指标系列
说明
自管理中的可用性 mongot

mongot_*embedding*

与自动嵌入相关的指标。例如,mongot_initialsync_queue_requeuedEmbeddingInitialSyncs_totalmongot_materialized_view_lifecycle_executor和带有 clientName="mongot AutoEmbedding Materialized View Writer"的连接池条目。

仅在配置自动嵌入时显示。

mongot_mongot_ftdc_executor_failure_total

FTDC 执行程序的失败次数。

仅在启用 ftdcExecutorMetricsToPrometheus 功能标志时显示。

此目录中的大多数延迟指标都是汇总,而不是直方图,因此,如果存在,请直接使用其发布的 quantile 标签。少量指标(如 mongot_index_stats_query_limitPerQuerymongot_index_stats_query_numCandidatesPerQuery)是直方图,并暴露 _bucket 系列。

# Replication state
max by (state) (mongot_replication_mongodb_indexManagerState)
# Number of search indexes at STEADY_STATE replication
mongot_replication_mongodb_indexManagerState{state="STEADY_STATE"}
# Maximum replication lag across all indexes, converted to seconds
max(mongot_index_stats_indexing_replicationLagMs) / 1000
# Index count by status
count by (status) (mongot_index_stats_indexStatusCode == 1)
# Search query p99 latency across all indexes
max(mongot_index_stats_query_searchResultBatchLatencies_seconds{quantile="0.99"})
# Worst recent GC pause
max(mongot_jvm_gc_pause_seconds_max)
# Average GC pause over 5 minutes
rate(mongot_jvm_gc_pause_seconds_sum[5m]) / rate(mongot_jvm_gc_pause_seconds_count[5m])
# Free disk percentage on dataPath
mongot_system_disk_space_data_path_free_bytes
/ mongot_system_disk_space_data_path_total_bytes
# Major page fault rate
rate(mongot_system_process_majorPageFaults_operations[5m])
# Steady-state and initial sync exceptions over 15 minutes
sum(rate(mongot_index_stats_indexing_steadyStateExceptions_total[15m]))
sum(rate(mongot_index_stats_indexing_initialSyncExceptions_total[15m]))