Backend service responsible for logging metrics into timeseries database (influx). Expected to run in the cloud and receive IoT data from beehives.
Main goal and feature is described in Notion
- ✅ temperature
- TODO: add 3d temperature endpoint
/metrics/temperature
- TODO: add 3d temperature endpoint
- ✅ beehive weight (over time)
- ✅ humidity
- CO2 levels
- atmospheric pressure
- bee traffic (in/out) at the hive entrance
- audio noise volume
- vibrations
- wind speed
URL | Description |
---|---|
http://telemetry.gratheon.com | Production |
http://localhost:8600 | Local dev |
This service provides two types of APIs
- GraphQL API - most flexible and type safe for web-app, not versioned
- REST API - more of a legacy API, intended for IoT devices, versioned
Then start telemetry api:
just start
We are NOT using timeseries DB (influx, clickhouse) because we don't have manpower to maintain multiple storage engines at this time. So we're relying on MySQL for ease of management, even though its not as efficient.
flowchart LR
hardware-beehive-sensors[<a href="https://github.com/Gratheon/hardware-beehive-sensors">hardware-beehive-sensors</a>] -."send aggregate (5sec)\n metric value".-> telemetry-api
telemetry-api --"update beehive entrance daily traffic counters"--> mysql[(<a href="https://github.com/Gratheon/mysql">mysql</a>)]
beehive-entrance-video-processor[<a href="https://github.com/Gratheon/beehive-entrance-video-processor">beehive-entrance-video-processor</a>] -."send entrance\n traffic metric".-> telemetry-api
telemetry-api --"store bee traffic timeseries" --> mysql
grafana[(<a href="https://github.com/Gratheon/grafana">grafana</a>)] --"fetch history"--> mysql
telemetry-api --"verify API tokens for REST calls"--> user-cycle[<a href="https://github.com/Gratheon/user-cycle">user-cycle</a>]
web-app[<a href="https://github.com/Gratheon/web-app">web-app</a>] --"display advanced configureable graphs"--> grafana
web-app --"query for simplistic metrics\nPOST graphql"-->graphql-router[<a href="https://github.com/Gratheon/graphql-router">graphql-router</a>]--> telemetry-api