DEV Community

Alex Spinov
Alex Spinov

Posted on

Envoy Proxy Has a Free API — The L7 Proxy Behind Istio, AWS, and Cloudflare

Envoy is the high-performance L7 proxy that powers Istio, AWS App Mesh, Cloudflare, and Lyft. It provides advanced load balancing, observability, and traffic management through a powerful admin API.

Free, open source, CNCF graduated. The backbone of modern service meshes.

Why Use Envoy?

  • L7 protocol support — HTTP/2, gRPC, WebSocket, MongoDB, Redis, Kafka
  • Advanced load balancing — least request, ring hash, random, zone-aware
  • Dynamic configuration — update routing without restarts via xDS API
  • Built-in observability — distributed tracing, detailed metrics, access logging
  • Hot restart — zero-downtime config updates

Quick Setup

1. Run Envoy

# Docker
docker run -d -p 10000:10000 -p 9901:9901 envoyproxy/envoy:v1.30-latest

# The admin interface runs on port 9901
Enter fullscreen mode Exit fullscreen mode

2. Admin API

ENVOY="http://localhost:9901"

# Server info
curl -s "$ENVOY/server_info" | jq '{version: .version, uptime: .uptime_current_epoch, state: .state}'

# All stats
curl -s "$ENVOY/stats?format=json" | jq '.stats[] | select(.name | contains("http")) | {name: .name, value: .value}' | head -20

# Cluster health
curl -s "$ENVOY/clusters" | head -30

# Listener info
curl -s "$ENVOY/listeners?format=json" | jq

# Config dump
curl -s "$ENVOY/config_dump" | jq '.configs | length'

# Ready check
curl -s "$ENVOY/ready"
Enter fullscreen mode Exit fullscreen mode

3. Prometheus Metrics

curl -s "$ENVOY/stats/prometheus" | grep envoy_http_downstream_rq | head -10
Enter fullscreen mode Exit fullscreen mode

4. Dynamic Configuration (xDS)

# Envoy can receive config updates via gRPC (xDS protocol)
# This is how Istio configures Envoy sidecars

# Check current routes
curl -s "$ENVOY/config_dump?resource=dynamic_route_configs" | jq

# Check current clusters
curl -s "$ENVOY/config_dump?resource=dynamic_active_clusters" | jq
Enter fullscreen mode Exit fullscreen mode

Python Example

import requests

ENVOY_ADMIN = "http://localhost:9901"

# Server info
info = requests.get(f"{ENVOY_ADMIN}/server_info").json()
print(f"Version: {info['version']} | Uptime: {info['uptime_current_epoch']}")

# Key metrics
stats = requests.get(f"{ENVOY_ADMIN}/stats?format=json").json()
for s in stats['stats']:
    if 'downstream_rq' in s['name']:
        print(f"{s['name']}: {s['value']}")

# Cluster health
clusters = requests.get(f"{ENVOY_ADMIN}/clusters?format=json").json()
for cluster in clusters.get('cluster_statuses', []):
    name = cluster['name']
    healthy = sum(1 for h in cluster.get('host_statuses', []) if h['health_status']['eds_health_status'] == 'HEALTHY')
    total = len(cluster.get('host_statuses', []))
    print(f"Cluster: {name} | Healthy: {healthy}/{total}")
Enter fullscreen mode Exit fullscreen mode

Key Admin Endpoints

Endpoint Description
/server_info Version and uptime
/stats All metrics (JSON/Prometheus)
/clusters Upstream cluster health
/listeners Listener configuration
/config_dump Full configuration
/ready Readiness check
/logging Get/set log levels
/drain_listeners Graceful shutdown
/hot_restart_version Hot restart info

Need custom data extraction or scraping solution? I build production-grade scrapers for any website. Email: Spinov001@gmail.com | My Apify Actors

Top comments (0)