How to debug and monitor Aranya Fast Channels (AFC), including shared memory (SHM) operations, channel lifecycle, and seal/open operations.
AFC provides high‑performance encrypted communication over shared memory. Common issues include:
AFC operations are split between client and daemon:
Client operations:
Daemon operations:
Note: Avoid placing logging in the hot path.
For level definitions (for example, what DEBUG vs TRACE means), see Log Levels.
Channel creation:
channel_id - Unique channel identifierpeer_device_id - Peer device for the channellabel_id - Label used for the channeldirection - “send” or “receive”Channel deletion:
channel_idtotal_messages_senttotal_bytes_senttotal_seal_failuresKey add (DEBUG level):
channel_idlabel_idpeer_device_idshm_path - Shared memory pathkey_index - Index where key was addedcurrent_key_count - Total keys in SHMKey remove (DEBUG level):
channel_idkey_index - Index of removed keyremaining_key_count - Keys remaining in SHMKey add failure (ERROR level):
channel_idlabel_idpeer_device_idshm_patherror - Error description from SHM librarycurrent_keys - Current key countmax_keys - Maximum allowed keystotal_add_failures - Cumulative failuresretry_count - Number of retries attemptedKey remove failure (ERROR level):
channel_idkey_indexerror - Error description from SHM librarySeal (encrypt) - TRACE level:
channel_idplaintext_len - Size of plaintext dataciphertext_len - Size of encrypted dataseq_num - Sequence numberduration_us - Operation duration in microsecondsOpen (decrypt) - TRACE level:
channel_idciphertext_len - Size of encrypted dataplaintext_len - Size of decrypted dataseq_num - Sequence numberduration_us - Operation duration in microsecondsSeal/Open failures (ERROR level):
channel_iderror - Error descriptionplaintext_len or ciphertext_len - Data sizeseq_numduration_us - Duration before failureNote: TRACE logging for seal/open can generate huge volumes in high-throughput scenarios. Use sparingly and only for targeted debugging.
Channel statistics should be logged on channel lifecycle events.
Fields for channel creation:
channel_idpeer_device_idlabel_iddirection - “send” or “receive”Fields for channel close:
channel_idmessages_sent - Total messages sealedmessages_received - Total messages openedbytes_sent - Total plaintext bytes sentbytes_received - Total plaintext bytes receivedseal_failures - Count of failed seal operationsopen_failures - Count of failed open operationskeys_added - Total keys added to SHMkeys_removed - Total keys removed from SHMshm_add_failures - Count of SHM key add failuresThe JSON format is configured via the tracing subscriber. See Logging Configuration for setup details.
Example log entry:
{
"timestamp":"2026-02-03T16:35:28.139545Z",
"level":"INFO",
"fields":{
"message":"afc channel deleted"
},
"target":"aranya_daemon::api",
"span":{
"chan":"LocalChannelId(0)",
"component":"daemon_api",
"name":"delete_afc_channel"
},
"spans":[
{
"component":"daemon",
"name":"member_a",
"name":"daemon"
},
{
"component":"daemon_api",
"name":"api-server"
},
{
"otel.kind":"server",
"otel.name":"DaemonApi.delete_afc_channel",
"rpc.deadline":"2026-02-03T16:35:38.139432834Z",
"rpc.trace_id":"a1b2c3d4e5f6789012345678abcdef01",
"name":"RPC"
},
{
"chan":"LocalChannelId(0)",
"component":"daemon_api",
"name":"delete_afc_channel"
}
]
}