aboutsummaryrefslogtreecommitdiff
path: root/kamon-core-tests
diff options
context:
space:
mode:
authorIvan Topolnjak <ivantopo@gmail.com>2017-08-26 22:04:34 +0200
committerIvan Topolnjak <ivantopo@gmail.com>2017-08-26 22:04:34 +0200
commit80d3d7706e5f4cbbfe2164d1b17b2649782e0e0e (patch)
tree5d6593b930390b42360d410a4899fff398bb8ab1 /kamon-core-tests
parent194bc4fc90c53199eae6b6ca05964f7aa03bbdb3 (diff)
downloadKamon-80d3d7706e5f4cbbfe2164d1b17b2649782e0e0e.tar.gz
Kamon-80d3d7706e5f4cbbfe2164d1b17b2649782e0e0e.tar.bz2
Kamon-80d3d7706e5f4cbbfe2164d1b17b2649782e0e0e.zip
make Span.addTag work only on Span tags
Diffstat (limited to 'kamon-core-tests')
-rw-r--r--kamon-core-tests/src/test/scala/kamon/trace/LocalSpanSpec.scala18
-rw-r--r--kamon-core-tests/src/test/scala/kamon/trace/SpanMetrics.scala10
-rw-r--r--kamon-core-tests/src/test/scala/kamon/trace/TracerSpec.scala13
3 files changed, 19 insertions, 22 deletions
diff --git a/kamon-core-tests/src/test/scala/kamon/trace/LocalSpanSpec.scala b/kamon-core-tests/src/test/scala/kamon/trace/LocalSpanSpec.scala
index f6bd3517..966fdbad 100644
--- a/kamon-core-tests/src/test/scala/kamon/trace/LocalSpanSpec.scala
+++ b/kamon-core-tests/src/test/scala/kamon/trace/LocalSpanSpec.scala
@@ -30,7 +30,7 @@ class LocalSpanSpec extends WordSpec with Matchers with BeforeAndAfterAll with E
"sampled and finished" should {
"be sent to the Span reporters" in {
Kamon.buildSpan("test-span")
- .withSpanTag("test", "value")
+ .withTag("test", "value")
.withStartTimestamp(100)
.start()
.finish(200)
@@ -46,16 +46,16 @@ class LocalSpanSpec extends WordSpec with Matchers with BeforeAndAfterAll with E
"pass all the tags, annotations and baggage to the FinishedSpan instance when started and finished" in {
Kamon.buildSpan("full-span")
- .withSpanTag("builder-string-tag", "value")
- .withSpanTag("builder-boolean-tag-true", true)
- .withSpanTag("builder-boolean-tag-false", false)
- .withSpanTag("builder-number-tag", 42)
+ .withTag("builder-string-tag", "value")
+ .withTag("builder-boolean-tag-true", true)
+ .withTag("builder-boolean-tag-false", false)
+ .withTag("builder-number-tag", 42)
.withStartTimestamp(100)
.start()
- .addSpanTag("span-string-tag", "value")
- .addSpanTag("span-boolean-tag-true", true)
- .addSpanTag("span-boolean-tag-false", false)
- .addSpanTag("span-number-tag", 42)
+ .addTag("span-string-tag", "value")
+ .addTag("span-boolean-tag-true", true)
+ .addTag("span-boolean-tag-false", false)
+ .addTag("span-number-tag", 42)
.setOperationName("fully-populated-span")
.finish(200)
diff --git a/kamon-core-tests/src/test/scala/kamon/trace/SpanMetrics.scala b/kamon-core-tests/src/test/scala/kamon/trace/SpanMetrics.scala
index dd777490..40813a25 100644
--- a/kamon-core-tests/src/test/scala/kamon/trace/SpanMetrics.scala
+++ b/kamon-core-tests/src/test/scala/kamon/trace/SpanMetrics.scala
@@ -46,7 +46,7 @@ class SpanMetrics extends WordSpecLike with Matchers with MetricInspection with
buildSpan(operation)
.start()
- .addSpanTag("error", true)
+ .addTag("error", true)
.finish()
val histogram = Span.Metrics.ProcessingTime.refine(Map(operationTag, noErrorTag))
@@ -66,13 +66,13 @@ class SpanMetrics extends WordSpecLike with Matchers with MetricInspection with
buildSpan(operation)
.asChildOf(parent)
.start()
- .addSpanTag("error", false)
+ .addTag("error", false)
.finish()
buildSpan(operation)
.asChildOf(parent)
.start()
- .addSpanTag("error", true)
+ .addTag("error", true)
.finish()
val histogram = Span.Metrics.ProcessingTime.refine(Map(operationTag, noErrorTag, parentOperationTag))
@@ -92,13 +92,13 @@ class SpanMetrics extends WordSpecLike with Matchers with MetricInspection with
buildSpan(operation)
.asChildOf(parent)
.start()
- .addSpanTag("error", false)
+ .addTag("error", false)
.finish()
buildSpan(operation)
.asChildOf(parent)
.start()
- .addSpanTag("error", true)
+ .addTag("error", true)
.finish()
val histogram = Span.Metrics.ProcessingTime.refine(Map(operationTag, noErrorTag, parentOperationTag))
diff --git a/kamon-core-tests/src/test/scala/kamon/trace/TracerSpec.scala b/kamon-core-tests/src/test/scala/kamon/trace/TracerSpec.scala
index a08277ea..92431470 100644
--- a/kamon-core-tests/src/test/scala/kamon/trace/TracerSpec.scala
+++ b/kamon-core-tests/src/test/scala/kamon/trace/TracerSpec.scala
@@ -36,23 +36,20 @@ class TracerSpec extends WordSpec with Matchers with SpanBuilding with SpanInspe
"pass the operation name and tags to started Span" in {
val span = tracer.buildSpan("myOperation")
- .withTag("both", "both")
.withMetricTag("metric-tag", "value")
.withMetricTag("metric-tag", "value")
- .withSpanTag("hello", "world")
- .withSpanTag("kamon", "rulez")
- .withSpanTag("number", 123)
- .withSpanTag("boolean", true)
+ .withTag("hello", "world")
+ .withTag("kamon", "rulez")
+ .withTag("number", 123)
+ .withTag("boolean", true)
.start()
val spanData = inspect(span)
spanData.operationName() shouldBe "myOperation"
spanData.metricTags() should contain only (
- ("metric-tag" -> "value"),
- ("both" -> "both"))
+ ("metric-tag" -> "value"))
spanData.spanTags() should contain allOf(
- ("both" -> TagValue.String("both")),
("hello" -> TagValue.String("world")),
("kamon" -> TagValue.String("rulez")),
("number" -> TagValue.Number(123)),