File: README.md

package info (click to toggle)
golang-github-grpc-ecosystem-go-grpc-middleware 2.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,464 kB
  • sloc: makefile: 107; sh: 9
file content (32 lines) | stat: -rw-r--r-- 1,005 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Example Go app instrumented with go-grpc-middleware

This directory has server and client application communicating using [testpb.PingService](../testing/testpb/v1/test.proto) gRPC service.
Both are instrumented with example interceptors for auth, observability correlation, timeouts and more.

Feel free to copy and play with it.

## Usage

1. Run server in one terminal:

    ```
    go run server/main.go
    ```

2. Run client in second terminal:
    
    ```
    go run client/main.go
    ```
   
3. You should see logs and tracing in the output of both terminals thanks to logging and otlpgrpc interceptors. To check metrics instrumented with prometheus interceptor you can curl OpenMetrics (so exemplars are included):

    For server metrics:
    ```
    curl http://localhost:8081/metrics -H 'Accept: application/openmetrics-text; version=0.0.1'
    ```
   
    For client metrics:
    ```
    curl http://localhost:8082/metrics -H 'Accept: application/openmetrics-text; version=0.0.1'
    ```