To process customer usage, Zenskar uses a two-phase approach for API-based ingestion:Documentation Index
Fetch the complete documentation index at: https://docs2.zenskar.com/llms.txt
Use this file to discover all available pages before exploring further.
- Define the schema of your usage events in Zenskar, which creates dedicated API endpoints for each event type.
- Send raw usage data to those endpoints.
Prerequisites
Usage events
Usage events are granular records of customer activity (e.g., an API call, a minute of video streaming). All ingested data is stored in Zenskar’s relational database tables.
2.1: Define usage event structure
Before ingesting data, define the schema for each type of usage event in Zenskar. This creates the API endpoints to which your system will send usage data. We will define two event types: one for Compute Usage and one for Storage Usage.- Dashboard
- API
- Log in to your Zenskar dashboard.
- Navigate to Usage > Usage Events.
- Click + ADD USAGE EVENT to open the configuration form.
- Usage Event Name: Enter
Compute events. This creates the endpointhttps://api.zenskar.com/usage/compute_events. - Root Fields:
customer_id(Data type:String)timestamp(Data type:DateTime64)
- Your Data Schema: Click + ADD NEW DATA FIELD and add:
cpu_hours_consumed(Data type:Float64)region(Data type:String)
- Order By: Ensure
timestampis selected. - Review the Data Schema Preview and click ADD USAGE EVENT.
- Usage Event Name: Enter
Storage events. This creates the endpointhttps://api.zenskar.com/usage/storage_events. - Root Fields:
customer_id(Data type:String)timestamp(Data type:DateTime64)
- Your Data Schema: Click + ADD NEW DATA FIELD and add:
storage_gb_month(Data type:Float64)storage_tier(Data type:String)
- Order By: Ensure
timestampis selected. - Review the Data Schema Preview and click ADD USAGE EVENT.
2.2: Ingest usage events
Once your usage event structures are defined, your system can push usage data to the generated endpoints, or you can upload it directly via the dashboard.- Dashboard
- API
- Log in to your Zenskar dashboard.
- Navigate to Usage > Usage Events and select the event type to ingest data for (e.g.,
compute_eventsorstorage_events). - To add data:
- Upload CSV: Click UPLOAD CSV. The CSV columns must match the schema defined in step 2.1 (e.g., for
compute_events:customer_id,timestamp,cpu_hours_consumed,region). - Add single event: Use the “Add single event” option to manually enter a single event via form.
- Upload CSV: Click UPLOAD CSV. The CSV columns must match the schema defined in step 2.1 (e.g., for
- After uploading, the events appear in the Events Table for the selected event type.
