Skip to main content
Version: 2.0

APM Gateway

Service: apm-gateway · Port: 8101

apm-gateway serves application performance data: how many requests each service handles, how fast, and how many fail — per service and per endpoint. It runs PromQL against Prometheus and returns structured JSON, so the dashboard, agents and scripts don't need to know PromQL. It stores nothing itself.

What it answers​

QuestionEndpointPromQL
How busy is each service?/api/v1/services/metricssum by (app, namespace) (rate(http_requests_total[5m]))
Which endpoints are slowest?/api/v1/endpoints/slowesttopk(10, histogram_quantile(0.99, sum by (le, handler, method) (rate(http_request_duration_seconds_bucket[5m]))))
Which endpoints fail most?/api/v1/endpoints/erroringtopk(10, sum by (handler, method) (rate(http_requests_total{status=~"5.."}[5m])))

Metric labels​

apm-gateway expects the standard labels used by Prometheus client libraries:

LabelMeaning
app or serviceThe workload.
namespaceThe Kubernetes namespace.
handlerThe route or endpoint.
methodThe HTTP method.
statusThe HTTP status code.

Using a service mesh or a framework with different label names? Map them in configuration — for example, for Istio:

APM_LABEL_MAP: "app=destination_service_name,status=response_code,handler=request_operation"
APM_REQUESTS_METRIC: "istio_requests_total"
APM_DURATION_METRIC: "istio_request_duration_milliseconds_bucket"

REST API​

MethodPathDescription
GET/api/v1/services/metricsRequest rate, p50/p95/p99 latency and error rate per service (?namespace=).
GET/api/v1/services/{service}/timeseriesA service's metrics over time (?from=&to=&step=).
GET/api/v1/endpoints/slowestThe ten slowest endpoints by p99 latency.
GET/api/v1/endpoints/erroringThe ten endpoints with the most 5xx errors.
POST/api/v1/queryRun a PromQL query (used by the Optimizer and troubleshooter).
GET/healthzHealth check.

Tenant users see only their own services.

Configuration​

VariableDefaultDescription
PROMETHEUS_URLhttp://kube-prometheus-stack-prometheus.monitoring:9090Prometheus.
APM_LABEL_MAP—Label name mappings (standard=yours, comma-separated).
APM_REQUESTS_METRIChttp_requests_totalRequest counter metric.
APM_DURATION_METRIChttp_request_duration_seconds_bucketLatency histogram metric.
AUTH_JWT_ACCESS_SECRET—Validates tokens.
PORT8101HTTP port.