From 67095b4ec3ab8bb52202153c0bbacebbafdeb96f Mon Sep 17 00:00:00 2001 From: Carlo Cabanilla Date: Tue, 19 Mar 2013 11:52:51 -0400 Subject: [PATCH] fix graphite listener payload serialization (fixes #415) --- ddagent.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ddagent.py b/ddagent.py index e3baeb5f2e..2c26018c84 100755 --- a/ddagent.py +++ b/ddagent.py @@ -36,7 +36,7 @@ from tornado.options import define, parse_command_line, options # agent import -from util import Watchdog, get_uuid, get_hostname +from util import Watchdog, get_uuid, get_hostname, json from emitter import http_emitter, format_body from config import get_config from checks.check_status import ForwarderStatus @@ -330,7 +330,8 @@ def _postMetrics(self): self._metrics['uuid'] = get_uuid() self._metrics['internalHostname'] = get_hostname(self._agentConfig) self._metrics['apiKey'] = self._agentConfig['api_key'] - MetricTransaction(self._metrics, {}) + MetricTransaction(json.dumps(self._metrics), + headers={'Content-Type': 'application/json'}) self._metrics = {} def run(self):