title: Tracing Kafka bus in distributed app using Jaeger
body: <p>I have distribute application that consists of several Go services. Some of those use Kafka as data bus. I was able trace down calls between services using <code>opentracing</code> with Jaeger. I have problem plotting Kafka spans on graph, them appear as gaps. </p>
  
  <p>Here is what i was able to do. 
  Initial spans been created by gRPC middleware. Producer side: </p>
  
  <pre><code>...    
  kafkaMsg := kafka.Message{Key: []byte(key), Value: msgBytes}
  headers:=make(map[string]string)
  if span := opentracing.SpanFromContext(ctx); span != nil {
      opentracing.GlobalTracer().Inject(
          span.Context(),
          opentracing.TextMap,
          opentracing.TextMapCarrier(headers))
  }
  for headerKey, headerValue:=range headers{
      msg.Headers = append(msg.Headers, kafka.Header{
          Key: headerKey,
          Value: []byte(headerValue),
      })
  }
  // Write message to Kafka
  ...
  </code></pre>
  
  <p>Consumer side:</p>
  
  <pre><code>...
  // read headers from Kafka message
  headers := make(map[string]string)
  for _, header := range kafkaMessage.Headers{
      headers[header.Key]=string(header.Value)
  }
  spanContext, _ := opentracing.GlobalTracer().Extract(opentracing.TextMap, opentracing.TextMapCarrier(headers))
  span := opentracing.StartSpan(
      "Consumer",
      opentracing.FollowsFrom(spanContext))
  defer span.Finish()
  ...
  </code></pre>
  
  <p>How should i modify this to plot span on graph when message was in Kafka?</p>