-
Type:
New Feature
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
DB Integration & Observability
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Overview
Support instance_of mounts nested inside metrics_structs fields and inside groups' fields, not only at the top level of a metrics: fragment (epic SPM-4962).
Background
The SPM-4962 grammar defines a use-mount (instance_of:) as node form 2, and the node grammar is recursive, so nothing in the design restricts mounts to the top level. SERVER-138331 deliberately fenced this: a mount nested in a struct or group currently fails the build with the framework's "not supported yet" error (ERROR_ID_METRICS_UNSUPPORTED, ID113) at _bind_metrics_node in buildscripts/idl/idl/binder.py (allow_mount), because a silently-unrendered mount would violate the framework's no-silent-acceptance rule and milestone 1 had no consumer for nested mounts.
Scope of Work
* Flip allow_mount to True for struct-field and group recursion in _bind_metrics_node / _bind_metrics_fields.
* Codegen: generate a member of the mounted struct's C++ type (e.g. SessionMetrics sessions;) and render it as a subobject, mirroring the group render path in _gen_metrics_node_append.
* Extend the fragment-struct / declared-struct collision checks if nested mounts introduce new name-collision surfaces.
* Binder and generator tests: nested mount inside a struct and inside a group bind, generate, and render; positive and negative cases.
* The top-level mount semantics (no generated code until the registration/rendering tickets wire it) must stay consistent with whatever SERVER-138333/138334 land for top-level mounts.
Trigger and sequencing
Build when the first real migration needs to embed a reusable metrics struct inside a group or struct. No milestone-1 consumer exists today; do not build speculatively.
- is blocked by
-
SERVER-138331 Codegen to create metrics structs (<file>_metrics_gen.h/cpp and metrics_sections.idl)
-
- In Code Review
-