Skip to main content
Enabling Monitoring To set up continuous monitoring for your AI application, navigate to the Applications section. Choose the AI application or LLM model you wish to monitor from your list of connected applications and select Enable Monitoring.
1

Connect Application Logs

Select how you wish to connect your application logs to Trusys. This is crucial for data ingestion and analysis:

Folder MethodInput the folder path where your application logs are stored. Select the cloud provider (currently Azure and AWS are supported) and provide the necessary authentication details.

SDK MethodSelect this option and choose an existing API key to save the configuration. This API key should be integrated into your application’s project to send logs directly to Trusys.1. Install the SDKInstall openlit using pip:
pip install openlit
2. Set Environment VariablesConfigure the required environment variables for exporting telemetry data:
export OTEL_EXPORTER_OTLP_ENDPOINT="https://otel.trusys.ai"
export OTEL_EXPORTER_OTLP_HEADERS="x-api-key=abc123"
export TRUSYS_APP_ID="xyz123"
💡 Replace abc123 with your actual API key. Refer to the documentation on “How to Create an API Key” for more details. 💡 Replace xyz123 with your actual application ID of your application on trusys platform.
3. Import the SDKIn your application code, import the openlit SDK:
import openlit
import os
4. Initialize the SDKInitialize openlit with your application ID:
openlit.init(application_name=os.getenv("TRUSYS_APP_ID"))
This sets up observability and monitoring hooks automatically for your application.
2

Define Collection Settings

Configure how Trusys collects data from your logs:
  • Sampling Frequency – Choose between percentage-wise or count-wise sampling.
  • Enter Percentage or Count – Specify the exact percentage of logs to sample (e.g., 10% of logs) or the number of logs to sample (e.g., 100 logs).
By default, sampling is performed and evaluated every hour.
3

Define Functional Monitoring Metrics

Select functional metrics against which you want to monitor your production logs and define their respective expected values. These metrics assess the performance and accuracy of your AI application in real-time.
4

Define Security Monitoring Metrics

Select vulnerable categories you wish to monitor for your application. This ensures continuous vigilance against potential security threats and compliance breaches.
Session Tracking for Conversational ApplicationsFor applications that maintain user sessions (such as chatbots, virtual assistants, or multi-turn conversational interfaces), implement session tracking to enable comprehensive evaluation and monitoring of complete user journeys. Evaluation is performed on traces with the same application.id, and sessions are identified by grouping traces that share a session.id attribute. The end of a session is explicitly marked with the ended status.On every request:
from opentelemetry import trace
span = trace.get_current_span()
span.set_attribute("session.id", "<user_session_id>")
On session end:
tracer = trace.get_tracer(__name__)
with tracer.start_as_current_span("session.end") as span:
        span.set_attribute("session.id", "<user_session_id>")
        span.set_attribute("session.status", "ended")
Upon successfully enabling monitoring, you will begin to see traces from your application appear in the Traces section, detailed evaluation results for each log, and a Monitoring Dashboard providing an overview of your application’s health, functional metric evaluations, and security evaluations.