Package ai.signalroom.kafka.isotope
Class Isotope
java.lang.Object
ai.signalroom.kafka.isotope.Isotope
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConsume-side marker header.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringScalar reporting headers, written alongsideHEADER_KEYbyIsotopeProducerInterceptor.static final intBounded ring for the hop list — a payload guard, not a routing cap.static final int -
Method Summary
Modifier and TypeMethodDescriptionappendHop(Isotope.Hop hop) static IsotopefromHeaders(org.apache.kafka.common.header.Headers headers) Returns the isotope carried by the given headers, ornullif absent.static IsotopefromJsonBytes(byte[] bytes) hops()static IsotopeStarts a fresh trace with an unnamed pipeline ("unknown").static Isotopestatic IsotopeStarts a fresh trace whose origin timestamp is set explicitly (e.g.longpipeline()byte[]byte[]traceId()booleanstatic StringConvenience: a fresh UUIDv7 in canonicalxxxxxxxx-...-7xxx-yxxx-...string form.
-
Field Details
-
HEADER_KEY
- See Also:
-
HEADER_TRACE_ID
Scalar reporting headers, written alongsideHEADER_KEYbyIsotopeProducerInterceptor. All values are UTF-8 strings so Flink SQL can cast them directly to STRING (or BIGINT for the numeric ones) without a UDF.- See Also:
-
HEADER_ORIGIN_TS
- See Also:
-
HEADER_ORIGIN_SERVICE
- See Also:
-
HEADER_PIPELINE
- See Also:
-
HEADER_THIS_SERVICE
- See Also:
-
HEADER_THIS_TOPIC
- See Also:
-
HEADER_HOP_COUNT
- See Also:
-
HEADER_CONSUMER_SERVICE
Consume-side marker header. Written byIsotopeContext.recordConsumewhen a consumer emits a marker to theisotope_consume_edge_markerstopic, on top of the seven forwarded headers above. Its presence is what Flink uses to distinguish a consume-event marker from a regular produced record.- See Also:
-
MAX_HOPS
public static final int MAX_HOPSBounded ring for the hop list — a payload guard, not a routing cap. On overflow the oldest hop is evicted andtruncatedlatches true; the trace keeps flowing through as many services as you want.- See Also:
-
TRACE_ID_BYTES
public static final int TRACE_ID_BYTES- See Also:
-
-
Method Details
-
newTrace
Starts a fresh trace with an unnamed pipeline ("unknown"). -
newTrace
-
newTrace
Starts a fresh trace whose origin timestamp is set explicitly (e.g. taken from the originating event rather than wall-clock now). The trace id is a UUIDv7 seeded fromoriginTsMsso id order still tracks origin time. -
uuidV7String
Convenience: a fresh UUIDv7 in canonicalxxxxxxxx-...-7xxx-yxxx-...string form. -
traceId
public byte[] traceId() -
traceIdHex
-
originTsMs
public long originTsMs() -
originService
-
pipeline
-
hops
-
truncated
public boolean truncated() -
appendHop
-
toJsonBytes
public byte[] toJsonBytes() -
fromJsonBytes
-
fromHeaders
Returns the isotope carried by the given headers, ornullif absent.
-