prometheus_covid19
This is a remote read storage adapter for Prometheus.
This is a hack I made to learn about Remote Read in Prometheus and to manipulate
Covid19 data with PromQL.
Note that those numbers are actual people and everyone can help slowing the
spread of the virus:
https://www.who.int/emergencies/diseases/novel-coronavirus-2019/advice-for-public
Usage
- Clone this repository
$ git clone https://github.com/roidelapluie/prometheus_covid19
$ cd prometheus_covid19
- Clone the data (I do not provide the data). This adapter uses the covid19
JHU CSSE data set.
$ git clone https://github.com/CSSEGISandData/COVID-19
- Run the remote adapter (you will need a functional golang setup)
$ go run *.go
Prometheus setup
Download Prometheus.
Exemple prometheus.yml:
remote_read:
- url: http://127.0.0.1:8080/read
read_recent: true
Launch prometheus with a big lookback delta, as the data has a 24h granularity:
$ ./prometheus --query.lookback-delta=36h
Metrics
The metrics you have access to depends on the CSV files in the data set.
At the time of writing, you have access to the following metrics:
- covid19_confirmed_global
- covid19_confirmed_US
- covid19_deaths_global
- covid19_deaths_US
- covid19_recovered_global
Update the data set
Update the git repo and launch the remote read adapater again. The adapter reads
the data at startup.
$ cd COVID-19
$ git pull
$ cd ..
About this work
I do not guarantee the quality of this work, it was done quickly and only for
hacking.
Pull requests are accepted.
This work is licensed under Apache-2.0 license and is partially based on the Prometheus
remote_read example, by the prometheus authors.