Netflix / servo

Netflix Application Monitoring Library
Apache License 2.0
1.42k stars 297 forks source link

What is the best way to shim Servo-enabled Metrics / Monitoring into Karyon #150

Closed robertjchristian closed 11 years ago

robertjchristian commented 11 years ago

For example, suppose before HelloWorldResource is encounted at Runtime in Karyon, a filter containing (ie) https://github.com/Netflix/servo/blob/master/servo-core/src/main/java/com/netflix/servo/examples/JvmMetricExample.java is run to keep track of all bytes in/out, etc for all Resources.

Basically we want to say "HelloWorldResource is your stub, and you get metrics and monitoring for free..."

Thanks

brharrington commented 11 years ago

I forwarded your question to Nitesh who does more with Karyon.

Internally there are some metrics that come for free, but there are also some controls to allow for customization. For example to avoid metrics bloat we may only want metrics indicating the behavior of /api/foo as an aggregate and not /api/foo/${id}. I assume this is similar with the open source version, but Nitesh could give you a better answer.

robertjchristian commented 11 years ago

"Internally there are some metrics that come for free" ----> I want to hook specifically into this and extend it to add a few more freebies (ie number connections, high water marks, bytes in/out, etc). Please point me in the right direction. Thanks.

On Tue, Apr 16, 2013 at 10:59 AM, brharrington notifications@github.comwrote:

I forwarded your question to Nitesh who does more with Karyon.

Internally there are some metrics that come for free, but there are also some controls to allow for customization. For example to avoid metrics bloat we may only want metrics indicating the behavior of /api/foo as an aggregate and not /api/foo/${id}. I assume this is similar with the open source version, but Nitesh could give you a better answer.

— Reply to this email directly or view it on GitHubhttps://github.com/Netflix/servo/issues/150#issuecomment-16460946 .

NiteshKant commented 11 years ago

Karyon does not really support the runtime aspects of service development as yet. So, it does not clearly provide any hooks or metrics related to service invocations. If you wish to do so, you would typically use a servlet filter to intercept the requests and provide the metrics you want.

robertjchristian commented 11 years ago

Interesting. Okay, thanks.

On Tue, Apr 16, 2013 at 12:01 PM, Nitesh Kant notifications@github.comwrote:

Karyon does not really support the runtime aspects of service development as yet. So, it does not clearly provide any hooks or metrics related to service invocations. If you wish to do so, you would typically use a servlet filter to intercept the requests and provide the metrics you want.

— Reply to this email directly or view it on GitHubhttps://github.com/Netflix/servo/issues/150#issuecomment-16464895 .

cfregly commented 11 years ago

+1 for this feature being added to karyon, Nitesh.

I understand the metrics-bloat argument, but it would be nice to enable/disable these metrics at the karyon level.

perhaps I can pick this task up. I'll work with you offline, Nitesh.

@robert: my fluxcapacitor project (https://github.com/cfregly/fluxcapacitor) explicitly adds these metrics directly into the edge and middletier service methods.

thanks!

-Chris

On Apr 16, 2013, at 12:18 PM, Robert Christian notifications@github.com wrote:

Interesting. Okay, thanks.

On Tue, Apr 16, 2013 at 12:01 PM, Nitesh Kant notifications@github.comwrote:

Karyon does not really support the runtime aspects of service development as yet. So, it does not clearly provide any hooks or metrics related to service invocations. If you wish to do so, you would typically use a servlet filter to intercept the requests and provide the metrics you want.

— Reply to this email directly or view it on GitHubhttps://github.com/Netflix/servo/issues/150#issuecomment-16464895 .

— Reply to this email directly or view it on GitHub.

robertjchristian commented 11 years ago

Thanks Chris. By edge do you mean class where the endpoint (jersey) is defined? I have it there in my project as well. But unfortunately that's part of the domain implementation and not the framework. (IE an individual service implementation can more easily modify core/standard metrics)

On Tue, Apr 16, 2013 at 12:31 PM, Chris Fregly notifications@github.comwrote:

+1 for this feature being added to karyon, Nitesh.

I understand the metrics-bloat argument, but it would be nice to enable/disable these metrics at the karyon level.

perhaps I can pick this task up. I'll work with you offline, Nitesh.

@robert: my fluxcapacitor project ( https://github.com/cfregly/fluxcapacitor) explicitly adds these metrics directly into the edge and middletier service methods.

thanks!

-Chris

On Apr 16, 2013, at 12:18 PM, Robert Christian notifications@github.com wrote:

Interesting. Okay, thanks.

On Tue, Apr 16, 2013 at 12:01 PM, Nitesh Kant notifications@github.comwrote:

Karyon does not really support the runtime aspects of service development as yet. So, it does not clearly provide any hooks or metrics related to service invocations. If you wish to do so, you would typically use a servlet filter to intercept the requests and provide the metrics you want.

— Reply to this email directly or view it on GitHub< https://github.com/Netflix/servo/issues/150#issuecomment-16464895> .

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/Netflix/servo/issues/150#issuecomment-16466569 .

cfregly commented 11 years ago

correct - they are domain classes and not karyon framework classes, unfortunately.

to be clear for others that may be following, the 2 domain classes that we're talking about are as follows

https://github.com/cfregly/fluxcapacitor/blob/master/flux-edge/src/main/java/com/fluxcapacitor/edge/jersey/resources/EdgeResource.java https://github.com/cfregly/fluxcapacitor/blob/master/flux-middletier/src/main/java/com/fluxcapacitor/middletier/jersey/resources/MiddleTierResource.java

these track request-level metrics that would best be replaced by a karyon servlet filter.

I'll create an issue under the karyon project for traceability. at minimum, it would be nice to have a standard karyon-framework-level servlet filter that we can use.

i'm pretty sure this is on the roadmap as this servlet-filter is used heavily at Netflix under the name NFFilter. Nitesh may have more info on the timeline of the open source release.

good catch, Robert!

-Chris

On Apr 16, 2013, at 12:40 PM, Robert Christian notifications@github.com wrote:

Thanks Chris. By edge do you mean class where the endpoint (jersey) is defined? I have it there in my project as well. But unfortunately that's part of the domain implementation and not the framework. (IE an individual service implementation can more easily modify core/standard metrics)

On Tue, Apr 16, 2013 at 12:31 PM, Chris Fregly notifications@github.comwrote:

+1 for this feature being added to karyon, Nitesh.

I understand the metrics-bloat argument, but it would be nice to enable/disable these metrics at the karyon level.

perhaps I can pick this task up. I'll work with you offline, Nitesh.

@robert: my fluxcapacitor project ( https://github.com/cfregly/fluxcapacitor) explicitly adds these metrics directly into the edge and middletier service methods.

thanks!

-Chris

On Apr 16, 2013, at 12:18 PM, Robert Christian notifications@github.com wrote:

Interesting. Okay, thanks.

On Tue, Apr 16, 2013 at 12:01 PM, Nitesh Kant notifications@github.comwrote:

Karyon does not really support the runtime aspects of service development as yet. So, it does not clearly provide any hooks or metrics related to service invocations. If you wish to do so, you would typically use a servlet filter to intercept the requests and provide the metrics you want.

— Reply to this email directly or view it on GitHub< https://github.com/Netflix/servo/issues/150#issuecomment-16464895> .

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub< https://github.com/Netflix/servo/issues/150#issuecomment-16466569> .

— Reply to this email directly or view it on GitHubhttps://github.com/Netflix/servo/issues/150#issuecomment-16467032 .

dmuino commented 11 years ago

I closed this since this is not a Servo specific issue.