Skip to content

Feat/grpc healthcheck#216

Merged
thorrester merged 4 commits intomainfrom
feat/grpc-healthcheck
Mar 2, 2026
Merged

Feat/grpc healthcheck#216
thorrester merged 4 commits intomainfrom
feat/grpc-healthcheck

Conversation

@thorrester
Copy link
Member

@thorrester thorrester commented Mar 2, 2026

Pull Request

This PR adds gRPC reflection and flexible server deployment modes to the scouter server.

gRPC Reflection (scouter-tonic, scouter-server)

  • Updated scouter_tonic/build.rs to emit a compiled proto file descriptor set (scouter_descriptor.bin) into OUT_DIR alongside the existing generated code, with proto file
    existence validation and a cargo:rerun-if-changed directive
  • Exposed FILE_DESCRIPTOR_SET as a public constant from scouter-tonic so downstream crates don't need to know the OUT_DIR path
  • Added tonic-reflection to the gRPC server, registering both the scouter service descriptors and the tonic_health descriptor — this enables tools like grpcurl to introspect
    the API and call grpc.health.v1.Health/Check without needing proto files

Flexible Serve Modes (scouter-server)

  • Added a ServeMode enum (Both / Http / Grpc) and a start_server_with_mode(mode: ServeMode) function to lib.rs. The existing start_server() delegates to ServeMode::Both,
    keeping all existing test and library usage unchanged
  • Added a clap-based Cli struct to main.rs with a --mode flag (default: both), allowing the binary to be deployed as HTTP-only or gRPC-only without code changes
  • Added make start.server.http and make start.server.grpc targets for local development
  • Updated make stop.server to also kill port 50051

Usage

./scouter-server # both (existing behaviour)
./scouter-server --mode http # HTTP only
./scouter-server --mode grpc # gRPC only (exposes grpc.health.v1.Health/Check on :50051)

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.59%. Comparing base (4a64214) to head (4b58ac1).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #216   +/-   ##
=======================================
  Coverage   62.59%   62.59%           
=======================================
  Files          18       18           
  Lines         262      262           
=======================================
  Hits          164      164           
  Misses         98       98           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@thorrester thorrester marked this pull request as ready for review March 2, 2026 20:43
@thorrester thorrester merged commit b82477a into main Mar 2, 2026
2 of 7 checks passed
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.

2 participants