Class/Object

com.twitter.finatra.kafka.producers

TracingKafkaProducer

Related Docs: object TracingKafkaProducer | package producers

Permalink

class TracingKafkaProducer[K, V] extends KafkaProducer[K, V] with Logging

An extension of KafkaProducer with Zipkin tracing to trace the records sent to Kafka. This is inspired by openzipkin's brave instrumentation. We need a custom implementation and not a ProducerInterceptor because to enable end-to-end tracing of the records sent to Kafka, we need the same trace id in the callback which is not possible in the interceptor because it's called in a background thread which is not Finagle controlled.

K

type of Key

V

type of value

Linear Supertypes
Logging, Logging, KafkaProducer[K, V], Producer[K, V], Closeable, AutoCloseable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TracingKafkaProducer
  2. Logging
  3. Logging
  4. KafkaProducer
  5. Producer
  6. Closeable
  7. AutoCloseable
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TracingKafkaProducer(configs: Map[String, AnyRef], keySerializer: Serializer[K], valueSerializer: Serializer[V])

    Permalink

    configs

    The producer configs

    keySerializer

    The serializer for key that implements Serializer. The

    configure()
    
    method won't be called in the producer when the serializer is passed in directly.

    valueSerializer

    The serializer for value that implements Serializer. The

    configure()
    
    serializer is passed in directly.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def abortTransaction(): Unit

    Permalink
    Definition Classes
    KafkaProducer → Producer
    Annotations
    @throws( ... )
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def beginTransaction(): Unit

    Permalink
    Definition Classes
    KafkaProducer → Producer
    Annotations
    @throws( ... )
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def close(arg0: Duration): Unit

    Permalink
    Definition Classes
    KafkaProducer → Producer
  9. def close(): Unit

    Permalink
    Definition Classes
    KafkaProducer → Producer → Closeable → AutoCloseable
  10. def commitTransaction(): Unit

    Permalink
    Definition Classes
    KafkaProducer → Producer
    Annotations
    @throws( ... )
  11. def debug(marker: Marker, message: ⇒ Any, cause: Throwable): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  12. def debug(message: ⇒ Any, cause: Throwable): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  13. def debug(marker: Marker, message: ⇒ Any): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  14. def debug(message: ⇒ Any): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  15. def debugFutureResult[T](msg: String)(func: ⇒ Future[T]): Future[T]

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  16. def debugResult[T](message: ⇒ String)(fn: ⇒ T): T

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  17. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  19. def error(marker: Marker, message: ⇒ Any, cause: Throwable): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  20. def error(message: ⇒ Any, cause: Throwable): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  21. def error(marker: Marker, message: ⇒ Any): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  22. def error(message: ⇒ Any): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  23. def errorResult[T](message: ⇒ String)(fn: ⇒ T): T

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  24. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  25. def flush(): Unit

    Permalink
    Definition Classes
    KafkaProducer → Producer
  26. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  27. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  28. def info(marker: Marker, message: ⇒ Any, cause: Throwable): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  29. def info(message: ⇒ Any, cause: Throwable): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  30. def info(marker: Marker, message: ⇒ Any): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  31. def info(message: ⇒ Any): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  32. def infoResult[T](message: ⇒ String)(fn: ⇒ T): T

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  33. def initTransactions(): Unit

    Permalink
    Definition Classes
    KafkaProducer → Producer
  34. def isDebugEnabled(marker: Marker): Boolean

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  35. def isDebugEnabled: Boolean

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  36. def isErrorEnabled(marker: Marker): Boolean

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  37. def isErrorEnabled: Boolean

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  38. def isInfoEnabled(marker: Marker): Boolean

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  39. def isInfoEnabled: Boolean

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  40. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  41. def isTraceEnabled(marker: Marker): Boolean

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  42. def isTraceEnabled: Boolean

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  43. def isWarnEnabled(marker: Marker): Boolean

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  44. def isWarnEnabled: Boolean

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  45. final def logger: Logger

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  46. final def loggerName: String

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  47. def metrics(): Map[MetricName, _ <: Metric]

    Permalink
    Definition Classes
    KafkaProducer → Producer
  48. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  49. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  50. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  51. def partitionsFor(arg0: String): List[PartitionInfo]

    Permalink
    Definition Classes
    KafkaProducer → Producer
  52. def send(record: ProducerRecord[K, V], callback: Callback): Future[RecordMetadata]

    Permalink
    Definition Classes
    TracingKafkaProducer → KafkaProducer → Producer
  53. def send(arg0: ProducerRecord[K, V]): Future[RecordMetadata]

    Permalink
    Definition Classes
    KafkaProducer → Producer
  54. def sendOffsetsToTransaction(arg0: Map[TopicPartition, OffsetAndMetadata], arg1: String): Unit

    Permalink
    Definition Classes
    KafkaProducer → Producer
    Annotations
    @throws( ... )
  55. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  56. def time[T](formatStr: String)(func: ⇒ T): T

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  57. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  58. def trace(marker: Marker, message: ⇒ Any, cause: Throwable): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  59. def trace(message: ⇒ Any, cause: Throwable): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  60. def trace(marker: Marker, message: ⇒ Any): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  61. def trace(message: ⇒ Any): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  62. def traceResult[T](message: ⇒ String)(fn: ⇒ T): T

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  63. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  64. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  65. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  66. def warn(marker: Marker, message: ⇒ Any, cause: Throwable): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  67. def warn(message: ⇒ Any, cause: Throwable): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  68. def warn(marker: Marker, message: ⇒ Any): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  69. def warn(message: ⇒ Any): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  70. def warnResult[T](message: ⇒ String)(fn: ⇒ T): T

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging

Deprecated Value Members

  1. def close(arg0: Long, arg1: TimeUnit): Unit

    Permalink
    Definition Classes
    Producer
    Annotations
    @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from Logging

Inherited from Logging

Inherited from KafkaProducer[K, V]

Inherited from Producer[K, V]

Inherited from Closeable

Inherited from AutoCloseable

Inherited from AnyRef

Inherited from Any

Ungrouped