Prerequisite Please see here to get and set your API Key environment variable.
Integration
Express Integration
Lytix provides an out of the box middleware that you can use to collect data from your NodeJS (Express) project. To get started, simply add the middleware to your Express app.Note: If you enable request metrics, data will be published with the
requestDuration metric nameManual Integration
You can always wrap your entrypoint to get access to all of Lytix log tracing features (for example if you are running a cron job and have a main entrypoint)Error Capturing
Error Class
You can now just replace all yourthrow new Error calls with throw new LError. For example:
Error Increment
You can also send an error along with related logs without throwing an error by using theincrement method.
Examples
To see all examples please check the Github repo hereLLM Model Input Output Collection
Lytix supports automatically collecting the input and output of LLM models. To do this you can use the followingLLM Model Trace Collection
Lytix also supports capturing trace information (e.g. duration) for the LLM model. To do this you can use the following
Manual Metric Collection
You always have the option to manually push metrics to the Lytix platform with custom names and metadata. The following example pushes a metric to the Lytix platform with the nametestMetic and the value 1 along with the env: prod metadata.
