

def service_check(self, check_name, status, tags=None, timestamp=None, hostname=None, message=None):
    "\n        Send a service check run.\n\n        >>> statsd.service_check('my_service.check_name', DogStatsd.WARNING)\n        "
    message = (self._escape_service_check_message(message) if (message is not None) else '')
    string = '_sc|{0}|{1}'.format(check_name, status)
    if timestamp:
        string = '{0}|d:{1}'.format(string, timestamp)
    if hostname:
        string = '{0}|h:{1}'.format(string, hostname)
    if tags:
        string = '{0}|#{1}'.format(string, ','.join(tags))
    if message:
        string = '{0}|m:{1}'.format(string, message)
    self._send(string)

dataset/ETHPy150Open DataDog/datadogpy/datadog/dogstatsd/base.py DogStatsd.service_check/original