Speech of Aliaksandr Valialkin, Founder VictoriaMetrics, at Ruby Meditation #26 Kyiv 16.02.2019
Next conference - http://www.rubymeditation.com/
Prometheus is a popular solution for metrics' collection and alerting. But it isn't suited for storing historical data. Let's see how VictoriaMetrics resolves this issue.
Announcements and conference materials https://www.fb.me/RubyMeditation
News https://twitter.com/RubyMeditation
Photos https://www.instagram.com/RubyMeditation
The stream of Ruby conferences (not just ours) https://t.me/RubyMeditation
2. Let me introduce myself
● VictoriaMetrics founder and core developer
● Fasthttp creator
● Fond of performance optimizations
3. What is Prometheus?
● The most popular monitoring system
● Metrics’ collector
● Time Series DB
● Rules evaluator and alerter
4. What Prometheus can do?
● Collecting metrics from pre-configured targets
● Storing metrics in the local and remote DBs
● Executing queries against metrics stored in the DB
● Sending alerts on pre-configured rules
● Helping to build nice dashboards in Grafana
5.
6. Ruby + Prometheus
● https://github.com/reinh/statsd +
https://github.com/prometheus/statsd_exporter
● https://github.com/prometheus/client_ruby - hard to use properly due
to support pre-fork (unicorn) servers issue
7. https://github.com/reinh/statsd usage
# Set up a global Statsd client for a server on localhost:9125
$statsd = Statsd.new 'localhost', 9125
# Send some stats
$statsd.increment 'garets'
$statsd.timing 'glork', 320
$statsd.gauge 'bork', 100
# Use {#time} to time the execution of a block
$statsd.time('account.activate') { @account.activate! }
# Create a namespaced statsd client and increment 'account.activate'
statsd = Statsd.new('localhost').tap{|sd| sd.namespace = 'account'}
statsd.increment 'activate'
8. Local DB issues in Prometheus
● Doesn’t scale outside the node
● Has limited size and retention (15 days)
9. Remote DB to rescue
● Remote DB may transparently scale to many nodes
● Remote DB may deal better with big retentions
● Remote DB may collect and query data from multiple Prometheus
instances
● Remote storages for Prometheus -
https://prometheus.io/docs/operating/integrations/#remote-endpoints-
and-storage
10.
11. What is VictoriaMetrics?
● Long-term remote storage for Prometheus
● Single-node version is available at
https://github.com/VictoriaMetrics/VictoriaMetrics/wiki/Single-server-VictoriaMetrics
● SaaS is in progress at https://victoriametrics.com
● There is SaaS playground at https://play.victoriametrics.com/signIn
12. VictoriaMetrics features
● Fast and cost-effective - see articles at https://medium.com/@valyala
● Easy to operate - just a single executable without dependencies
● Supports PromQL - native query language for Prometheus
● Accepts metrics in InfluxDB and Graphite formats