grpc.health.v1.Health/Check) on the configured interval and report
the serving status as 1 (SERVING) or 0 (NOT_SERVING), or the Check
round-trip latency in milliseconds.
This is the right probe for gRPC services used in service-to-service
communication. It does not invoke arbitrary methods on your service:
only the well-known health-check RPC, which most gRPC frameworks expose
with a few lines of setup.
What it requires of your service
Your server must implement the standard health service. Most gRPC stacks ship a ready-made implementation:- Go:
google.golang.org/grpc/health+grpc_health_v1.RegisterHealthServer. - Java:
grpc-servicesHealthStatusManager. - Node:
grpc-health-check. - Python:
grpcio-health-checking.
grpc_unimplemented rather than a connection error, so you can tell the
two apart.
Overall health vs a named service
The health service tracks status per service name, plus an overall server status under the empty name:- Leave Service name blank to check the overall server health. This is the common case.
- Set a registered service name (for example
my.package.MyService) to check just that service. If the name is not registered, the probe reportsgrpc_service_unknown.
Transport security
Three modes:- Plaintext (
plaintext): no TLS. Use inside a trusted cluster network (h2c). - TLS (
tls): server-authenticated TLS. Set the CA certificate env var if the server uses a private CA; leave it blank to use the system trust store. - mTLS (
mtls): mutual TLS. The agent presents a client certificate. This reuses the same env-var-reference mechanism as the HTTP probe’s mTLS: each field is the NAME of an environment variable on the agent host whose value is the PEM material (or a path to a PEM file). The cloud stores only the variable name, never the certificate or key.
Secret metadata
Usemetadata_refs for any metadata entry that carries a credential:
bearer tokens, API keys, session cookies. Each entry maps a metadata key
to the name of an environment variable on the agent host. The agent
reads the value at probe time and sends it with the health check.
Observer stores only the variable name, never the token.
-e, a Compose
environment: block, or a Kubernetes secret mapped to env) and restart
the agent:
Bearer yourself.
Rules:
- Keys use letters, digits,
-,_and.. They are case-insensitive and sent lowercase. Keys starting withgrpc-are reserved by gRPC, and binary keys ending in-binare not supported. Variable names must beUPPER_SNAKE_CASE. Up to 32 entries. - A key can be in
metadataormetadata_refs, not both. - Values must be printable ASCII. A value with a line break or other
control character reports
metadata_ref_invalid. - If a variable is unset or blank the probe reports
no_datawithmetadata_ref_missingand does not send the health check. The result names the key and the variable, never the value. - The agent never logs secret metadata values or includes them in results.
Agent version
metadata_refs requires agent 1.6.0 or later. Agents at 1.5.0 or
older do not recognise the field and report invalid_config for any
probe that uses it. Upgrade the agent before adding secret metadata.Configuration shape
Plaintext overall-health check:Field reference
Interpretations
Reason codes
grpc_unimplemented: the server doesn’t implement the health service. Addgrpc.health.v1.Healthto the server.grpc_service_unknown: the named service isn’t registered. Check the name, or leave it blank for overall health.grpc_health_unknown: the server answered UNKNOWN (often mid-startup).grpc_unavailable: connection failed (refused, DNS, network). Distinct from auth and TLS errors.grpc_timeout: the Check didn’t complete within the timeout.grpc_unauthenticated: the server rejected the call as unauthenticated. Check the secret metadata and the env var it names.grpc_permission_denied: authenticated but not authorized.grpc_tls_failed: TLS handshake failed. Check the TLS mode and set the CA cert env var for a private CA.grpc_ca_unreadable: the CA cert env var is unset or points at an unreadable file on the agent.grpc_metadata_invalid: a metadata key or value is not legal gRPC metadata. The health check is not sent.mtls_*: withtls_modeset tomtls, client certificate and key problems use the samemtls_*codes as HTTP probes (for examplemtls_ref_missingormtls_key_parse_failed). See mTLS authentication.grpc_error: an uncategorised gRPC error. Check the agent log for the status code.metadata_ref_missing: an env var named inmetadata_refsis not set (or is blank) on the agent host. The health check is not sent.metadata_ref_invalid: an env var named inmetadata_refsholds a line break, control character, or non-ASCII character, which gRPC metadata does not allow.
Troubleshooting
grpc_unimplementedon a service you know is up. The server is reachable but doesn’t register the health service. This is a server change, not a probe setting.grpc_unavailableonly over TLS. If plaintext works and TLS doesn’t, the listener may not be terminating TLS on that port, or the port differs. Confirm the TLS port.grpc_tls_failedagainst a private CA. Setca_cert_refto an env var holding the CA PEM so the agent can verify the server.- mTLS reports
mtls_ref_missing. The field wants the NAME of an env var, not the certificate text. Set the env var on the agent and reference it by name.

