If you’re building AI-powered products for multiple customers, Netra’s tenant tracking gives you complete visibility into how each customer uses your platform. This is a unique capability that lets multi-tenant partners monitor, debug, and optimize AI interactions on a per-customer basis.
Why Tenant Tracking Matters
For platforms serving multiple customers, understanding per-tenant behavior is critical:
- Usage Attribution: Know exactly which customer is driving costs, token consumption, and API calls
- Customer Support: When a customer reports an issue, instantly access their specific traces without sifting through logs
- SLA Monitoring: Track performance metrics per tenant to ensure service level agreements are met
- Cost Allocation: Generate accurate billing reports based on actual LLM usage per customer
- Anomaly Detection: Identify unusual patterns in specific tenant activity before they become problems
Setting Up Tenant Tracking
Associate traces with tenants by calling set_tenant_id in your application code:
from netra import Netra
# Set tenant context - all subsequent traces will be associated with this tenant
Netra.set_tenant_id("acme-corp")
# Your LLM calls are now attributed to "acme-corp"
response = client.chat.completions.create(
model="gpt-4",
messages=[{"role": "user", "content": "Hello"}]
)
Set the tenant ID early in your request lifecycle, typically in middleware or at the start of request handling, to ensure all traces within that request are properly attributed.
View Tenants List
The Tenants view provides a centralized dashboard of all customers whose activity you monitor.
Navigate to Observability → Tenants from the left navigation menu.
Available Controls
| Control | Description |
|---|
| Search | Locate tenants by name using the search bar |
| Time Range | Filter tenant-level metrics based on a predefined or custom date range |
| Sort by Cost | Quickly identify high-usage or high-spend customers |
Tenant List Columns
| Column | Description |
|---|
| Tenant | The unique identifier of the end customer |
| Sessions | Total number of sessions generated for this tenant within the selected time range |
| Traces | Total number of traces recorded for this tenant |
| Cost | Aggregated token cost attributed to this tenant |
| Actions | View Traces button to drill down into tenant-specific data |
Clicking View Traces navigates to the Traces view, automatically filtered to display only the traces associated with that specific tenant.
Use Cases
Customer Support
When a customer reports an issue:
- Search for their tenant ID in the Tenants view
- Click View Traces to see all their recent activity
- Identify the problematic trace and investigate the root cause
Usage-Based Billing
Generate accurate invoices by:
- Filtering the Tenants view by your billing period
- Exporting cost data per tenant
- Attributing LLM costs directly to each customer
Compare performance across your customer base:
- Sort tenants by trace count or cost
- Identify outliers in latency or error rates
- Proactively reach out to customers experiencing issues
- Users - Track individual user activity within tenants
- Sessions - Group related interactions into sessions
- Traces Overview - Deep dive into individual trace analysis