-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Integration
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Simplifies the opCounters metrics to have one process-global allocation. The split by cluster role is no longer necessary now that embedded routers are not on the roadmap, so the code can be simplified. This simplification is a building block towards our goal of porting some metrics (including this one) to the OTel framework in SERVER-118979.
This patch refactors how operation counters are accessed and updated throughout the codebase. The main change is to replace calls to the `serviceOpCounters()` function with direct usage of a new or existing global `opCounters` object. This affects how operation statistics (such as inserts, deletes, updates, and nested aggregates) are incremented and queried. The change simplifies and unifies the way operation counters are referenced, reducing indirection and potential confusion.
Key changes include:
*Core Operation Counter Refactoring*
- Replaced all calls to `serviceOpCounters(opCtx)` or `serviceOpCounters(ClusterRole::ShardServer)` with direct usage of the `opCounters` object for incrementing and accessing operation statistics in CRUD, aggregation, and command code paths.
*Server Status and Registration*
- Updated the server status registration to bind the `opcounters` section directly to the `opCounters` object instead of using role-specific calls to `serviceOpCounters`.
*Test Code Updates*
- Refactored test code to use the `opCounters` object directly, replacing helper functions and all usages of `serviceOpCounters` for querying operation counts.
- is related to
-
SERVER-118979 Instrument the query codebase with OpenTelemetry Metrics
-
- Investigating
-