11package kamon .datadog
22
3- import java .time .{Duration , Instant }
3+ import java .time .{ Duration , Instant }
44import java .util .concurrent .TimeUnit
55
66import kamon .Kamon
@@ -59,30 +59,30 @@ trait TestData {
5959 " duration" -> JsNumber (duration.getSeconds * 1000000000 + duration.getNano),
6060 " name" -> " kamon.trace" ,
6161 " meta" -> Json .obj(
62- " env" -> " staging" ,
62+ " env" -> " staging"
6363 ),
6464 " error" -> 0 ,
6565 " type" -> " custom" ,
6666 " start" -> JsNumber (from.getEpochNano),
6767 " metrics" -> JsObject (Seq (
68- " _sampling_priority_v1" -> JsNumber (1 )
68+ " _sampling_priority_v1" -> JsNumber (1 )
6969 ))
7070 )
7171
7272 val spanWithoutParentId = span.copy(parentId = Identifier .Empty )
7373 val jsonWithoutParentId = json - " parent_id"
7474
75- val spanWithError = span.copy(tags = TagSet .of(" error" , true ), hasError= true )
75+ val spanWithError = span.copy(tags = TagSet .of(" error" , true ), hasError = true )
7676
7777 val jsonWithError = json ++ Json .obj(
7878 " meta" -> Json .obj(
7979 " error" -> " true" ,
80- " env" -> " staging" ,
80+ " env" -> " staging"
8181 ),
8282 " error" -> 1
8383 )
8484
85- val spanWithTags = span.copy(tags =
85+ val spanWithTags = span.copy(metricTags =
8686 TagSet .from(
8787 Map (
8888 " string" -> " value" ,
@@ -104,7 +104,7 @@ trait TestData {
104104 " false" -> " false" ,
105105 " number" -> randomNumber.toString,
106106 " component" -> " custom.component" ,
107- " env" -> " staging" ,
107+ " env" -> " staging"
108108 )
109109 )
110110
@@ -115,7 +115,7 @@ trait TestData {
115115 val jsonWithMarks = json ++ Json .obj(
116116 " meta" -> Json .obj(
117117 " from" -> JsString (from.getEpochNano.toString),
118- " env" -> JsString (" staging" )
118+ " env" -> JsString (" staging" )
119119 )
120120 )
121121
@@ -144,8 +144,8 @@ trait TestData {
144144 " span with meta and marks" -> (Seq (spanWithTagsAndMarks), Json .arr(Json .arr(jsonWithTagsAndMarks))),
145145 " span with error" -> (Seq (spanWithError), Json .arr(Json .arr(jsonWithError))),
146146
147- " multiple spans with same trace" -> (Seq (span, spanWithTags), Json .arr(Json .arr(json, jsonWithTags))),
148- // "multiple spans with two traces" -> (Seq(span, spanWithTags, otherTraceSpan, span), Json.arr(Json.arr(json, jsonWithTags, json), Json.arr(otherTraceJson)))
147+ " multiple spans with same trace" -> (Seq (span, spanWithTags), Json .arr(Json .arr(json, jsonWithTags)))
148+ // "multiple spans with two traces" -> (Seq(span, spanWithTags, otherTraceSpan, span), Json.arr(Json.arr(json, jsonWithTags, json), Json.arr(otherTraceJson)))
149149 )
150150}
151151
@@ -165,7 +165,7 @@ class DatadogSpanReporterSpec extends AbstractHttpReporter with Matchers with Re
165165
166166 val baseUrl = mockResponse(" /test" , new MockResponse ().setStatus(" HTTP/1.1 200 OK" ).setBody(" OK" ))
167167
168- applyConfig(" kamon.datadog.trace.http. api-url = \" " + baseUrl + " \" " )
168+ applyConfig(" kamon.datadog.trace.api-url = \" " + baseUrl + " \" " )
169169 reporter.reconfigure(Kamon .config())
170170 reporter.reportSpans(spans)
171171 val request = server.takeRequest()
@@ -186,7 +186,7 @@ class DatadogSpanReporterSpec extends AbstractHttpReporter with Matchers with Re
186186
187187 s " ignore error responses " in {
188188 val baseUrl = mockResponse(" /test" , new MockResponse ().setStatus(" HTTP/1.1 500 Internal Server Error" ))
189- applyConfig(" kamon.datadog.trace.http. api-url = \" " + baseUrl + " \" " )
189+ applyConfig(" kamon.datadog.trace.api-url = \" " + baseUrl + " \" " )
190190 reporter.reconfigure(Kamon .config())
191191 reporter.reportSpans(firstSpan)
192192 server.takeRequest()
0 commit comments