Prometheus 1.6 includes a new experimental feature called remote read. Let's look at what it can do.
Long term storage is one of the most requested features of Prometheus. The remote write path allows streaming data out of Prometheus, and the new remote read allows pulling that data back in PromQL queries.
While long term storage is its primary intended use, the APIs don't restrict it to that. You could use it to transparently access data from an older monitoring system that Prometheus has replaced, or even a SQL database. Such uses should be very limited on both reliability and sanity grounds, but let's run small example to give a taste of what's possible.
Presuming you already have a working Go build environment, let's run the adapter:
go get -d github.com/robustperception/go_examples/sql_read_adapter cd $GOPATH/src/github.com/robustperception/go_examples/sql_read_adapter go build ./sql_read_adapter &
This creates and fills a local SQLite database.
Now let's point a minimal Prometheus at it which only does remote read:
wget https://github.com/prometheus/prometheus/releases/download/v2.0.0/prometheus-2.0.0.linux-amd64.tar.gz tar -xzf prometheus-*.tar.gz cd prometheus-* cat <<'EOF' > prometheus.yml remote_read: - url: :8080/read read_recent: true EOF ./prometheus
If you go to Prometheus's expression browser, you can run arbitrary SQL queries:
The source code for this demo is available, and is easily extendable to other databases and data sources. Don't go too far though, you don't want a misbehaving system to take out your critical monitoring!
Unsure how to scale Prometheus? Contact us.
No comments.