## Prometheus Metrics for the Wallet Service

The wallet service can expose an HTTP metrics API in Prometheus format. These application-level metrics can be queried with curl, a Prometheus collector, or Grafana dashboards.

> 📘
>
> ### Note:
>
> Metrics are **off by default**. Enable them by setting `telemetry.enable_prom: true` in `wallet.yaml`. When enabled, the metrics server listens on **port 9090** by default (configurable via `telemetry.prom_port`).

The following metrics are exposed when Prometheus is enabled:

| Metric Name | Dimensions | Description |
| --- | --- | --- |
| wallet\_http\_inbound\_request\_total | path, status | Total inbound HTTP requests. |
| wallet\_http\_inbound\_request\_duration\_seconds | path, status | Inbound request duration (histogram; Prometheus exposes _count,_ sum, \_bucket). |
| wallet\_http\_inbound\_client\_ip\_requests\_total | ip\_addr | Inbound requests by client IP. |
| wallet\_http\_outbound\_request\_in\_flight | — | Current number of outbound HTTP requests in flight. |
| wallet\_http\_outbound\_request\_duration\_seconds | — | Outbound request duration (histogram). |
| wallet\_http\_outbound\_request\_total | code, method | Total outbound HTTP requests by response code and method. |
| wallet\_http\_outbound\_request\_dns\_duration\_seconds | event | DNS resolution latency (event: dns\_start, dns\_done). |
| wallet\_http\_outbound\_request\_tls\_duration\_seconds | event | TLS handshake latency (event: tls\_handshake\_start, tls\_handshake\_done). |
| gateway\_listener\_messages\_total | event\_type | Total gateway webhook messages by event type.

In addition, when Prometheus is enabled the registry includes the standard Go and process collectors (e.g. `go_*`, `process_*`).

## Health Status for the Wallet Stack Services

To maintain smooth operations, each service within the deployment provides a `/health` endpoint. This endpoint is responsible for indicating the health status of the service through HTTP status codes. Follow the steps outlined below to ensure the reliability of the system.

### 1. Enable Micro-Service Health Monitoring

For optimal micro-service performance, consistently check the `/health` endpoint, which reflects the current status.

### 2. Decode Status Codes

The `/health` endpoint status codes reveal service health. **200 - OK** indicates success; others like **503 - service unavailable** suggest possible issues.

### 3. Set up Instant Alerts

Arrange to receive notifications when `/health` status codes deviate from 200 for rapid issue resolution.

### 4. Apply Auto-Restart

When a service repeatedly fails health checks, trigger an automatic restart. Fine-tune the number of failures needed to invoke this to ensure system stability.

### 5. Connect Health Checks and Logs

Link health checks with logs for additional failure cause insight, aiding in swift problems resolution.

# 🗣️We Are Here to Help!

Please contact us via [email](mailto:support@blockdaemon.com) or support chat if you encounter an issue, bug, or need assistance. Don't forget to include any relevant details about the problem. To request a wallet form and Institutional Vault Approver form, please click [here](/content/support/index.html) or contact [our sales team](/content/get-in-touch/?contact-sales/index.html).
