Lerix 0.4.0 or later. Both features use the LerixClient singleton
you inject after Installation. For what you
see in the dashboard, read Analytics and
Feedback.
Analytics
Record what happens on the server: sign-ups, payments, jobs. Events show up under Analytics in the dashboard next to the ones your apps send.OrdersService.cs
Tracknever throws and never blocks on the network. It validates the event and puts it in an in-memory buffer.userIdis your ID for the user the event is about, the same one your apps pass tosetUser()(trimmed, up to 255 characters). It is sent per event, so one service can track many users.- Names start with a letter, then letters, digits, spaces,
_,.,:or-(2 to 64 characters). Any other name drops the event. - Props: up to 25 keys, each starting with a letter or
_, then letters, digits,_,.or-. Values are strings (up to 1,024 characters), finite numbers (any numeric type ordecimal),boolornull; aJsonElementof one of those kinds works too. Anything else (nested objects, lists, dates, NaN) is dropped key by key, and logged whenDebugis on.
Delivery
Events are sent everyFlushInterval (10 seconds), as soon as FlushAt (50)
are waiting, on FlushAsync(), and on shutdown (IHostedService.StopAsync, or
disposing the client). Each request carries at most 100 events. The buffer
holds MaxQueueSize (1,000) events, dropping the oldest when full. Nothing is
written to disk.
When the API is unreachable or returns a retryable error, the batch is kept and
sending backs off from 2 seconds up to 5 minutes. Batches the API rejects as
invalid are dropped. If the project has analytics paused on the Lerix side,
sending waits for the time the API asks for.
appsettings.json
"Analytics": { "Enabled": false } turns Track into a no-op. Events carry
the environment from the Environment option (or ASPNETCORE_ENVIRONMENT /
DOTNET_ENVIRONMENT), lowercased, with Production sent as prod and
Development as dev.
Feedback
Send user feedback from your own UI, a support inbox or a bot. It shows up under Feedbacks in the dashboard, like feedback sent from the app SDKs.Messageis required (1 to 4,000 characters after trimming).Labelsare the label keys set up for the project; unknown ones are dropped by the API.Customtakes up to 50 keys and 16 KB of JSON.Attachments: up to 5 PNG, JPEG or WebP images of at most 5 MB each. The type is read from the bytes; aContentTypethat disagrees with them is an error.- A call made inside a traced request carries that request’s trace ID, and the trace is kept.
- Invalid input throws
LerixApiExceptionwithCode = "INVALID_FEEDBACK"before anything is sent. Network errors, 5xx and 429 are retried twice with the same client ID, so a retry never creates a second entry. The last error is thrown asLerixApiException. - Returns the feedback ID, or
nullwhen the SDK is disabled (Enabled = false).
The
UserId you pass is stored as reported by your server. Replies by push
only go to users verified through a client SDK’s setUser.