API

cid.locals.generate_new_cid(upstream_cid=None)

Generate a new correlation id, possibly based on the given one.

cid.locals.get_cid()

Return the currently set correlation id (if any).

If no correlation id has been set and CID_GENERATE is enabled in the settings, a new correlation id is set and returned.

FIXME (dbaty): in version 2, just return getattr(_thread_locals, ‘CID’, None) We want the simplest thing here and let generate_new_cid do the job.

cid.locals.set_cid(cid)

Set the correlation id for the current request.