io.quicklog.client.TraceCtx Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quicklog-client Show documentation
Show all versions of quicklog-client Show documentation
Client for Quicklog.io Service
package io.quicklog.client;
import java.util.Random;
public class TraceCtx {
private static final Random rand = new Random();
public final String actor;
public final String traceId;
public final String parentSpanId;
public final String spanId;
public TraceCtx(String actor, String traceId, String parentSpanId) {
String spanId = generateId();
if (traceId == null || traceId.isEmpty()) {
traceId = spanId;
parentSpanId = null;
}
this.actor = actor;
this.traceId = traceId;
this.parentSpanId = parentSpanId;
this.spanId = spanId;
}
public static String generateId() {
return Long.toHexString(rand.nextLong());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy