diff --git a/instrumentation/kamon-akka/src/akka-2.6/scala/kamon/instrumentation/akka/instrumentations/akka_26/remote/internal/AkkaPduProtobufCodecDecodeMessageMethodAdvisor.scala b/instrumentation/kamon-akka/src/akka-2.6/scala/kamon/instrumentation/akka/instrumentations/akka_26/remote/internal/AkkaPduProtobufCodecDecodeMessageMethodAdvisor.scala index 06a8ba93b..217102c21 100644 --- a/instrumentation/kamon-akka/src/akka-2.6/scala/kamon/instrumentation/akka/instrumentations/akka_26/remote/internal/AkkaPduProtobufCodecDecodeMessageMethodAdvisor.scala +++ b/instrumentation/kamon-akka/src/akka-2.6/scala/kamon/instrumentation/akka/instrumentations/akka_26/remote/internal/AkkaPduProtobufCodecDecodeMessageMethodAdvisor.scala @@ -20,7 +20,7 @@ object AkkaPduProtobufCodecDecodeMessage { @OnMethodEnter @static def enter(@Argument(0) bs: ByteString, @Argument(1) provider: RemoteActorRefProvider, @Argument(2) localAddress: Address): Unit = { - val ackAndEnvelope = AckAndContextAwareEnvelopeContainer.parseFrom(bs.toArray) + val ackAndEnvelope = AckAndContextAwareEnvelopeContainer.parseFrom(bs.toArrayUnsafe()) if (ackAndEnvelope.hasEnvelope && ackAndEnvelope.getEnvelope.hasTraceContext) { val remoteCtx = ackAndEnvelope.getEnvelope.getTraceContext diff --git a/instrumentation/kamon-pekko/src/main/scala/kamon/instrumentation/pekko/remote/internal/PekkoPduProtobufCodecDecodeMessageMethodAdvisor.scala b/instrumentation/kamon-pekko/src/main/scala/kamon/instrumentation/pekko/remote/internal/PekkoPduProtobufCodecDecodeMessageMethodAdvisor.scala index 10f28b66c..232c88ce7 100644 --- a/instrumentation/kamon-pekko/src/main/scala/kamon/instrumentation/pekko/remote/internal/PekkoPduProtobufCodecDecodeMessageMethodAdvisor.scala +++ b/instrumentation/kamon-pekko/src/main/scala/kamon/instrumentation/pekko/remote/internal/PekkoPduProtobufCodecDecodeMessageMethodAdvisor.scala @@ -24,7 +24,7 @@ object PekkoPduProtobufCodecDecodeMessage { @Argument(1) provider: RemoteActorRefProvider, @Argument(2) localAddress: Address ): Unit = { - val ackAndEnvelope = AckAndContextAwareEnvelopeContainer.parseFrom(bs.toArray) + val ackAndEnvelope = AckAndContextAwareEnvelopeContainer.parseFrom(bs.toArrayUnsafe()) if (ackAndEnvelope.hasEnvelope && ackAndEnvelope.getEnvelope.hasTraceContext) { val remoteCtx = ackAndEnvelope.getEnvelope.getTraceContext