Skip to main content
Lemma Analytics widgets consume source telemetry from ingested traces. The SDK emits that telemetry; the backend computes windowed aggregates. The SDK must not derive user-facing totals or estimated cost. For the full ingest contract, see Trace contract. This page lists the attributes Analytics depends on and how missing vs zero values are interpreted.

Required signals

Coverage semantics (omit vs zero)

Analytics treats a missing field as “not instrumented / unknown” and an explicit 0 as a healthy zero. Inventing zeros in the SDK would under-report coverage and hide upgrade gaps. Estimated cost is a backend derivation from model/provider + token telemetry. Do not emit billed cost from the SDK.

Provenance attributes

Lemma extensions on every span: Use these to attribute sparse coverage to an integration or SDK language without hard-coding provider logic in the Analytics frontend.

Framework integrations

Manual recordGeneration / record_generation always accepts usage when you have it from the provider response.

Upgrade behavior (older SDK versions)

Upgrading to an SDK that emits usage, provider, duration, and provenance enables Analytics to move from “not instrumented” to populated charts without re-ingesting historical traces.

Trace contract

Full ingest payload and native contract props.

Generations

How to record model calls with usage.

Traces

Root latency vs generation duration.