Skip to content

Commit dbe4635

Browse files
authored
Merge pull request #9 from instana/json_encoding
Fix json encoding error
2 parents b99b9ff + 298627f commit dbe4635

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

instana/agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(self, sensor):
4545

4646
def to_json(self, o):
4747
try:
48-
return json.dumps(o, default=lambda o: o.to_dict(),
48+
return json.dumps(o, default=lambda o: o.__dict__,
4949
sort_keys=False, separators=(',', ':')).encode()
5050
except Exception as e:
5151
l.error("to_json: ", e, o)
@@ -103,7 +103,7 @@ def full_request_response(self, url, method, o, body, header):
103103
except Exception as e:
104104
# No need to show the initial 404s or timeouts. The agent
105105
# should handle those correctly.
106-
if type(e) is urllib2.HTTPError and e.code != 404:
106+
if not (type(e) is urllib2.HTTPError and e.code == 404):
107107
l.error("%s: full_request_response: %s" % (threading.current_thread().name, str(e)))
108108

109109
return (b, h)

instana/meter.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ def process(self):
134134
ss = None
135135
cm = self.collect_metrics()
136136

137-
l.debug("snapshot_countdown is:", str(self.snapshot_countdown))
138137
if self.snapshot_countdown == 0:
139138
self.snapshot_countdown = self.SNAPSHOT_PERIOD
140139
ss = self.collect_snapshot()

0 commit comments

Comments
 (0)