---
title: "gRPC Health Checks"
description: "Monitor gRPC services with configurable host, port, service name, and TLS settings. Detect gRPC failures and performance issues in real time."
url: "https://www.upti.my/docs/healthchecks/grpc"
---

Healthchecks

# gRPC Health Checks

Monitor gRPC services with configurable host, port, service name, and TLS settings.

## Overview

gRPC health checks in Uptimy use the standard gRPC Health Checking Protocol to verify that your gRPC services are operational. This protocol is the recommended way to monitor gRPC services and is supported by most gRPC frameworks out of the box.

The check establishes a connection to your gRPC server, sends a health check RPC call, and validates the response status. You can monitor the overall server health or check individual service names for more granular visibility.

## Configuration

| Parameter | Description | Default |
| --- | --- | --- |
| **Host** | The hostname or IP address of your gRPC server | Required |
| **Port** | The port number your gRPC server listens on | `9090` |
| **Service name** | The specific gRPC service to check. Leave empty to check the overall server health. | Empty (server-level check) |
| **TLS/SSL Encryption** | Toggle TLS encryption for the gRPC connection | Off |

**Service name** and **TLS/SSL Encryption** are under **Advanced settings** in the app.

Service Name

If your gRPC server hosts multiple services, specify the service name to check each one independently. This lets you detect when a specific service is unhealthy while the server itself is still accepting connections.

## How It Works

The gRPC health check follows the standard Health Checking Protocol defined in the `grpc.health.v1` package. When a check runs, Uptimy performs these steps:

1.  Establishes a TCP connection to the specified host and port
2.  Performs a TLS handshake if TLS is enabled
3.  Sends a `Check` RPC to the `grpc.health.v1.Health` service
4.  Evaluates the response status (SERVING, NOT\_SERVING, UNKNOWN, or SERVICE\_UNKNOWN)

The check is considered successful only when the response status is `SERVING`. Any other status, connection failure, or timeout is treated as a failure.

## Response Data

Each gRPC health check execution captures the following data:

| Field | Description |
| --- | --- |
| **gRPC Status** | The health check response status (SERVING, NOT\_SERVING, UNKNOWN, SERVICE\_UNKNOWN) |
| **Service Name** | The service name that was checked |
| **Connection Time** | Time taken to establish the TCP connection |
| **RPC Call Time** | Time taken to complete the health check RPC call, including the TLS handshake when TLS is on |
| **Connect Error** | Details if the connection could not be established |
| **Check Error** | Details if the health check RPC failed after connecting |

## Example Configuration

gRPC is healthcheck type `2`. This is its `config` as the API and uptimyctl take it. The interval and timeout aren't part of it: they are set on the check itself, as `intervalSeconds` and `timeoutSeconds`.

gRPC check config

```json
{
  "host": "grpc.example.com",
  "port": 9090,
  "service": "my.package.MyService",
  "useTls": true
}
```

## Implementing the Health Check Protocol

Your gRPC server must implement the standard health checking service to work with Uptimy. Here is a minimal example using Go:

main.go

```go
import (
    "google.golang.org/grpc/health"
    healthpb "google.golang.org/grpc/health/grpc_health_v1"
)

// Register the health service on your gRPC server
healthServer := health.NewServer()
healthpb.RegisterHealthServer(grpcServer, healthServer)

// Set the serving status for a specific service
healthServer.SetServingStatus(
    "my.package.MyService",
    healthpb.HealthCheckResponse_SERVING,
)
```

Framework Support

Most gRPC frameworks provide built-in support for the health checking protocol. Check your framework's documentation for specific implementation details. Popular frameworks like Go gRPC, Java gRPC, and Python grpcio all include health check utilities.

Firewall and Network Access

Ensure that the gRPC port is accessible from Uptimy's monitoring nodes. If your service is behind a firewall or in a private network, consider using heartbeat monitoring, which only requires outbound traffic from your network.
