Ejemplo n.º 1
0
func (c *UDPCollector) send(s *zipkin.Span) error {
	t := thrift.NewTMemoryBuffer()
	p := thrift.NewTBinaryProtocolTransport(t)
	err := s.Write(p)
	if err != nil {
		return err
	}
	_, err = c.conn.WriteToUDP(t.Buffer.Bytes(), c.addr)
	return err
}
Ejemplo n.º 2
0
// Collect will serialize and send a zipkin.Span to the configured Scribe
// endpoint
func (c *ScribeCollector) Collect(s *zipkin.Span) {
	t := thrift.NewTMemoryBuffer()
	p := thrift.NewTBinaryProtocolTransport(t)
	err := s.Write(p)
	if err != nil {
		logger.Errore(err)
	} else {
		logger.Errore(c.CollectSerialized(t.Buffer.Bytes()))
	}
}