Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add InfluxDB support #5

@mroch

Description

@mroch

I'd like to write directly to InfluxDB and log with grafana.

I think the format should look like (in InfluxDB line format):

measurement_name XXXX123_ch1_aws=1234.0,XXXX123_ch2_aws=345.0 123456789000000000
measurement_name XXXX789_ch1_aws=1.0,XXXX789_ch2_aws=2.0 123456789000000000

That is, each channel reading should be a field, named for the serial number and channel. (note that since the timestamps and measurement name + tags match, this is a single measurement with 4 fields... i just split it for readability).


An alternative would be

measurement_name,serial=XXXX123 ch1_aws=1234.0,ch2_aws=345.0 123456789000000000
measurement_name,serial=XXXX789 ch1_aws=1.0,ch2_aws=2.0 123456789000000000

which is two separate series. I don't think this is as valuable because there's no reason you'd want to query for all the ch1_aws values across tags.

Another alternative would be

measurement_name,serial=XXXX123,id=ch1_aws value=1234.0 123456789000000000
measurement_name,serial=XXXX123,id=ch2_aws value=345.0 123456789000000000
measurement_name,serial=XXXX789,id=ch1_aws value=1.0 123456789000000000
measurement_name,serial=XXXX789,id=ch2_aws value=2.0 123456789000000000

The problem with this format is that each channel is a separate series, so you can't do interesting things like add two values together. For example, the plugs in my kitchen are on 3 different branch circuits, so I'd like to have a "Kitchen" value that is mean("ch1_aws") + mean("ch2_aws") + mean("ch3_aws") but you can't do that. This is possible with the proposed format above, though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions