The tool based on prometheus. Currently, there are 2 tools in the repo. One is used to import data to prometheus and the other is used to export data from prometheus.
./import-tool import --input=$SimpleData --output=$emptyDirectory
{"__name__":"oiwwpnxbzvnglxqfmmgydouluripxyalq","blppopdupk":"cnzzbfczfyogugkqbbgptameitukmyqrvfdnbvuennkrjroklunnmhonozwjbhtcyxtmrtslabqlkoimdafoipcrdbtjaxlzlebaiwkjzzpuusp","bvqcfmtc":"nrmpn","etunlkkq":"jlc","ieh":"nrcqguxwfdarfbnnjwrqyavsvr","igaxksxlcgqesc":"ymmoqcbydfyiiqjarxdplpejidikup","peyxeulfptstx":"mznnnpqbwkjjh","pwtdcjrs":"kupicpeeswkcvcqjsbntrqjrzqceppkgkkglgbckqrwo","vgcdywyzlg":"ucafvj","xlqhwhxrcya":"ztnhtzzrz","xtbla":"mznnnpqbwkjjh","zigoeqifdui":"mnjbteqhtkxeovesczl","zxknjgnlwexn":"hcasvfr", "__value__":"111", "__time__":1585799158000}
I extend the format of prometheus label, there are 2 special labels: __time__ and __value__.
__time__: the timestamp of the series.
__value: the value of the series.
They are not appended the collection of prometheus labels.
Start prometheus and gc the data
./prometheus --config.file=prometheus.yml --storage.tsdb.path=$outputPath
./export-data dump --dump-dir=$dumpdir --min-time=1561701600000 --max-time=1561714950000 $(prometheus data directory)
Start a new prometheus and set data directory as $dumpdir
./prometheus --config.file=prometheus.yml --storage.tsdb.path=$dumpdir