aboutsummaryrefslogtreecommitdiff
path: root/kamon-core-tests/src/test/scala
diff options
context:
space:
mode:
authorIvan Topolnjak <ivantopo@gmail.com>2018-10-30 17:24:54 +0100
committerIvan Topolnjak <ivantopo@gmail.com>2018-10-30 17:24:54 +0100
commit313b7e7dac497c9563c09d7c8a47af8353e3e6c9 (patch)
tree212b2babdfa7cf759f7562dbc7c26e363073dcfb /kamon-core-tests/src/test/scala
parentf1c6ceffa22c59a463d6d8cd2ca77e2b440eb450 (diff)
downloadKamon-313b7e7dac497c9563c09d7c8a47af8353e3e6c9.tar.gz
Kamon-313b7e7dac497c9563c09d7c8a47af8353e3e6c9.tar.bz2
Kamon-313b7e7dac497c9563c09d7c8a47af8353e3e6c9.zip
include trace identifiers in HTTP responses, fixes #558
Diffstat (limited to 'kamon-core-tests/src/test/scala')
-rw-r--r--kamon-core-tests/src/test/scala/kamon/instrumentation/HttpServerInstrumentationSpec.scala12
1 files changed, 12 insertions, 0 deletions
diff --git a/kamon-core-tests/src/test/scala/kamon/instrumentation/HttpServerInstrumentationSpec.scala b/kamon-core-tests/src/test/scala/kamon/instrumentation/HttpServerInstrumentationSpec.scala
index c3c5f131..62eae45b 100644
--- a/kamon-core-tests/src/test/scala/kamon/instrumentation/HttpServerInstrumentationSpec.scala
+++ b/kamon-core-tests/src/test/scala/kamon/instrumentation/HttpServerInstrumentationSpec.scala
@@ -220,6 +220,18 @@ class HttpServerInstrumentationSpec extends WordSpec with Matchers with SpanInsp
val span = inspect(handler.span)
span.tag("peer").value shouldBe "superservice"
}
+
+ "write trace identifiers on the responses" in {
+ val handler = httpServer().receive(fakeRequest("http://localhost:8080/", "/", "GET", Map(
+ "x-correlation-id" -> "0011223344556677"
+ )))
+
+ val responseHeaders = mutable.Map.empty[String, String]
+ handler.send(fakeResponse(200, responseHeaders), handler.context)
+
+ responseHeaders.get("x-trace-id").value shouldBe "0011223344556677"
+ responseHeaders.get("x-span-id") shouldBe defined
+ }
}
"all capabilities are disabled" should {