Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ python {

tasks {
register<Exec>("buildDist") {
commandLine("sh", "-c", "python setup.py sdist")
executable = "python3"
args("setup.py", "sdist")
}

register<Copy>("updateDockerFiles") {
Expand Down
4 changes: 2 additions & 2 deletions e2e/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ RUN pip install Flask
RUN pip install PyYAML
RUN pip install vertx-eventbus-client

COPY sourceplusplus-0.1.3.tar.gz .
COPY sourceplusplus-0.1.4.tar.gz .

RUN pip install sourceplusplus-0.1.3.tar.gz
RUN pip install sourceplusplus-0.1.4.tar.gz

COPY E2ETest.py .

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from setuptools import setup

setup(name='sourceplusplus',
version='0.1.3',
version='0.1.4',
description='Source++ Python Probe',
url='https://github.com/sourceplusplus/probe-python',
author='Source++',
Expand Down
2 changes: 1 addition & 1 deletion sourceplusplus/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = '0.1.3'
__version__ = '0.1.4'
__name__ = 'Source++'
agent_name = 'Source++ Python Probe'
22 changes: 17 additions & 5 deletions sourceplusplus/control/ContextReceiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import threading
import time
import traceback

from skywalking import config, agent
from skywalking.protocol.common.Common_pb2 import KeyStringValuePair
from skywalking.protocol.logging.Logging_pb2 import LogData, LogDataBody, TextLog, TraceContext, LogTags
Expand Down Expand Up @@ -90,6 +91,9 @@ def apply_log(live_log_id, globals, locals):


def apply_breakpoint(live_breakpoint_id, globals, locals):
globals.pop("SourcePlusPlus", None)
locals.pop("ContextReceiver", None)

live_breakpoint: LiveBreakpoint = LiveInstrumentRemote.instruments[live_breakpoint_id][1]
if live_breakpoint.throttle.is_rate_limited():
return
Expand All @@ -100,12 +104,20 @@ def apply_breakpoint(live_breakpoint_id, globals, locals):
context: SpanContext = get_context()

with context.new_local_span(op=operation) as span:
for key in locals:
var = try_find(key, globals, locals)
for key, value in globals.items():
tag = StringTag(json.dumps({
key: str(value), # todo: don't str everything
"@class": str(type(value)),
"@identity": id(value)
}))
tag.key = "spp.global-variable:" + live_breakpoint.id + ":" + key
span.tag(tag)

for key, value in locals.items():
tag = StringTag(json.dumps({
key: str(var), # todo: don't str everything
"@class": str(type(var)),
"@identity": id(var)
key: str(value), # todo: don't str everything
"@class": str(type(value)),
"@identity": id(value)
}))
tag.key = "spp.local-variable:" + live_breakpoint.id + ":" + key
span.tag(tag)
Expand Down
2 changes: 1 addition & 1 deletion sourceplusplus/control/LiveInstrumentRemote.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def add_live_instrument(self, context: LiveInstrumentContext, instrument_type: L
else:
live_instrument = LiveMeter.from_json(i)
bp = LiveInstrumentRemote.dbg.breakpoint(
file=live_instrument.location.source,
file=live_instrument.location.source[live_instrument.location.source.rfind("/") + 1:],
line=live_instrument.location.line
)
LiveInstrumentRemote.instruments[live_instrument.id] = [bp, live_instrument]
Expand Down