3

I want to integrate a Scala app (Kestrel, http://robey.github.com/kestrel) with NewRelic using java agant but failed with error

sh scripts/devel.sh 
Starting kestrel in development mode... 
Mar 28, 2013 18:15:15 +0800 NewRelic 1 INFO: Agent is using Logback 
Mar 28, 2013 18:15:15 +0800 NewRelic 1 INFO: Loading configuration file "/tmp/newrelic.yml" 
Mar 28, 2013 6:15:24 PM java.util.logging.LogManager$RootLogger log 
FATAL: Error in config file: %s com.twitter.util.Eval$CompilerException: Compiler exception error: line 1: object twitter is not a member of package com

import com.twitter.conversions.storage._ 
^ at com.twitter.util.Eval$StringCompiler.apply(Eval.scala:533) 
at com.twitter.util.Eval$StringCompiler$$anonfun$apply$3.apply(Eval.scala:544) 
at com.twitter.util.Eval$StringCompiler$$anonfun$apply$3.apply(Eval.scala:543) 
at scala.Option.getOrElse(Option.scala:108) 
at com.twitter.util.Eval$StringCompiler.apply(Eval.scala:543) 
at com.twitter.util.Eval.applyProcessed(Eval.scala:196) at com.twitter.util.Eval.apply(Eval.scala:167) at com.twitter.ostrich.admin.RuntimeEnvironment.loadConfig(RuntimeEnvironment.scala:230) 
at com.twitter.ostrich.admin.RuntimeEnvironment.loadRuntimeConfig(RuntimeEnvironment.scala:256) 
at net.lag.kestrel.Kestrel$.main(Kestrel.scala:307) at net.lag.kestrel.Kestrel.main(Kestrel.scala)

Mar 28, 2013 6:15:24 PM java.util.logging.LogManager$RootLogger log 
FATAL: error: line 1: object twitter is not a member of package com 
import com.twitter.conversions.storage._

Steps to reproduce:

  • Download http://robey.github.com/kestrel/download/kestrel-2.4.1.zip
  • Put newrelic.jar & newrelic.yml (with config) inside another folder, e.g. /tmp/newrelic
  • Edit the scripts/devel.sh, Add the javaagent flags

    java -server -Xmx1024m -Dstage=development -Dnewrelic.config.file=/tmp/newrelic/newrelic.yml -javaagent:/tmp/newrelic/newrelic.jar -jar "$ROOT_DIR"/kestrel_2.9.2-2.4.1.jar 4. Run scripts/devel.sh and you will see the above error.

Any idea? Actually I have fire a ticket to NewRelic but got no answer from them for a whole month, I hope the community and @lewis-cirne (NewRelic CEO) can shield some light on this

Community
  • 1
  • 1
Ryan
  • 10,041
  • 27
  • 91
  • 156

3 Answers3

2

There's no Scala support in the New Relic Java Agent https://newrelic.com/docs/java/new-relic-for-java

Scalayer
  • 1,217
  • 9
  • 6
  • Actually it do work, but only failed to bootstrap the class path when Twitter Finagle is compiling config. – Ryan Apr 29 '13 at 16:02
  • The only thing you'll likely see is JVM stats and maybe certain rolled-up web transactions. You won't see any of the stats you're used to seeing for a Java web app because there's no instrumentation for Scala or Kestrel. – Scalayer Apr 29 '13 at 21:16
2

With the release of version 2.19.0 of New Relic's Java agent on May 29, 2013, there is significant support for Scala and it's use in Play 2.0 and 2.1 frameworks. The problem you're having isn't' related to Scala directly. Kestrel uses an eval leading to a runtime compilation. New Relic's agent is designed to work with precompiled Java bytecode, so the eval process is not supported.

NR_Tony
  • 185
  • 4
1

Even if New Relic were to support Scala (which I hear may be coming soon), the use of eval by Kestrel seems like a much tougher nut to crack. Is there a setting for Kestrel which doesn't use eval or is that baked-in?