• 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

      Add attribute support to the metrics IDL grammar and codegen (epic SPM-4962): set_once descriptive attributes and enumerated allowed_values attributes. This was cut from SERVER-138331 to keep the struct-codegen ticket on the minimal milestone-1 grammar subset.

      Scope of Work

      * Parse the attributes: block on metric leaves: type (string, int64, double, bool), set_once, allowed_values, and when (attribute-level gating, which may itself depend on the Existence and Gating tab landing first).
      * set_once: the generated registration code evaluates the named parameterless symbol once, before the tree freezes at materialization, and attaches the value as a static OTel datapoint attribute.
      * allowed_values: generate one enum constant per declared value (reusing the existing enums: codegen machinery) and one storage slot per attribute combination, in the same spirit as the existing pre-computed cartesian attribute tables. The record path gains the attribute argument, e.g. stats.scanned.add(n, PlanStage::kIxscan).
      * The generated OTel instrument exports one datapoint per recorded combination.
      * Build-time validation: cartesian-product cardinality caps, attribute type checks, and rejection of dynamic attributes (use set_once for process-constant values, or a metric family for genuinely dynamic keys).
      * Extend buildscripts/idl/metrics_schema.yml and the idl_schema.yml unit tests for the new grammar.

      Design source

      [Technical Design: Unified Metrics Framework|$GDOC], Core Scalar Framework tab: "Attributes" section (Descriptive attributes, Enumerated attributes, Dynamic attributes, IDL Extensions).

            Assignee:
            Unassigned
            Reporter:
            Finley Lau
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: