use of brave.ScopedSpan in project brave by openzipkin.
the class DefaultTagsTest method defaultTagsOnlyAddedOnce.
@Test
public void defaultTagsOnlyAddedOnce() {
ScopedSpan parent = tracing.tracer().startScopedSpan("parent");
try {
tracing.tracer().startScopedSpan("child").finish();
} finally {
parent.finish();
}
assertThat(spans.get(0).name()).isEqualTo("child");
assertThat(spans.get(0).tags()).isEmpty();
assertThat(spans.get(1).name()).isEqualTo("parent");
assertThat(spans.get(1).tags()).containsExactly(entry("env", "prod"), entry("region", "east"));
}
Aggregations