Commit f75bf92f by Calen Pennington

Pass start times as unix timestamps to datadog in the DatadogFormatter

parent f6ce3a79
......@@ -64,7 +64,7 @@ class DatadogFormatter(Formatter):
for name, timestamp in results.items():
datadog_tasks_metrics.append({
'metric': 'edx.ansible.task_duration',
'date_happened': timestamp.start,
'date_happened': time.mktime(timestamp.start.timetuple()),
'points': timestamp.duration.total_seconds(),
'tags': [
'task:{0}'.format(self.clean_tag_value(name)),
......@@ -75,7 +75,7 @@ class DatadogFormatter(Formatter):
datadog.api.Metric.send(datadog_tasks_metrics)
datadog.api.Metric.send(
metric="edx.ansible.playbook_duration",
date_happened=time.time(),
date_happened=time.mktime(playbook_timestamp.start.timetuple()),
points=playbook_timestamp.duration.total_seconds(),
tags=["playbook:{0}".format(self.clean_tag_value(playbook_name))]
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment