TracingTopicProducer

class TracingTopicProducer(val delegate: TopicProducer, openTelemetry: OpenTelemetry, messagingSystem: String = OtelObserver.MEMORY_SYSTEM) : TopicProducer, AutoCloseable

A TopicProducer that sends through delegate in a span of its own, send <topic> of kind PRODUCER, the child of the span the sender runs in: a Kafka produce, its messaging.system messagingSystem. The span ends with its wow.outcome, and error.type after a failure. The messages themselves carry the sender's trace already (me.ahoo.wow.spi.log.Transport.trace), so their consumers continue the sender's trace, beside this span.

Closing it closes delegate when that is AutoCloseable, as a host that replaced its producer bean by this one closes the bean.

Constructors

Link copied to clipboard
constructor(delegate: TopicProducer, openTelemetry: OpenTelemetry, messagingSystem: String = OtelObserver.MEMORY_SYSTEM)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
open suspend override fun send(topic: String, messages: List<TopicMessage>)
Link copied to clipboard
open override fun toString(): String