Skip to main content

Module telemetry

Module telemetry 

Source
Expand description

Cockpit metrics and receipts.

  • POST /v1/metrics MetricsUploadV1 (leanctx.cloud-metrics/v1, unchanged from the cloud cockpit) → MetricsAckV1. Idempotent replace per (device.id, date, vault.id); vault.id is the resolved Cloud vault_id.
  • 1.9 (X4): a day may carry cloud (MetricsCloudV1), how Cloud helped in that vault: counts and durations only. Claim conflicts are not reported; Cloud derives them from its own refusals and bus lease conflicts.
  • POST /v1/receipts ReceiptsUploadV1 → ReceiptsAckV1; a receipt already stored (same receipt_id and digest) counts as duplicate.

Structs§

MetricsAckV1
Response of POST /v1/metrics.
MetricsAgentV1
MetricsCloudV1
1.9 (X4): one vault day of Cloud use.
MetricsDayV1
MetricsDeviceV1
MetricsGuardsV1
MetricsLedgerV1
MetricsMemoryV1
MetricsSavingsV1
MetricsSpendV1
MetricsTaskUsageV1
MetricsUploadV1
MetricsVaultV1
ReceiptItemV1
One receipt. document is the receipt as persisted locally.
ReceiptsAckV1
Response of POST /v1/receipts.
ReceiptsUploadV1
POST /v1/receipts.

Constants§

MAX_METRIC_AGENT_ROWS
MAX_METRIC_DAYS
MAX_METRIC_DAY_COUNT
1.9 R3: ceilings of MetricsCloudV1 (counts per day, the median in milliseconds up to one day, tokens and USD micros per task row); the names match the Cloud server’s.
MAX_METRIC_DAY_MS
MAX_METRIC_SPEND_ROWS
MAX_METRIC_TASK_ROWS
MAX_METRIC_TASK_TOKENS
MAX_METRIC_TASK_USD_MICROS
MAX_RECEIPTS
METRICS_ACK_SCHEMA
METRICS_SCHEMA
RECEIPTS_ACK_SCHEMA
RECEIPTS_SCHEMA

Functions§

receipt_digest
sha256:<hex> of document with object keys sorted and no whitespace (numbers as serde_json prints them; receipts are not signed here).