Class AbstractMetricsMiddleware
java.lang.Object
com.networknt.aws.lambda.handler.middleware.metrics.AbstractMetricsMiddleware
- All Implemented Interfaces:
LambdaHandler,MiddlewareHandler
- Direct Known Subclasses:
APMMetricsMiddleware,InfluxMetricsMiddleware
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic com.networknt.metrics.MetricsConfigstatic final io.dropwizard.metrics.MetricRegistryFields inherited from interface com.networknt.aws.lambda.handler.LambdaHandler
DISABLED_LAMBDA_HANDLER_RETURN, SUCCESS_LAMBDA_HANDLER_RETURN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateJVMMetricsReporter(com.networknt.metrics.TimeSeriesDbSender sender) voidvoidinjectMetrics(LightLambdaExchange exchange, long startTime, String metricsName, String endpoint) This is the method that is used for all other handlers to inject its metrics info to the real metrics handler impl.booleanIndicate if this handler is enabled or not.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.networknt.aws.lambda.handler.LambdaHandler
disabledMiddlewareStatus, execute, isAsynchronous, isResponseMiddleware, register, reload, successMiddlewareStatusMethods inherited from interface com.networknt.aws.lambda.handler.MiddlewareHandler
getCachedConfigurations, isAudited, isContinueOnFailure
-
Field Details
-
config
public static com.networknt.metrics.MetricsConfig config -
registry
public static final io.dropwizard.metrics.MetricRegistry registry -
commonTags
-
-
Constructor Details
-
AbstractMetricsMiddleware
public AbstractMetricsMiddleware()
-
-
Method Details
-
isEnabled
public boolean isEnabled()Description copied from interface:LambdaHandlerIndicate if this handler is enabled or not.- Specified by:
isEnabledin interfaceLambdaHandler- Returns:
- boolean true if enabled
-
createJVMMetricsReporter
public void createJVMMetricsReporter(com.networknt.metrics.TimeSeriesDbSender sender) -
incCounterForStatusCode
-
injectMetrics
public void injectMetrics(LightLambdaExchange exchange, long startTime, String metricsName, String endpoint) This is the method that is used for all other handlers to inject its metrics info to the real metrics handler impl.- Parameters:
exchange- the LightLambdaExchange that is used to get the auditInfo to collect the metrics tag.startTime- the start time passed in to calculate the response time.metricsName- the name of the metrics that is collected.endpoint- the endpoint that is used to collect the metrics. It is optional and only provided by the external handlers.
-