Essential Concepts of Using Flux with InfluxDB

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] all right welcome to video one i'm sam with influx data and this video is the first of a series of tutorials on the flux query language if you don't even know what flux is you might be in the wrong place but you're welcome to stick around either way this short intro video will cover a first query using a query builder and then some of the underlying fundamentals of what flux is really doing under the hood what's happening under the hood is a pretty critical thing to have ingrained when we work more closely with flux itself there's a not a prerequisite but an assumption that people listening to this video or watching this video understand the influx db line protocol and the data model to some degree you don't have to know that to understand what's going on but it will help you to better really take more away from these videos so without further ado welcome to the the 2.0 ui we're not going to explore this so much but we are going to use the explore tab because that's where we will write our flux queries so let's jump in there so quick anatomy down here what i'm circling is the query builder it's a gui for generating flux queries it'll also be where you write your flux queries when you come over to script editor but this is a great thing a great tool for generating flux in the beginning of creating a query maybe you can you can write your whole query this way but sometimes you can't so anyways we'll use both up here is it'll be really obvious in a second but this is where your data is visualized so you'll we'll see a line graph here and then we'll work with tables and stuff like that so let's move into the data so my i know where my data is my current live data is in sam bucket for this exercise i will use disk i o to measure my disk throughput to get the throughput we'll get reads and writes in bytes that's all we'll do for here for now so this is wait i could make this query a little more advanced from the gui but for now let's just get the data and filter it and submit the query and we'll notice that we have a line graph here now uh what we are seeing here is possibly not immediately intuitive so we've selected two fields right two influx data fields and what you might expect is to get something like two columns or two series because we've got we've got uh selected just two fields here uh let's explore why that's not the case so maybe for at first we'll take a look at the legend on this graph so we see in this legend that we have read bytes there under field we have our measurement we've got two two columns host and name those are tags moving on to another one read we have read bytes here we've got read bytes here hopefully you see right bytes yeah there's right bytes down here so it looks like our disk is doing reading but not so much writing but we'll also notice that our host values are changing and so are is the name values so host is obviously the host from which this data is coming from name happens to be because i know this data happens to be the name of the actual storage device you'll notice vda 1 sr0 sr2 and so on so what's happening here is we're actually getting read bytes and write bytes from each host and each device within each host that's more clear if we view the data itself in the tabular format there's two ways to do that it's very popular internally at influx to use the raw data function this is what this is what you see here this is basically the raw annotated csv response from the engine so we'll actually go through this in a little bit more detail and probably a follow-up video but know that this is available to you you can you can look at types and and you can kind of see the organization of tables this way but let's go over to tables so we can change the visualization type into a table this is what i like to use most of the time because what it does is it gives you this kind of index of the group keys of each of your tables what group keys are and i'll also use the term table keys in this series interchangeably are the things that distinguish your tables and what and one of those fundamentals i alluded to in the beginning is that flux returns a stream of tables it's a concept that you'll want to have ingrained each of these tables that is returned in the stream of tables is defined by a table or a group key those table keys by default if you're not using a grouping function are going to be the same as the data as the series keys that you had stored in influx db so remember measurement and tag set and field key are what's determining your individual series so without grouping you are getting a response of the individual series by default which is a nice convenience function for working with influx db but that is that may be unintuitive at first right so that's one of the things you want to just make sure you you have an understanding of while you're working with this data um with that i will conclude this video and we'll i'll see you on the next one we'll dive deeper into actual flux when we go over here and click this script editor you
Info
Channel: InfluxData
Views: 6,459
Rating: 4.4375 out of 5
Keywords: InfluxDB, InfluxData, Flux, query builder, query response, open source, data, time series, flux query, time series data, time series database, data visualization
Id: o0ip9nqbna8
Channel Id: undefined
Length: 6min 10sec (370 seconds)
Published: Wed Sep 30 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.