aboutsummaryrefslogtreecommitdiff
path: root/kamon-core-tests/src/test/scala
diff options
context:
space:
mode:
authorDiego Parra <diegolparra@gmail.com>2018-10-31 11:51:23 -0300
committerGitHub <noreply@github.com>2018-10-31 11:51:23 -0300
commit4d261a83cfae95a79cf233aec54197a5b1a56538 (patch)
tree212b2babdfa7cf759f7562dbc7c26e363073dcfb /kamon-core-tests/src/test/scala
parentf1c6ceffa22c59a463d6d8cd2ca77e2b440eb450 (diff)
parent313b7e7dac497c9563c09d7c8a47af8353e3e6c9 (diff)
downloadKamon-4d261a83cfae95a79cf233aec54197a5b1a56538.tar.gz
Kamon-4d261a83cfae95a79cf233aec54197a5b1a56538.tar.bz2
Kamon-4d261a83cfae95a79cf233aec54197a5b1a56538.zip
Merge pull request #560 from ivantopo/trace-identifiers-in-response
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 {