Create Raw Metric

:body CreateRawMetricRequest
:return RawMetricResponse
creates a raw metric

Introduction

🚧

Prerequisite

Zenskar's metering documentation provides the prerequisite conceptual knowledge.

In Zenskar, a data-ingestion API is known as a raw metric. This API helps you create a new raw metric in an automated way.

The API request parameters are described below.

ParamDescription
nameA descriptive name.
api_slugThe slug of the endpoint URL. The slug must contain alphanumeric characters, underscores, and dashes only.
dataschemaDefine the schema of the JSON data you wish to send to Zenskar in the dataschema object. Zenskar will use this schema to create tables.

customer_id and timestamp are mandatory system parameters in a POST or GET request related to raw metrics. However, you must not include these parameters while building the dataschema parameter.

The dataschema object

📚

Note

Irrespective of the data source type, Zenskar stores all ingested data in the form of RDBMS tables.

Tables are database objects that contain all the data in a database. In tables, data is logically organized in a row-and-column format similar to a spreadsheet.

The dataschema is a string-based key-value store for custom fields you would like to include in the raw metric. The data type of the column is determined by the dataschema you defined while creating a raw metric. A sample raw metric with all available data types is shown below:

Data type
Int64
Float64
Decimal
Bool
Date32
DateTime64
String
UUID

The data type of the database column is determined by the schema you defined while creating a raw metric. A sample raw metric with all available data types is shown below:

{
    "dataschema": {
        "a_string_field": "String",
        "an_int64_field": "Int64",
        "a_float64_field": "Float64",
        "a_date32_field": "Date32",
        "a_datetime64_field": "DateTime64",
        "a_UUID_field": "UUID",
        "a_bool_field": "Bool",
        "a_decimal_field": "Decimal"
    }
}
Language
Credentials
Header
Click Try It! to start a request and see the response here!