Skip to main content

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.

To process customer usage, Zenskar uses a two-phase approach for API-based ingestion:
  1. Define the schema of your usage events in Zenskar, which creates dedicated API endpoints for each event type.
  2. 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.
  1. Log in to your Zenskar dashboard.
  2. Navigate to Usage > Usage Events.
  3. Click + ADD USAGE EVENT to open the configuration form.
First definition: Compute usage events
  • Usage Event Name: Enter Compute events. This creates the endpoint https://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 timestamp is selected.
  • Review the Data Schema Preview and click ADD USAGE EVENT.
Second definition: Storage usage events
  • Usage Event Name: Enter Storage events. This creates the endpoint https://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 timestamp is 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.
  1. Log in to your Zenskar dashboard.
  2. Navigate to Usage > Usage Events and select the event type to ingest data for (e.g., compute_events or storage_events).
  3. 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.
  4. After uploading, the events appear in the Events Table for the selected event type.