Monitoring and Metrics Guide¶
This guide covers monitoring Fabric-X components using Prometheus.
Prometheus Setup¶
All Arma and Committer components expose Prometheus metrics endpoints.
Endpoint Configuration¶
Monitoring ports are configurable via MonitoringListenPort in Arma component configs and metricsPort in Committer service configs. The ports shown below are DEFAULTS only - always verify your actual configuration.
| Component | Default Port | Config Field | Endpoint |
|---|---|---|---|
| Arma Router | 9090 | MonitoringListenPort |
http://localhost:9090/metrics |
| Arma Batcher | 9091 | MonitoringListenPort |
http://localhost:9091/metrics |
| Arma Consenter | 9092 | MonitoringListenPort |
http://localhost:9092/metrics |
| Arma Assembler | 9093 | MonitoringListenPort |
http://localhost:9093/metrics |
| Committer Sidecar | 2114 | metricsPort |
http://localhost:2114/metrics |
| Committer Verifier | 2115 | metricsPort |
http://localhost:2115/metrics |
| Committer VC | 2116 | metricsPort |
http://localhost:2116/metrics |
| Committer Query | 2117 | metricsPort |
http://localhost:2117/metrics |
| Committer Coordinator | 2119 | metricsPort |
http://localhost:2119/metrics |
⚠️ Important: All monitoring ports are CONFIGURABLE. The values above are factory defaults. Always check your component configuration files (
local_config.yamlfor Arma, service YAMLs for Committer) for actual port assignments.
Basic Prometheus Configuration¶
scrape_configs:
- job_name: 'arma'
static_configs:
- targets:
- 'localhost:9090' # Router (check config)
- 'localhost:9091' # Batcher (check config)
- 'localhost:9092' # Consenter (check config)
- 'localhost:9093' # Assembler (check config)
- job_name: 'committer'
static_configs:
- targets:
- 'localhost:2114' # Sidecar
- 'localhost:2115' # Verifier
- 'localhost:2116' # VC
- 'localhost:2117' # Query
- 'localhost:2119' # Coordinator
Arma Metrics¶
Metrics are exposed via the fabric-lib-go metrics library and Prometheus.
Standard Metrics¶
Common metrics available on all components:
go_gc_duration_seconds- GC durationgo_goroutines- Number of goroutinesgo_memstats_*- Memory statisticsprocess_cpu_seconds_total- CPU usageprocess_open_fds- Open file descriptors
Consenter-Specific Metrics¶
Consensus metrics from Consenter (consensus_ prefix):
consensus_decisions_count- Total decisions madeconsensus_blocks_count- Total blocks orderedconsensus_bafs_count- Batch attestation fragments receivedconsensus_complaints_count- Complaints receivedconsensus_txs_count- Total transactions ordered
Batcher-Specific Metrics¶
Batcher metrics (batcher_ prefix):
batcher_current_role- Current role (1=primary, 2=secondary)batcher_mempool_size- Current mempool sizebatcher_role_changes_total- Total role changesbatcher_batches_created_total- Total batches createdbatcher_batches_pulled_total- Total batches pulledbatcher_batched_txs_total- Total transactions batchedbatcher_router_txs_total- Total transactions from routerbatcher_complaints_total- Total complaints sentbatcher_first_resends_total- Total first resends
From Integration Tests¶
The integration tests verify metrics capture patterns like:
// From testutil/network_utils.go
FetchPrometheusMetricValue(t, re, url) // Fetches metric from /metrics endpoint
CaptureArmaNodePrometheusServiceURL(t, node) // Gets metrics URL from log output
Health Checks¶
gRPC Health Checks¶
For gRPC services, use the standard gRPC health check protocol:
Log Monitoring¶
Configure LogSpec in component configs to control log verbosity:
Key Alerts¶
| Alert | Query | Severity |
|---|---|---|
| Component Down | up{job="arma"} == 0 |
Critical |
| High Latency | histogram_quantile(0.95, rate(request_duration_seconds_bucket[5m])) > 5 |
Warning |
| Memory Usage | process_resident_memory_bytes / 1024 / 1024 > 4096 |
Warning |
| Consensus Stalled | rate(consensus_decisions_count[1m]) == 0 |
Critical |
Troubleshooting Metrics¶
No metrics showing¶
-
Check monitoring port is configured in component config:
-
Verify firewall allows access to monitoring port
-
Check component logs for errors:
High metric cardinality¶
- Limit label values (avoid unbounded values like transaction IDs)
- Use aggregation for high-cardinality histograms
See Also: Logging Guide | Troubleshooting