filling the SpanContext Pojo
This commit is contained in:
parent
7ee51d005e
commit
580a0d2b1c
|
@ -6,22 +6,83 @@ import java.util.Map;
|
||||||
public class SpanContext implements io.opentracing.SpanContext {
|
public class SpanContext implements io.opentracing.SpanContext {
|
||||||
|
|
||||||
// Public span attributes
|
// Public span attributes
|
||||||
private String serviceName;
|
private final String serviceName;
|
||||||
private String resourceName;
|
private final String resourceName;
|
||||||
private long spanId;
|
private final long traceId;
|
||||||
private long traceId;
|
private final long spanId;
|
||||||
private long parentId;
|
private final long parentId;
|
||||||
private Map<String, String> baggageItems; // know as 'meta' in dd-trace-py
|
private final Map<String, String> baggageItems; // know as 'meta' in dd-trace-py
|
||||||
private boolean errorFlag;
|
private final boolean errorFlag;
|
||||||
private Map<String, Object> metrics;
|
private final Map<String, Object> metrics;
|
||||||
private String spanType;
|
private final String spanType;
|
||||||
private long start;
|
|
||||||
private long duration;
|
|
||||||
// Sampler attributes
|
// Sampler attributes
|
||||||
private boolean sampled;
|
private boolean sampled;
|
||||||
|
|
||||||
|
public SpanContext(
|
||||||
|
long traceId,
|
||||||
|
long spanId,
|
||||||
|
long parentId,
|
||||||
|
String serviceName,
|
||||||
|
String resourceName,
|
||||||
|
Map<String, String> baggageItems,
|
||||||
|
boolean errorFlag,
|
||||||
|
Map<String, Object> metrics,
|
||||||
|
String spanType,
|
||||||
|
boolean sampled) {
|
||||||
|
this.serviceName = serviceName;
|
||||||
|
this.resourceName = resourceName;
|
||||||
|
this.traceId = traceId;
|
||||||
|
this.spanId = spanId;
|
||||||
|
this.parentId = parentId;
|
||||||
|
this.baggageItems = baggageItems;
|
||||||
|
this.errorFlag = errorFlag;
|
||||||
|
this.metrics = metrics;
|
||||||
|
|
||||||
|
this.spanType = spanType;
|
||||||
|
this.sampled = sampled;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public Iterable<Map.Entry<String, String>> baggageItems() {
|
public Iterable<Map.Entry<String, String>> baggageItems() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long getTraceId() {
|
||||||
|
return this.traceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public long getParentId() {
|
||||||
|
return this.parentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getSpanId() {
|
||||||
|
return this.spanId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getServiceName() {
|
||||||
|
return serviceName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getResourceName() {
|
||||||
|
return resourceName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isErrorFlag() {
|
||||||
|
return errorFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, Object> getMetrics() {
|
||||||
|
return metrics;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSpanType() {
|
||||||
|
return spanType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSampled() {
|
||||||
|
return sampled;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue