6 min readUpdated Mar 2, 2026

Usage Overview

Overview

The UsageOverview component is an essential dashboard for the token usage information within the Vantage analytics platform. It provides insights about token consumption over various periods and allows users to filter, visualize, and download their usage data. It serves different scopes such as user-level, client-level, and organization-level insights. The primary aim of this component is to present usage metrics effectively, enabling users to understand and manage their resource consumption more effectively.

Settings

1. scope

2. periodKey

3. customFrom

4. customTo

5. dateDropdownOpen

6. dateDropdownTab

7. summary

8. events

9. pagination

10. loading

11. eventsLoading

12. activeSection

13. granularity

14. filterOp

15. filterCategory

How It Works

  1. Initialization: The component initializes with default settings, including 'user' scope and 'this_month' period.

  2. Data Fetching:

    • Uses the fetchSummary function to send a request to the specified API endpoint to get the usage summary based on the current settings.
    • A similar approach is used in fetchEvents, which retrieves usage events data.
  3. Event Handling: User interactions, such as changing scopes or periods, or selecting filters, trigger updates to state variables and subsequently re-fetch the relevant data.

  4. Rendering:

    • Outputs a loading state until the data is ready, then dynamically populates the charts and summaries with fetched data.
    • Displays various UI elements including charts, summaries, and date selectors.

Use Cases & Examples

Use Case 1: User Monitoring

An analytics manager at a company wants to track the token consumption of individual users to optimize resource allocation and identify potential cost-saving areas.

Use Case 2: Business Insights

A project lead is interested in understanding the overall usage patterns within different operational categories over past months to make informed data budgeting decisions for the upcoming quarter.

Use Case 3: Performance Comparison

A data analytics team desires to conduct a comparative analysis of token usage between the current month and the previous month, identifying trends or anomalies.

Example Configuration for Use Case 1

To enable monitoring for a specific user over the last 30 days, the component can be configured as follows:

javascript
const usageOverviewConfig = {
    scope: 'user',
    periodKey: 'last_30',
    customFrom: '',
    customTo: '',
    dateDropdownOpen: false,
    dateDropdownTab: 'presets',
    summary: null,
    events: [],
    pagination: { page: 1, totalPages: 1 },
    loading: true,
    eventsLoading: true,
    activeSection: 'overview',
    granularity: 'daily',
    filterOp: null,
    filterCategory: null,
};

This configuration focuses on individual usage over an extended timeline, making it possible to gather comprehensive insights into token consumption patterns for analysis.