The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#) https://grpc.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Xuan Wang 24be69b9bd [Python O11y] Change public interface (#36094) 9 months ago
..
README.md
helloworld_pb2.py
helloworld_pb2.pyi
helloworld_pb2_grpc.py
observability_greeter_client.py [Python O11y] Change public interface (#36094) 9 months ago
observability_greeter_server.py [Python O11y] Change public interface (#36094) 9 months ago
open_telemetry_exporter.py
requirements.txt

README.md

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

  1. Navigate to this directory:
cd examples/python/observability
  1. 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