Operational telemetry and observability
The IBC CLI runtime exposes OpenTelemetry metrics so operators can follow process health, chain access, packet relay progress, proof work, attestations, signing, and transaction cost. Metrics are optional and best effort. When enabled, the runtime serves Prometheus data locally or sends metric data to an OpenTelemetry collector. A local Grafana stack is available for testing these signals.
Observability pipeline
The observability pipeline turns runtime events into metrics that an operator can scrape or store in a metrics system. The relayer starts the pipeline with its own lifecycle and stops it during graceful shutdown. The current setup exports metrics only. It does not export traces or logs. cli/…/otel.go
The selected mode controls how metrics leave the process:
| Mode | Output | Main use |
|---|---|---|
simple | Prometheus-compatible /metrics endpoint | Local work or direct Prometheus scraping |
otel | OpenTelemetry SDK export to an OTLP endpoint | A collector and a configurable metrics backend |
| Disabled | No metrics provider | Runs without telemetry |
The service name is ibc. Meter scopes group signals by area, while shared labels make chain, client, route, actor, operation, and result dimensions consistent. Duration metrics use milliseconds unless the metric describes a relay leg, which uses seconds. The metric reference defines the supported names, labels, and semantics. cli/…/metrics.go docs/…/04-observability-and-metrics.mdx
The following diagram shows how runtime activity reaches an operator-facing metrics store.
flowchart LR
R[IBC CLI runtime] --> M[OpenTelemetry meters]
M --> S[Prometheus endpoint]
M --> O[OTLP export]
S --> C[Collector or Prometheus]
O --> C
C --> B[Metrics processing]
B --> D[Metrics backend]
Local telemetry stack
The repository provides a single-container Grafana, OpenTelemetry collector, and Prometheus stack for local IBC metrics testing. It uses host networking so the collector can reach the IBC process. The stack accepts either a scrape from simple mode or an OTLP push from otel mode. cli/…/README.md cli/…/docker-compose.yml
The collector configuration accepts OTLP over gRPC and HTTP, and can scrape the simple endpoint before forwarding metrics to the local backend. cli/…/otelcol-config.yaml
Start the stack with make -C cli/scripts/otel up, then open Grafana at http://localhost:3001. The main local endpoints are:
:9090/metricsfor the IBC simple-mode endpoint.:4317and:4318for collector OTLP ingestion.:9091for Prometheus storage.:3001for Grafana.
The sample OTEL configuration names the service ibc and sends metrics to the local OTLP HTTP receiver every two seconds. Relative config paths use the process working directory. OTEL_CONFIG_FILE can provide an absolute path and overrides the configured file path. cli/…/ibc-otel.yaml cli/…/README.md
Prometheus keeps resource fields such as service.name and service.runtime and promotes meter scope data. This lets dashboards separate relayer and service runtimes while keeping the metric names shared. cli/…/prometheus.yaml
The load-test dashboard is a versioned snapshot. Its rows cover relayer API calls, relay work, prover work, attestors, signers, the chain RPC client, and process health. It combines request rates, failures, latency, pending packets, completed relay legs, retries, proof batches, attestor heights, signing work, and runtime resource use. Route panels display full client identities in their queries and shorten long client IDs only in the legend. Import creates the dashboard without overwriting an existing dashboard unless OVERWRITE=1 is set. Export saves current Grafana edits back to the snapshot and removes instance-specific metadata. Switching between metric modes does not require a stack restart. cli/…/dashboard-loadtest.json cli/…/dashboard-loadtest.json cli/…/README.md cli/…/dashboard.sh
References: cli/…/README.md• L5-16 cli/…/otel.go• L112-220 docs/…/04-observability-and-metrics.mdx• L6-37 cli/…/README.md• L5-82 cli/…/docker-compose.yml• L3-16 cli/…/ibc-otel.yaml• L3-20 cli/…/prometheus.yaml• L3-19 cli/…/dashboard-loadtest.json• L30-38 cli/…/dashboard-loadtest.json• L3600-4124 cli/…/dashboard.sh• L15-71
Runtime health signals
The runtime adds standard OpenTelemetry Go runtime metrics when observability is enabled. Host instrumentation also reports process CPU time plus host-wide CPU, memory, and network data. Connect RPC handlers receive standard request metrics without tracing. These signals show process resource behavior and API activity beside the IBC domain metrics. cli/…/otel.go
Use the rate of process.cpu.time for process CPU use. Host-wide values describe the machine across processes and must not be added together as if each value belonged to one runtime. The local dashboard uses runtime, RPC, memory, goroutine, CPU, and allocation views to support this distinction. docs/…/04-observability-and-metrics.mdx cli/…/dashboard-loadtest.json
Telemetry setup errors are logged and tolerated. A running relayer can therefore have no metric stream because the provider could not start. Operators must check setup logs before treating missing metrics as proof that relay work is idle. cli/…/otel.go
References: cli/…/otel.go• L43-110 cli/…/otel_test.go• L22-54 docs/…/04-observability-and-metrics.mdx• L21-37 cli/…/dashboard-loadtest.json• L390-749
Chain and service telemetry
Chain and service signals explain whether the runtime can read state and create the material needed for relay work. They separate access delay from proof, attestation, and transaction delay.
Chain client signals
The EVM chain client measures calls at the JSON-RPC boundary. evm_operation_dur records the duration of recognized go-ethereum calls for reads, subscriptions, gas estimates, transaction submission, receipts, balances, and transaction lookup. Each observation includes the chain ID, JSON-RPC method, result, and an error code when the client provides one. cli/…/metrics.go
The result label distinguishes ok from error. HTTP failures use http_<status>, JSON-RPC failures use jsonrpc_<code>, and other failures use other. A missing or null result such as an unavailable receipt is an answer from the endpoint and counts as ok. The websocket path for subscriptions is not instrumented. cli/…/metrics.go docs/…/04-observability-and-metrics.mdx
These signals show the health of the chain access boundary. They can explain watcher gaps, slow proof work, delayed receipt checks, and failed broadcasts, but they do not prove that an event was stored or that a relay completed.
References: cli/…/metrics.go• L21-81 cli/…/metrics.go• L83-196 cli/…/metrics_test.go• L36-77 docs/…/04-observability-and-metrics.mdx• L119-128
Prover signals
The prover reports whether the runtime can obtain usable chain state and packet proofs. prover_operation measures latest provable height, state proof, and packet proof work. latest_provable_height records the last successful usable height. packet_batch_size records the number and proof kind of packets requested together. cli/…/metrics.go
The main dimensions are chain, client, prover type, operation, result, and proof kind. Proof kinds are packet commitments, acknowledgements, receipt absence, or unknown. A latest-height gauge updates only after a successful request, so an old value can remain visible while later requests fail.
The prover's attestation generator counts attestation_data_matches_total for each attestation data comparison. The result label records whether the data matched, while chain, client, and attestor labels identify the comparison. This signal shows attestation agreement and does not by itself show that relay execution completed. cli/…/metrics.go
References: cli/…/metrics.go• L18-85 cli/…/metrics.go• L103-153 cli/…/metrics.go• L13-33 docs/…/04-observability-and-metrics.mdx• L57-74 cli/…/dashboard-loadtest.json• L1468-1988
Attestor signals
The attestor reports work done for service consumers that need state or packet attestations. attestor_operation measures latest-height, state-attestation, and packet-attestation calls. latest_height records the height from a successful latest-height call. cli/…/metrics.go
The caller label separates RPC calls from internal calls. Chain and attestor labels identify the source of the result. These signals answer a different question from prover signals: attestor metrics describe service-facing attestations, while prover metrics describe proof material prepared for relay execution.
References: cli/…/metrics.go• L14-60 cli/…/metrics.go• L63-109 cli/…/metrics.go• L75-93 cli/…/dashboard-loadtest.json• L32-150
Relay pipeline telemetry
Relay metrics follow a packet from event discovery through batching, state changes, and completed relay legs. Route labels keep the source and destination sides distinct so operators can compare one path without merging it with another.
Watcher and dispatch signals
The watcher counts observed send-packet events with watcher_events_total. Its chain_id and type=send_packet labels show that the runtime saw an event on a source chain. The watcher also reports packet_event_stream_up for auto-relay chains. It stays at one during an active connection, including idle periods, and becomes zero before connection, during reconnection, and after shutdown. cli/…/metrics.go docs/…/04-observability-and-metrics.mdx
The dispatcher reports the current number of non-terminal packets with packets_pending. It emits zero for configured routes with no pending packets and clears routes that no longer have pending work. packet_poll_last_success_timestamp_seconds records the last completed successful poll, including an empty poll. Listing errors and blocked polls leave it unchanged. excessive_relay_latency_total counts each poll that finds a packet beyond the threshold for its current relay leg. cli/…/metrics.go docs/…/04-observability-and-metrics.mdx
The latency signal is an event counter rather than a stuck-packet gauge. Build alerts from its rate. The dispatcher checks three legs: send to receive, send to timeout, and receive to acknowledgement. The current limits are 60 minutes for normal pending work, five minutes past packet timeout, and a 15-minute source-finality delay before a missing timeout relay is considered excessive. cli/…/metrics.go cli/…/metrics.go
References: cli/…/metrics.go• L13-32 cli/…/metrics.go• L17-35 cli/…/metrics.go• L66-136 cli/…/metrics.go• L139-179 docs/…/04-observability-and-metrics.mdx• L107-117
Packet and batch signals
The pipeline counts each real packet state transition with packets_total. It does not count a repeated observation of the same state. batch_size records the number of transfers in a receive, acknowledgement, or timeout batch and marks the batch as ok or error. The batch chain is the destination for receive work and the source for acknowledgement or timeout work. cli/…/metrics.go
The core route dimensions use a fixed meaning: chain_id and client_id identify the packet source, while dest_chain_id and dest_client_id identify its destination. Processor values are recv, ack, and timeout. This convention lets packet movement and transaction outcomes join across the relay pipeline.
The processors also report relay_packet_execution_total for each packet outcome. executed means the packet event was found and its status was saved. failed means the relay transaction was retried after a revert, a missing packet event, or no receipt by the retry threshold. docs/…/04-observability-and-metrics.mdx
The pipeline tests protect two key contracts. They verify that repeated states do not add transitions and that batch results show an error when processing fails at the batch level or marks transfers as failed. cli/…/metrics_test.go
References: cli/…/metrics.go• L15-95 cli/…/metrics_test.go• L44-159 docs/…/04-observability-and-metrics.mdx• L76-117 cli/…/dashboard-loadtest.json• L1990-2220
The relay flow connects the discovery, pending, batch, transition, and completion signals.
flowchart LR
E[Send-packet event] --> W[Watcher event count]
W --> P[Pending packet view]
P --> D[Latency and route view]
D --> B[Processor batch]
B --> T[Packet state transition]
T --> F[Completed relay leg]
Transaction and signing telemetry
Transaction signals show the path from signing and broadcast to receipt, retry, relay completion, and wallet cost. They describe what this process observed, not every transaction that exists on the chain.
Signing and submission signals
The signer measures signing duration and result. Its labels identify the signer alias and whether the signer is remote, local ECDSA, or local EdDSA. cli/…/metrics.go
The relay processors count successful broadcasts with transactions_submitted_total and successful receipts with transactions_confirmed_total. They count retries with transaction_retries_total. Transaction labels use the chain receiving the transaction and the client updated by it. Confirmation and retry counts are matched in memory by chain and transaction hash, so a confirmation is counted only when this process recorded the broadcast first. cli/…/metrics.go
The transaction submitter counts each completed Submit call with transaction_submission_attempts_total. Its result is ok or error, including capacity deferrals. Internal fee replacements do not add attempts. docs/…/04-observability-and-metrics.mdx
Relay completion signals describe successful legs only. relays_completed_total counts completed legs and relay_duration measures their wall time in seconds. The leg types are send to receive, send to timeout, and receive to acknowledgement. cli/…/metrics.go cli/…/metrics.go
References: cli/…/metrics.go• L17-75 cli/…/metrics.go• L78-145 cli/…/metrics.go• L148-174 cli/…/metrics.go• L21-80 docs/…/04-observability-and-metrics.mdx• L39-46 docs/…/04-observability-and-metrics.mdx• L94-106 cli/…/dashboard-loadtest.json• L870-1225
EVM wallet signals
The EVM transaction submitter reports wallet cost and balance through evm_gas_spent and evm_gas_balance. Gas spent is cumulative for each chain and wallet. It includes mined transactions sent by that submitter, including failed transactions, and is expressed in native-token units. cli/…/metrics.go
Balance observations are made at the latest block and are refreshed at most once every ten seconds per wallet. Calls for the same wallet within that period reuse the last observation. A failed balance query emits -1; treat this as an observation error rather than a real negative balance. Balance reads use a three-second observation context and run across wallets in parallel. cli/…/metrics.go
The EVM JSON-RPC duration signal also covers the EVM client used by the transaction submitter. This gives operators one view of endpoint delay across chain reads and transaction work. docs/…/04-observability-and-metrics.mdx
References: cli/…/metrics.go• L19-91 cli/…/metrics.go• L113-171 cli/…/metrics.go• L176-239 docs/…/04-observability-and-metrics.mdx• L76-128 cli/…/dashboard-loadtest.json• L2253-2639
Operational interpretation
Use the metric groups as a chain of evidence rather than as isolated health scores. A watcher event shows that discovery saw activity. Pending and transition signals show whether the packet entered and moved through relay work. Chain-client and prover signals explain access or preparation delay. Submission, confirmation, retry, and completion signals show the observed transaction outcome.
Use these labels as the main join keys:
- Use
chain_idandclient_idfor one side of a chain or client operation. - Use
dest_chain_idanddest_client_idfor the counterparty side of a packet route. - Use
typefor signer, prover, proof, event, or relay-leg variants when the metric defines it. - Use
operationto separate named service or chain calls. - Use
resultto compare successful and failed duration observations. - Use
processorto compare receive, acknowledgement, and timeout batch work. - Use
service.runtimeto separate the relayer from other IBC service runtimes in a shared metrics store.
Metrics show counts, levels, durations, and broad outcomes. Use packet status, service responses, chain data, and logs for the exact packet, transaction hash, error, or terminal state. See relayer system, relay execution, attestation and transactions, chain connectivity, runtime and services, and deployment and persistence for those system views.
Change checklist
When these files or sections are changed, remember to consider these:
- Keep service names, meter scopes, metric names, units, and label meanings aligned with dashboards and alert rules.
- When a relay state or relay leg changes, update transition, batch, completion, retry, execution, and excessive-latency interpretations together.
- When an EVM client call changes, keep its JSON-RPC operation name and error-code mapping aligned with endpoint health alerts.
- When the OTEL sample changes, keep its OTLP endpoint, service attributes, and export interval compatible with the collector receiver and Prometheus resource mapping.
- When the simple endpoint or OTEL config path changes, update the local scrape or receive path and deployment exposure.
- When dashboard queries or the Grafana API changes, check the snapshot import and export rules and the overwrite guard.
- When transaction ownership or confirmation matching changes, check that submitted, confirmed, retry, submission-attempt, and gas-cost signals still use the same chain and transaction identity.
- When a gauge changes from success-only observation to error observation, update alerts so stale values are not read as current state.
- When attestation data comparison or attestor identity changes, keep
attestation_data_matches_totalresult and chain, client, and attestor labels aligned with attestation diagnostics. - When watcher connection or poll health changes, keep the stream-up and last-success signals aligned with the states that operators use for alerts.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| Metrics are enabled with an invalid listen address or missing or invalid OTEL file | The provider does not start, so the relayer can run without metrics | Validate the observability settings and watch for setup warnings |
Simple mode is used without a Prometheus scrape of /metrics | Metrics remain at the CLI endpoint and do not reach the backend | Configure the collector or Prometheus target for the CLI address |
| OTEL mode points to an endpoint that does not accept OTLP HTTP | Export attempts cannot reach the collector | Match the CLI OTLP endpoint with the collector receiver |
| The local stack uses the wrong service or runtime labels | Dashboards can merge runtimes or show no series | Keep service.name, service.runtime, and scope promotion aligned |
| A packet stays past a relay-leg threshold | excessive_relay_latency_total rises on each later poll | Alert on rate() and inspect route and leg labels |
| A balance query fails | evm_gas_balance reports -1 | Treat negative values as telemetry errors and inspect RPC health |
| The process restarts before receipt confirmation | In-memory matching is lost and a later receipt is not counted by this process | Correlate with chain data and packet status |
| A JSON-RPC endpoint returns an HTTP or JSON-RPC error | evm_operation_dur records result=error with a code that identifies the failure class | Compare the code and operation labels with endpoint logs |
| A dashboard already exists during import without overwrite | The import refuses to replace local edits | Use OVERWRITE=1 only when replacement is intended |
| Attestation data does not match | attestation_data_matches_total records result=false for the attestor and client | Compare the chain, client, and attestor labels with attestation diagnostics |
| A watcher loses its event stream or a poll fails | packet_event_stream_up becomes zero or packet_poll_last_success_timestamp_seconds stops advancing | Alert on the connection state and age of the last successful poll |
Key files
| File | Why to read it |
|---|---|
| cli/…/otel.go | Defines provider setup, export modes, runtime and host metrics, RPC instrumentation, and shutdown |
| cli/…/metrics.go | Defines shared metric labels, service naming, units, and operation timing |
| cli/…/README.md | Points to the metric reference and gives the guide for adding metrics and shared attribute keys |
| docs/…/04-observability-and-metrics.mdx | Gives the current metric modes, names, labels, and semantics |
| cli/…/otel_test.go | Shows the provider contracts for simple export, invalid setup, shutdown, and the local OTEL config |
| cli/…/README.md | Explains the local stack, both metric modes, ports, and dashboard workflow |
| cli/…/docker-compose.yml | Defines the local Grafana, collector, Prometheus, and persisted Grafana data setup |
| cli/…/otelcol-config.yaml | Connects local OTLP and Prometheus inputs to the metrics backend |
| cli/…/ibc-otel.yaml | Shows local OTLP export, service identity, and export interval |
| cli/…/prometheus.yaml | Shows how resource and meter-scope labels enter Prometheus |
| cli/…/dashboard-loadtest.json | Provides the local dashboard view across runtime, service, prover, relay, and transaction signals |
| cli/…/dashboard.sh | Controls safe dashboard import and export against Grafana |
| cli/…/metrics.go | Defines EVM JSON-RPC duration, result, and error-code signals |
| cli/…/metrics.go | Defines send-packet discovery and event-stream health signals |
| cli/…/metrics.go | Defines poll health, pending-route, and excessive-latency signals |
| cli/…/metrics.go | Defines packet state transition and batch-size signals |
| cli/…/metrics.go | Defines relay completion, duration, submission, confirmation, retry, and execution signals |
| cli/…/metrics.go | Defines proof-operation, usable-height, and proof-batch signals |
| cli/…/metrics.go | Defines attestation data match signals by chain, client, and attestor |
| cli/…/metrics.go | Defines attestation operation and height signals |
| cli/…/metrics.go | Defines signing duration and signer-type signals |
| cli/…/metrics.go | Defines EVM gas-spend and wallet-balance observations |