Skip to content

Conversation

@keivenchang
Copy link
Contributor

@keivenchang keivenchang commented Jan 27, 2026

Overview:

SGLang metrics natively use the sglang: prefix (with colon), not sglang_ (with underscore).

Details:

  • Removed add_prefix="sglang_" parameter from setup_prometheus_registry() in publisher.py to preserve native sglang: prefix
  • Updated metrics validation pattern in payloads.py from sglang_* to sglang:* to match actual format
  • Verified fix with end-to-end aggregated deployment test showing correct sglang: metrics exposure
  • Ensures consistency between code, documentation, and actual metrics output

Where should the reviewer start?

  • components/src/dynamo/sglang/publisher.py - Review the removal of add_prefix parameter
  • tests/utils/payloads.py - Review the updated validation pattern for SGLang metrics
  • Documentation at fern/pages/backends/sglang/prometheus.md already correctly states metrics use sglang: prefix

Related Issues:

DYN-1962

/coderabbit profile chill

Summary by CodeRabbit

  • Refactor

    • Simplified metrics prefix handling in registry configuration.
  • Tests

    • Updated metrics validation pattern for backend verification to use colon-delimited naming format.

✏️ Tip: You can customize this high-level summary in your review settings.

SGLang metrics use a colon prefix (sglang:) not underscore (sglang_).
This fix removes the incorrect add_prefix parameter that was converting
sglang: to sglang_ and updates test validation patterns to match the
actual sglang: prefix format.

Changes:
- Remove add_prefix="sglang_" from publisher.py setup
- Update payloads.py validation pattern from sglang_ to sglang:
- Verified with end-to-end test that sglang: metrics are correctly exposed

Signed-off-by: Keiven Chang <keivenchang@users.noreply.github.com>
@github-actions github-actions bot added fix backend::sglang Relates to the sglang backend labels Jan 27, 2026
@keivenchang keivenchang marked this pull request as ready for review January 28, 2026 00:14
@keivenchang keivenchang requested review from a team as code owners January 28, 2026 00:14
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 28, 2026

Walkthrough

Updates sglang metrics naming convention from underscore-based to colon-based delimiters. Removes explicit prefix configuration from publisher code and updates corresponding validation patterns in test utilities to match the new naming format.

Changes

Cohort / File(s) Summary
Sglang Metrics Naming Updates
components/src/dynamo/sglang/publisher.py, tests/utils/payloads.py
Transitions metric naming from underscore (sglang_*) to colon-based delimiters (sglang:*). Removes add_prefix argument from register_engine_metrics_callback, relying on default behavior. Updates regex patterns in metrics validation from ^sglang_\w+ to ^sglang:\w+ to match the new naming scheme.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 Hops through metrics with glee,
Colons replace underscores, so neat!
No prefix needed, defaults run free,
New naming scheme makes validation complete!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: correcting the SGLang metrics prefix from underscore to colon format, which aligns with the actual code modifications.
Description check ✅ Passed The description covers all required template sections with comprehensive details about the changes, rationale, files to review, and related issue reference.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@keivenchang keivenchang self-assigned this Jan 28, 2026
@keivenchang keivenchang merged commit e555780 into main Jan 28, 2026
37 checks passed
@keivenchang keivenchang deleted the keivenchang/DYN-1962__sglang-metrics-prefix-mismatch branch January 28, 2026 01:22
keivenchang added a commit that referenced this pull request Jan 28, 2026
Signed-off-by: Keiven Chang <keivenchang@users.noreply.github.com>
Co-authored-by: Keiven Chang <keivenchang@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend::sglang Relates to the sglang backend fix size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants