Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix json encoding error #9

Merged
merged 2 commits into from
Jul 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions instana/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion instana/meter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down