Destinations
InfluxDB
Write line protocol directly to InfluxDB.
healthHozz writes line protocol directly to InfluxDB's write endpoint.
Setting it up#
Put the whole write URL in the address field#
Include the query string:
/api/v2/writewithorg,bucketandprecision, or/write?db=…for 1.8.Put the authorization value in the secret field#
For 2.x and 3.x, enter
Token YOUR_API_TOKEN.Set the measurement and precision under Details#
The measurement defaults to
health. Match the URL's precision.Send a test#
The probe writes one
hozz_connection_testpoint without Health data.
InfluxDB 2.x and 3.x#
POST http://influxdb.local:8086/api/v2/write?org=YOURORG&bucket=health&precision=ns
Authorization: Token YOUR_API_TOKEN
Content-Type: text/plain; charset=utf-8InfluxDB 1.8#
POST http://influxdb.local:8086/write?db=health&precision=nsWhat gets written#
health,type=heart_rate,source=Apple\ Watch,device=Apple\ Watch,unit=count/min value=62.5 1787433046500000000
health,type=sleep_analysis,source=Apple\ Watch value=3.0,duration=1800.0 1787436000000000000
health_workouts,type=workout,activity=Running,source=Apple\ Watch duration=1800.0,id="7b21c0de-0000-4000-8000-000000000001" 1787382000000000000
health_deletions,type=step_count,id=9c40c0de-0000-4000-8000-000000000002 deleted=trueMeasurements#
| Measurement | Holds |
|---|---|
| health | Every sample with a numeric value. |
| health_workouts | Workouts. |
| health_events | Records with no numeric value at all, such as a correlation. |
| health_deletions | Tombstones. |
health is the configurable part; the four suffixes follow whatever you set it to.
Tags#
| Tag | Value |
|---|---|
| type | The metric name, e.g. heart_rate. workout for a workout. |
| source | The app or device that recorded it. Omitted when unknown. |
| device | The hardware name. Omitted when unknown. |
| unit | HealthKit’s unit string. Omitted for types without one. |
| activity | Workouts only — Running, Cycling, and so on. |
Tags stay low-cardinality. Record identifiers are not tags, except on deletions.
Fields#
| Field | Type | Where |
|---|---|---|
| value | Float | Samples. |
| duration | Float | Seconds. Present when the record covers an interval. |
| id | String | Workouts and events, for tracing a point back to a record. |
| deleted | Boolean | Tombstones. |
Limits#
Deletions are recorded, not applied. Reconcile tombstones from <measurement>_deletions. Their ids are tags because tombstones have no source timestamp and would otherwise overwrite one another.
Non-finite values go to <measurement>_events.