Upgrade to Pro — share decks privately, control downloads, hide ads and more …

InfluxDB

 InfluxDB

The talk I gave on the Ruby Usergroup Berlin on the 3rd of March 2016

Bodo Tasche

March 03, 2016
Tweet

More Decks by Bodo Tasche

Other Decks in Programming

Transcript

  1. SELECT COUNT(duration) as count_duration, MIN(duration) as min, MAX(duration) as max,

    MEAN(duration) as MEAN FROM events WHERE time > now() - 1h GROUP BY time(30s)
  2. CREATE CONTINUOUS QUERY cq_30m ON food_data BEGIN SELECT mean(temperature) AS

    mean_temperature, mean(delivery_time) AS mean_delivery_time INTO food_data."default".downsampled_orders FROM orders GROUP BY time(30m) END
  3. INPUT PLUGINS aerospike, apache, bcache, couchdb, disque, dns query time,

    docker, dovecot, elasticsearch, exec, haproxy, httpjson, influxdb, jolokia, leofs, lustre2, mailchimp, memcached, mesos, mongodb, mysql, net_response, nginx, nsq, phpfpm, phusion passenger, ping, postgresql, powerdns, procstat, prometheus, puppetagent, rabbitmq, raindrops, redis, rethinkdb, riak, sensors, snmp, sql server, twemproxy, zfs, zookeeper, win_perf_counters, system, cpu, mem, net, netstat, disk, diskio, swap, statsd, mqtt_consumer, kafka_consumer, nats_consumer, github_webhooks
  4. OUTPUT PLUGINS influxdb, amon, amqp, aws kinesis, aws cloudwatch, datadog,

    graphite, kafka, librato, mqtt, nsq, opentsdb, prometheus, riemann
  5. GitLab Performance Monitoring: a monitoring system using InfluxDB [...] then

    visualized using Grafana — Gitlab Performance Blogpost
  6. CPU_ALERT.TICK stream // Select just the cpu measurement .from().measurement('cpu') .alert()

    .crit(lambda: "usage_idle" < 70) // Whenever we get an alert write it to a file. .log('/tmp/alerts.log')
  7. kapacitor define \ -name cpu_alert \ -type stream \ -tick

    cpu_alert.tick \ -dbrp kapacitor_example.default
  8. stream .from().measurement('cpu') .alert() // Compare values to running mean and

    standard deviation .crit(lambda: sigma("usage_idle") > 3) .log('/tmp/alerts.log')
  9. stream .from().measurement('cpu_usage_idle') .groupBy('host') .window().period(1m).every(1m) .mapReduce(influxql.mean('value')) .eval(lambda: 100.0 - "mean").as('used') .alert()

    .message('{{ .Level}}: {{ .Name }}/{{ index .Tags "host" }} has ' + 'high cpu usage: {{ index .Fields "used" }}') .warn(lambda: "used" > 70.0) .crit(lambda: "used" > 85.0) .slack().channel('#alerts') .pagerDuty()