prometheus_covid19

command module
v0.0.0-...-64098bb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

README

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

screenshot

Usage

  1. Clone this repository
$ git clone https://github.com/roidelapluie/prometheus_covid19
$ cd prometheus_covid19
  1. 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
  1. 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.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL