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