|
2 | 2 | import threading
|
3 | 3 | import time
|
4 | 4 | import traceback
|
| 5 | + |
5 | 6 | from skywalking import config, agent
|
6 | 7 | from skywalking.protocol.common.Common_pb2 import KeyStringValuePair
|
7 | 8 | from skywalking.protocol.logging.Logging_pb2 import LogData, LogDataBody, TextLog, TraceContext, LogTags
|
@@ -102,12 +103,20 @@ def apply_breakpoint(live_breakpoint_id, globals, locals):
|
102 | 103 | context: SpanContext = get_context()
|
103 | 104 |
|
104 | 105 | with context.new_local_span(op=operation) as span:
|
105 |
| - for key in locals: |
106 |
| - var = try_find(key, globals, locals) |
| 106 | + for key, value in globals.items(): |
| 107 | + tag = StringTag(json.dumps({ |
| 108 | + key: str(value), # todo: don't str everything |
| 109 | + "@class": str(type(value)), |
| 110 | + "@identity": id(value) |
| 111 | + })) |
| 112 | + tag.key = "spp.global-variable:" + live_breakpoint.id + ":" + key |
| 113 | + span.tag(tag) |
| 114 | + |
| 115 | + for key, value in locals.items(): |
107 | 116 | tag = StringTag(json.dumps({
|
108 |
| - key: str(var), # todo: don't str everything |
109 |
| - "@class": str(type(var)), |
110 |
| - "@identity": id(var) |
| 117 | + key: str(value), # todo: don't str everything |
| 118 | + "@class": str(type(value)), |
| 119 | + "@identity": id(value) |
111 | 120 | }))
|
112 | 121 | tag.key = "spp.local-variable:" + live_breakpoint.id + ":" + key
|
113 | 122 | span.tag(tag)
|
|
0 commit comments