@@ -52,21 +52,21 @@ that communicates using a custom-built remoting protocol (e.g. over TCP/IP).
5252First you would instrument the applications separately using, e.g. using the
5353`trace_* ` functions from :class: `oneagent.sdk.SDK ` together with `with `-blocks::
5454
55- from oneagent.sdk import SDK, CHANNEL_TYPE_TCP_IP , Channel
55+ from oneagent.sdk import SDK, ChannelType , Channel
5656
5757 # In the client:
5858 def call_remote(message):
5959 tracer = SDK.get().trace_outgoing_remote_call(
6060 'my_remote_function', 'MyRemoteService', 'MyRemoteEndpoint',
61- Channel(CHANNEL_TYPE_TCP_IP , 'example.com:12345'))
62- with tracer.start() :
61+ Channel(ChannelType.TCP_IP , 'example.com:12345'))
62+ with tracer:
6363 myremotingchannel.send('my_remote_function', message)
6464
6565 # In the server:
6666 def my_remote_function(message):
6767 tracer = SDK.get().trace_incoming_remote_call(
6868 'my_remote_function', 'MyRemoteService', 'MyRemoteEndpoint')
69- with tracer.start() :
69+ with tracer:
7070 do_actual_work()
7171
7272Now you will get two paths that will be completely unrelated from Dynatrace's
@@ -82,14 +82,14 @@ The result after doing this could look like this:
8282.. code-block :: python
8383 :emphasize- lines: 9 - 10 ,15 ,17
8484
85- from oneagent.sdk import SDK , CHANNEL_TYPE_TCP_IP , Channel
85+ from oneagent.sdk import SDK , ChannelType , Channel
8686
8787 # In the client:
8888 def call_remote (message ):
8989 tracer = SDK .get().trace_outgoing_remote_call(
9090 ' my_remote_function' , ' MyRemoteService' , ' MyRemoteEndpoint' ,
91- Channel(CHANNEL_TYPE_TCP_IP , ' example.com:12345' ))
92- with tracer.start() : # Starts the tracer; required for obtaining a tag!
91+ Channel(ChannelType. TCP_IP , ' example.com:12345' ))
92+ with tracer: # Starts the tracer; required for obtaining a tag!
9393 tag = tracer.outgoing_dynatrace_byte_tag
9494 message.add_header(' Dynatrace-Tag' , tag) # Or some such
9595 myremotingchannel.send(' my_remote_function' , message)
@@ -100,7 +100,7 @@ The result after doing this could look like this:
100100 tracer = SDK .get().trace_incoming_remote_call(
101101 ' my_remote_function' , ' MyRemoteService' , ' MyRemoteEndpoint' ,
102102 byte_tag = tag)
103- with tracer.start() :
103+ with tracer:
104104 do_actual_work()
105105
106106 Note these points:
0 commit comments