APISIX monitoring

APISIX performance from apisix prometheus plugin

SkyWalking leverages OpenTelemetry Collector to transfer the metrics to OpenTelemetry receiver and into the Meter System.

Data flow

  1. APISIX Prometheus plugin collects metrics data from APSIX.
  2. OpenTelemetry Collector fetches metrics from APISIX Prometheus plugin via Prometheus Receiver and pushes metrics to SkyWalking OAP Server via the OpenCensus gRPC Exporter or OpenTelemetry gRPC exporter.
  3. The SkyWalking OAP Server parses the expression with MAL to filter/calculate/aggregate and store the results.

Set up

  1. Enable APISIX APISIX Prometheus plugin .
  2. Set up OpenTelemetry Collector . For details on Prometheus Receiver in OpenTelemetry Collector, refer to here.
  3. Config SkyWalking OpenTelemetry receiver.

APISIX Monitoring

APISIX prometheus plugin provide multiple dimensions metrics for APISIX server , upstream , route , etc. Accordingly, SkyWalking observes the status, payload, and latency of the APISIX server, which is cataloged as a LAYER: APISIX Service in the OAP. Meanwhile, the instances would be recognized as LAYER: APISIX instances. The route rules and nodes would be recognized as endpoints with route/ and upstream/ prefixes.

Specify SkyWalking Service name

SkyWalking expects OTEL Collector attribute skywalking_service to be the Service name.

Make sure skywalking_service attribute exists through static_configs of OTEL Prometheus scape config.

receivers:
  prometheus:
    config: 
     scrape_configs:
       - job_name: 'apisix-monitoring' 
         static_configs:
           - targets: ['apisix:9091']
             labels:
               skywalking_service: exmple_service_name  # Specify SkyWalking Service name              

You also could leverage OTEL Collector processor to add skywalking_service attribute , as following :

processors:
  resource/skywalking-service:
    attributes:
    - key: skywalking_service   
      value: exmple_service_name # Specify Skywalking Service name 
      action: insert                     

Notice , if you don't specify skywalking_service attribute, SkyWalking OAP would use APISIX as the default service name

Supported Metrics

Monitoring PanelUnitMetric NameCatalogDescriptionData Source
HTTP statusmeter_apisix_sv_http_statusServiceThe increment rate of the status of HTTP requestsAPISIX Prometheus plugin
HTTP latencymeter_apisix_sv_http_latencyServiceThe increment rate of the latency of HTTP requestsAPISIX Prometheus plugin
HTTP bandwidthKBmeter_apisix_sv_bandwidthServiceThe increment rate of the bandwidth of HTTP requestsAPISIX Prometheus plugin
HTTP status of non-matched requestsmeter_apisix_sv_http_statusServiceThe increment rate of the status of HTTP requests, which don't match any routeAPISIX Prometheus plugin
HTTP latency non-matched requestsmeter_apisix_sv_http_latencyServiceThe increment rate of the latency of HTTP requests, which don't match any routeAPISIX Prometheus plugin
HTTP bandwidth non-matched requestsKBmeter_apisix_sv_bandwidthServiceThe increment rate of the bandwidth of HTTP requests ,which don't match any routeAPISIX Prometheus plugin
HTTP connectionmeter_apisix_sv_http_connectionsServiceThe avg number of the connectionsAPISIX Prometheus plugin
HTTP Request Trendmeter_apisix_http_requestsServiceThe increment rate of HTTP requestsAPISIX Prometheus plugin
HTTP statusmeter_apisix_instance_http_statusInstanceThe increment rate of the status of HTTP requestsAPISIX Prometheus plugin
HTTP latencymeter_apisix_instance_http_latencyInstanceThe increment rate of the latency of HTTP requestsAPISIX Prometheus plugin
HTTP bandwidthKBmeter_apisix_instance_bandwidthInstanceThe increment rate of the bandwidth of HTTP requestsAPISIX Prometheus plugin
HTTP status of non-matched requestsmeter_apisix_instance_http_statusInstanceThe increment rate of the status of HTTP requests, which don't match any routeAPISIX Prometheus plugin
HTTP latency non-matched requestsmeter_apisix_instance_http_latencyInstanceThe increment rate of the latency of HTTP requests, which don't match any routeAPISIX Prometheus plugin
HTTP bandwidth non-matched requestsKBmeter_apisix_instance_bandwidthInstanceThe increment rate of the bandwidth of HTTP requests ,which don't match any routeAPISIX Prometheus plugin
HTTP connectionmeter_apisix_instance_http_connectionsInstanceThe avg number of the connectionsAPISIX Prometheus plugin
HTTP Request Trendmeter_apisix_instance_http_requestsInstanceThe increment rate of HTTP requestsAPISIX Prometheus plugin
Shared dict capacityMBmeter_apisix_instance_shared_dict_capacity_bytesInstanceThe avg capacity of shared dict capacityAPISIX Prometheus plugin
Shared free spaceMBmeter_apisix_instance_shared_dict_free_space_bytesInstanceThe avg free space of shared dict capacityAPISIX Prometheus plugin
etcd indexmeter_apisix_instance_sv_etcd_indexesInstanceetcd modify index for APISIX keysAPISIX Prometheus plugin
etcd latest reachabilitymeter_apisix_instance_sv_etcd_reachableInstanceetcd latest reachable , Refer to APISIX Prometheus pluginAPISIX Prometheus plugin
HTTP statusmeter_apisix_endpoint_node_http_statusEndpointThe increment rate of the status of HTTP requestsAPISIX Prometheus plugin
HTTP latencymeter_apisix_endpoint_node_http_latencyEndpointThe increment rate of the latency of HTTP requestsAPISIX Prometheus plugin
HTTP bandwidthKBmeter_apisix_endpoint_node_bandwidthEndpointThe increment rate of the bandwidth of HTTP requestsAPISIX Prometheus plugin

Customizations

You can customize your own metrics/expression/dashboard panel. The metrics definition and expression rules are found in /config/otel-rules/apisix.yaml. The APISIX dashboard panel configurations are found in /config/ui-initialized-templates/apisix.