Divide by Zero exception with sigar

40 views
Skip to first unread message

Adarsh J

unread,
Apr 20, 2015, 8:30:20 AM4/20/15
to kamon...@googlegroups.com
hi,
I see the following exception almost consistently -

```
[ERROR] [04/16/2015 02:23:06.689]
[kamon-akka.actor.default-dispatcher-4]
[akka://kamon/user/kamon-system-metrics/sigar-metrics-recorder] / by
zero
java.lang.ArithmeticException: / by zero
at kamon.system.sigar.ProcessCpuMetrics.percentUsage$1(ProcessCpuMetrics.scala:54)
at kamon.system.sigar.ProcessCpuMetrics.update(ProcessCpuMetrics.scala:60)
at kamon.system.sigar.SigarMetricsUpdater.updateMetrics(SigarMetricsUpdater.scala:47)
at kamon.system.sigar.SigarMetricsUpdater$$anonfun$receive$1.applyOrElse(SigarMetricsUpdater.scala:42)
at akka.actor.Actor$class.aroundReceive(Actor.scala:465)
at kamon.system.sigar.SigarMetricsUpdater.aroundReceive(SigarMetricsUpdater.scala:28)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
at akka.actor.ActorCell.invoke(ActorCell.scala:487)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:254)
at akka.dispatch.Mailbox.run(Mailbox.scala:221)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
```

I don't have a reproduction for this, but it scares me everytime such
exception occurs which could have been easily handled at the first
place and prevented from happening. Is there any issue that tracks
this (I tried to find on gh issues but was unable to find other than
this auxiliary issue whose log also has this exception -
https://github.com/kamon-io/Kamon/issues/94)? I would like to know if
there's a workaround to prevent this bug from happening?

The versions in use are - Kamon
"0.3.6-5456e7ca8f215b2a3a5bdbd3177a6ae61f268eef" with akka "2.3.9"

Regards,
Adarsh J

Ivan Topolnjak

unread,
Apr 20, 2015, 8:47:04 AM4/20/15
to kamon...@googlegroups.com
Hello Adarsh!

Thanks for reporting this issue. The Sigar metrics are recorded once every second, are you seeing this error every second or just from time to time?, Also, can you let us know whether you are on Linux, Mac or Windows?.. Maybe we made some assumptions that work well with linux but not so well with other OSs.

--
You received this message because you are subscribed to the Google Groups "kamon-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kamon-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Adarsh J

unread,
Apr 23, 2015, 11:34:46 AM4/23/15
to kamon...@googlegroups.com
hi Ivan,
Sorry for a delayed reply. The error occurs once every few hours
(approx 8~9 hrs once). The platform is docker on linux (both are
Ubuntu 14.04), I package the scala app using sbt-native-packager to
generate docker image and use the sbt-aspectj
(https://github.com/sbt/sbt-aspectj/tree/master/src/sbt-test/weave/load-time/)
way of weaving option to include aspectj. Let me know if more
information can help triage the problem.

thanks,
Regards,
Adarsh J

Diego Parra

unread,
May 6, 2015, 11:27:57 AM5/6/15
to kamon...@googlegroups.com
hi Adarsh, 

we just open a new issue with this. #194

Cheers,

Diego.
>> To unsubscribe from this group and stop receiving emails from it, send an email to kamon-user+unsubscribe@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups "kamon-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to kamon-user+unsubscribe@googlegroups.com.

Adarsh J

unread,
May 6, 2015, 12:19:01 PM5/6/15
to kamon...@googlegroups.com
Thanks Diego, just saw that it has also been fixed already. That was fast!

thanks,
Regards,
Adarsh J
>> >> an email to kamon-user+...@googlegroups.com.
>> >> For more options, visit https://groups.google.com/d/optout.
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "kamon-user" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an email to kamon-user+...@googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "kamon-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to kamon-user+...@googlegroups.com.

anthony...@gmail.com

unread,
Feb 7, 2016, 8:20:13 PM2/7/16
to kamon-user

Hi Adarsh,

Sorry for replying an old thread.

I wonder how you include javaagent options? I use sbt-native-packager and sbt-aspectj and generate docker image, but I can't get option added to bashScriptExtraDefines correctly.

Thanks & Regards,
Anthony L

Reply all
Reply to author
Forward
0 new messages