github zingolabs/zaino 0.4.2

7 hours ago

0.4.2 — Prometheus metrics & structured tracing

This release adds an optional Prometheus metrics endpoint and structured tracing across all crates. Both are opt-in at build time and have no effect on default builds.

Note: the published Docker images for this release — 0.4.2 (default) and 0.4.2-no-tls (no_tls_use_unencrypted_traffic) — are built without metrics. Metrics require a build with the prometheus feature (see below).

Enabling metrics

Build time — compile zainod with the prometheus cargo feature:

cargo build -p zainod --release --features prometheus

The prometheus feature fans out to zaino-state/prometheus, zaino-serve/prometheus, and zaino-fetch/prometheus, and pulls in metrics + metrics-exporter-prometheus. There is also a convenience feature no_tls_with_prometheus (= no_tls_use_unencrypted_traffic + prometheus) for no-TLS operator builds; the container Dockerfile enables it when built with --build-arg CARGO_FEATURES=no_tls_with_prometheus (these images are published with a -no-tls-with-prometheus tag suffix, separate from the stock -no-tls release image).

Runtime — set metrics_endpoint in the zainod config (default None = disabled):

metrics_endpoint = "0.0.0.0:9998"

A Prometheus scrape endpoint is then served at that address (port 9998 by convention). Metric names are emitted with dots in code (zaino.sync.lag_blocks) and sanitized to underscores on export (zaino_sync_lag_blocks), which is what you scrape/query.

Metrics exposed

Build info

  • zainod_build_info — gauge, version label

Sync lifecycle (zaino-state)

  • zaino_chain_tip_height, zaino_db_tip_height
  • zaino_sync_finalized_height, zaino_sync_target_height, zaino_sync_lag_blocks
  • zaino_sync_iterations_total, zaino_sync_iteration_duration_seconds, zaino_sync_errors_total
  • zaino_sync_has_reached_tip, zaino_sync_reached_tip_at, zaino_sync_last_block_written_at
  • zaino_sync_reorg_total, zaino_sync_reorg_depth
  • zaino_sync_block_build_seconds, zaino_sync_block_write_seconds
  • zaino_sync_transactions_total, zaino_sync_sapling_outputs_total, zaino_sync_orchard_actions_total

Mempool (zaino-state)

  • zaino_mempool_transactions, zaino_mempool_tip_changes_total

Outbound RPC to Zebra (zaino-fetch)

  • zaino_rpc_outbound_requests_total — counter, method label
  • zaino_rpc_outbound_request_duration_seconds — histogram, method label
  • zaino_rpc_outbound_errors_total, zaino_rpc_outbound_retries_total

gRPC inbound (zaino-serve)

  • zaino_grpc_requests_total, zaino_grpc_request_duration_seconds, zaino_grpc_errors_total

Error counters carry a severity label (critical / recoverable).

Structured tracing

Tracing emission was reworked to use structured key-value fields across all crates (no new mandatory configuration; standard RUST_LOG filtering applies), making logs machine-parseable for ingestion into log pipelines.

Crate versions

zainod 0.4.2, zaino-serve 0.3.1, zaino-state 0.3.1, zaino-fetch 0.2.1, zaino-proto 0.1.3, zaino-common 0.2.0 — all published to crates.io.


Commits
  • Merge pull request #1306 from zingolabs/rc/0.4.2 (Prometheus metrics and structured tracing)
  • Finalize 0.4.2: strip -rc.1 from release versions (#1338)

Don't miss a new zaino release

NewReleases is sending notifications on new releases.