Skip to content

Monitoring

This document summarizes the various details regarding to monitoring Amaru. As a pre-requisite, it’s important to note that Amaru leverages OpenTelemetry to emit traces & metrics. A compatible observability backend such as Jaeger, Grafana Tempo and/or Prometheus is therefore needed to collect and visualise telemetry.

We provide example configurations using different compositions of tools:

To turn on monitoring, use the following CLI options when running the application:

  • --with-open-telemetry (or env variable AMARU_WITH_OPEN_TELEMETRY) to enable OpenTelemetry traces
  • --with-json-traces (or env variable AMARU_WITH_JSON_TRACES) to enable JSON traces on stdout

Any event (trace, span or metric) can be filtered by target and severity using two environment variables:

  • AMARU_TRACE: for any event emitted by the OpenTelemetry layer (enabled both by --with-open-telemetry and --with-json-traces);
  • AMARU_LOG: for any event emitted to stdout;

A target is a ::-separated path of identifiers such as amaru::ledger::state. One can filter by providing either a full target, or a sub-path prefix. For example, the target amaru::ledger will match the following:

  • amaru::ledger::state
  • amaru::ledger::state::forward
  • amaru::ledger::store

But it will not match any of the following:

  • amaru::sync
  • amaru::consensus

e.g. AMARU_LOG="amaru::ledger::state::forward=info" will filter out target amaru::ledger::state::forward with level bellow info.

Refer to the tables below for the list of available targets.

Filters can be provided as a sequence of ,-separated values. Right-most filters take precedence. A usual pattern is to first define a global filter and override it with specific target. For example, error,amaru::ledger::store=debug will exclude any event below the error severity except those targetting amaru::ledger::store which will show up to the debug severity.

nameseveritydescription
forwardinfoWraps the processing of a block forward
backwardinfoWraps the processing of a rollback
span: forward
fielddescription
header.heightAbsolute block height
header.slotAbsolute slot number
header.hashBlock header hash
stable.epochCurrent epoch of the most recent stable point
tip.epochCurrent epoch of the most recent volatile point
tip.relative_slotRelative slot within the epoch of the most recent volatile point
span: backward
fielddescription
point.slotAbsolute slot number of the target rollback point
point.hashBlock header hash of the target rollback point
nameseveritydescription
block.body.validateinfoWraps the block body validation & processing
snapshotinfoWraps the creation of a new epoch-boundary snapshot
saveinfoWraps the persistence on-disk of the next now-stable ledger delta
tick.poolinfoWraps the update of pool parameters and enactment of retirements at an epoch-boundary
apply.transactioninfoWraps the validation & processing of a single transaction
span: block.body.validate
fielddescription
block.transactions.totalTotal number of transactions in the block
block.transactions.failedTotal number of failed transactions in the block
block.transactions.successTotal number of successful transactions in the block
span: snapshot
fielddescription
epochThe epoch being captured as snapshot, typically the immediately previous epoch
span: apply.transaction
fielddescription
transaction.idThe transaction identifier/hash
transaction.certificatesThe number of certificates within the transaction
transaction.inputsThe number of (collateral) inputs within the transaction
transaction.outputsThe number of (collateral) outputs within the transaction
transaction.withdrawalsThe number of withdrawals within the transaction

Coming soon.

Amaru provides a few options to configure OpenTelemetry:

--amaru-service-name <STRING> (environment variable AMARU_SERVICE_NAME): Sets the service.name key used to identify metrics and traces. This is useful when a single OTLP service stack collects telemetry from several Amaru instances --otlp_span_url <STRING> (environment variable AMARU_OTLP_SPAN_URL): Sets the endpoint used to send spans, defaults to http://localhost:4317 --otlp_metrics_url <STRING> (environment variable AMARU_OTLP_METRICS_URL): Sets the endpoint used to send metrics, defaults to http://localhost:4318/v1/metrics