Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
README.md | H A D | 25-Apr-2025 | 1.3 KiB | 64 | 44 | |
helloworld_pb2.py | H A D | 25-Apr-2025 | 1.4 KiB | 31 | 18 | |
helloworld_pb2.pyi | H A D | 25-Apr-2025 | 576 | 18 | 14 | |
helloworld_pb2_grpc.py | H A D | 25-Apr-2025 | 2.3 KiB | 71 | 55 | |
observability_greeter_client.py | H A D | 25-Apr-2025 | 2.1 KiB | 65 | 39 | |
observability_greeter_server.py | H A D | 25-Apr-2025 | 2.3 KiB | 76 | 48 | |
open_telemetry_exporter.py | H A D | 25-Apr-2025 | 2.9 KiB | 76 | 52 | |
requirements.txt | H A D | 25-Apr-2025 | 70 | 4 | 3 |
README.md
1gRPC Observability Example 2===================== 3 4The examples here demonstrate how to setup gRPC Python Observability with Opentelemetry. 5 6More details about how to use gRPC Python Observability APIs can be found in [OpenTelemetry Metrics gRFC](https://github.com/grpc/proposal/blob/master/A66-otel-stats.md#opentelemetry-metrics). 7 8### Install Requirements 9 101. Navigate to this directory: 11 12```sh 13cd examples/python/observability 14``` 15 162. Install requirements: 17 18```sh 19python -m pip install -r requirements.txt 20``` 21 22### Run the Server 23 24Start the server: 25 26```sh 27python -m observability_greeter_server 28``` 29 30### Run the Client 31 32Note that client should start within 10 seconds of the server becoming active. 33 34```sh 35python -m observability_greeter_client 36``` 37 38### Verifying Metrics 39 40The example will print a list of metric names collected. 41 42Server Side: 43 44``` 45Server started, listening on 50051 46Metrics exported on Server side: 47grpc.server.call.started 48grpc.server.call.sent_total_compressed_message_size 49grpc.server.call.rcvd_total_compressed_message_size 50grpc.server.call.duration 51``` 52 53Client Side: 54 55``` 56Greeter client received: Hello You 57Metrics exported on client side: 58grpc.client.call.duration 59grpc.client.attempt.started 60grpc.client.attempt.sent_total_compressed_message_size 61grpc.client.attempt.rcvd_total_compressed_message_size 62grpc.client.attempt.duration 63``` 64