Successfully reported this slideshow.
Your SlideShare is downloading. ×

Optimizing the Grafana Platform for Flux

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Upcoming SlideShare
Flux and InfluxDB 2.0
Flux and InfluxDB 2.0
Loading in …3
×

Check these out next

1 of 24 Ad

Optimizing the Grafana Platform for Flux

Download to read offline

Flux, the new InfluxData Data Scripting Language (formerly IFQL), super-charges queries both for analytics and data science. Matt will give a quick overview of the language features as well as the moving parts for a working deployment. Grafana is an open source dashboard solution that shares Flux’s passion for analytics and data science. For that reason, they are very excited to showcase the new Flux support within Grafana, and a couple of common analytics use cases to get the most out of your data.

In this talk, Matt Toback from Grafana Labs will share the latest updates they have made with their Flux builder in Grafana.

Flux, the new InfluxData Data Scripting Language (formerly IFQL), super-charges queries both for analytics and data science. Matt will give a quick overview of the language features as well as the moving parts for a working deployment. Grafana is an open source dashboard solution that shares Flux’s passion for analytics and data science. For that reason, they are very excited to showcase the new Flux support within Grafana, and a couple of common analytics use cases to get the most out of your data.

In this talk, Matt Toback from Grafana Labs will share the latest updates they have made with their Flux builder in Grafana.

Advertisement
Advertisement

More Related Content

Slideshows for you (20)

Similar to Optimizing the Grafana Platform for Flux (20)

Advertisement

More from InfluxData (20)

Recently uploaded (20)

Advertisement

Optimizing the Grafana Platform for Flux

  1. 1. Optimizing Grafana for Flux Matt Toback
  2. 2. TL;DR ● Flux is powerful ● You can start playing with Flux in Grafana today ○ Flux support in Grafana is available via a new datasource plugin ● For now, no automated way to migrate dashboards ○ Transpiler for Influx queries is being worked on ○ You can migrate your dashboards and panels manually
  3. 3. Housekeeping: Upgrade to v5
  4. 4. Provisioning API: Config as code
  5. 5. Feedback: david@grafana.com
  6. 6. Flux
  7. 7. Flux Design Goals Decouplings Galore! ● Decouple language from the execution engine ○ Execution engine takes a DAG of transformations ○ Transpilers: Flux, Influx Query, PromQL ● Decouple database from query computation ○ Iterate faster on query engine ○ Keep database untouched ○ Independently scalable ● Add more functions ○ Chainable: transformation from input table to output table
  8. 8. Flux recap from(db: “telegraf”) |> filter(fn: (r) => r[“host”] == “myServer”) |> range(start: -1h)
  9. 9. Flux primer: Select one value from a table from(db: “telegraf”) |> filter(fn: (r) => r[“host”] == “myServer”) |> range(start: -1h) |> max() // Selector
  10. 10. Flux primer: Window-chunk and aggregate from(db: “telegraf”) |> filter(fn: (r) => r[“_measurement”] == “cpu”) |> range(start: -1h) |> window(every: 10m) |> mean() // Aggregator |> filter(fn: (r) => r._value > 1) // Having
  11. 11. Flux query planning from(db: “telegraf”) |> filter(fn: (r) => r[“host”] == “myServer”) |> range(start: -1h) |> max() from(db: “telegraf”) |> range(start: -1h) |> filter(fn: (r) => r[“host”] == “myServer”) |> max() ● Same plan DAG
  12. 12. Flux query planning gotchas from(db: “telegraf”) |> filter(fn: (r) => r[“host”] == “myServer”) |> range(start: -1h) |> max() from(db: “telegraf”) |> filter(fn: (r) => r[“host”] == “myServer”) |> max() // Selector function returns 1 record |> range(start: -1h) from(db: “telegraf”) |> range(start: -1h) |> filter(fn: (r) => r[“_value”] > 1) // Full table scan
  13. 13. User defined functions select = (db=”telegraf”, m, f) => { return from(db:db) |> filter(fn: (r) => r._measurement == m and r._field == f) } select(m: “cpu”, f: “usage_user”) |> filter(fn: (r) => r[“host”] == “myServer”) |> range(start: -1h)
  14. 14. Chainable user defined functions myFilter = (m, f, table=<-) => { return table |> filter(fn: (r) => r._measurement == m and r._field == f) } from(db: “telegraf”) |> myFilter(m: “cpu”, f: “usage_user”) |> range(start: -1h)
  15. 15. Flux function library https://github.com/influxdata/platform/tree/master/query/functions
  16. 16. Math on tables cpu = from(db)... CpuRequests = from(db)... join( tables: {cpu: cpu, req: CpuRequests}, fn: (t) => t.cpu._value / t.req._value ) // Implicit join on time
  17. 17. New response format: CSV
  18. 18. Get started: Flux ● Run latest influxd (nightly) ○ https://portal.influxdata.com/downloads ○ influxd config > config.toml # enable ifql influxd -config config.toml ● Run nightly build of fluxd ○ https://s3.amazonaws.com/dl.influxdata.com/flux/nightlies/fluxd_nightly_macOS_amd64.tar.gz ○ https://s3.amazonaws.com/dl.influxdata.com/flux/nightlies/fluxd_nightly_linux_amd64.tar.gz ○ Generate config and start like done above ● Generate data ○ brew install telegraf telegraf
  19. 19. Get started: Grafana datasource ● Get Grafana nightly or check out master ○ Clone, build, and run from Github; or use a docker image: grafana/grafana-dev:master-25e1d72 ○ Support for the plugin will be in v5.2 ● Install Flux datasource plugin ○ https://github.com/grafana/influxdb-flux-datasource ○ Clone into data/plugins ○ Restart Grafana ● Add datasource Flux ● Add dashboard ● Add panel
  20. 20. Demo
  21. 21. Datasource feature summary ● Syntax highlighting, tab completion, raw table preview ● Inline function documentation ● $range variable
  22. 22. Datasource feature summary ● Shortcodes ● Template variables with helper functions ○ measurements() ○ field_keys() ○ tags() ○ tag_values() ● Annotations
  23. 23. Release!
  24. 24. Thanks for listening! Questions? @mattttt

×