0

I am unable to create cinnamon metrics with akka.actor.ActorContext :-

val summaryStateUpdated: Rate = CinnamonMetrics(context).createRate("summaryStateUpdated")

Where context is akka.actor.ActorContext

but when I use akka.actor.ActorSystem, then cinnamon metrics works fine:-

val summaryStateUpdated: Rate = CinnamonMetrics(actorSystem).createRate("summaryStateUpdated")

Where actorSystem is akka.actor.ActorSystem

I am using 2.7.4 version of the cinnamon dependency.

addSbtPlugin("com.lightbend.cinnamon" % "sbt-cinnamon" % "2.7.4")

I am using 2.11.12 version of scala.

1 Answers1

0

I think what you are trying to do is to do actor specific metrics.

In order to do it you have to do the first line inside of an actor.

Here's an example https://developer.lightbend.com/docs/monitoring/2.7.x/extensions/custom.html#custom-metric-example

check that the imported dependencies match the example.

In example it's custom metrics but you can do whatever you want inside your actor.

Marko Švaljek
  • 2,071
  • 1
  • 14
  • 26
  • Thnx @Marko for help but I am doing the same thing, means yes I am creating actor specific metrics and for that, I am creating cinnamon matrics inside actor only and then I am passing context(i.e akka.actor.ActorContext) but still cinnamon metrics are not creating but as soon as I pass "context.system" (i.e akka.actor.ActorSystem) everything works fine – NITIN AGGARWAL Mar 16 '18 at 06:42