Skip to main content
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

ControlDescription
SearchLocate tenants by name using the search bar
Time RangeFilter tenant-level metrics based on a predefined or custom date range
Sort by CostQuickly identify high-usage or high-spend customers

Tenant List Columns

ColumnDescription
TenantThe unique identifier of the end customer
SessionsTotal number of sessions generated for this tenant within the selected time range
TracesTotal number of traces recorded for this tenant
CostAggregated token cost attributed to this tenant
ActionsView 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:
  1. Search for their tenant ID in the Tenants view
  2. Click View Traces to see all their recent activity
  3. Identify the problematic trace and investigate the root cause

Usage-Based Billing

Generate accurate invoices by:
  1. Filtering the Tenants view by your billing period
  2. Exporting cost data per tenant
  3. Attributing LLM costs directly to each customer

Performance Benchmarking

Compare performance across your customer base:
  1. Sort tenants by trace count or cost
  2. Identify outliers in latency or error rates
  3. 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
Last modified on January 28, 2026