Discussion:
[influxdb] Please help me get this right the first time
Dan Hoover
2018-01-10 03:49:16 UTC
Permalink
I'm a complete and total noob to influx/grafana but I do understand SQL
pretty well. I'd just like to ask a few questions to make sure I'm on the
right track. Thanks in advance for your help (and your patience).

I have a bunch (200) of temperature sensors that all report the temp, the
setpoint, the state of the HVAC, and the sensor id. They report once per
minute.

I'm currently only saving the latest result in a SQL database. Now I'm
ready to begin adding this information to influx. I've confirmed that the
connections are working and that I can add data properly.

Here are my questions:

1. Should each sensor be its own "table" or do I just dump all the data in
one table called temperatures and let the IDs sort it out?
2. Is there any way to run a query once a month or so that automatically
averages the data over the course of an hour and stores that to keep the
size of the db reasonable? That's probably far fetched, but I thought I'd
ask.
3. Can I have something like grafana automatically detect a new sensor id
and create a gauge/chart for it, or do I have to do this manually every
time I add new sensor? I'm guessing that this could have a bearing on
question #1.


I think that's a good start. I just want to get my schema right from the
beginning. I'm sure I'll have a ton to learn, but I feel like playing with
it will be easier once I have a nice stream of data to visualize.
--
Remember to include the version number!
---
You received this message because you are subscribed to the Google Groups "InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to influxdb+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/cf234f7f-3703-46e0-bff5-881af1c92d9c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Frank Inselbuch
2018-01-10 22:13:14 UTC
Permalink
1) i would propose a single table for all your time-series values

insert tdata,id=<blah> setpoint=15.6
insert tdata,id=<blah> temp=22.5

(note that these two statements will get their own timestamps)

insert tdata,id=<blah> setpoint=12.2,temp=55.6

Also note, if you want to coerce the datatype to be an integer or a float
you're going to want to specify that, too

insert tdata,id=<blah> temp=12i

for example

2) yes, but 200 temperature sensors storing minute values is a very small
database
so i wouldn't worry about that
it can be added in later

this used to be done with a continuous query
but i think there is a new technique with their fancier query language
so i am going to let that stabilize for a while before i start playing with
it

3) repeating panels... i think this is possible
what i do, however, is construct a list of "things" periodically
so within a few minutes the new sensor is populated into the list
and grafana will reflect this updated list in a drop selector
but that's not exactly your use case

good luck
Post by Dan Hoover
I'm a complete and total noob to influx/grafana but I do understand SQL
pretty well. I'd just like to ask a few questions to make sure I'm on the
right track. Thanks in advance for your help (and your patience).
I have a bunch (200) of temperature sensors that all report the temp, the
setpoint, the state of the HVAC, and the sensor id. They report once per
minute.
I'm currently only saving the latest result in a SQL database. Now I'm
ready to begin adding this information to influx. I've confirmed that the
connections are working and that I can add data properly.
1. Should each sensor be its own "table" or do I just dump all the data
in one table called temperatures and let the IDs sort it out?
2. Is there any way to run a query once a month or so that automatically
averages the data over the course of an hour and stores that to keep the
size of the db reasonable? That's probably far fetched, but I thought I'd
ask.
3. Can I have something like grafana automatically detect a new sensor id
and create a gauge/chart for it, or do I have to do this manually every
time I add new sensor? I'm guessing that this could have a bearing on
question #1.
I think that's a good start. I just want to get my schema right from the
beginning. I'm sure I'll have a ton to learn, but I feel like playing with
it will be easier once I have a nice stream of data to visualize.
--
Remember to include the version number!
---
You received this message because you are subscribed to the Google Groups "InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to influxdb+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/3e994019-e3ec-4090-a804-dc380e14a6e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...