kotori icon indicating copy to clipboard operation
kotori copied to clipboard

Question about the payload format

Open amotl opened this issue 5 years ago • 1 comments

@Dewieinns just asked...

Hey Andreas,

I am playing with sending data to my server through Kotori and looking at the automatically generated dashboards in Grafana.

Is there any place where the structure of the data to be sent is documented? I've determined, by trial and error, that for the following 'topic':

databaseName/dev/site_name/device_name/data.json
  • A database called "databaseName_dev" gets automatically generated.
  • A dashboard in Grafana is automatically generated by the same name
  • On that dashboard a panel is generated automatically showing:
    • device=device_name
    • site=site_name
  • data.json tells the server we're sending data vs annotations (event.json)

The data is sent through as key-value pairs as I would expect:

{"key1":123, "key2":456, "key3":789}

But is there any special things I should know about? I haven't explored trying to add tags or anything yet, is this supported?

-- Andrew

amotl avatar Mar 04 '20 04:03 amotl

Dear @Dewieinns,

thanks for your analysis and sorry that these details might not have been documented well enough. I will be very happy about pull requests to improve the documentation!

You are absolutely right in every detail as far as I can see. The idea was to make acquisition of measurement data completely schemaless and essentially a nobrainer. Please let me know if you need more advanced acquisition schemes we could support through respective payload decoders.

Tags in InfluxDB are supported and currently will be extracted heuristically from the flat dictionary of ingested data, see also #14. You can find the implementation at [1]. If you need any changes to that, please also let me know!

With kind regards, Andreas.

[1] https://github.com/daq-tools/kotori/blob/e55cf70e/kotori/daq/storage/influx.py#L181-L197

amotl avatar Mar 04 '20 04:03 amotl