

def _post(self, args):
    self.dog.timeout = args.timeout
    if args.localhostname:
        host = find_localhost()
    else:
        host = args.host
    if args.tags:
        tags = sorted(set([t.strip() for t in args.tags.split(',') if t]))
    else:
        tags = None
    if args.counter:
        metric_type = MetricType.Counter
    else:
        metric_type = MetricType.Gauge
    res = self.dog.metric(args.name, args.value, host=host, device=args.device, tags=tags, metric_type=metric_type)
    report_warnings(res)
    report_errors(res)

dataset/ETHPy150Open DataDog/dogapi/src/dogshell/metric.py MetricClient._post/original