Patrick Partin What just happened? Creating your own real-time dashboard with Grafana, Influx, and Telegraf Congratulations on successfully downloading this slide deck! Inside is valuable information, and since there’s absolutely no cost other than your time, why not try it out?
Session Agenda Influx Telegraf Grafana Install and Configure it to store your data Telegraf Install and Configure to pull and push to Influx Grafana Install and Configure to pull from Influx Create a few simple Dashboards Create an Alert that when triggered, posts to Slack Note to Self - Before you get started, extract that Grafana.zip because it has like 15k tiny files and depending on the day, might take 2 mins unlike the others. 2 | #SQLSatLA
Background Patrick Partin Admin, Architect, DBA, Developer, Engineer Manager of Data and Systems Infrastructure at SmartDrive @GingerDBA – Twitter @Paddyrick – SQLCommunity.Slack.com You could go on and on, but they’re here for the information, not the backstory. Shut up, move on. 3 | #SQLSatLA
Please Support Our Sponsors SQL Saturday in Los Angeles is made possible with the generous support of these sponsors. You can support them by opting-in and visiting them in the sponsor area. #SQLSatLA
Orange County User Group Orange County Power BI User Group Regional Local User Groups LA Data Platform (a.k.a. SQL Malibu) 3rd Wednesday of each month ladataplatform.pass.org - Join us remotely! L.A. User Group 3rd Thursday of each odd month sqlla.pass.org Los Angeles - Korean Every Other Tuesday sqlangeles.pass.org San Diego User Group 1st & 3rd Thursday of each month meetup.com/sdsqlug meetup.com/sdsqlbig Orange County User Group 2rd Thursday of each month bigpass.pass.org Orange County Power BI User Group meetup.com/OC-Power-BI-User-Group/ Sacramento User Group 1st Wednesday of each month http://sac.pass.org/ #SQLSatLA
Regional 2019 SQL Saturday events SQL Saturday in Sacramento When: August 17, 2019 Where: Patrick Hays Learning Center https://www.sqlsaturday.com/885 #SQLSatSac #SQLSat885 SQL Saturday in San Diego When: September 21, 2019 Where: San Diego – UCSD Extension Center, University Center https://www.sqlsaturday.com #SQLSatSanDiego #SQLSat909 #SQLSatLA
If you want to follow along… Influx 1.7.6 (April 17th) – 48mb Telegraf 1.11 (June 11th) – 19mb https://portal.influxdata.com/downloads/ Grafana (June 5th) – 52mb https://grafana.com/get/ Slack (often?) – 0mb https://slack.com/create/ Today, I will show you this starter set which works, I swear. The beauty of this, is that it’s so flexible, and can work with anything as you may become more polyglot. 7 | #SQLSatLA
Why are we doing this? In all seriousness, knowing your data is important. Having the ability to capture, track, and display is relatively easy, and shouldn’t be a blocker to your success. #SQLSatLA
Data Acquisition Push/Pull Data Storage Time Structured Merge Tree Data Visualization Alerting Monitoring
Getting to know our lab, Chooch and Halladay Connect to Chooch, push Perf Counters Chooch:8086 Connect to Halladay, grab DMVs Macbook-Pro:3000 Run Influx queries, pull JSON to display metrics, call Slack 10 | #SQLSatLA
Install InfluxDB Demo Pretty much straight out of the box. Run InfluxD.exe in a command prompt window, and the Influx.exe in another. #SQLSatLA
InfluxDB Quickies CasE SenSITiVe select * X LIMIT 5 instead of select TOP 5 * X Influx < - > SQL speak Measurements < - > Table Series < - > Columns Tag – Optional Metadata that’s indexed Field – Required metadata that’s not indexed Can’t do epoch conversions in your head? Precision rfc3339 There is soooooooo much more about this database that I love and wish that I could cover, but 60 minutes only gives so much coverage. Please do go to their website and read their well documented documentation and community forums. #SQLSatLA
Install Telegraf Demo A little less much straight out of the box. Run Telegraf.exe in a command prompt window, but do a little config on the telegraf.conf. Chooch is connecting to Halladay using the mssql input. Halladay will have Telegraf pushing to Chooch with some Perf Counters, including SSAS. #SQLSatLA
Telegraf Quickies Telegraf can push and pull We pulled from SQL Server We pushed SSAS Metrics from the SQL Server Database was created on the fly Measurements were created on the fly typeperf –q Dumped all of the hosts’s perf counters These differ between hosts and configurations This is such a fantastic program, and I cannot stress it enough. This has such amazing community support, amazing to see how much it has grown in just the few years I’ve been doing this talk. #SQLSatLA
Install Grafana Demo This program is so seriously sweet. This space is getting crowded, but it’s awfully hard to find something better. #SQLSatLA
Grafana Quickies In \conf, copy sample.ini to custom.ini Uncomment out the port, it defaults to 3000 Know your data! Ever-increasing counter? Perhaps Derivative? Non-Negative? Grab a Slack, it’s free! This is such a fantastic program, and I cannot stress it enough. This has such amazing community support, amazing to see how much it has grown in just the few years I’ve been doing this talk. #SQLSatLA
Wrapping it all up - We were able to stand up a server to take metrics We were able to push and pull metrics from Perf Counters and Inputs We were able to run some basic queries inside Influx to see how it looked We were able to create some simple dashboards, and configure thresholds and alerts 17 | #SQLSatLA
More Information - Telegraf does LOTS more than I covered https://github.com/influxdata/telegraf#input-plugins https://github.com/influxdata/telegraf#output-plugins Grafana has plenty of generic dashboards https://grafana.com/dashboards/ https://www.youtube.com/watch?v=sKNZMtoSHN4 SQL Server 2017 Developer Edition (free!) https://go.microsoft.com/fwlink/?linkid=853016 If serving from Windows, you’ll need NSSM https://nssm.cc/ 18 | #SQLSatLA
Not covered, but perhaps helpful DBATools.io Powershell pretty much everything https://ramblingcookiemonster.github.io/PSSlack/ Write into Slack from Powershell #SQLSatLA
Questions? If not, catch me after the session, or on the interwebs… Thank you! 20 | #SQLSatLA