pub struct JaegerCompactReporter(/* private fields */);
Expand description
Reporter for the agent which accepts jaeger.thrift over compact thrift protocol.
Implementations§
Source§impl JaegerCompactReporter
impl JaegerCompactReporter
Sourcepub fn new(service_name: &str) -> Result<Self>
pub fn new(service_name: &str) -> Result<Self>
Makes a new JaegerCompactReporter
instance.
§Errors
If the UDP socket used to report spans can not be bound to 0.0.0.0:0
,
it will return an error which has the kind ErrorKind::Other
.
Sourcepub fn set_agent_addr(&mut self, addr: SocketAddr)
pub fn set_agent_addr(&mut self, addr: SocketAddr)
Sets the address of the report destination agent to addr
.
The default address is 127.0.0.1:6831
.
Note that you may also need to call set_reporter_addr
if the addr
is IPv6 or non localhost address.
Sourcepub fn set_reporter_addr(&mut self, addr: SocketAddr) -> Result<()>
pub fn set_reporter_addr(&mut self, addr: SocketAddr) -> Result<()>
Sets the address to which the reporter bind.
The default address is 127.0.0.1:0
.
Sourcepub fn add_service_tag(&mut self, tag: Tag)
pub fn add_service_tag(&mut self, tag: Tag)
Adds tag
to this service.
Sourcepub fn report(&self, spans: &[FinishedSpan]) -> Result<()>
pub fn report(&self, spans: &[FinishedSpan]) -> Result<()>
Reports spans
.
§Errors
If it fails to encode spans
to the thrift compact format (i.e., a bug of this crate),
this method will return an error which has the kind ErrorKind::InvalidInput
.
If it fails to send the encoded binary to the jaeger agent via UDP,
this method will return an error which has the kind ErrorKind::Other
.