Skip to main content

Version: 3.2.16.4.1

Monitor API Metrics

import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';

API7 Gateway supports exposing a comprehensive set of metrics to the monitoring system with minimal delay, facilitating ongoing monitoring and diagnostics.

API7 Gateway's monitoring and alerting framework is built on Prometheus, a widely used system monitoring and alerting toolkit. Prometheus gathers and stores multidimensional time series data, including metrics annotated with key-value labels.

This guide explains how to enable the Prometheus plugin to integrate with the monitoring system, allowing you to collect and visualize HTTP metrics.

Prerequisites

  1. Install API7 Enterprise.
  2. Have a running API on the gateway group.

Monitor All Services

It is recommended to enable the prometheus plugin as a global rule. This ensures that all services and routes are consistently monitored and tracked.

<Tabs groupId="api" defaultValue="dashboard" values={[ {label: 'Dashboard', value: 'dashboard'}, {label: 'ADC', value: 'adc'}, {label: 'Ingress Controller', value: 'ingress'} ]}>

  1. Select Plugin Settings of your gateway group from the side navigation bar.
  2. Select the Plugin Global Rules tab, then click Enable Plugin.
  3. Search for the prometheus plugin, then click Enable.
  4. In the dialog box that appeared, click Enable, no extra configuration needed.
  5. Make some API calls to test the monitoring.
  6. Select Monitoring from the side navigation bar to view the metrics.

To use ADC to enable monitoring, create the following configuration:

adc.yaml
global_rules:
prometheus:
_meta:
disable: false

Synchronize the configuration to API7 Gateway:

adc sync -f adc.yaml
note

ADC uses the configuration files as the single source of truth. Make sure to pass all configuration files to the adc sync command using the -f flag.

In the API7 Enterprise Dashboard, select Monitoring from the side navigation bar to view the metrics.

Create a manifest file to enable the Prometheus plugin globally for all routes:

global-observability.yaml
apiVersion: apisix.apache.org/v2
kind: ApisixGlobalRule
metadata:
name: global-observability
# namespace: api7 # replace with your namespace
spec:
monitoring:
prometheus:
enable: true

Apply the configuration to your cluster:

kubectl apply -f global-observability.yaml

In the API7 Enterprise Dashboard, select Monitoring from the side navigation bar to view the metrics.

API7.ai Logo

The digital world is connected by APIs,
API7.ai exists to make APIs more efficient, reliable, and secure.

Sign up for API7 newsletter

Product

API7 Gateway

SOC2 Type IIISO 27001HIPAAGDPRRed Herring

Copyright © APISEVEN PTE. LTD 2019 – 2025. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the Apache Software Foundation