Skip to main content
A delete removes whole traces: every span, the summary and the scores. The examples use an open store (open a store). The same tasks with the server: data lifecycle.

Delete traces for privacy

deleteUser(userId) and deleteSession(sessionId) are short for the first two. Each returns { tracesDeleted, spansDeleted, scoresDeleted, segmentsTouched, segmentsWithDeleted }.
  • The call commits what was written before it, then the delete. It returns when the delete is durable. From then on, no list, count, sum, session, getTrace, getScores or text search gives the data.
  • A crash leaves the store before the delete or after it. It does not leave it between.
  • A span written after the call stays, also of the same user. To keep a user out, refuse their spans before they reach the store.
  • A filter with a text over the word limit of contains and prefix is an error: nothing is deleted.
  • Copies outside the store folder (backups, S3) are not touched.

Take deleted data off the disk

A deleted span is hidden at once, but its text stays in its file until that file is written again. segmentsWithDeleted counts those files. purgeDeleted() writes those files again now, and waits for it. It commits first, so the write log holds nothing from before the call. With segmentsWithDeleted: 0 in its answer, no file of the store holds data that was deleted before the call. The cost is the live spans of those files (docsRewritten). For a user with traces at all times, that is the whole store. So delete all users of one request first, then purge once. The answer: { segmentsRewritten, docsRewritten, docsRemoved, segmentsWithDeleted, bytesBefore, bytesAfter }.

Delete one trace

deleteTrace(traceId) removes the spans, the scores and the summary of one trace, at the next commit. It returns nothing. The scores on its session stay. To delete for privacy, with an answer and the bytes off the disk, use deleteTraces and purgeDeleted.

Drop old spans

dropBefore(cutoffMs) removes every span that started before the cutoff.
  • The cutoff is rounded down to a whole hour, so the sums per hour stay exact. The answer’s cutoff is the time used.
  • A trace with no span left goes with its summary and its scores (tracesDropped). A trace with spans on both sides keeps the later ones, and its summary is made again from them, so its start, root and sums can change (tracesCut). Session rows and sums are exact after it.
  • The call commits what was written before it, then the drop. It returns when the drop is durable.
  • Old data goes as whole files (segmentsRemoved). The one file that crosses the cutoff keeps its old spans on disk, not in any answer, until all of it is old. If that is more than 7 days away, the file is written again when a third of it is old.
  • With the option retentionMs, the store drops by itself when it opens and then every 10 minutes. A span is gone at most 1 hour and 10 minutes after it got too old, plus the time of the drop. A store that is not open drops nothing.

Check the size of a store

Errors and input rules

A full disk, a closed store, bad input.

Data lifecycle

Retention and deletes with the server.