census-ecosystem / opencensus-experiments

Apache License 2.0
15 stars 11 forks source link

Add python services #111

Closed c24t closed 5 years ago

c24t commented 5 years ago

This diff adds HTTP and GRPC python services that implement TestRequest. Each service tries to register itself on start, and continues to serve requests until it's killed. They can be run as stand-alone scripts (e.g. ./grpcserver.py) or from another python process as e.g. grpcserver.main() or with grpcserver.serve_grpc_binary(): ....

This diff doesn't check the trace context or tags, but I think it makes sense to split that into a separate PR.

I'm using flask here instead of e.g. BaseHTTPServer since opencensus-python ships with flask integration, but I've left the (uninstrumented) BaseHTTPServer service in here as WIP.

c24t commented 5 years ago

Moved from https://github.com/rghetia/opencensus-experiments/pull/1.