Customers
The Customer Dashboard in Treblle provides a comprehensive view of your API’s usage by individual customers.
It helps you understand how different customers interact with your API, identify trends in their usage patterns, and pinpoint potential issues or areas for improvement.
Accessing the Customer Dashboard
Section titled “Accessing the Customer Dashboard”The Customer Dashboard is available at the individual API level. To access it:
- Navigate to the specific API you want to analyze.
- Click on “Customers” in the left navigation bar.
- The Customer Dashboard will display all customers and their usage data for that specific API.
Customer Dashboard Overview
Section titled “Customer Dashboard Overview”The Customer Dashboard provides a comprehensive overview of all customers using your API.
Here’s what you’ll find:
-
Customer Profiles: A list of all your customers, identified by their display name or Customer ID. When available, Treblle shows the customer’s display name for easier identification instead of technical IDs.
-
Request Count: The total number of API requests each customer makes.
-
Overall Percentage: The percentage of total API requests attributed to each customer, giving you a sense of their impact on your API traffic.
-
Last Active: A timestamp indicating when each customer made their last API request.
Dashboard Customization
Section titled “Dashboard Customization”You can customize the Customer Dashboard to show the widgets that matter most to you:
-
Click the Customize Dashboard button (grid icon) in the top-right corner.
-
Enable or disable widgets such as:
- New Customers: Number of new customers in your API
- Active Customers: Number of active customers in your API
- Top Customer: Customer with highest number of requests
- Average Requests Per Customer: Average number of API requests made by all customers
- Customers List: List of 10 most recent customers in your API
- Favorite Customers: List of customers you marked as favorite
- Top Customers List: List of customers with highest number of requests in your API
Individual Customer Profile
Section titled “Individual Customer Profile”Click on any customer from the list to access their detailed profile and request history.
Customer Profile Overview
Section titled “Customer Profile Overview”The Individual Customer Profile provides:
-
Customer Name: The display name or customer ID at the top of the page
-
Total Requests: The total number of API requests made by this customer
-
Overall Percentage: The percentage of total API requests attributed to this customer
-
Request Graph: A visual representation of the customer’s API request activity over time, helping you identify peak usage periods, trends, and potential anomalies
-
Description Field: Space to add notes or context about the customer
Customer Request History
Section titled “Customer Request History”Below the overview, you’ll find a complete list of all API requests made by that customer, including:
- Method: HTTP method used (GET, POST, etc.)
- Response: Response status code
- Name: Endpoint name or path
- Load Time: Request processing duration
- Threat Level: Security assessment (Low, Medium, High)
- Device: Device type used for the request
- AI Agent: AI service detection if applicable
- Location: Geographic location of the request
- Time: Timestamp of the request
You can filter, search, and sort these requests to analyze specific patterns or troubleshoot issues for individual customers.
Adding Customer/User Information to Requests
Section titled “Adding Customer/User Information to Requests”treblle-user-id is used to identify your customers. You can pass any value here, such as ID, UUID, email, username, or company name.
The header can be included in either Request or Response Headers - Treblle will pick them up from both.
Steps to add the Customer Information in Treblle’s Express SDK
Section titled “Steps to add the Customer Information in Treblle’s Express SDK”Here’s how you can modify your Express middleware to add these headers:
// Custom middleware to add Customer informationapp.use((req, res, next) => { if (req.user) { // Ensure the user is authenticated req.headers['treblle-user-id'] = req.user.id; // Attach Customer ID } next();});
// Treblle Middlewareapp.use(treblle({ apiKey: process.env.TREBLLE_API_KEY, projectId: process.env.TREBLLE_PROJECT_ID}));Treblle Dashboard View of Customer Information
Section titled “Treblle Dashboard View of Customer Information”The image below shows how the customer information will appear on the Treblle dashboard once you add it to the request.
Implementing Customer ID Tracking in Other SDKs
Section titled “Implementing Customer ID Tracking in Other SDKs”For other SDKs, the approach is similar. Here’s how you can implement it:
-
First, check the user authentication, and then you can retrieve the Customer ID from the authentication system.
Terminal window if (isAuthenticated) {customerId = getCustomerIdFromSession() // Fetch Customer ID from session or token} -
After authentication, you can add the Customer ID to the request headers (typically as “treblle-user-id”).
Terminal window request.headers.set('treblle-user-id', customerId) -
Apply middleware to track customer data in API requests.
Terminal window applyMiddleware('customerTrackingMiddleware', routes)
For specific integration details for other SDKs, please refer to the Integration page.
The Customer Dashboard in Treblle gives valuable insights into how your customers use your API at the individual API level. With detailed customer profiles, request history, and usage analytics, you can spot patterns, monitor adoption, and address performance or support issues early on.
For a quick overview of top customers across all your APIs, use the Top Customers widget available on the workspace-level Home page.