Skip to content

feat(sdk): add IsHealthy public reachability probe for parity with Go SDK #359

Description

@marythought

Context

The Go SDK now has a public SDK.IsHealthy(ctx) (bool, error) method (opentdf/platform#3412) that lets downstream services run readiness probes through the SDK instead of open-coding http.Client.Get(healthzEndpoint). The Go version honors ctx for deadline/cancellation, supports OTEL tracing via interceptors, and uses gRPC Health v1.

This issue tracks the equivalent for the Java SDK.

Why

Cross-SDK feature parity for an idiomatic readiness probe. Without this, Java consumers have to either:

  • Open-code an HTTP /healthz check (no auth interceptor, no OTEL trace propagation, easy to misconfigure)
  • Skip readiness probes entirely

Proposed shape

Go signature is IsHealthy(ctx) (bool, error). Java idioms differ — possibilities:

  • boolean isHealthy() throwing a checked exception (e.g. PlatformUnreachableException) on transport failure
  • A typed HealthCheckResult if more granularity is wanted
  • Match whatever pattern the Java SDK already uses for similar transport-failure-vs-success calls

Let the implementer pick the most natural Java idiom; this issue is about the capability, not the exact signature.

Acceptance

  • Public method on the Java SDK performing a gRPC Health v1 probe
  • Honors a deadline arg for cancellation
  • Does not require callers to import gRPC health protobuf types
  • Tested against a grpchealth-style test server
  • Documented with a runnable example

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions