Skip to content

Add seprate metrics endpoint for grpc and optionally http server#14378

Closed
Kangyan-Zhou wants to merge 2 commits intomainfrom
add_tls
Closed

Add seprate metrics endpoint for grpc and optionally http server#14378
Kangyan-Zhou wants to merge 2 commits intomainfrom
add_tls

Conversation

@Kangyan-Zhou
Copy link
Copy Markdown
Collaborator

@Kangyan-Zhou Kangyan-Zhou commented Dec 4, 2025

Prometheus cannot scrape server metrics with grpc ports

@github-actions github-actions bot added documentation Improvements or additions to documentation model-gateway labels Dec 4, 2025
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @Kangyan-Zhou, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the operational flexibility and security posture of the SGLang server and router. It provides a dedicated mechanism for exposing Prometheus metrics, which is essential for monitoring gRPC-based deployments, and introduces robust mutual TLS authentication for secure router-worker interactions. Additionally, it enables standard TLS for the HTTP server, ensuring encrypted communication for all server types.

Highlights

  • Separate Metrics Endpoint: Introduced a new --metrics-port argument allowing Prometheus metrics to be served on a dedicated HTTP port, separate from the main server. This is particularly useful for gRPC mode, where HTTP endpoints cannot share the gRPC server's port.
  • Mutual TLS (mTLS) for Router-Worker Communication: Added support for mTLS to secure communication between the SGLang router and its workers. New CLI arguments (--client-cert-path, --client-key-path, --ca-cert-path) are available for configuring client certificates, private keys, and CA certificates for worker verification.
  • TLS/SSL for HTTP Server: Enabled standard TLS/SSL for the HTTP server, allowing secure connections using --ssl-keyfile, --ssl-certfile, --ssl-ca-certs, and --ssl-keyfile-password.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

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

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 two significant features: a separate metrics endpoint and mTLS support for both the Python server and the Rust router. The implementation is well-structured, with corresponding changes in documentation, server arguments, and core logic. The new --metrics-port argument allows metrics to be served on a dedicated port, which is particularly useful in gRPC mode. The mTLS support enhances security for server-worker communication. My review includes a couple of suggestions to improve code clarity and maintainability.

@Kangyan-Zhou Kangyan-Zhou changed the title Add seprate metrics endpoint for grpc and add mtls for server/worker … Add seprate metrics endpoint for grpc and optionally http server Dec 4, 2025
@Kangyan-Zhou Kangyan-Zhou marked this pull request as ready for review December 4, 2025 05:02
@Kangyan-Zhou
Copy link
Copy Markdown
Collaborator Author

/tag-and-rerun-ci

@github-actions github-actions bot added the run-ci label Dec 4, 2025
@Kangyan-Zhou Kangyan-Zhou marked this pull request as draft December 4, 2025 05:04
@Kangyan-Zhou Kangyan-Zhou marked this pull request as ready for review December 4, 2025 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation model-gateway run-ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant