Skip to main content

Retention

--retention 30d keeps spans for 30 days (also h, m, s). The server drops older spans by itself: when a store opens, and then every 10 minutes. With tenants, it opens each tenant’s store once an hour to do it. The sample data of the query guide has times in 1970. So with any retention, it all goes when the server opens the store:
  • The drop at the start runs in the background. For a moment after the start (about 1 s with this small store), queries can still find the old spans.
  • The cutoff is now - retention, rounded down to a whole hour. A span is gone at most 1 hour and 10 minutes after it got too old (about 2 hours and 10 minutes for a tenant with no requests), plus the time of the drop.
  • A trace with no span left goes with its summary and its scores. A trace with spans on both sides of the cutoff keeps the newer spans.
Old data goes as whole files. The one file that crosses the cutoff keeps its old spans on disk (not in any answer) until all of it is old. So there is no fixed time by which the bytes of a dropped span leave the disk. For a privacy request, use a delete and a purge (below).

Deletes for privacy, and purge

A person asks you to delete their data (a GDPR request). Delete every trace of that user, then take the bytes off the disk.
  • segmentsTouched and segmentsWithDeleted count files of the store; they depend on the commits before.
  • POST /v1/traces/delete takes one of {"userId": ...}, {"sessionId": ...}, {"traceIds": [...]} or {"filter": traceFilter} (the filters of the query guide). It deletes whole traces: every span, the summary and the scores. A trace with spans of two users goes whole.
  • The answer comes after the commit: from then on no query returns the data, and a crash leaves the store before the delete or after it.
  • The bytes stay in the store’s files until those files are written again (segmentsWithDeleted counts them). POST /v1/purge writes them again now. With "segmentsWithDeleted": 0, no file of the store holds data that was deleted before the call. A purge can take minutes on a large store: give the client a long timeout. Delete all the users of one request first, then purge once.
  • A span that arrives after the delete is kept, also of the same user.
  • Both routes need the write right, and Content-Type: application/json (curl -d alone sends another type: 415).
Copies outside the store folder (backups, exports, S3) are not touched by a delete or a purge.