Skip to content

dynamic_modules: expose stat tags and tag-extracted names in the stats sink ABI#46028

Draft
basundhara-c wants to merge 2 commits into
envoyproxy:mainfrom
basundhara-c:stat-sink-tags
Draft

dynamic_modules: expose stat tags and tag-extracted names in the stats sink ABI#46028
basundhara-c wants to merge 2 commits into
envoyproxy:mainfrom
basundhara-c:stat-sink-tags

Conversation

@basundhara-c

Copy link
Copy Markdown
Contributor

Commit Message: expose stat tags and tag-extracted names in the stats sink ABI
Additional Description:

The stats sink ABI previously exposed only each stat's full, flat name (e.g. cluster.foo.upstream_rq_total) and its value. This adds callbacks to also read a stat's tag-extracted name and its tags (name/value pairs) for counters, gauges, etc.

This lets a custom dynamic-module stats sink consume the same dimensional decomposition Envoy's built-in formatters use so it can reconstruct labelled output like envoy_cluster_upstream_rq_total{cluster_name="foo"} instead of only the flat name.

Risk Level: Low
Testing: Tests Added
Docs Changes: N.A
Release Notes: N.A
Platform Specific Features: N.A

…s sink ABI

Signed-off-by: Basundhara Chakrabarty <basundhara17061996@gmail.com>
@repokitteh-read-only

Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #46028 was opened by basundhara-c.

see: more, trace.

@basundhara-c

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces new ABI functions and Rust SDK wrappers to retrieve tag-extracted names, tag counts, and individual tags for counters, gauges, and text readouts in Envoy dynamic modules. It also refactors buffer-filling logic in the Rust SDK and adds comprehensive unit tests in both C++ and Rust. The feedback points out a minor documentation mismatch in the Rust SDK where counter_tag_extracted_name is documented as returning None instead of false when the index is out of range.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

}

/// Reads the tag-extracted name of the counter at `index` into `name` (the stat name with tag
/// values removed). Returns `None` and leaves `name` unchanged when the index is out of range.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The doc comment for counter_tag_extracted_name states that it returns None when the index is out of range, but the function actually returns a bool (returning false on failure). The documentation should be updated to reflect the correct return type.

Suggested change
/// values removed). Returns `None` and leaves `name` unchanged when the index is out of range.
/// values removed). Returns false and leaves name unchanged when the index is out of range.

…oc comment

Signed-off-by: Basundhara Chakrabarty <basundhara17061996@gmail.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