Skip to content

XRayUDPEmitter

pokryfka edited this page Aug 10, 2020 · 4 revisions

XRayUDPEmitter

Sends XRayRecorder.Segments to the X-Ray daemon, which will buffer them and upload to the X-Ray API in batches. The X-Ray SDK sends segment documents to the daemon to avoid making calls to AWS directly.

public class XRayUDPEmitter:​ XRayNIOEmitter

The IP address and port of the X-Ray daemon is configured using AWS_XRAY_DAEMON_ADDRESS environment variable, 127.0.0.1:​2000 by default.

References

Inheritance

XRayNIOEmitter

Initializers

init(encoding:​eventLoopGroupProvider:​config:​)

Creates an instance of XRayUDPEmitter.

public convenience init(encoding:​ SegmentEncoding, eventLoopGroupProvider:​ EventLoopGroupProvider = .createNew, config:​ Config = Config()) throws

Parameters

  • encoding:​ - encoding:​ Contains encoder used to encode XRayRecorder.Segment to JSON string.
  • eventLoopGroupProvider:​ - eventLoopGroupProvider:​ Specifies how EventLoopGroup will be created and establishes lifecycle ownership.
  • config:​ - config:​ configuration, overrides enviromental variables.

Throws

may throw if the UDP Daemon endpoint cannot be parsed.

Methods

send(_:​)

public func send(_ segment:​ XRayRecorder.Segment)

flush(_:​)

public func flush(_ callback:@escaping (Error?) -> Void)

flush(on:​)

public func flush(on eventLoop:​ EventLoop? = nil) -> EventLoopFuture<Void>

shutdown(_:​)

public func shutdown(_ callback:@escaping (Error?) -> Void)