Closed banteg closed 1 year ago
I'm working on making something work end to end for this as a POC https://github.com/yearn/yearn-exporter/pull/337
To get setup, we need timescale running with the promscale extension installed. The image I selected already has that. We also need promscale itself which is just a layer above timescale that provides the prometheus read/write apis. Think of promscale as a microservice that sits on top of timescaledb.
Other than that, the way we format the json to be POSTed to the /write apis was all I needed to change. Since promscale supports prometheus apis, grafana had no issues querying the data.
Closing for now as the historical rebuild showed multiple issues with the promscale <-> timescale integration which deleted datapoints after insertion under certain conditions:
ERROR: duplicate key value violates unique constraint \"_hyper_627_195351_chunk_data_series_id_time_308
Also promscale has been officially discontinued: https://docs.timescale.com/promscale/latest/
as per @mariuspod idea, we could avoid duplicating the data and store everything in postgres, getting the best of both worlds
we could even keep the grafana dashboard code intact by using promscale, which would translate the promql queries![](https://s3.amazonaws.com/assets.timescale.com/docs/images/promscale-arch.png)