- Did this code path create a Lemma trace?
- Did the SDK send a payload to
POST /traces/ingest? - Did the ingest request succeed or fail?
- How many child spans did the SDK include?
Enable it
Enable debug mode before creating the Lemma client.- TypeScript
- Python
LEMMA_DEBUG=true is also accepted for backwards compatibility.
After init, debug mode prints a one-time config banner:
baseUrl is not production or projectId is not a valid UUID, the banner includes warnings.
Verify logs and debugSmokeTest().ingestStatus reflect whether this specific trace was enqueued / ingested / ready — not whether the project has any ready traces.
Run a smoke test
UsedebugSmokeTest() for a one-call delivery checklist you can paste into support:
- TypeScript
- Python
cf-ray, server), and per-trace ingestStatus (enqueued / ingested / ready / not_found).
You can also run one minimal trace manually from the same runtime that serves production traffic:
- TypeScript
- Python
sending trace now includes projectId, bodyBytes, and requestedAt. trace sent includes response headers (cf-ray, server, date) and warns when status !== 201.
If the trace uses a handle, you should see trace handle created, then sending trace when the handle ends.
Verify ingest enqueue
After a successful 201, optionally poll the API to confirm this specific trace was enqueued (or already ingested/ready). This requires both debug mode and verify:true is also accepted for both flags.
With both enabled, the SDK calls GET /traces/ingest-status?project_id=...&otel_trace_id=... after ingest (polls immediately, then every 1s for up to 15s) and logs one of:
enqueued means the OTLP worker accepted the payload and wrote it to the ingest queue — it does not require the dashboard to show the trace yet (useful during backlog).
Confirming delivery reached Lemma
Support bundle to request from customers:
projectId,traceId, ingesturl, HTTPstatus- Response headers (
cf-ray,server,date) - Timestamp from
requestedAtin thesending tracelog
Read the logs
Use the first missing log line to narrow the problem.Debug common issues
Missing traces
Start with the smoke test. If it logstrace sent, credentials and networking are working; move to the real request path and confirm that path also logs trace started.
If it logs trace ingest failed, check:
LEMMA_API_KEYandLEMMA_PROJECT_IDare from the same project.baseUrl/base_urlpoints at a server that implementsPOST /traces/ingest.- Your runtime can make outbound HTTPS requests.
- The
hintfield ontrace ingest failed(401 → API key, 403 → project mismatch, 429 → rate limit, 404 → wrong host).
Missing tools or generations
Look at thespanCount (span_count in Python) in the sending trace log. If the count is lower than expected, the SDK never recorded those children.
Common fixes:
- Put
recordTool()/recordGeneration()orrecord_tool()/record_generation()inside thelemma.trace()callback. - For work under a parent span, record it on the span handle in TypeScript or pass
parent_idfrom the parent handle in Python before callingspan.end(...). - For detached helpers, pass
traceIdandparentSpanIdwhere needed.
Flat or incorrectly nested traces
If a parent span exists but its children appear as siblings, debug the order of calls:- TypeScript
- Python
retrieve.end(...). In TypeScript, make it from the parent span handle. In Python, pass the parent handle’s id as parent_id when starting the child.
Serverless or streaming handlers
Debug mode should showtrace sent before the function exits. If not, make sure the handler awaits the trace:
- TypeScript
- Python
trace.end(...) from the terminal callback or finalization path.