Gateway Mode¶
Starting with RBLN Metrics Exporter v0.3.0, a single exporter instance can collect metrics from multiple remote hosts in gateway mode. Gateway mode follows the multi-target exporter pattern provided by Prometheus and is intended for bare-metal or non-Kubernetes environments where deploying an exporter per host is impractical.
| Aspect | local (default) | gateway |
|---|---|---|
| Deployment | One per node (DaemonSet) | One central instance |
| Collection target | rbln-smd on the local node | Remote rbln-smd specified per scrape |
| Target selection | None (own node) | Query parameter ?target=<host:port> |
| Kubernetes pod labels | Provided | Not provided (hardware metrics only) |
Operation¶
When Prometheus scrapes /metrics?target=<host:port> on the gateway, the gateway connects to the target's rbln-smd over gRPC, collects the full set of metrics on demand, and returns them in Prometheus format. The gateway does not retain metric state between requests or maintain a target list. The Prometheus scrape configuration defines the targets. The gateway caches gRPC connections for each target and reconnects automatically if a connection is lost.
Gateway Startup¶
The exporter runs in one of two execution modes, selected at startup with the --mode flag or the RBLN_METRICS_EXPORTER_MODE environment variable.
Prometheus Scrape Configuration¶
List the NPU host addresses under targets. Use relabel_configs to pass each address as the target query parameter and direct HTTP requests to the gateway.
With this configuration, Prometheus sends a scrape request to the gateway for each host. For example, it scrapes http://rbln-gateway:9200/metrics?target=npu-host-1:50051 for npu-host-1 and stores the returned series with the instance="npu-host-1:50051" label.
Scrape timeout
The gateway collects metrics during each scrape request, so slow responses from target hosts increase collection time. The gateway honors the timeout in the X-Prometheus-Scrape-Timeout-Seconds header sent by Prometheus. Increase Prometheus's scrape_timeout if collection needs more time.