From 4b634aeb68655c5ed883abb84e6e254cde6e2bc6 Mon Sep 17 00:00:00 2001 From: Peter Giacomo Lombardo Date: Sat, 9 Dec 2017 19:38:47 +0100 Subject: [PATCH 1/4] Update list of package classifiers. --- setup.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 19b91c3b..8c55d22c 100644 --- a/setup.py +++ b/setup.py @@ -23,9 +23,13 @@ test_suite='nose.collector', keywords=['performance', 'opentracing', 'metrics', 'monitoring'], classifiers=[ - 'Development Status :: 4 - Beta', + 'Development Status :: 5 - Production/Stable', + 'Framework :: Django', + 'Framework :: Flask', 'Intended Audience :: Developers', 'Intended Audience :: Information Technology', + 'Intended Audience :: Science/Research', + 'Intended Audience :: System Administrators', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', @@ -34,6 +38,7 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware', 'Topic :: System :: Monitoring', 'Topic :: System :: Networking :: Monitoring', 'Topic :: Software Development :: Libraries :: Python Modules']) From fc35b177558b64dcf265ef82cd88253f39c99a54 Mon Sep 17 00:00:00 2001 From: Peter Giacomo Lombardo Date: Sat, 9 Dec 2017 19:41:30 +0100 Subject: [PATCH 2/4] Hook & probe initializers. --- gdbinit | 4 ++++ instana/probe.py | 13 +++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 gdbinit create mode 100644 instana/probe.py diff --git a/gdbinit b/gdbinit new file mode 100644 index 00000000..759228e9 --- /dev/null +++ b/gdbinit @@ -0,0 +1,4 @@ +call PyGILState_Ensure() +call PyRun_SimpleString("import sys; sys.path.insert(0, '/tmp/instana/python');") +call PyRun_SimpleString("exec(open(\"/tmp/instana/python/python-sensor/instana/probe.py\").read())") +call PyGILState_Release($1) diff --git a/instana/probe.py b/instana/probe.py new file mode 100644 index 00000000..6c401a82 --- /dev/null +++ b/instana/probe.py @@ -0,0 +1,13 @@ +import opentracing as ot +from instana import tracer, options + +# This file is the hook for autoinstrumenation. +# Here, we should: +# 1. Make sure instana sensor is not already active in the process +# 2. Activate properly +# a. Runtime metrics +# b. Detect and instrument framework +# c. Detect and instrument any libraries + +opts = options.Options() +ot.global_tracer = tracer.InstanaTracer(opts) From f0c5bdd4e0cc605f85aeef5c61de50d4fd088849 Mon Sep 17 00:00:00 2001 From: Peter Giacomo Lombardo Date: Sat, 9 Dec 2017 19:42:11 +0100 Subject: [PATCH 3/4] Linter config file. --- pylama.ini | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 pylama.ini diff --git a/pylama.ini b/pylama.ini new file mode 100644 index 00000000..a4a750dc --- /dev/null +++ b/pylama.ini @@ -0,0 +1,2 @@ +[pylama:pycodestyle] +max_line_length = 120 From 2e73ea7d09a3e7817e018ac645495508844a3a90 Mon Sep 17 00:00:00 2001 From: Peter Giacomo Lombardo Date: Fri, 15 Dec 2017 15:48:48 +0100 Subject: [PATCH 4/4] Lower log levels; no need to shout --- instana/fsm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/instana/fsm.py b/instana/fsm.py index 85cd38ad..7563e3e7 100644 --- a/instana/fsm.py +++ b/instana/fsm.py @@ -79,7 +79,7 @@ def lookup_agent_host(self, e): self.fsm.announce() return True - log.warn("Instana Host Agent can't be found. Scheduling retry.") + log.info("Instana Host Agent couldn't be found. Scheduling retry.") self.schedule_retry(self.lookup_agent_host, e, "agent_lookup") return False @@ -136,11 +136,11 @@ def announce_sensor(self, e): if b: self.agent.set_from(b) self.fsm.ready() - log.warn("Host agent available. We're in business. Announced pid: %i (true pid: %i)" % + log.info("Host agent available. We're in business. Announced pid: %i (true pid: %i)" % (pid, self.agent.from_.pid)) return True else: - log.warn("Cannot announce sensor. Scheduling retry.") + log.debug("Cannot announce sensor. Scheduling retry.") self.schedule_retry(self.announce_sensor, e, "announce") return False