diff --git a/instana/agent.py b/instana/agent.py index c4a6dfdc9..46bbccc60 100644 --- a/instana/agent.py +++ b/instana/agent.py @@ -45,7 +45,7 @@ def __init__(self, sensor): def to_json(self, o): try: - return json.dumps(o, default=lambda o: o.to_dict(), + return json.dumps(o, default=lambda o: o.__dict__, sort_keys=False, separators=(',', ':')).encode() except Exception as e: l.error("to_json: ", e, o) @@ -103,7 +103,7 @@ def full_request_response(self, url, method, o, body, header): except Exception as e: # No need to show the initial 404s or timeouts. The agent # should handle those correctly. - if type(e) is urllib2.HTTPError and e.code != 404: + if not (type(e) is urllib2.HTTPError and e.code == 404): l.error("%s: full_request_response: %s" % (threading.current_thread().name, str(e))) return (b, h) diff --git a/instana/meter.py b/instana/meter.py index db6dd60ca..e189246a5 100644 --- a/instana/meter.py +++ b/instana/meter.py @@ -134,7 +134,6 @@ def process(self): ss = None cm = self.collect_metrics() - l.debug("snapshot_countdown is:", str(self.snapshot_countdown)) if self.snapshot_countdown == 0: self.snapshot_countdown = self.SNAPSHOT_PERIOD ss = self.collect_snapshot()