Schema Detection
PEEK automatically detects the structure of your JSON payloads without storing raw message data.
How It Works
Every time a message arrives, PEEK extracts the field names and types from the JSON payload. For example, this message:
{
"temperature": 22.5,
"humidity": 48,
"sensor": {
"model": "DHT22",
"firmware": "1.2.3"
}
}Produces this detected schema:
| Field | Type |
|---|---|
| temperature | number |
| humidity | number |
| sensor·model | string |
| sensor·firmware | string |
Nested objects are flattened using the · (middle dot) separator. Arrays are recorded as the array type without recursing into their contents.
Schema Evolution
As your devices evolve, their payloads may gain new fields. PEEK handles this gracefully — if a message contains all the fields of an existing schema plus new ones, the schema is updated and the new fields are marked as optional.
Discriminator Fields
Many IoT systems send different message types through the same channel. For example, a device might send telemetry, status, and alert messages that all have different structures.
To keep these schemas separate, you can configure a discriminator field on your source. This tells PEEK which field determines the message type. For example, setting the discriminator to messageType means:
{"messageType": "telemetry", "temperature": 22} -> Telemetry Schema
{"messageType": "status", "battery": 85} -> Status Schema
{"messageType": "alert", "code": "E001"} -> Alert SchemaWithout a discriminator, these would be merged into one schema with many optional fields. With a discriminator, they remain separate, semantically meaningful schemas.
Group-By Analytics
You can mark any schema field as a group-by field to track fleet-wide distributions. For example, marking sensor·firmware as group-by lets you see how many devices are running each firmware version.
PEEK tracks the latest value of group-by fields per device and displays the distribution as an inline chart on the Messages page.
Viewing Schemas
Navigate to the Messages tab in the dashboard to see all detected schemas. Click on a schema to view its fields, toggle optional flags, enable group-by analytics, and rename it for clarity.