Skip to content

Commit

Permalink
[doc] Updating write-stream documentation to be clearer for metric ty…
Browse files Browse the repository at this point in the history
…pe keys
  • Loading branch information
Jesse Yates committed Apr 5, 2017
1 parent 14db2ad commit 4be98f6
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions docs/write.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,41 @@ Streaming data events must include two things:
* timestamp

The `metrictype` field ties the event back to a JDBC table. The `timestamp` field ensures the the data can be found.

However, you are not limited to just these two field names to identify this information in the event.

Using metric field aliases (currently available only through the command line or SDK) you can define alternative field names to use for the `metrictype`. For example, assume there is a metric type (e.g. table) named 'hounds' and you added a metric field alias of 'type', the event:

Let's look at example. Suppose there is a metric type (e.g. table) named 'hounds' and we just want to send the indication that an event happened (not even the value of the event, just that it happened). The event would look like:

```
{
"metrictype" : "hounds"
"timestamp" : 1490638685520
}
```

While the idea of a `metrictype` and `timestamp` are required, you are not required to use those exact field names.

A custom "metric type key" (currently available through the command line or SDK) you can define alternative field names to use for the `metrictype`. Suppose we added a metric type key of 'type', then we could send the event:

```
{
"type" : "hounds"
"timestamp" : 1490638685520
}
```

Would be all that is needed to make a valid event.
Where the `type` field serves the same purpose as the `metrictype` key, but is perhaps a bit more friendly.


Similarly, timestamp aliases can be defined for each metric (or globally for all metrics). Continuing the example above, uppose we define a timestamp alias of 'ts'. We can then send the following event:

Similarly, timestamp aliases can be defingted for each metric (or globally). So you can define a timestamp alias of 'ts' and, continuing the above example, send a valid event:


```
{
"type" : "hounds"
"ts" : 1490638685520
}
```

Which logically exactly the same, but far more friendly to use. You can use metric type type keys and field aliases to fully customize your stream events to any existing data format.

[Read more about schema management and aliases](/schema)

## Batch Uploads
Expand Down

0 comments on commit 4be98f6

Please sign in to comment.