[ 
https://issues.apache.org/jira/browse/SAMZA-105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14119929#comment-14119929
 ] 

Chris Riccomini commented on SAMZA-105:
---------------------------------------

I was thinking that we'd just use Samza's MetricsRegistry to expose the 
metrics. In this way, the metrics would end up being funneled into the same 
MetricsReporter stuff that all the other framework metrics end up in.

I haven't thought in great detail about how this would be implemented, though. 
The lifecycle listener seems like a reasonable approach, but I believe those 
are instantiated once per-task, not once per-container, so you'd need some rule 
on which listener actually instantiated the scraper, or you could use a 
singleton to instantiate it.

Regarding how to scrape the metrics, maybe something like a config-based regex 
to specify which JMX MBeans should be counters, and which should be gauges.

> Write a JMX scraper
> -------------------
>
>                 Key: SAMZA-105
>                 URL: https://issues.apache.org/jira/browse/SAMZA-105
>             Project: Samza
>          Issue Type: Bug
>          Components: metrics
>    Affects Versions: 0.6.0
>            Reporter: Chris Riccomini
>
> Samza currently has a JmxReporter, which exposes Samza's metrics via JMX, so 
> they can be viewed in things like VisualVM, JConsole, etc. It would be nice 
> to have the inverse of this, as well: the ability to scrape metrics from JMX 
> beans, and inject them into Samza's metrics framework.
> The main motivation for adding this support is to allow us to collect metrics 
> for third party libraries that don't use Samza's metrics framework. Since 
> most libraries expose information via JMX, it's can be used as a common 
> bridge that we can pull metrics out of.
> One way to implement this would be to write a JmxMetricsScraper that 
> implements TaskLifecycleListener. In the beforeInit method, it could grab the 
> metrics registry and config objects, connect to the local process' JMX beans, 
> and start scraping the relevant metrics.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to