Metering

The act of measuring customer activity or consumption of resources to collect the metrics needed to generate an invoice.

Overview

📖

Definitions

Metrics represent all the data that you capture to analyze trends across your business and technology domains. Raw metrics are unfiltered data. Derived metrics, on the other hand, are generated when a certain combination of selection criteria (or filters) is applied on the raw metrics.

Metering is the act of measuring customer activity or consumption of resources to collect the metrics needed to generate an invoice.

Aggregates are derived metrics. Average, count, distinct, maximum, minimum, and sum are some selection criteria (or filters) applied on raw metrics to derive aggregates.

Your application can be instrumented with specific metering capabilities to extract the metrics needed to generate an invoice. These metrics could be number of messages sent or received, number of active users, or it could be some aggregate of resource consumption (CPU, memory, storage) that makes sense to your customers.

Zenskar can be configured to connect with your data sources to ingest raw metrics or aggregates. Zenskar can ingest data from various data sources seamlessly. Alternatively, you can send us your raw metrics using our application programming interfaces (APIs) to generate an invoice, as shown in Fig. 1.

Various data sources that Zenskar can connect to and various ways customers can send raw metrics to Zenskar

Fig. 1: Zenskar ingests data from various data sources and generates invoices


Data ingestion

Data ingestion is the process of moving or replicating data from data sources to destination. Zenskar can ingest your data in the following two ways:

  1. Data Sources: We pull data from your data infrastructure using data-source-specific connectors.
  2. Raw Metrics: You push data to Zenskar by creating APIs in Zenskar and integrating these APIs in your application workflow.

📚

Note

Zenskar stores all ingested data in the form of RDBMS tables. This is true irrespective of the ingestion method: push or pull.

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.

Data sources

Zenskar connects with your data sources, such as databases, data warehouses, comma-separated-value files, and spreadsheets. Subsequently, we move or replicate (pull) the data on our data infrastructure (destination) for further processing, as shown in the figure below.

📚

Further reading

Refer the detailed documentation on data sources to learn how to let Zenskar ingest data.

Raw metrics

Zenskar exposes APIs that can be integrated into your application workflow. You can use these APIs from your application to let (push) Zenskar ingest data. Alternatively, you can upload a Zenskar-compatible CSV.

📚

Further reading

Refer the detailed documentation on raw metrics to learn how to let Zenskar ingest data.


Data processing

Raw Metrics versus aggregates

You have seen how to configure data sources and data-ingestion APIs. There are two types of data that these sources can send: raw metrics and aggregates. It is important to remember that aggregates are actionable data derived from raw metrics. If the data ingested by Zenskar is raw metrics, further filtering is necessary to derive aggregates, as shown in Fig. 2.

📖

The Structured Query Language

Zenskar stores all the data in the form of RDBMS tables. Therefore, the power of the Structured Query Language (SQL) must be employed to derive and\or retrieve aggregates from the databases. If the source data is raw metrics, SQL queries must be written to derive and retrieve specific aggregates for calculations. However, if the source data is aggregates, SQL queries must only retrieve specific aggregates for calculations.

Fig. 8: Deriving aggregates from raw metrics by applying necessary filters

Fig. 2: Deriving aggregates from raw metrics by applying necessary filters

Deriving Aggregates from Raw Metrics

Zenskar provides you two ways to create SQL queries to derive and\or retrieve aggregates. Once you pick your source, a list of relevant tables are displayed. You can define SQL queries on these tables to derive or retrieve the aggregates needed to generate an invoice. There are two ways to create SQL queries:

  1. Visual query builder
  2. SQL builder