def handle_stat(client, container, line): data = json.loads(line.decode('utf-8')) events = riemann.handle_stat(data, container._info) for event in events: client.event(**event) client.flush()
def write_log(events): try: with riemann_client.client.QueuedClient(riemann_client.transport.TCPTransport("localhost", 5555)) as client: for event in events: client.event(**event) client.flush() except Exception as exc: pass
def handle_log(client, container, line): if len(line) == 8: container.logs_stream = 'stdout' if line[0] == 1 else 'stderr' return events = riemann.handle_log(line, container._info, container.logs_stream) for event in events: client.event(**event) client.flush()