This is an automated email from the ASF dual-hosted git repository.
kezhenxu94 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 f7d97bf Bugfix when protocol use http, fix loop call report trigger
by skywalking self http request (#18)
f7d97bf is described below
commit f7d97bf6cc0d921d78b9040bc4e5d1cd1cbddaa1
Author: chestar <[email protected]>
AuthorDate: Wed Jun 17 16:36:30 2020 +0800
Bugfix when protocol use http, fix loop call report trigger by skywalking
self http request (#18)
---
skywalking/agent/__init__.py | 2 +-
skywalking/plugins/sw_requests/__init__.py | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/skywalking/agent/__init__.py b/skywalking/agent/__init__.py
index adf5297..fe181a5 100644
--- a/skywalking/agent/__init__.py
+++ b/skywalking/agent/__init__.py
@@ -83,7 +83,7 @@ def stop():
def connected():
- return __protocol.connected
+ return __protocol.connected()
def archive(segment: 'Segment'):
diff --git a/skywalking/plugins/sw_requests/__init__.py
b/skywalking/plugins/sw_requests/__init__.py
index dc028fe..b1b6d02 100644
--- a/skywalking/plugins/sw_requests/__init__.py
+++ b/skywalking/plugins/sw_requests/__init__.py
@@ -22,6 +22,7 @@ from skywalking.trace import tags
from skywalking.trace.carrier import Carrier
from skywalking.trace.context import get_context
from skywalking.trace.tags import Tag
+from skywalking import config
logger = logging.getLogger(__name__)
@@ -41,6 +42,13 @@ def install():
from urllib.parse import urlparse
url_param = urlparse(url)
+ # ignore trace skywalking self request
+ if config.protocol == 'http' and
config.collector_address.rstrip('/').endswith(url_param.netloc):
+ return _request(this, method, url, params, data, headers,
cookies, files, auth, timeout,
+ allow_redirects,
+ proxies,
+ hooks, stream, verify, cert, json)
+
context = get_context()
carrier = Carrier()
with context.new_exit_span(op=url_param.path or "/",
peer=url_param.netloc, carrier=carrier) as span: