Class AbstractMetricsMiddleware

    • Field Detail

      • config

        public static com.networknt.metrics.MetricsConfig config
      • registry

        public static final io.dropwizard.metrics.MetricRegistry registry
    • Constructor Detail

      • AbstractMetricsMiddleware

        public AbstractMetricsMiddleware()
    • Method Detail

      • isEnabled

        public boolean isEnabled()
        Description copied from interface: LambdaHandler
        Indicate if this handler is enabled or not.
        Specified by:
        isEnabled in interface LambdaHandler
        Returns:
        boolean true if enabled
      • createJVMMetricsReporter

        public void createJVMMetricsReporter​(com.networknt.metrics.TimeSeriesDbSender sender)
      • 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.