kamon-io / kamon-jmx

Kamon JMX Integration
http://kamon.io/backends/jmx
Other
2 stars 5 forks source link

Can't get it working, example requested please #1

Open cwei-bgl opened 7 years ago

cwei-bgl commented 7 years ago

I was following the example trying to get kamon-mxbeans working, but with no luck. I saw the following from the log, which I would assume JMX extension is started, but there was no kamon actor mbean information. Could you please help. Thanks in advance.

[2017-02-09 10:13:33,625] [] [main] [INFO] [Kamon:35] - Initializing Kamon...
[INFO] [02/09/2017 10:13:36.497] [main] [SystemMetricsExtension(akka://kamon)] Starting the Kamon(SystemMetrics) extension
Feb 09, 2017 10:13:36 AM kamon.sigar.SigarProvisioner provision
INFO: Sigar library provisioned: /Users/cwei/git/notification/native/libsigar-universal64-macosx.dylib
[INFO] [02/09/2017 10:13:37.032] [main] [JMXExtension(akka://kamon)] Starting the Kamon(JMX) extension
[INFO] [02/09/2017 10:13:37.085] [main] [JMXMetricsExtension(akka://kamon)] Starting the Kamon(JMXMetrics) extension
registering jmx exporter
[2017-02-09 10:13:38,169] [] [bglcorp_prod_notification_ActorSystem-akka.actor.default-dispatcher-2] [INFO] [Slf4jLogger:85] - Slf4jLogger started
ivantopo commented 7 years ago

can you please check how your filters look like? that's under the kamon.metric.filters configuration key, maybe you are not including anything there and then, nothing gets reported to the JMX module.

cwei-bgl commented 7 years ago

Thanks @ivantopo . The following is my configuration. ` kamon { metrics { tick-interval = 2 second filters = [ { actor { includes = [ "" ] excludes = [] } }, { akka-actor { includes = [ "" ] excludes = [] } }, { trace { includes = [ "*" ] excludes = [] } } ] }

jmx {
subscriptions {
  histogram       = [ "**" ]
  min-max-counter = [ "**" ]
  gauge           = [ "**" ]
  counter         = [ "**" ]
  trace           = [ "**" ]
  trace-segment   = [ "**" ]
  akka-actor      = [ "**" ]
  akka-dispatcher = [ "**" ]
  akka-router     = [ "**" ]
  system-metric   = [ "**" ]
  http-server     = [ "**" ]
  # Here is the addition of the JMX exporting functionality to the subscriptions
  kamon-mxbeans   = [ "**" ]
}

}

adding the JMX to Kamon module

modules { kamon-mxbeans { auto-start = yes requires-aspectj = no extension-class = "kamon.jmx.extension.JMXMetricImporter" } }

Configuring what JMX metrics to export to Kamon

kamon-mxbeans { mbeans = [ { "name": "my-mbean", "jmxQuery": "test:type=exampleBean,name=*", "attributes": [ { "name": "Value1", "type": "counter" } ] } ], identify-delay-interval-ms = 1000, identify-interval-ms = 1000, value-check-interval-ms = 1000 } } `

About the part below. How can i configure it to monitor certain type of properties in all beans? mbeans = [ { "name": "my-mbean", "jmxQuery": "test:type=exampleBean,name=*", "attributes": [ { "name": "Value1", "type": "counter" } ] }

cwei-bgl commented 7 years ago

The Kamon documentation states 'For connect to your application you need [add some JVM parameters] for start JMX agent and install a JMX client (for example VisualVM)'. I already have a javaagent parameter for aspectJ, Can I add a JMX agent still? Is there a full running example that i can follow? Thanks.

kuzkdmy commented 6 years ago
kuzkdmy commented 6 years ago

@cwei-bgl Just FYI How do I got metrics to Graphite -> Graphana Add dependency "org.fusesource" % "sigar" % "1.6.4", And call SystemMetrics.startCollecting()