Admin Login
HomeGuidesAPI ReferenceChangelogBlockdaemon Main Docs
Log In
Guides

Metrics and Health

Understand wallet metrics, traces, Vault operations metrics, system health, and application logging.

Prometheus metrics for the Vault API

The Vault API can expose HTTP request and gateway webhook metrics in Prometheus text format on a dedicated listener. Scrape that listener with Prometheus, Grafana, or curl. These series are separate from the Vault operations and Policy Node cwp_* metrics below.

📘

Note:

This scrape is off by default. Enable it 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). Metrics are served on this dedicated listener and are not routed on the public API ingress.

The following metrics are exposed on that listener when Prometheus is enabled:

Metric NameLabelsDescription
wallethttpinboundrequesttotalpath, statusTotal inbound HTTP requests.
wallethttpinboundrequestdurationsecondspath, statusInbound request duration (histogram; Prometheus exposes count, sum, bucket).
wallethttpinboundclientiprequeststotalipaddrInbound requests by client IP.
wallethttpoutboundrequestinflight-Current number of outbound HTTP requests in flight.
gatewaylistenermessagestotaleventtypeTotal gateway webhook messages by event type.

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


Prometheus Metrics for Vault Operations and Policy Nodes

Vault operations (the Core Wallet Platform control plane embedded in the wallet process) and Policy Nodes expose a separate Prometheus endpoint at GET /metrics. All metric names are prefixed with cwp_.

ComponentHow to enableDefault scrape location
Wallet (Vault operations / orchestrator)Set environment variable CWP_HTTP_PORT (deployments typically use 9091)http://<wallet-host>:9091/metrics
Policy NodeSet HealthCheckPort in policy-node.confhttp://<policy-node-host>:<HealthCheckPort>/metrics (same port as /live and /ready)

These metrics use the default Prometheus registry for that process. Metric names are registered in both the wallet and Policy Node processes; values are populated only where the corresponding code path runs.

Shared (Wallet orchestrator and Policy Nodes)

Metric NameLabelsDescription
cwp_db_open_connections-Gauge of established database connections (in use + idle), summed across pools.
cwp_db_in_use-Gauge of connections currently executing a query.
cwp_db_idle-Gauge of idle pooled connections.
cwp_db_wait_count-Counter of times a caller waited for a free connection.
cwp_db_wait_duration-Counter of total seconds spent waiting for a connection.
cwp_db_max_idle_closed-Counter of connections closed by the max-idle limit.
cwp_db_max_lifetime_closed-Counter of connections closed by the max-lifetime limit.
cwp_db_max_idletime_closed-Counter of connections closed by the max-idle-time limit.
cwp_db_query_timestatus (ok / error), operation (query, create, update, delete, row, raw)Histogram of database query time in seconds.
cwp_broker_publish_sizestatus (ok / error)Histogram of message sizes published to the message broker, in KiB (1024-byte units). Buckets: 0.25, 1, 4, 16, 64, 256.
cwp_broker_received_size-Histogram of message sizes received from the message broker, in KiB. Same buckets as publish.
cwp_broker_reconnected-Counter of message-broker reconnects.

Wallet orchestrator (CWP_HTTP_PORT)

Metric NameLabelsDescription
cwp_operation_timestatus (ok / error), function, operation_typeHistogram of operation-related execution time in seconds. Common function values: lockDataForExecution, operation_execute. operation_type is the CWP operation type.
cwp_in_memory_operations-Gauge of operations that currently hold an execute slot (in-flight execution). Capped at 20 by default. Flat at 20 means the execute pool is saturated; it is not a queue-depth gauge.
cwp_ping_pong_roundtrip_time-Histogram of ping-pong round-trip time to Policy Nodes, in seconds.

Policy Nodes (HealthCheckPort)

Metric NameLabelsDescription
cwp_function_timestatus (ok / error), functionHistogram of function execution time in seconds (includes fine-grained buckets). Common function values: ECDSA Sign, Schnorr Sign.
cwp_active_mpc_sessionstenantGauge of currently active MPC sessions on this Policy Node.

Standard Go and process collectors may also appear on these scrapes depending on the process runtime.


Distributed tracing (OpenTelemetry)

The wallet can export traces over OTLP/HTTP to a collector you operate (for example an OpenTelemetry Collector, Grafana Tempo, or Datadog Agent). Tracing is off by default and is independent of Prometheus metrics.

Traces stay inside your infrastructure. The wallet does not send spans to Blockdaemon.

Enable tracing

Set the following in wallet.yaml (see the wallet.yaml reference):

telemetry:
  enable_otlp: true
  service_name: wallet
  otel_endpoint: "https://otel-collector.example.com:4318"
  otel_sample_ratio: 1
FieldPurpose
enable_otlpTurns on application tracing, including database and NATS spans in the wallet process.
otel_endpointOTLP/HTTP collector address. Required to export. host:port uses plain HTTP. https://... uses TLS. If the URL has no path, the wallet appends /v1/traces. An empty endpoint skips export even when enable_otlp is true.
service_nameResource attribute service.name. Default wallet.
otel_sample_ratioHead-sample ratio from 0 to 1. Default 1 is parent-based always-on. Values between 0 and 1 apply parent-based ratio sampling. Tail or intelligent sampling belongs on the collector.

Restart the wallet after changing these values. Allow egress from the wallet to the collector. telemetry.enable_prom does not have to be on.

Collector credentials

Do not put exporter API keys or auth headers in wallet.yaml. Set the standard OpenTelemetry environment variable OTEL_EXPORTER_OTLP_HEADERS on the wallet process (for example authorization=Bearer <token>), typically from a secret. Optional OTEL_SERVICE_NAME and OTEL_RESOURCE_ATTRIBUTES are also read at process start.

What is traced

The wallet records low-cardinality spans. Request and response bodies, headers, user identifiers, wallet addresses, amounts, and SQL text are not attached.

SpanWhen
METHOD /api/... (route template)Every inbound Wallet HTTP request. Attributes include method, route, and status code. Incoming traceparent is honored (W3C Trace Context and Baggage).
wallet.transaction.transferChild span for transfer operations.
Outbound HTTP client spansCalls to dependencies, with trace context injected on the outgoing request.
db.query, db.create, db.update, db.delete, db.rawPostgreSQL operations (db.system=postgresql).
nats.publish ..., nats.consume ...Wallet NATS publish and consume for EVM address notifications.

Policy Nodes do not export traces from this wallet setting.

When a span is active, wallet JSON logs include trace_id and span_id (see Logging). Use those together with correlationId and opID.


Health Status for the Wallet Stack Services

To maintain smooth operations, each service within the deployment provides health endpoints. Use HTTP status codes from those endpoints to drive monitoring and auto-restart.

Wallet (Vault API)

On the wallet API port (typically 8080):

  • GET /live: HTTP 200 while the process is accepting HTTP (liveness).
  • GET /ready: HTTP 200 when the API server is ready to receive traffic (readiness).

Policy Nodes

When HealthCheckPort is set in policy-node.conf:

  • GET /live: HTTP 200 while the process is running (liveness).
  • GET /ready: HTTP 200 only after the node has connected to the message broker and subscribed; 503 before then (readiness).

NATS (Message Broker)

On the NATS HTTP monitoring port (http_port in nats-server.conf, typically 8222):

  • GET /healthz: HTTP 200 when the NATS server process is healthy. Deployments typically use this for both liveness and readiness probes.

EVM Tracker

When the tracker is started with --health-port (typically 8080):

  • GET /livez: HTTP 200 while the process is running (liveness).
  • GET /readyz: HTTP 200 when the chain RPC endpoint is reachable; 503 if the RPC client is unavailable or a block-number check fails (readiness).

Recommended practices

  1. Probe the endpoints above on a regular interval.
  2. Alert when status codes leave the expected success range (Wallet /live or /ready not 200; Policy Node /live not 200; Policy Node /ready stuck on 503; NATS /healthz not 200; EVM Tracker /livez not 200 or /readyz stuck on 503).
  3. Auto-restart after repeated failures, with a failure threshold tuned for your environment.
  4. Correlate failed probes with component logs (see Logging below; enable debug logging when investigating).

Logging

Institutional Vault components write structured JSON logs to standard output or standard error (one JSON object per line). Collect them with your platform log agent (for example CloudWatch, Azure Log Analytics, or Datadog) and index common fields for search and correlation.

Typical fields include:

FieldDescription
time / timestampEvent time
levelLog level (debug, info, warn, error, …)
msgHuman-readable message
correlationIdRequest-tracing ID across Wallet, Vault operations, and Policy Nodes
opIDVault operation identifier when the log line is tied to an operation
trace_idOpenTelemetry trace ID when tracing is enabled and a span is active
span_idOpenTelemetry span ID for the current span

OperationID and CorrelationID

  • OperationID (opID in logs): The business identifier of a Vault / CWP operation (create account, makeTransaction, and so on). Clients may supply it when starting an operation for idempotency, then use it to poll status, approve, or search. It is the durable key for that operation in the system of record.
  • CorrelationID (correlationId in logs and often in API error responses): A tracing identifier that links log lines across components for a single request or workflow. Use it when escalating to support. If no correlation ID is present on the request context, the system may fall back to the OperationID.

When an API call fails, responses may also include an M-prefixed error code (for example M0001, M0025, M0080). See the Troubleshooting Guide for the full M-code catalog, typical HTTP statuses, and resolution steps.

Log verbosity:

  • Wallet: log_level in wallet.yaml controls the global level. Valid values:

    ValueLevel
    -1trace
    0debug
    1info
    2warn
    3error
    4fatal
    5panic
    7disabled

    Default: 1 (info). To adjust verbosity for a single component without
    changing the global level, add a component_log_levels map — for example:

    log_level: 1
    component_log_levels:
      canton_poller: 0   # debug this component only
      mpa_listener: 2    # warn this component only

    See the wallet.yaml reference for the full
    list of component names.

  • Policy Nodes / Vault control plane: DEFAULT_LOG_LEVEL environment variable (debug, info, warn, error), read at process start.

  • EVM Tracker: --verbose / -v flag. When set, logs at info level; when omitted, logs at warn level and above.


Did this page help you?