Class InstrumentedProxy

java.lang.Object
com.netflix.spinnaker.kork.telemetry.InstrumentedProxy
All Implemented Interfaces:
InvocationHandler

public class InstrumentedProxy extends Object implements InvocationHandler
Adds automatic instrumentation to a target object's method invocations.

Two metrics will be recorded for any target: timing and invocations, with an additional tag for "success", having either the value "success" or "failure".

Instrumented methods will be generated at proxy creation time, each associated with a metric name following a pattern of "{namespace}.{method}.{metricName}", where "{metricName}" is either "timing" or "invocations". The namespace is provided at creation time, and is typically unique per target. The "method" is automatically generated, using the method name and parameter count of the method.

Instrumented methods can be customized slightly via the Metered annotation:

- A method can be ignored, causing no metrics to be collected on it. - Provided a custom metric name, in case auto naming produces naming conflicts. - A list of tags added to the metrics.

  • Constructor Details

    • InstrumentedProxy

      public InstrumentedProxy(com.netflix.spectator.api.Registry registry, Object target, String metricNamespace)
    • InstrumentedProxy

      public InstrumentedProxy(com.netflix.spectator.api.Registry registry, Object target, String metricNamespace, Map<String,String> tags)
  • Method Details