Meter Event Schema
The default ingest event schema supported by Amberflo is as follows:
{
"customerId": string,
"meterApiName": string,
"meterValue": number,
"meterTimeInMillis": number,
"uniqueId": string
"dimensions": map<string, string>
}Amberflo supports the following input formats
- JSON
- NDJSON
- CSV
Amberflo also supports defining a custom schema, which transforms the input into Amberflo ingest events. This guide explains how to use a custom schema for ingesting meter events.
JSON format
Sample Input in JSON format.
[{
"customerId": "customer-123",
"meterApiName": "ComputeHours",
"meterValue": 5,
"meterTimeInMillis": 1619445706909,
"dimensions": {
"region": "us-west-2",
"az": "az1"
}
}, {
...
}]NDJSON format
Amberflo also supports the NDJSON format, where each record is separated by a new line.
Sample Input in NDJSON format.
{ "customerId": "customer-123", "meterApiName": "ComputeHours", "meterValue": 5, "meterTimeInMillis": 1619445706909 }
{ "customerId": "customer-321", "meterApiName": "ComputeHours", "meterValue": 4, "meterTimeInMillis": 1619445712341 }
{ "customerId": "customer-123", "meterApiName": "ComputeHours", "meterValue": 1, "meterTimeInMillis": 1619445783456 }CSV format
Sample Input in CSV format.
meterApiName,meterValue,meterTimeInMillis,customerId,region
ComputeHours,5,1619445706909,customer-123,us-west-2
ComputeHours,4,1619445712341,customer-321,us-east-1
ComputeHours,1,1619445783456,customer-123,us-west-2Difference in behavior for CSV and JSON inputs
If a custom schema is not provided:
- For CSV input, any columns that are not part of the Amberflo default schema will be automatically treated as dimensions.
- For JSON input, any keys that do not match the default schema will be ignored (they will not be included as dimensions or stored).
The table below illustrates how this behavior works.
| Input | Transformed Input | |
|---|---|---|---|
CSV | meterApiName meterValue meterTimeInMillis customerId region m1 1 1714070079000 c1 us-west-2 | {
"meterApiName": "m1",
"meterValue": 1,
"meterTimeInMillis": 1714073679000,
"customerId": "c1",
"dimensions": {
region": "us-west-2"
}
} | |
JSON | {
"meterApiName": "m1",
"meterValue": 1,
"meterTimeInMillis": 1714073679000,
"customerId": "c1",
"region": "us-west-2"
} | {
"meterApiName": "m1",
"meterValue": 1,
"meterTimeInMillis": 1714073679000,
"customerId": "c1"
} | |
| | | |
As shown in the example, the region column/key is not part of the default Amberflo schema. In the transformed input:
- For CSV input, the region column is automatically included as a dimension.
- For JSON input, the region key is excluded entirely.
When a custom schema is used, only the fields explicitly mapped in the schema’s sub-components are considered. All other fields are excluded—this applies to both CSV and JSON inputs.
Defining custom ingest schema
The Amberflo Custom Ingest Schema API lets you define your own custom schema based on your events. This custom schema can be used with both CSV and JSON inputs. The schema has sub-components that define the mapping of a particular source column-name/json-key to the Amberflo ingest event parameter.