

def event(self, title, text, alert_type=None, aggregation_key=None, source_type_name=None, date_happened=None, priority=None, tags=None, hostname=None):
    "\n        Send an event. Attributes are the same as the Event API.\n            http://docs.datadoghq.com/api/\n\n        >>> statsd.event('Man down!', 'This server needs assistance.')\n        >>> statsd.event('The web server restarted', 'The web server is up again', alert_type='success')  # NOQA\n        "
    title = self._escape_event_content(title)
    text = self._escape_event_content(text)
    if self.constant_tags:
        if tags:
            tags += self.constant_tags
        else:
            tags = self.constant_tags
    string = ('_e{%d,%d}:%s|%s' % (len(title), len(text), title, text))
    if date_happened:
        string = ('%s|d:%d' % (string, date_happened))
    if hostname:
        string = ('%s|h:%s' % (string, hostname))
    if aggregation_key:
        string = ('%s|k:%s' % (aggregation_key, aggregation_key))
    if priority:
        string = ('%s|p:%s' % (string, priority))
    if source_type_name:
        string = ('%s|s:%s' % (string, source_type_name))
    if alert_type:
        string = ('%s|t:%s' % (string, alert_type))
    if tags:
        string = ('%s|#%s' % (string, ','.join(tags)))
    if (len(string) > (8 * 1024)):
        raise Exception(('Event "%s" payload is too big (more that 8KB), event discarded' % title))
    self._send(string)

dataset/ETHPy150Open DataDog/datadogpy/datadog/dogstatsd/base.py DogStatsd.event/VarMisuse@162/343 `string`->`aggregation_key`