lerix 0.5.0 or later. For what you see in the dashboard, read
Analytics and Feedback.
Analytics
Record what happens on your backend as analytics events.track returns
immediately and never raises: events are buffered in memory and a background
thread sends them in batches.
user_idis your own ID for the person the event is about, the same one your apps pass tosetUser(). Events without it belong to one anonymous service user, so pass it whenever the event is about someone.- Names start with a letter, then letters, digits, spaces,
_,.,:or-(2 to 64 characters). An event with an invalid name is dropped (and logged withdebug=True). - Props are a
dictof up to 25 keys. Keys start with a letter or_, then letters, digits,_,.or-. Values are strings (up to 1,024 characters), finite numbers, bools orNone. Invalid entries are dropped one by one; nested dicts and lists aren’t supported.
Delivery
Events are sent every 10 seconds, as soon as 50 are waiting, onlerix.flush() or lerix.analytics.flush(), and when the interpreter exits.
Each request carries up to 100 events, and up to 1,000 wait in memory (the
oldest is dropped past that).
A batch the API refuses as invalid is dropped. A network error, 401, 429 or
5xx keeps it and retries with backoff (2 seconds up to 5 minutes). Events
aren’t kept across restarts.
Environment
Events carryprod, dev or your own value: production becomes prod and
development becomes dev. An unset or invalid value becomes dev with
debug=True, otherwise prod.
Feedback
Send feedback from your backend, for example from your own support form or a chatbot. There is no UI on the server:submit posts what you give it and
returns the feedback ID. It shows up under Feedbacks in the dashboard.
messageis trimmed and must be 1 to 4,000 characters.attachments: up to 5 PNG, JPEG or WebP images of up to 5 MB each, asbytes,FeedbackAttachmentor a dict with the same fields. The type is read from the bytes; acontent_typethat disagrees is an error.- Inside a traced request, the feedback is linked to the request’s trace.
- Unlike
track,submitblocks and raiseslerix.LerixApiError: codeINVALID_FEEDBACKfor bad input (nothing is sent), or the API error after two retries of a network error, 429 or 5xx. Retries reuse the same client ID, so the feedback is never created twice. It returnsNonewithenabled=False.
The
user_id you pass is stored as reported by your server. Replies by
push only go to users verified through a client SDK’s setUser.