22import threading
33import time
44import traceback
5+
56from skywalking import config , agent
67from skywalking .protocol .common .Common_pb2 import KeyStringValuePair
78from skywalking .protocol .logging .Logging_pb2 import LogData , LogDataBody , TextLog , TraceContext , LogTags
@@ -90,6 +91,9 @@ def apply_log(live_log_id, globals, locals):
9091
9192
9293def apply_breakpoint (live_breakpoint_id , globals , locals ):
94+ globals .pop ("SourcePlusPlus" , None )
95+ locals .pop ("ContextReceiver" , None )
96+
9397 live_breakpoint : LiveBreakpoint = LiveInstrumentRemote .instruments [live_breakpoint_id ][1 ]
9498 if live_breakpoint .throttle .is_rate_limited ():
9599 return
@@ -100,12 +104,20 @@ def apply_breakpoint(live_breakpoint_id, globals, locals):
100104 context : SpanContext = get_context ()
101105
102106 with context .new_local_span (op = operation ) as span :
103- for key in locals :
104- var = try_find (key , globals , locals )
107+ for key , value in globals .items ():
108+ tag = StringTag (json .dumps ({
109+ key : str (value ), # todo: don't str everything
110+ "@class" : str (type (value )),
111+ "@identity" : id (value )
112+ }))
113+ tag .key = "spp.global-variable:" + live_breakpoint .id + ":" + key
114+ span .tag (tag )
115+
116+ for key , value in locals .items ():
105117 tag = StringTag (json .dumps ({
106- key : str (var ), # todo: don't str everything
107- "@class" : str (type (var )),
108- "@identity" : id (var )
118+ key : str (value ), # todo: don't str everything
119+ "@class" : str (type (value )),
120+ "@identity" : id (value )
109121 }))
110122 tag .key = "spp.local-variable:" + live_breakpoint .id + ":" + key
111123 span .tag (tag )
0 commit comments