You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by to...@apache.org on 2022/07/19 12:09:59 UTC

[skywalking-python] branch master updated: Fix RabbitMQ basic_get(), Makefile missing packages (#225)

This is an automated email from the ASF dual-hosted git repository.

tompytel pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-python.git


The following commit(s) were added to refs/heads/master by this push:
     new a5a0625  Fix RabbitMQ basic_get(), Makefile missing packages (#225)
a5a0625 is described below

commit a5a0625d172a89ed834a74968388a4c937cfcad6
Author: Tomasz Pytel <to...@gmail.com>
AuthorDate: Tue Jul 19 09:09:54 2022 -0300

    Fix RabbitMQ basic_get(), Makefile missing packages (#225)
    
    * improved ignore path regex
    
    * update test
    
    * fix sw_psycopg2 register_type()
    
    * fix complexity level
    
    * fix psycopg2 register_type() second arg default
    
    * fix rabbitmq BlockingChannel consume cb span link
    
    * add BlockingChannel.consume() instrumentation
    
    * fix rabbit basic_get(), Makefile missing packages
---
 Makefile                          | 1 +
 skywalking/plugins/sw_rabbitmq.py | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 4e90501..25c9422 100644
--- a/Makefile
+++ b/Makefile
@@ -28,6 +28,7 @@ endif
 $(VENV):
 	python3 -m venv $(VENV_DIR)
 	$(VENV)/python -m pip install --upgrade pip
+	$(VENV)/python -m pip install wheel twine
 
 setup: $(VENV)
 	$(VENV)/python -m pip install grpcio --ignore-installed
diff --git a/skywalking/plugins/sw_rabbitmq.py b/skywalking/plugins/sw_rabbitmq.py
index 97230cc..6ec9b08 100644
--- a/skywalking/plugins/sw_rabbitmq.py
+++ b/skywalking/plugins/sw_rabbitmq.py
@@ -126,7 +126,11 @@ def _sw__on_deliver_func(__on_deliver):
 
 def _sw_callback_func(callback):
     def _sw_callback(this, method, properties, body):
-        peer = method._sw_peer
+        peer = getattr(method, '_sw_peer', None)
+
+        if peer is None:  # this is not a callback caused by _on_deliver(), some other object like GetOk
+            return callback(this, method, properties, body)
+
         context = get_context()
         exchange = method.exchange
         routing_key = method.routing_key