You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Amit.. Gupta." <am...@adobe.com> on 2014/10/21 11:49:46 UTC

[RTC] SLING-4080 - API to capture/measure application-level metrics

Hi Devs,


I would like to add API to capture application-level metrics. The api is inspired by Yammer Metrics [0]. A first cut implementation is available at [1]


Idea is to provide high level constructs such as Timer, Counter, Gauge, which can be used by applications. This RTC is only for api, plan is to also provide a metrics based implementation as well.


Driver for this api, is to provide easy to use first class constructs that can be quickly integrated into new and existing application.


Metrics [0] one of the widely used implementation and provide some OOTB integration with JMX and popular monitoring tools such as Ganglia, Graphite.


Thanks,

Amit

[0] https://dropwizard.github.io/metrics/3.1.0/?

[1] https://svn.apache.org/repos/asf/sling/whiteboard/amitgupt/monitoring/

[2] https://issues.apache.org/jira/browse/SLING-4080?

Re: [RTC] SLING-4080 - API to capture/measure application-level metrics

Posted by Ian Boston <ie...@tfd.co.uk>.
Hi
The Karaf Decanter proposal appears to go much wider than just an API.
It includes collection of metrics, dashboard, UI etc.

The same thread in its entirety is a bit easier to read here

http://karaf.922171.n3.nabble.com/PROPOSAL-Karaf-Decanter-monitoring-td4035902.html

There isn't a conclusion at the moment.

Best Regards,
Ian


BTW, for consuming the metrics we have been pushing the data to
Ganglia and Greylog, which appear to work very well for medium size
clusters.


On 23 October 2014 15:53, Oliver Lietz <ap...@oliverlietz.de> wrote:
> On Tuesday 21 October 2014 15:47:45 Carsten Ziegeler wrote:
>> Am 21.10.14 um 15:07 schrieb Ian Boston:
>> > Agreed, imho thats what Amit's proposal does, but it needs to be
>> > somewhere it can be used. If Oak and Felix dont want to use it, then
>> > Sling is the right place.
>>
>> We have Sling commons, which is intended to host stuff that is not tied
>> to Sling.
>>
>> My initial comment would have been the same as Bertrand, why reinvent?
>> But I've tried to use Yammer in the past and fell into the incompatible
>> API changes (and other things). It's a shame that there is no real
>> library out there which can be used ootb and does not come with the
>> mentioned problems....
>
> There is some effort for a monitoring project right now at Karaf ("Karaf
> Decanter"):
>
> http://mail-archives.apache.org/mod_mbox/karaf-
> user/201410.mbox/%3C543D3D62.6050608@nanthrax.net%3E
>
> This should help to find out what works on OSGi - or reuse some parts of it in
> Sling.
>
> O.
>
>> Carsten

Re: [RTC] SLING-4080 - API to capture/measure application-level metrics

Posted by Oliver Lietz <ap...@oliverlietz.de>.
On Tuesday 21 October 2014 15:47:45 Carsten Ziegeler wrote:
> Am 21.10.14 um 15:07 schrieb Ian Boston:
> > Agreed, imho thats what Amit's proposal does, but it needs to be
> > somewhere it can be used. If Oak and Felix dont want to use it, then
> > Sling is the right place.
> 
> We have Sling commons, which is intended to host stuff that is not tied
> to Sling.
> 
> My initial comment would have been the same as Bertrand, why reinvent?
> But I've tried to use Yammer in the past and fell into the incompatible
> API changes (and other things). It's a shame that there is no real
> library out there which can be used ootb and does not come with the
> mentioned problems....

There is some effort for a monitoring project right now at Karaf ("Karaf 
Decanter"):

http://mail-archives.apache.org/mod_mbox/karaf-
user/201410.mbox/%3C543D3D62.6050608@nanthrax.net%3E

This should help to find out what works on OSGi - or reuse some parts of it in 
Sling.

O.

> Carsten

Re: [RTC] SLING-4080 - API to capture/measure application-level metrics

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi Amit,

On Wed, Oct 22, 2014 at 9:56 AM, Amit.. Gupta. <am...@adobe.com> wrote:
>>... isn't there another choice besides building our own?
> We are adding api only and allowing different implementations to be supported...

Ok, thanks everybody for the clarifications, I'm ok with adding this API now!

bundles/commons sounds good, we can always open that to committers
form other interested projects if needed.

-Bertrand

Re: [RTC] SLING-4080 - API to capture/measure application-level metrics

Posted by "Amit.. Gupta." <am...@adobe.com>.
>I am sure we could do a simple implementation of the SPI for those
>that don't want to run Metrics.... but we don't need to as the
>proposal stands. It has a null impl built in.
yeah, that's right. It provides a No-Op implementation.

> isn't there another choice besides building our own?
We are adding api only and allowing different implementations to be supported.

>We have Sling commons, which is intended to host stuff that is not tied
>to Sling.
Sure, It can be moved there.

Thanks,
Amit
________________________________________
From: Carsten Ziegeler <cz...@apache.org>
Sent: Tuesday, October 21, 2014 7:17 PM
To: dev@sling.apache.org
Subject: Re: [RTC] SLING-4080 - API to capture/measure application-level metrics

Am 21.10.14 um 15:07 schrieb Ian Boston:

>
> Agreed, imho thats what Amit's proposal does, but it needs to be
> somewhere it can be used. If Oak and Felix dont want to use it, then
> Sling is the right place.
>
We have Sling commons, which is intended to host stuff that is not tied
to Sling.

My initial comment would have been the same as Bertrand, why reinvent?
But I've tried to use Yammer in the past and fell into the incompatible
API changes (and other things). It's a shame that there is no real
library out there which can be used ootb and does not come with the
mentioned problems....

Carsten
--
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org

Re: [RTC] SLING-4080 - API to capture/measure application-level metrics

Posted by Carsten Ziegeler <cz...@apache.org>.
Am 21.10.14 um 15:07 schrieb Ian Boston:

> 
> Agreed, imho thats what Amit's proposal does, but it needs to be
> somewhere it can be used. If Oak and Felix dont want to use it, then
> Sling is the right place.
> 
We have Sling commons, which is intended to host stuff that is not tied
to Sling.

My initial comment would have been the same as Bertrand, why reinvent?
But I've tried to use Yammer in the past and fell into the incompatible
API changes (and other things). It's a shame that there is no real
library out there which can be used ootb and does not come with the
mentioned problems....

Carsten
-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org

Re: [RTC] SLING-4080 - API to capture/measure application-level metrics

Posted by Felix Meschberger <fm...@adobe.com>.
Hi

I am +1 to have a common and easy to use (read deploy) metrics API.

>> 
>>>> ...Also, as Ian says we need metrics all the way down to the Oak level,..
>> 
>>> .. Or putting this simple API somewhere it can be used by both projects ?..
>> 
>> Ok, if we create a simple OSGi-friendly metrics library that's shared
>> between Sling, Oak and maybe Felix (as those communities overlap) that
>> would be much better that just doing it in our own corner.
> 
> Agreed, imho thats what Amit's proposal does, but it needs to be
> somewhere it can be used. If Oak and Felix dont want to use it, then
> Sling is the right place.

Well, I am sure Felix could host it as well and we would thus make sure it is properly OSGi-fied. Yet, Oak unfortunately has non-OSGi use cases and deployments as well, so care would have to be taken to support OSGi but to also support non-OSGi.

Thinking of common use and need, there is one place at Apache, which would be a primary „taker“: Apache Commons …

Regards
Felix

Re: [RTC] SLING-4080 - API to capture/measure application-level metrics

Posted by Ian Boston <ie...@tfd.co.uk>.
On 21 October 2014 13:35, Bertrand Delacretaz <bd...@apache.org> wrote:
> Hi,
>
> On Tue, Oct 21, 2014 at 1:04 PM, Ian Boston <ie...@tfd.co.uk> wrote:
>> ...Yammer metrics went through some breaking API changes between 3.0 and
>> 3.1. It wasnt designed for OSGi and it is debatable if those changes
>> conform to an OSGi notion of semantic versioning...
>
>> ...One reason for the SPI is that Yammer Metrics uses
>> sun.misc.Unsafe and does implements a 64bit Stripe class that bind to
>> the Sun JDK. There are pointers to what needs to be done OpenJDK...

actually I think the pointer is commented out code to make it work in OpenJDK.

>
> Ok, given those two points I'm ok with not using Yammer Metrics -

The SPI implementation should obviously live in its own bundle so that
no one feels forced to use Yammer Metrics.

> isn't there another choice besides building our own?

100s (probably). Its a bit like logging. Everyone writes their own
initially, until they have to deal with real usage. A large proportion
are unsupported, left to fester on GitHub. Some come from commercial
organisations. Some are based on proprietary output protocols and some
on standards. If you want to do a proper asesment of Yammer Metrics
start at [1]. Its also worth looking at [2]. I haven found a list of
libs in the past.

I am sure we could do a simple implementation of the SPI for those
that don't want to run Metrics.... but we don't need to as the
proposal stands. It has a null impl built in.


1 https://dropwizard.github.io/metrics/3.1.0/about/
2 http://pivotallabs.com/139-metrics-metrics-everywhere/

>
>>> ...Also, as Ian says we need metrics all the way down to the Oak level,..
>
>>.. Or putting this simple API somewhere it can be used by both projects ?..
>
> Ok, if we create a simple OSGi-friendly metrics library that's shared
> between Sling, Oak and maybe Felix (as those communities overlap) that
> would be much better that just doing it in our own corner.

Agreed, imho thats what Amit's proposal does, but it needs to be
somewhere it can be used. If Oak and Felix dont want to use it, then
Sling is the right place.

Best Regards
Ian


>
> -Bertrand

Re: [RTC] SLING-4080 - API to capture/measure application-level metrics

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi,

On Tue, Oct 21, 2014 at 1:04 PM, Ian Boston <ie...@tfd.co.uk> wrote:
> ...Yammer metrics went through some breaking API changes between 3.0 and
> 3.1. It wasnt designed for OSGi and it is debatable if those changes
> conform to an OSGi notion of semantic versioning...

> ...One reason for the SPI is that Yammer Metrics uses
> sun.misc.Unsafe and does implements a 64bit Stripe class that bind to
> the Sun JDK. There are pointers to what needs to be done OpenJDK...

Ok, given those two points I'm ok with not using Yammer Metrics -
isn't there another choice besides building our own?

>> ...Also, as Ian says we need metrics all the way down to the Oak level,..

>.. Or putting this simple API somewhere it can be used by both projects ?..

Ok, if we create a simple OSGi-friendly metrics library that's shared
between Sling, Oak and maybe Felix (as those communities overlap) that
would be much better that just doing it in our own corner.

-Bertrand

Re: [RTC] SLING-4080 - API to capture/measure application-level metrics

Posted by Ian Boston <ie...@tfd.co.uk>.
On 21 October 2014 11:40, Bertrand Delacretaz <bd...@apache.org> wrote:
> Hi Amit,
>
> On Tue, Oct 21, 2014 at 11:49 AM, Amit.. Gupta. <am...@adobe.com> wrote:
>> ...I would like to add API to capture application-level metrics. The api
>> is inspired by Yammer Metrics [0]...
>
> I'll repeat my SLING-4080 comments: why reinvent this here?

Yammer metrics went through some breaking API changes between 3.0 and
3.1. It wasnt designed for OSGi and it is debatable if those changes
conform to an OSGi notion of semantic versioning.

I may have prompted Amit to pursue the shim API as I had to
re-instrument everywhere upgrading between 3.0 and 3.1 which was real
pain. I think the shim API eliminates that issue.

>
> I'm not against that if you can provide compelling reasons, but the
> Sling codebase is big enough that we should try to keep it focused on
> Sling's "core business", and I don't think metrics are part of that.

Agreed, we must not re-implement Yammer Metrics (or any other metrics
impl), there is some serious production experience deep inside that
jar. One reason for the SPI is that Yammer Metrics uses
sun.misc.Unsafe and does implements a 64bit Stripe class that bind to
the Sun JDK. There are pointers to what needs to be done OpenJDK.

>
> Also, as Ian says we need metrics all the way down to the Oak level,
> so the effort might be better invested in making the necessary
> adaptions to use a good metrics library inside both projects.

Or putting this simple API somewhere it can be used by both projects ?

Best Regards
Ian

>
> -Bertrand

Re: [RTC] SLING-4080 - API to capture/measure application-level metrics

Posted by Antonio Sanso <as...@adobe.com>.
On Oct 21, 2014, at 12:40 PM, Bertrand Delacretaz <bd...@apache.org> wrote:

> Hi Amit,
> 
> On Tue, Oct 21, 2014 at 11:49 AM, Amit.. Gupta. <am...@adobe.com> wrote:
>> ...I would like to add API to capture application-level metrics. The api
>> is inspired by Yammer Metrics [0]...
> 
> I'll repeat my SLING-4080 comments: why reinvent this here?
> 
> I'm not against that if you can provide compelling reasons, but the
> Sling codebase is big enough that we should try to keep it focused on
> Sling's "core business", and I don't think metrics are part of that.
+1

regards

antonio

> 
> Also, as Ian says we need metrics all the way down to the Oak level,
> so the effort might be better invested in making the necessary
> adaptions to use a good metrics library inside both projects.
> 
> -Bertrand


Re: [RTC] SLING-4080 - API to capture/measure application-level metrics

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi Amit,

On Tue, Oct 21, 2014 at 11:49 AM, Amit.. Gupta. <am...@adobe.com> wrote:
> ...I would like to add API to capture application-level metrics. The api
> is inspired by Yammer Metrics [0]...

I'll repeat my SLING-4080 comments: why reinvent this here?

I'm not against that if you can provide compelling reasons, but the
Sling codebase is big enough that we should try to keep it focused on
Sling's "core business", and I don't think metrics are part of that.

Also, as Ian says we need metrics all the way down to the Oak level,
so the effort might be better invested in making the necessary
adaptions to use a good metrics library inside both projects.

-Bertrand

Re: [RTC] SLING-4080 - API to capture/measure application-level metrics

Posted by Ian Boston <ie...@tfd.co.uk>.
Hi,
I have used Yammer Metrics upstream with Sling and found it useful,
allowing me to run tests and get very low level detailed stats at
minimal effort. Yammer Metrics was wrapped in a similar but less
extensible way. I used the json feed since I was able to automate
collection and graphing. Instrumenting the code was relatively quick
and easy. We did some application code and a customised version of
MongoMK. The JMX integration is easy to use, although I didnt use it
to collect stats as there were too many. I have used the Ganglia
integration which works OOTB with 1 or 2 glue classes. The data out
reported times well below the ms range and I didn't notice any
overhead with a few 100 probes. There are some talks from the creators
of Yammer Metrics that report using 1000s of probes in production
code, so I guess that is its intended use.

Two observations:

Having this in Sling should really help Sling instrument, but (imho)
it would also be really useful to have this type of metrics inside Oak
and Jackrabbit, otherwise we will find ourselves forking Oak and JR
releases to get below those APIs. (in my case, we had no option).
Would this be possible ?

Having a working implementation of the SPI based on Yammer Metrics
would make it useful. Without that it allows Sling to instrument, but
not to really gather knowledge on how Sling performs in the wild.

best regards
Ian

(short version, +1)



On 21 October 2014 10:49, Amit.. Gupta. <am...@adobe.com> wrote:
> Hi Devs,
>
>
> I would like to add API to capture application-level metrics. The api is inspired by Yammer Metrics [0]. A first cut implementation is available at [1]
>
>
> Idea is to provide high level constructs such as Timer, Counter, Gauge, which can be used by applications. This RTC is only for api, plan is to also provide a metrics based implementation as well.
>
>
> Driver for this api, is to provide easy to use first class constructs that can be quickly integrated into new and existing application.
>
>
> Metrics [0] one of the widely used implementation and provide some OOTB integration with JMX and popular monitoring tools such as Ganglia, Graphite.
>
>
> Thanks,
>
> Amit
>
> [0] https://dropwizard.github.io/metrics/3.1.0/?
>
> [1] https://svn.apache.org/repos/asf/sling/whiteboard/amitgupt/monitoring/
>
> [2] https://issues.apache.org/jira/browse/SLING-4080?