Skip to content

qiffang/prom-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

prom-tools

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

How to use it

import data

  ./import-tool import --input=$SimpleData --output=$emptyDirectory

SimpleData Format

{"__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.

Note

Start prometheus and gc the data

./prometheus  --config.file=prometheus.yml --storage.tsdb.path=$outputPath

Export Tool

How to use it

export data

 ./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 

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages