1# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! 2import grpc 3 4from opencensus.proto.agent.trace.v1 import trace_service_pb2 as opencensus_dot_proto_dot_agent_dot_trace_dot_v1_dot_trace__service__pb2 5 6 7class TraceServiceStub(object): 8 """Service that can be used to push spans and configs between one Application 9 instrumented with OpenCensus and an agent, or between an agent and a 10 central collector or config service (in this case spans and configs are 11 sent/received to/from multiple Applications). 12 """ 13 14 def __init__(self, channel): 15 """Constructor. 16 17 Args: 18 channel: A grpc.Channel. 19 """ 20 self.Config = channel.stream_stream( 21 '/opencensus.proto.agent.trace.v1.TraceService/Config', 22 request_serializer=opencensus_dot_proto_dot_agent_dot_trace_dot_v1_dot_trace__service__pb2.CurrentLibraryConfig.SerializeToString, 23 response_deserializer=opencensus_dot_proto_dot_agent_dot_trace_dot_v1_dot_trace__service__pb2.UpdatedLibraryConfig.FromString, 24 ) 25 self.Export = channel.stream_stream( 26 '/opencensus.proto.agent.trace.v1.TraceService/Export', 27 request_serializer=opencensus_dot_proto_dot_agent_dot_trace_dot_v1_dot_trace__service__pb2.ExportTraceServiceRequest.SerializeToString, 28 response_deserializer=opencensus_dot_proto_dot_agent_dot_trace_dot_v1_dot_trace__service__pb2.ExportTraceServiceResponse.FromString, 29 ) 30 31 32class TraceServiceServicer(object): 33 """Service that can be used to push spans and configs between one Application 34 instrumented with OpenCensus and an agent, or between an agent and a 35 central collector or config service (in this case spans and configs are 36 sent/received to/from multiple Applications). 37 """ 38 39 def Config(self, request_iterator, context): 40 """After initialization, this RPC must be kept alive for the entire life of 41 the application. The agent pushes configs down to applications via a 42 stream. 43 """ 44 context.set_code(grpc.StatusCode.UNIMPLEMENTED) 45 context.set_details('Method not implemented!') 46 raise NotImplementedError('Method not implemented!') 47 48 def Export(self, request_iterator, context): 49 """For performance reasons, it is recommended to keep this RPC 50 alive for the entire life of the application. 51 """ 52 context.set_code(grpc.StatusCode.UNIMPLEMENTED) 53 context.set_details('Method not implemented!') 54 raise NotImplementedError('Method not implemented!') 55 56 57def add_TraceServiceServicer_to_server(servicer, server): 58 rpc_method_handlers = { 59 'Config': grpc.stream_stream_rpc_method_handler( 60 servicer.Config, 61 request_deserializer=opencensus_dot_proto_dot_agent_dot_trace_dot_v1_dot_trace__service__pb2.CurrentLibraryConfig.FromString, 62 response_serializer=opencensus_dot_proto_dot_agent_dot_trace_dot_v1_dot_trace__service__pb2.UpdatedLibraryConfig.SerializeToString, 63 ), 64 'Export': grpc.stream_stream_rpc_method_handler( 65 servicer.Export, 66 request_deserializer=opencensus_dot_proto_dot_agent_dot_trace_dot_v1_dot_trace__service__pb2.ExportTraceServiceRequest.FromString, 67 response_serializer=opencensus_dot_proto_dot_agent_dot_trace_dot_v1_dot_trace__service__pb2.ExportTraceServiceResponse.SerializeToString, 68 ), 69 } 70 generic_handler = grpc.method_handlers_generic_handler( 71 'opencensus.proto.agent.trace.v1.TraceService', rpc_method_handlers) 72 server.add_generic_rpc_handlers((generic_handler,)) 73