Skip to content

Gateway Metrics

This guide explains how to implement and configure metrics collection for the API Platform Gateway components.

Overview

The default metrics services included in the Docker Compose configuration are demonstration services designed to showcase how you can observe component metrics in a centralized setup. These services provide a reference implementation that you can use out-of-the-box for development, testing, or as a starting point for your production metrics strategy.

Important: You are free to choose any metrics or observability strategy that suits your environment and requirements. The provided setup is just one of many possible configurations.

Metrics Architecture

The default metrics stack consists of:

  • Prometheus: Scrapes, stores, and queries metrics from gateway components
  • Grafana: Visualizes metrics through dashboards with alerts and notifications

How It Works

  1. Gateway components (gateway-controller, policy-engine, router) expose metrics via Prometheus HTTP endpoints
  2. Prometheus scrapes these endpoints at regular intervals (default: 15s)
  3. Metrics are stored in Prometheus's time-series database
  4. Grafana queries Prometheus to visualize metrics through pre-built dashboards
  5. Users can view real-time metrics, historical trends, and set up alerts

What are Metrics?

Metrics are numerical measurements tracked over time:

  • Counters: Cumulative values that only increase (e.g., total requests, total errors)
  • Gauges: Current values that can go up or down (e.g., active connections, memory usage)
  • Histograms: Sample observations with configurable buckets (e.g., request duration)

In This Section

Additional Resources