Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

akka-http-2.4.5 instrumentation doesn't apply when using Scala 2.13.x #260

Closed
jasonjkeller opened this issue Apr 1, 2021 · 2 comments · Fixed by #271
Closed

akka-http-2.4.5 instrumentation doesn't apply when using Scala 2.13.x #260

jasonjkeller opened this issue Apr 1, 2021 · 2 comments · Fixed by #271
Assignees
Labels
bug Something isn't working as designed/intended

Comments

@jasonjkeller
Copy link
Contributor

jasonjkeller commented Apr 1, 2021

When using Scala 2.13.x the akka-http-2.4.5 instrumentation doesn't apply due to this weave violation:

2021-03-25T13:43:37,490+0000 [1 24] com.newrelic FINEST: com.newrelic.instrumentation.akka-http-2.4.5 - 1 violations against classloader jdk.internal.loader.ClassLoaders$AppClassLoader@73d16e93
2021-03-25T13:43:37,490+0000 [1 24] com.newrelic FINEST: WeaveViolation: MISSING_ORIGINAL_BYTECODE
2021-03-25T13:43:37,490+0000 [1 24] com.newrelic FINEST: 		Class: scala/collection/immutable/StringOps
2021-03-25T13:43:37,490+0000 [1 24] com.newrelic FINEST: 		Reason: Could not find original bytecode

The result is that any transactions that are normally started by the Java agent from this instrumentation when akka.http.scaladsl.server.ContextWrapper.apply(AkkaHttpContextFunction.scala) is executed will not exist if using Scala 2.13.x.

The reason that the instrumentation no longer applies is due to refactoring where scala/collection/immutable/StringOps was refactored in Scala v2.13.0-M4 and now is found in scala/collection/StringOps.

The StringOps class wraps the scala implementation of java.lang.String which is scala.Predef.String. It appears that some magic happens behind the scenes where scala Strings are implicitly converted into instances of the StringOps class.

You can see the differences documented here:

We'll need to build a new version of the instrumentation from the Scala 2.13 dependency.

@jasonjkeller
Copy link
Contributor Author

I’ve got a branch here that modifies the v6.4.2 agent branch and adds a new instrumentation module named akka-http-2.13_2.4.5 that should apply when using scala 2.13. It needs to be tested and cleaned up a bit before we can get it into an agent release.

v6.4.2...akka-http-2.13_2.4.5

@jasonjkeller jasonjkeller added the bug Something isn't working as designed/intended label Apr 2, 2021
@BoopBoopBeepBoop
Copy link

Note that scala convention for jar naming would place the scala major version after an underscore

${name}_${scalaVersion}-${version}-${tag}
ex: server_2.13-0.3.241

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as designed/intended
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants