Metering
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.
Fig. 1: Zenskar ingests data from various data sources and generates invoices
Data ingestion
Read the documentation on the various ways Zenskar can ingest your 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. 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:
Updated about 2 months ago