Skip to content

Add native_memory fields to nodes.stats spec - #1145

Open
sean- wants to merge 1 commit into
opensearch-project:mainfrom
sean-:feat-nodes-stats-native-memory
Open

Add native_memory fields to nodes.stats spec#1145
sean- wants to merge 1 commit into
opensearch-project:mainfrom
sean-:feat-nodes-stats-native-memory

Conversation

@sean-

@sean- sean- commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

OpenSearch 3.7.0 extended the _nodes/stats response with native-memory reporting. This adds the four corresponding fields to the nodes.stats spec. The opensearch-go client (#867) already models these locally; upstreaming them here lets that local patch be dropped.

All additions are gated on x-version-added: 3.7.0, matching the server's Version.V_3_7_0 gates. V_3_7_0 is a defined release constant below CURRENT = V_3_8_0, so the full 3.7.0 is the correct annotation:
Version.java#L174-L177.

Changes to spec/schemas/nodes.stats.yaml

Field shapes verified against opensearch-project/OpenSearch@3cd77ad. No released tag contains this yet — latest tag is 3.6.0; 3.7.0 is unreleased.

Issues Resolved

OpenSearch 3.7.0 extended the _nodes/stats response with native-memory
reporting. This adds the four corresponding fields to the nodes.stats spec.
The opensearch-go client (opensearch-project/opensearch-go#867) already
models these locally; upstreaming them here lets that local patch be dropped.

All additions are gated on `x-version-added: 3.7.0`, matching the server's
Version.V_3_7_0 serialization gates. V_3_7_0 is a defined release constant
sitting below CURRENT = V_3_8_0, so 3.7.0 (full patch version) is the correct
annotation:
  Version.java#L174-L177

Changes to spec/schemas/nodes.stats.yaml:

- native_memory_utilization_percent on ShardResourceUsageStatsDetail.
  Emitted as a String.format("%.1f", …) value, so PercentageString (not
  PercentageNumber) is the correct ref, matching its memory_utilization_percent
  sibling.
    NodeResourceUsageStats.java#L145 (wire gate L67-L68)

- global_native_memory_usage on ShardAdmissionControlStats. The admission
  controller name is the JSON key, a sibling of global_cpu_usage/global_io_usage.
    NativeMemoryBasedAdmissionController.java#L30

- native_memory_usage_tracker on the search-backpressure resource tracker,
  plus a new ShardSearchBackpressureTaskResourceTrackerNativeMemoryUsageTrackerStats
  schema. It intentionally omits rolling_avg/rolling_avg_bytes (unlike the heap
  tracker): the server keeps no rolling baseline for native memory and a zeroed
  field would be misleading.
    TaskResourceUsageTrackerType.java#L18
    NativeMemoryUsageTracker.java#L213-L237
    SearchShardTaskStats.java#L63-L66 (V_3_7_0 wiring)

- top-level native_memory, plus new NativeMemory, NativeMemoryAnalyticsBackend,
  NativeMemoryAllocator, and NativeMemoryAllocatorPool schemas.
    NodeStats.java#L777-L787 (V_3_7_0 gates L288-L298)
    AnalyticsBackendNativeMemoryStats.java#L78-L80
    NativeAllocatorPoolStats.java#L92-L98 (pool body L174-L176)

Field shapes verified against opensearch-project/OpenSearch@3cd77ad
(upstream/main). No released tag contains this yet — latest tag is 3.6.0;
3.7.0 is unreleased.

Signed-off-by: Sean Chittenden <sean.chittenden@crowdstrike.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant