Metrics

Reference table and example use cases for metrics based engagement rules.

The following are some of the example use cases for metrics based engagement rules:

  • Notify if the execution errors increase when compared to previous intervals.
  • Trigger an alert if the average API response time exceeds 4s.
  • Trigger an alert if the average backend response time exceeds 3s.

The following table shows the list of fields available for the metrics record. These fields are used as filters in the Rule definition list and you can select an option based on the data that is used to trigger the rule.

Table 1. Metrics record fields
Field name Type Description
apiMetrics Array Metrics grouped per API.
apiMetrics.apiId String The API identifier.
apiMetrics.metrics Object Overall metrics across all responses for this API.
apiMetrics.metrics.averageBackendResponseTime Number Average time spent by the backend service.
apiMetrics.metrics.averageLatency Number The average latency between the gateway receiving the request and sending the response back to the client.
apiMetrics.metrics.averageResponseTime Number Average time spent by the request.
apiMetrics.metrics.transactionCount Number API calls recorded in this interval.
apiMetrics.metricsPerStatusCodeType Object Breakdown of the same metrics per HTTP status code class.
id String A unique identifier for this specific metrics event.
metricsPerStatusCodeType Object Breakdown of the metrics per HTTP status code class.
runtimeId String A unique identifier for the running process.
runtimeMetric.execution_errors Number Number of errors that occurred during API execution.
runtimeMetrics Object Metrics aggregated at the runtime.
runtimeMetrics.average_latency Number Average latency across all API calls.
runtimeMetrics.average_response_time Number Average total response time of the request.
runtimeMetrics.component_errors Number Number of component-level errors.
runtimeMetrics.total_apicalls Number Total number of API calls