Skip to content

Commit 8a396e2

Browse files
authored
examples/health: fix markdown formatting and improve content (#8625)
This PR fixes some markdown formatting issues flagged by an internal tool (when attempting to import recent changes into google3). It also makes minor improvements to the content. RELEASE NOTES: N/A
1 parent 1b8b98e commit 8a396e2

File tree

1 file changed

+31
-20
lines changed

1 file changed

+31
-20
lines changed

examples/features/health/README.md

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# Health
22

3-
gRPC provides a health library to communicate a system's health to their clients.
4-
It works by providing a service definition via the [health/v1](https://github.com/grpc/grpc-proto/blob/master/grpc/health/v1/health.proto) api.
3+
gRPC provides a health library to communicate a system's health to their
4+
clients. It works by providing a service definition via the
5+
[health/v1](https://github.com/grpc/grpc-proto/blob/master/grpc/health/v1/health.proto)
6+
api.
57

6-
By using the health library, clients can gracefully avoid using servers as they encounter issues.
7-
Most languages provide an implementation out of box, making it interoperable between systems.
8+
Clients use the health library to gracefully avoid servers that encounter
9+
issues. Most languages provide an out-of-box implementation, which makes it
10+
interoperable between systems.
811

912
## Try it
1013

@@ -21,13 +24,17 @@ go run client/main.go
2124

2225
### Client
2326

24-
Clients have two ways to monitor a servers health.
25-
They can use `Check()` to probe a servers health or they can use `Watch()` to observe changes.
27+
Clients have two ways to monitor a server's health. They use `Check()` to probe
28+
a server's health or `Watch()` to observe changes.
2629

27-
In most cases, clients do not need to directly check backend servers.
28-
Instead, they can do this transparently when a `healthCheckConfig` is specified in the [service config](https://github.com/grpc/proposal/blob/master/A17-client-side-health-checking.md#service-config-changes) and the [health package](https://pkg.go.dev/google.golang.org/grpc/health) is imported.
29-
The `serviceName` in `healthCheckConfig` will be used in the health check when connections are established.
30-
An empty string (`""`) typically indicates the overall health of a server should be reported.
30+
In most cases, clients do not directly check backend servers. Instead, they do
31+
this transparently when you specify a `healthCheckConfig` in the [service
32+
config](https://github.com/grpc/proposal/blob/master/A17-client-side-health-checking.md#service-config-changes)
33+
and import the [health
34+
package](https://pkg.go.dev/google.golang.org/grpc/health). The `serviceName` in
35+
`healthCheckConfig` is used in the health check when connections are
36+
established. An empty string (`""`) typically indicates the overall health of a
37+
server.
3138

3239
```go
3340
// import grpc/health to enable transparent client side checking
@@ -43,21 +50,25 @@ serviceConfig := grpc.WithDefaultServiceConfig(`{
4350
conn, err := grpc.NewClient(..., serviceConfig)
4451
```
4552

46-
See [A17 - Client-Side Health Checking](https://github.com/grpc/proposal/blob/master/A17-client-side-health-checking.md) for more details.
53+
See [A17 - Client-Side Health
54+
Checking](https://github.com/grpc/proposal/blob/master/A17-client-side-health-checking.md)
55+
for more details.
4756

4857
### Server
4958

50-
Servers control their serving status.
51-
They do this by inspecting dependent systems, then update their own status accordingly.
52-
A health server can return one of four states: `UNKNOWN`, `SERVING`, `NOT_SERVING`, and `SERVICE_UNKNOWN`.
59+
Servers control their serving status. They do this by inspecting dependent
60+
systems, then update their status accordingly. A health server can return one of
61+
four states: `UNKNOWN`, `SERVING`, `NOT_SERVING`, and `SERVICE_UNKNOWN`.
5362

54-
`UNKNOWN` indicates the current state is not yet known.
55-
This state is often seen at the start up of a server instance.
63+
`UNKNOWN` indicates the system does not yet know the current state. Servers
64+
often show this state at startup.
5665

5766
`SERVING` means that the system is healthy and ready to service requests.
58-
Conversely, `NOT_SERVING` indicates the system is unable to service requests at the time.
67+
Conversely, `NOT_SERVING` indicates the system is unable to service requests at
68+
the time.
5969

60-
`SERVICE_UNKNOWN` communicates the `serviceName` requested by the client is not known by the server.
61-
This status is only reported by the `Watch()` call.
70+
`SERVICE_UNKNOWN` communicates the `serviceName` requested by the client is not
71+
known by the server. This status is only reported by the `Watch()` call.
6272

63-
A server may toggle its health using `healthServer.SetServingStatus("serviceName", servingStatus)`.
73+
A server may toggle its health using
74+
`healthServer.SetServingStatus("serviceName", servingStatus)`.

0 commit comments

Comments
 (0)