diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2017-08-21 12:09:20 +0200 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2017-08-21 12:09:20 +0200 |
commit | 670f32d19a30283a39a0519a74fc5c6a0efd379b (patch) | |
tree | bcaa52f9ed6e77560fa5079444e4e09a706c33b6 /kamon-testkit/src/main/scala/kamon/testkit/SpanInspector.scala | |
parent | 865025d199ca9430851e512e99780c065dee635e (diff) | |
download | Kamon-670f32d19a30283a39a0519a74fc5c6a0efd379b.tar.gz Kamon-670f32d19a30283a39a0519a74fc5c6a0efd379b.tar.bz2 Kamon-670f32d19a30283a39a0519a74fc5c6a0efd379b.zip |
fix the SpanInspector reflection for Scala 2.12
Diffstat (limited to 'kamon-testkit/src/main/scala/kamon/testkit/SpanInspector.scala')
-rw-r--r-- | kamon-testkit/src/main/scala/kamon/testkit/SpanInspector.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kamon-testkit/src/main/scala/kamon/testkit/SpanInspector.scala b/kamon-testkit/src/main/scala/kamon/testkit/SpanInspector.scala index 0ba61f87..25f7ee06 100644 --- a/kamon-testkit/src/main/scala/kamon/testkit/SpanInspector.scala +++ b/kamon-testkit/src/main/scala/kamon/testkit/SpanInspector.scala @@ -27,7 +27,7 @@ class SpanInspector(span: Span) { spanData.tags def metricTags(): Map[String, String] = - getField[Span.Local, Map[String, String]](realSpan, "kamon$trace$Span$Local$$customMetricTags") + getField[Span.Local, Map[String, String]](realSpan, "customMetricTags") def startTimestamp(): Long = getField[Span.Local, Long](realSpan, "startTimestampMicros") @@ -42,7 +42,7 @@ class SpanInspector(span: Span) { private def getField[T, R](target: Any, fieldName: String)(implicit classTag: ClassTag[T]): R = { - val toFinishedSpanMethod = classTag.runtimeClass.getDeclaredField(fieldName) + val toFinishedSpanMethod = classTag.runtimeClass.getDeclaredFields.find(_.getName.contains(fieldName)).get toFinishedSpanMethod.setAccessible(true) toFinishedSpanMethod.get(target).asInstanceOf[R] } |