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

will this work for akka 2.3 and scala 2.11? #34

Closed
jahangirmohammed opened this issue May 16, 2014 · 19 comments
Closed

will this work for akka 2.3 and scala 2.11? #34

jahangirmohammed opened this issue May 16, 2014 · 19 comments

Comments

@jahangirmohammed
Copy link

When can we expect the project work for akka 2.3 and scala 2.11?

@ivantopo
Copy link
Contributor

Scala 2.11 is not binary compatible with Scala 2.10.x, so I guess it wont work at all.. there have been a couple requests from people trying to use Scala 2.11 so we will probably make a release in the following days. I'll let you known when it is out!

@jahangirmohammed
Copy link
Author

Thanks..Will be waiting on this.

@adrien-aubel
Copy link

+1 for that. Kamon is the only dependency that I have right now that doesn't play well with Scala 2.11.

@ivantopo
Copy link
Contributor

@adrien-aubel that sounds like you are already using Kamon for some time! It would be nice if you can share a bit of you experience with us.. in the meantime, the Scala 2.11 support just gained a couple priority points, I'll get back to you guys soon.

@ivantopo
Copy link
Contributor

@jahangirmohammed @adrien-aubel I just published Kamon 0.3.1-5a87b76817433b7d2997bcbbe3d9173a6f6a1055 for Scala 2.11 in our snapshots repository, just in case you guys want to try it out before our next release is available. From now on we will publish releases for Scala 2.11 as well. Have fun!

@adrien-aubel
Copy link

That's cool man. Testing it right now.
Yeah I've been using Kamon and watching its evolutions for a few months now, mainly to be able to monitor Spray on New Relic. It's working great for me so far.
Btw I have one suggestion about this integration:
When I see the transactions in New Relic and I have routes that have variables in it, the transactions of the same route are not grouped together.

For example I see this:

/users/12/messages
/users/13/messages

As two different transactions.

I'd love to see only one transaction showing up in New Relic, like this for example:

/users/:<Long>/messages

But I'm not sure of the changes it would imply on your side.

@adrien-aubel
Copy link

I get this exception when starting tests:

Uncaught error from thread [api-GroupsApiSpec-akka.actor.default-dispatcher-2] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[api-GroupsApiSpec]
java.lang.NoClassDefFoundError: spray/json/RootJsonWriter
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2493)
        at java.lang.Class.getConstructor0(Class.java:2803)
        at java.lang.Class.getDeclaredConstructor(Class.java:2053)
        at akka.util.Reflect$$anonfun$4.apply(Reflect.scala:86)
        at akka.util.Reflect$$anonfun$4.apply(Reflect.scala:86)
        at scala.util.Try$.apply(Try.scala:191)
        at akka.util.Reflect$.findConstructor(Reflect.scala:86)
        at akka.actor.NoArgsReflectConstructor.<init>(Props.scala:356)
        at akka.actor.IndirectActorProducer$.apply(Props.scala:305)
        at akka.actor.Props.producer(Props.scala:173)
        at akka.actor.Props.<init>(Props.scala:186)
        at akka.actor.Props$.apply(Props.scala:69)
        at kamon.newrelic.NewRelicMetricsListener.<init>(NewRelic.scala:39)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at java.lang.Class.newInstance(Class.java:374)
        at akka.util.Reflect$.instantiate(Reflect.scala:45)
        at akka.actor.NoArgsReflectConstructor.produce(Props.scala:358)
        at akka.actor.Props.newActor(Props.scala:249)
        at akka.actor.ActorCell.newActor(ActorCell.scala:552)
        at akka.actor.ActorCell.create(ActorCell.scala:578)
        at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:456)
        at akka.actor.ActorCell.systemInvoke(ActorCell.scala:478)

I use spray 1.3.1-20140423 for Scala 2.11, plus this commit: spray/spray@2e97286 (copied PlayJsonSupport.scala in my project).

@ivantopo
Copy link
Contributor

ivantopo commented Jun 2, 2014

@adrien-aubel thanks for testing this out! First, regarding your web transactions name, what you currently see is the default name that Kamon sets for a "automatically generated Trace", but you can change the name if you want to. There is a traceDirective that allows you to do just that, and ideally you will give a transaction a more meaningful name.. a example based on your case might be:

get {
  path("users" / IntNumber / "messages) { userID =>
    traceName("GetUserMessages") {
      complete {
        // Get that info from somewhere
        ....
      }
    }
  }
}

That should solve your first problem, in a few minutes will try out the NCDFE.

@ivantopo
Copy link
Contributor

ivantopo commented Jun 2, 2014

@adrien-aubel I just tried to run one of our toy apps and everything is working just fine.. could you please review that your classpath contains spray-json 1.2.6? Is it possible that you excluded it from your classpath because you are using play-json and it just seemed to be unnecessary? Kamon uses it when posting data to New Relic.

@adrien-aubel
Copy link

Oh yeah you're right, I've put this in my dependencies:

    // Kamon (for metrics)
    "io.kamon" %% "kamon-core" % "0.3.1-5a87b76817433b7d2997bcbbe3d9173a6f6a1055" excludeAll ExclusionRule(organization = "io.spray"),
    "io.kamon" %% "kamon-spray" % "0.3.1-5a87b76817433b7d2997bcbbe3d9173a6f6a1055" excludeAll ExclusionRule(organization = "io.spray"),
    "io.kamon" %% "kamon-newrelic" % "0.3.1-5a87b76817433b7d2997bcbbe3d9173a6f6a1055" excludeAll ExclusionRule(organization = "io.spray"),

because otherwise the Spray version would clash with the one compatible with Scala 2.11.

They're busy at Spray / Typesafe making of Spray the new akka-http, but it's also part of a bigger plan (Reactive Streams), so the situation right now around Spray is kind of complicated.

I'll tweak the dependencies and get back to you if I don't succeed.

Thanks for the help, I really appreciate that.

@ivantopo
Copy link
Contributor

ivantopo commented Jun 2, 2014

Nice! the snapshot you are using depends on Spray 1.3.1-20140423 as well, so there should be no need to exclude the spray version pulled from Kamon. Also hope that you have fun personalizing your trace names with the directive I mentioned before, let us know if you need something else.

@jahangirmohammed
Copy link
Author

thanks a ton for this - @ivantopo ..Will try out..

@adrien-aubel
Copy link

Thanks @ivantopo I removed the dependency exclusion and it's working great!

Just one last thing: is there anything special to be done to have the error rates (HTTP 4xx and 5xx) correctly showing up on New Relic?
Right now it's always 0% on my NR dashboard.

@ivantopo
Copy link
Contributor

ivantopo commented Jun 4, 2014

There is a NewRelicErrorLogger that takes all Error events and sends them to New Relic.. we recently found out that even while the errors can be seen in New Relic, the way in which they are grouped is not the best and we need to provide a better support for error messages.. you can use what we have now and I'll let you know when the improved version is available.

@adrien-aubel
Copy link

I see. I'll test it, and I'm looking forward for any improvement in this class.
I was on the phone with New Relic earlier today actually, if you want me to talk to them about anything on that matter, let me know.

@adrien-aubel
Copy link

So I tested today this with a small amount of our users in production.

For some reason I see a lot of occurrences this exception, that wasn't happening with Scala 2.10:

[ERROR] [06/05/2014 15:36:21.550] [services-scheduler-1] [akka.dispatch.Dispatcher] null
java.lang.NullPointerException
    at akka.instrumentation.DispatcherTracing.afterDispatcherShutdown(DispatcherTracing.scala:85)
    at akka.dispatch.Dispatcher.shutdown(Dispatcher.scala:101)
    at akka.dispatch.MessageDispatcher$$anon$2.run(AbstractDispatcher.scala:212)
    at akka.dispatch.MessageDispatcher$$anon$3.execute(AbstractDispatcher.scala:174)
    at akka.actor.LightArrayRevolverScheduler$TaskHolder.executeTask(Scheduler.scala:467)
    at akka.actor.LightArrayRevolverScheduler$$anon$8.executeBucket$1(Scheduler.scala:419)
    at akka.actor.LightArrayRevolverScheduler$$anon$8.nextTick(Scheduler.scala:423)
    at akka.actor.LightArrayRevolverScheduler$$anon$8.run(Scheduler.scala:375)
    at java.lang.Thread.run(Thread.java:744)

Do you know what could cause this?
Apparently the exception occurs in one of your files: https://github.com/kamon-io/Kamon/blob/master/kamon-core/src/main/scala/akka/instrumentation/DispatcherTracing.scala#L85

@dpsoft
Copy link
Contributor

dpsoft commented Jun 5, 2014

I think that you found a bug, let me check and I'll notice you when I fix
it.

best regards.

Diego

On Thu, Jun 5, 2014 at 7:38 PM, Adrien Aubel notifications@github.com
wrote:

So I tested today this with a small amount of our users in production.

For some reason I see a lot of occurrences this exception, that wasn't
happening with Scala 2.10:

[ERROR] [06/05/2014 15:36:21.550] [services-scheduler-1] [akka.dispatch.Dispatcher] null
java.lang.NullPointerException
at akka.instrumentation.DispatcherTracing.afterDispatcherShutdown(DispatcherTracing.scala:85)
at akka.dispatch.Dispatcher.shutdown(Dispatcher.scala:101)
at akka.dispatch.MessageDispatcher$$anon$2.run(AbstractDispatcher.scala:212)
at akka.dispatch.MessageDispatcher$$anon$3.execute(AbstractDispatcher.scala:174)
at akka.actor.LightArrayRevolverScheduler$TaskHolder.executeTask(Scheduler.scala:467)
at akka.actor.LightArrayRevolverScheduler$$anon$8.executeBucket$1(Scheduler.scala:419)
at akka.actor.LightArrayRevolverScheduler$$anon$8.nextTick(Scheduler.scala:423)
at akka.actor.LightArrayRevolverScheduler$$anon$8.run(Scheduler.scala:375)
at java.lang.Thread.run(Thread.java:744)

Do you know what could cause this?


Reply to this email directly or view it on GitHub
#34 (comment).

@adrien-aubel
Copy link

Thanks. Looking forward for it! Let me know if I can help.
Btw, it seems like it doesn't happen using sbt run, but it definitely happens after sbt dist (using SBT Native packager)

@ivantopo
Copy link
Contributor

ivantopo commented Jun 6, 2014

@adrien-aubel I just created #36 to track that bug, it would be nice if you can go there and give us a bit more info, thanks for reporting!

@dpsoft dpsoft closed this as completed Jun 19, 2014
ivantopo pushed a commit that referenced this issue Mar 18, 2020
Kanela support for akka 2.5.x
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

No branches or pull requests

4 participants