Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ private boolean publish(CoreSpan<?> span, boolean isTopLevel) {
span.getType(),
span.getHttpStatusCode(),
isSynthetic(span),
span.isTopLevel(),
span.getParentId() == 0,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Shouldn't we use DDSpanId.ZERO ?

SPAN_KINDS.computeIfAbsent(
spanKind, UTF8BytesString::create), // save repeated utf8 conversions
getPeerTags(span, spanKind.toString()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class ConflatingMetricAggregatorTest extends DDSpecification {
"type",
HTTP_OK,
false,
true,
false,
"baz",
[]
), _) >> { MetricKey key, AggregateMetric value ->
Expand Down Expand Up @@ -197,7 +197,7 @@ class ConflatingMetricAggregatorTest extends DDSpecification {
features.supportsMetrics() >> true
features.peerTags() >>> [["country"], ["country", "georegion"],]
ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator(empty,
features, sink, writer, 10, queueSize, reportingInterval, SECONDS)
features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS)
aggregator.start()

when:
Expand Down Expand Up @@ -256,7 +256,7 @@ class ConflatingMetricAggregatorTest extends DDSpecification {
features.supportsMetrics() >> true
features.peerTags() >> ["peer.hostname", "_dd.base_service"]
ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator(empty,
features, sink, writer, 10, queueSize, reportingInterval, SECONDS)
features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS)
aggregator.start()

when:
Expand Down Expand Up @@ -327,7 +327,7 @@ class ConflatingMetricAggregatorTest extends DDSpecification {
"type",
HTTP_OK,
false,
topLevel,
false,
"baz",
[]
), { AggregateMetric value ->
Expand Down Expand Up @@ -444,7 +444,7 @@ class ConflatingMetricAggregatorTest extends DDSpecification {
"type",
HTTP_OK,
false,
true,
false,
"baz",
[]
), _) >> { MetricKey key, AggregateMetric value ->
Expand All @@ -458,7 +458,7 @@ class ConflatingMetricAggregatorTest extends DDSpecification {
"type",
HTTP_OK,
false,
true,
false,
"baz",
[]
), _)
Expand Down Expand Up @@ -503,7 +503,7 @@ class ConflatingMetricAggregatorTest extends DDSpecification {
"type",
HTTP_OK,
false,
true,
false,
"baz",
[]
), { AggregateMetric value ->
Expand Down Expand Up @@ -534,7 +534,7 @@ class ConflatingMetricAggregatorTest extends DDSpecification {
"type",
HTTP_OK,
false,
true,
false,
"baz",
[]
), { AggregateMetric value ->
Expand All @@ -548,7 +548,7 @@ class ConflatingMetricAggregatorTest extends DDSpecification {
"type",
HTTP_OK,
false,
true,
false,
"baz",
[]
), _)
Expand Down Expand Up @@ -593,7 +593,7 @@ class ConflatingMetricAggregatorTest extends DDSpecification {
"type",
HTTP_OK,
false,
true,
false,
"quux",
[]
), { AggregateMetric value ->
Expand Down Expand Up @@ -631,7 +631,7 @@ class ConflatingMetricAggregatorTest extends DDSpecification {
CountDownLatch latch = new CountDownLatch(1)
for (int i = 0; i < 5; ++i) {
aggregator.publish([
new SimpleSpan("service" + i, "operation", "resource", "type", false, true, false, 0, duration, HTTP_OK)
new SimpleSpan("service" + i, "operation", "resource", "type", false, true, false, 0, duration, HTTP_OK, true)
.setTag(SPAN_KIND, "garply")
])
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class SimpleSpan implements CoreSpan<SimpleSpan> {
private final String type
private final boolean measured
private final boolean topLevel
private final boolean traceRoot
private final boolean error
private final short statusCode

Expand All @@ -31,14 +32,16 @@ class SimpleSpan implements CoreSpan<SimpleSpan> {
boolean error,
long startTime,
long duration,
int statusCode
int statusCode,
boolean traceRoot = false
) {
this.serviceName = serviceName
this.operationName = operationName
this.resourceName = resourceName
this.type = type
this.measured = measured
this.topLevel = topLevel
this.traceRoot = traceRoot
this.error = error
this.startTime = startTime
this.duration = duration
Expand Down Expand Up @@ -77,7 +80,7 @@ class SimpleSpan implements CoreSpan<SimpleSpan> {

@Override
long getParentId() {
return DDSpanId.ZERO
return traceRoot ? DDSpanId.ZERO : 1L
}

@Override
Expand Down
Loading