Running Typesafe Console/Atmos to monitor actor system/scala app. Running from IntelliJ IDEA or any other IDE

2.6k views Asked by At

Writing a program in Scala with actor system.

Need to monitor it with Atmos (Typesafe console)

Found documentation to this using sbt or Eclipse, problem is im looking for a way to :

  1. Restart/start typesafe console on each run from my IDE
  2. Run the app with the needed java opt
  3. Open the console on each run
  4. Do this automatically

any link to a nice wiki / doc for this issue ?

thanks

1

There are 1 answers

1
Nimrod007 On BEST ANSWER

This is how i solved this issue in the end (my dev machine is Ubuntu 12.04) :

script example :

#this will restart atmos 
FILE=`find /opt -name typesafe-console | head -1`
BASEDIR=$(dirname $FILE)
echo "Starting Atmos (this may take a few seconds)"
kill -9 `ps aux | grep atmos | grep -v grep |  awk '{print $2}'`
kill -9 `ps aux | grep typesafe-console | grep -v grep |  awk '{print $2}'`
rm -f $BASEDIR/../var/RUNNING_PID
nohup $FILE atmos > /var/log/typesafe-console/console.log &
sleep 5
nohup $FILE ui > /var/log/typesafe-console/ui.log &
sleep 4
firefox "http://localhost:9900"
exit
  • Go to IntelliJ, to your app, run configuration and add the VM options :
-javaagent:/opt/typesafe-console-developer-1.3.1/lib/weaver/aspectjweaver.jar
-Dorg.aspectj.tracing.factory=default
-Djava.library.path=/opt/typesafe-console-developer-1.3.1/lib/sigar

screen shot :

enter image description here

  • Add "Before lunch -> "external tool" -> "run external tool"

screen shot :

External tool

External tool 2

  • In your application.conf file add :


akka {
    loggers = ["com.typesafe.atmos.trace.Slf4jTraceContextLogger"]
    loglevel = "INFO"
}

atmos { trace { enabled = true traceable { "*" = on }

sampling { "*" = 1 } }}
  • Now you can run your app from the IDE and get it working with typesafe console

Hope this helps!