Skip to main content


Send APISIX metrics and traces to Levitate using Prometheus Remote Write and Opentelemetry


This document will showcase how to send metrics and traces from Apache APISIX to Levitate.


  1. You have created a Levitate cluster by following the getting started guide
  2. You have Apache APISIX set up and running.

Setup Metrics

Apache APISIX Metrics to Levitate

Enable Prometheus Plugin in APISIX

The APISIX Prometheus Plugin exports metrics in Prometheus exposition format. It can be enabled with following configuration.

export_uri: /apisix/prometheus/metrics

The exposed metrics can now be fetched as follows:

curl -i

Follow the official documentation for more details and configuration options for the Prometheus Plugin here.

Setup Prometheus Agent

Follow this guide to setup Prometheus agent which will remote write metrics to Levitate.

Configure Prometheus Agent to fetch metrics from APISIX

Modify the prometheus.yaml as follows.

- job_name: "apisix"
scrape_interval: 15s # This value will be related to the time range of the rate function in Prometheus QL. The time range in the rate function should be at least twice this value.
metrics_path: "/apisix/prometheus/metrics"
- targets: [""]

The IP Address in the documentation is, which may not be the same in your case. This IP address should ideally be the internal IP address of the instance in which APISIX is running.

Grafana Dashboard

You can import the Grafana dashboard for APISIX from the repo here

Available Metrics

The following metrics are exported by the APISIX:

  • Status code: HTTP status code returned from Upstream services. They are available for a single service and across all services.
  • Bandwidth: Total amount of traffic (ingress and egress) flowing through APISIX. Total bandwidth of a service can also be obtained.
  • etcd reachability: A gauge type representing whether etcd can be reached by APISIX. A value of 1 represents reachable, and 0 represents unreachable.
  • Connections: Nginx connection metrics like active, reading, writing, and number of accepted connections.
  • Batch process entries: A gauge type useful when Plugins like syslog, http-logger, tcp-logger, udp-logger, and zipkin use batch process to send data. Entries that hasn't been sent in batch process will be counted in the metrics.
  • Latency: Histogram of the request time per service in different dimensions.
  • Info: Information about the APISIX node.
  • Shared dict: The capacity and free space of all nginx.shared.DICT in APISIX.
  • apisix_upstream_status: Health check result status of upstream nodes. A value of 1 represents healthy and 0 represents unhealthy.

Detailed information on the exposed metrics and their dimensions can be found here

Setup Traces

The APISIX OpenTelemetry plugin can be used to report tracing data according to the OpenTelemetry specification.

Apache APISIX Traces to Levitate

Enable Opentelemetry Plugin in APISIX

Enable the Opentelemetry plugin as follows:

- opentelemetry
resource: APISIX business_id
address: <leviate_otlp_endpoint>
request_timeout: 3
foo: bar
drop_on_queue_full: false
max_queue_size: 6
batch_timeout: 2
inactive_timeout: 1
max_export_batch_size: 2

You can follow the official documentation on enabling the Opentelemetry plugin here.

This will send traces from APISIX to Levitate with Opentelemetry Specification.


Please get in touch with us on Discord or Email if you have any questions.