Skip to content

Commit b04de80

Browse files
authored
Sensor Clean Up: Reduce log output; Beautify (#147)
* Remove unnecessary; better announce log * More Perty * Travis: Force Trusty due to Rabbitmq not supported on others
1 parent 58aecb9 commit b04de80

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
language: python
22

3+
dist: trusty
4+
35
python:
46
- "2.7"
57
- "3.4"

instana/agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ def is_agent_listening(self, host, port):
123123
logger.debug("Host agent found on %s:%d" % (host, port))
124124
rv = True
125125
else:
126-
logger.debug("...something is listening on %s:%d but it's not the Instana Agent: %s"
126+
logger.debug("...something is listening on %s:%d but it's not the Instana Host Agent: %s"
127127
% (host, port, server_header))
128128
except (requests.ConnectTimeout, requests.ConnectionError):
129-
logger.debug("No host agent listening on %s:%d" % (host, port))
129+
logger.debug("Instana Host Agent not found on %s:%d" % (host, port))
130130
rv = False
131131
finally:
132132
return rv

instana/fsm.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ def reset(self):
8181
self.fsm.lookup()
8282

8383
def lookup_agent_host(self, e):
84-
logger.debug("lookup_agent_host")
8584
host, port = self.__get_agent_host_port()
8685

8786
if self.agent.is_agent_listening(host, port):
@@ -106,7 +105,7 @@ def lookup_agent_host(self, e):
106105
return False
107106

108107
def announce_sensor(self, e):
109-
logger.debug("announcing sensor to the agent")
108+
logger.debug("Announcing sensor to the agent")
110109
sock = None
111110
pid = os.getpid()
112111
cmdline = []
@@ -147,15 +146,14 @@ def announce_sensor(self, e):
147146
if response and (response.status_code is 200) and (len(response.content) > 2):
148147
self.agent.set_from(response.content)
149148
self.fsm.pending()
150-
logger.debug("Announced pid: %s (true pid: %s) Waiting for Agent Ready" % (str(pid), str(self.agent.from_.pid)))
149+
logger.debug("Announced pid: %s (true pid: %s). Waiting for Agent Ready..." % (str(pid), str(self.agent.from_.pid)))
151150
return True
152151
else:
153152
logger.debug("Cannot announce sensor. Scheduling retry.")
154153
self.schedule_retry(self.announce_sensor, e, "announce")
155154
return False
156155

157156
def schedule_retry(self, fun, e, name):
158-
logger.debug("Scheduling: " + name)
159157
self.timer = t.Timer(self.RETRY_PERIOD, fun, [e])
160158
self.timer.daemon = True
161159
self.timer.name = name

instana/instrumentation/tornado/__init___.py

Whitespace-only changes.

instana/sensor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ def __init__(self, agent, options=None):
1717

1818
self.agent = agent
1919
self.meter = Meter(agent)
20-
logger.debug("initialized sensor")
2120

2221
def set_options(self, options):
2322
self.options = options

0 commit comments

Comments
 (0)