Quickstart
How to setup async logging
Lytix supports sending log events without being on the critical path. We use Traceloop to power this feature.
Prerequisite Please see here to get and set your API Key environment variable.
Install the SDK
To get started first download the relevant SDK for your language of choice.
Initialize the Logger
Now you can initialize the logger with your API key.
Note: If you are in the EU you have to update the baseURL
on the LytixAsyncLogger
to https://eu.api.lytix.co/v2/metrics/async
.
Start Collecting Logs ๐
Now you can call OpenAI as you normally would, and logs will automatically get sent to the Lytix platform.
Optional Metadata
You can also add metadata to your logs. This can be useful for tracking things like user idโs, session idโs, or other metadata.
To do this, you just need to first set the parameters on the logger:
Metadata Options
You can set the following metadata fields:
userId
: The user id of the user making the requestsessionId
: The session id of the user making the requestworkflowName
: The name of the workflow the request was made inlytix-metadata-*
: Any additional metadata you would like to track, e.g.lytix-metadata-env
:dev
will add the metadata keyenv
with the valuedev