aws_xray_sdk.core.emitters.udp_emitter

Module Contents

log
PROTOCOL_HEADER = {"format":"json","version":1}
PROTOCOL_DELIMITER =
DEFAULT_DAEMON_ADDRESS = 127.0.0.1:2000
class UDPEmitter(daemon_address=DEFAULT_DAEMON_ADDRESS)

Bases:object

The default emitter the X-Ray recorder uses to send segments/subsegments to the X-Ray daemon over UDP using a non-blocking socket. If there is an exception on the actual data transfer between the socket and the daemon, it logs the exception and continue.

ip
port
send_entity(self, entity)

Serializes a segment/subsegment and sends it to the X-Ray daemon over UDP. By default it doesn’t retry on failures.

Parameters:entity – a trace entity to send to the X-Ray daemon
set_daemon_address(self, address)

Set up UDP ip and port from the raw daemon address string using DaemonConfig class utlities.

_send_data(self, data)
_parse_address(self, daemon_address)