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 core 2 13 10 2 #149

Merged
merged 6 commits into from
Dec 15, 2020
Merged

Akka http core 2 13 10 2 #149

merged 6 commits into from
Dec 15, 2020

Conversation

tspring
Copy link
Contributor

@tspring tspring commented Dec 11, 2020

This is largely a copy/paste of akka-http-core-2.13_10.1.8, only it weaves singleRequest as the singleRequestImpl was removed in 10.2.0 . See also https://github.com/newrelic/newrelic-java-agent/tree/main/instrumentation/akka-http-core-10.2.0

Co-authored-by: jack-berg <[email protected]>
@tspring
Copy link
Contributor Author

tspring commented Dec 14, 2020

#152

@tspring tspring merged commit 10953fc into main Dec 15, 2020
@tspring tspring deleted the akka-http-core-2_13_10_2 branch December 15, 2020 16:15
@tspring tspring linked an issue Dec 15, 2020 that may be closed by this pull request
@ryanb93
Copy link

ryanb93 commented Jan 5, 2021

@tspring @jack-berg Does this mean it will only work for 10.2.0 or would 10.2.2 work as well? We're having issues where our Scala projects are not reporting any transaction data.

@tspring
Copy link
Contributor Author

tspring commented Jan 5, 2021

@ryanb93 The instrumentation should match on 10.2.2 as well. Each module's build.gradle contains a verifyInstrumentation block that checks the matched versions like here: https://github.com/newrelic/newrelic-java-agent/pull/149/files#diff-e4cdea3b7561b480821e0b8e0229e081549a591277fb2627b7a4abf68f42e3bcR17

The syntax is a range where [ is inclusive and ) is exclusive. So currently this instrumentation will apply to all akka-http-core_2.13 versions starting with 10.2.0-RC1.

If you aren't getting transactions I'd suspect the problem is that your code is not going through either of these AkkaHttp methods .

If you don't mind, identifying the correct transaction start point or filing an issue with a simple example project that demonstrates the problem would be a great help.

@ryanb93
Copy link

ryanb93 commented Jan 15, 2021

I'm on akka-http version 10.2.2 and set the logging to finest, I see this in the logs:

2021-01-15T16:22:14,228+0000 [1 22] com.newrelic FINEST: Skipping instrumentation module com.newrelic.instrumentation.akka-http-core-10.2.0. The most likely cause is that com.newrelic.instrumentation.akka-http-core-10.2.0 shouldn't apply to this application.

We are using https://github.com/softwaremill/tapir to create a Akka Http Routes but those are still bound to a Http() server so it should all go through the handleWithAsyncHandler.

I also see a lot of:

2021-01-15T16:23:06,236+0000 [1 52] com.newrelic FINE: created com.newrelic.agent.TransactionActivity@7fffffff for null

Looking into the agent code, this means the Transaction is null.

We are also running the Kamon java agent at the same time, I wonder if something is conflicting there. Will try to create an example project to isolate the issue, but quite hard to test without publishing data to our newrelic account.

Another strange thing, the version of akka-http is being logged as 4.3.0

2021-01-15T16:23:06,348+0000 [1 54] com.newrelic FINE: Setting akka-http port to: 8080
2021-01-15T16:23:06,348+0000 [1 54] com.newrelic FINER: Application server port: 8080
2021-01-15T16:23:06,348+0000 [1 54] com.newrelic FINER: The dispatcher was set to Akka HTTP:4.3.0.

Update:
Turns out 4.3.0 is my application's version, it's the value in Implementation-Version: 4.3.0 from MANIFEST.MF. We create a fat jar and the MANIFEST.MF for akka-http is renamed to MANIFEST_akka-http_2.13-10.2.2.MF. Don't know if this would impact the actual implementation?

2021-01-15T16:23:06,559+0000 [1 54] com.newrelic DEBUG: Instrumenting class akka/http/scaladsl/AsyncRequestHandler
2021-01-15T16:23:06,561+0000 [1 54] com.newrelic FINER: Traced akka/http/scaladsl/AsyncRequestHandler methods [apply(Lakka/http/scaladsl/model/HttpRequest;)Lscala/concurrent/Future;]
2021-01-15T16:23:06,561+0000 [1 54] com.newrelic FINER: While tracing akka/http/scaladsl/AsyncRequestHandler the following methods were not traced: [apply(Ljava/lang/Object;)Ljava/lang/Object;]
2021-01-15T16:23:06,562+0000 [1 54] com.newrelic FINER: Instrumented akka.http.scaladsl.AsyncRequestHandler.apply(Lakka/http/scaladsl/model/HttpRequest;)Lscala/concurrent/Future;, [TracedWeaveInstrumentation], [com.newrelic.instrumentation.akka-http-core-2.13_10.2.0]
2021-01-15T16:23:06,563+0000 [1 54] com.newrelic FINER: Final transformation of class akka/http/scaladsl/AsyncRequestHandler

Update:

Think I've managed to narrow it down to a use of newServerAt and bindFlow, raised an issue here with example code: #189

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Akka-http-core-2.13_10.2.0
3 participants