mirror of
https://github.com/php-win-ext/grpc.git
synced 2026-03-24 17:12:19 +01:00
<!-- If you know who should review your pull request, please assign it to that person, otherwise the pull request would get assigned randomly. If your pull request is for a specific language, please add the appropriate lang label. -->
1.3 KiB
1.3 KiB
gRPC Observability Example
The examples here demonstrate how to setup gRPC Python Observability with Opentelemetry.
More details about how to use gRPC Python Observability APIs can be found in OpenTelemetry Metrics gRFC.
Install Requirements
- Navigate to this directory:
cd examples/python/observability
- Install requirements:
python -m pip install -r requirements.txt
Run the Server
Start the server:
python -m observability_greeter_server
Run the Client
Note that client should start within 10 seconds of the server becoming active.
python -m observability_greeter_client
Verifying Metrics
The example will print a list of metric names collected.
Server Side:
Server started, listening on 50051
Metrics exported on Server side:
grpc.server.call.started
grpc.server.call.sent_total_compressed_message_size
grpc.server.call.rcvd_total_compressed_message_size
grpc.server.call.duration
Client Side:
Greeter client received: Hello You
Metrics exported on client side:
grpc.client.call.duration
grpc.client.attempt.started
grpc.client.attempt.sent_total_compressed_message_size
grpc.client.attempt.rcvd_total_compressed_message_size
grpc.client.attempt.duration