|
5 | 5 |
|
6 | 6 |
|
7 | 7 | class TraceServiceStub(object): |
8 | | - # missing associated documentation comment in .proto file |
9 | | - pass |
| 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 | + """ |
10 | 13 |
|
11 | | - def __init__(self, channel): |
12 | | - """Constructor. |
| 14 | + def __init__(self, channel): |
| 15 | + """Constructor. |
13 | 16 |
|
14 | | - Args: |
15 | | - channel: A grpc.Channel. |
16 | | - """ |
17 | | - self.Config = channel.stream_stream( |
18 | | - '/opencensus.proto.agent.trace.v1.TraceService/Config', |
19 | | - request_serializer=opencensus_dot_proto_dot_agent_dot_trace_dot_v1_dot_trace__service__pb2.CurrentLibraryConfig.SerializeToString, |
20 | | - response_deserializer=opencensus_dot_proto_dot_agent_dot_trace_dot_v1_dot_trace__service__pb2.UpdatedLibraryConfig.FromString, |
| 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, |
21 | 24 | ) |
22 | | - self.Export = channel.stream_stream( |
23 | | - '/opencensus.proto.agent.trace.v1.TraceService/Export', |
24 | | - request_serializer=opencensus_dot_proto_dot_agent_dot_trace_dot_v1_dot_trace__service__pb2.ExportTraceServiceRequest.SerializeToString, |
25 | | - response_deserializer=opencensus_dot_proto_dot_agent_dot_trace_dot_v1_dot_trace__service__pb2.ExportTraceServiceResponse.FromString, |
| 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, |
26 | 29 | ) |
27 | 30 |
|
28 | 31 |
|
29 | 32 | class TraceServiceServicer(object): |
30 | | - # missing associated documentation comment in .proto file |
31 | | - pass |
| 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 | + """ |
32 | 38 |
|
33 | | - def Config(self, request_iterator, context): |
34 | | - """After initialization, this RPC must be kept alive for the |
35 | | - entire life of the application. The agent pushes configs |
36 | | - down to applications via a stream. |
37 | | - """ |
38 | | - context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
39 | | - context.set_details('Method not implemented!') |
40 | | - raise NotImplementedError('Method not implemented!') |
| 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!') |
41 | 47 |
|
42 | | - def Export(self, request_iterator, context): |
43 | | - """Allows applications to send spans to the agent. |
44 | | - For performance reasons, it is recommended to keep this RPC |
45 | | - alive for the entire life of the application. |
46 | | - """ |
47 | | - context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
48 | | - context.set_details('Method not implemented!') |
49 | | - raise NotImplementedError('Method not implemented!') |
| 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!') |
50 | 55 |
|
51 | 56 |
|
52 | 57 | def add_TraceServiceServicer_to_server(servicer, server): |
53 | | - rpc_method_handlers = { |
54 | | - 'Config': grpc.stream_stream_rpc_method_handler( |
55 | | - servicer.Config, |
56 | | - request_deserializer=opencensus_dot_proto_dot_agent_dot_trace_dot_v1_dot_trace__service__pb2.CurrentLibraryConfig.FromString, |
57 | | - response_serializer=opencensus_dot_proto_dot_agent_dot_trace_dot_v1_dot_trace__service__pb2.UpdatedLibraryConfig.SerializeToString, |
58 | | - ), |
59 | | - 'Export': grpc.stream_stream_rpc_method_handler( |
60 | | - servicer.Export, |
61 | | - request_deserializer=opencensus_dot_proto_dot_agent_dot_trace_dot_v1_dot_trace__service__pb2.ExportTraceServiceRequest.FromString, |
62 | | - response_serializer=opencensus_dot_proto_dot_agent_dot_trace_dot_v1_dot_trace__service__pb2.ExportTraceServiceResponse.SerializeToString, |
63 | | - ), |
64 | | - } |
65 | | - generic_handler = grpc.method_handlers_generic_handler( |
66 | | - 'opencensus.proto.agent.trace.v1.TraceService', rpc_method_handlers) |
67 | | - server.add_generic_rpc_handlers((generic_handler,)) |
| 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,)) |
0 commit comments