###############################################################################
# This is a very strange handler setup, but this is how it's documented.
# See https://github.com/DataDog/datadogpy#quick-start-guide
###############################################################################
import os
from datadog import initialize
options = {
    'statsd_host': os.getenv('STATSD_HOST_IP', '127.0.0.1')
}
initialize(**options)

from datadog import statsd
DATADOG_METRICS = {
    'tweet_process_success': 'traptor.src.tweet_process.success.count',
    'tweet_process_failure': 'traptor.src.tweet_process.failure.count',
    'tweet_to_kafka_success': 'traptor.src.tweet_to_kafka.success.count',
    'tweet_to_kafka_failure': 'traptor.src.tweet_to_kafka.failure.count',
}

def increment(metric_name):
    return statsd.increment(DATADOG_METRICS[metric_name])

def gauge(metric_name, value):
    return statsd.gauge(DATADOG_METRICS[metric_name], value)

@@ -527,38 +527,32 @@
 _process.success
-.count
 ',%0A    'tweet_pr
@@ -601,22 +601,16 @@
 .failure
-.count
 ',%0A    '
@@ -669,22 +669,16 @@
 .success
-.count
 ',%0A    '
@@ -741,14 +741,8 @@
 lure
-.count
 ',%0A%7D

Use shorter metric names