ytyou / ticktock

TickTockDB is an OpenTSDB-like time series database, with much better performance.
GNU General Public License v3.0
72 stars 8 forks source link

String value #25

Open mkohns opened 1 year ago

mkohns commented 1 year ago

I read in the docs that only int and float value types are allowed. I also have some strings. Coming from influx, this never was a problem. Any ideas how i could inject strings to metrics?

ytyou commented 1 year ago

Strings are not supported at this time. Do you mine giving us an sample use case? Thanks.

mkohns commented 1 year ago

I have a heater integration. The heater has different op codes about his state. These are two to four character long. They indicate the heater status and errors. The list is quite long. About 200 op codes. I could of course translate them to numeric enums - but this would be nasty as I have multiple Frontend clients. On top there are remarks the heater repair guy can type in. 120 char long.

ylin30 commented 1 year ago

@mkohns Our original thought was to use tags for string values. For example, (metric: heater.status, ts=160000000, value=0, op='op1'). It is not a problem if you have limited number of tag string values, e.g., 200 op codes in one of your cases. But the other case (you have arbitrary number of remarks) may result in perf issues if there are too many different remarks and each is sparse/unique, though it is still workable. We need to think about it. Probably it'd better store strings as values. Please give us some time.

Are there any other blockers in your side?

I am curious how you plan to migrate from Influxdb and what is your existing data size? For on-the-fly data, if you use Telegraf as collector, you can just update your output plugin to Opentsdb (note: use tcp instead of http in telegraf.conf). For existing data, you might need to do a backfill to TT.