ingest

command module
v0.0.0-...-2ad9263 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

README

ingest

Backfill prometheus.

Build

go build

args

  -block-range int
        block range (default 1048576)
  -input-file string
        json input file (default "input")
  -output-dir string
        directory where to put the TSDB (default "output")

Use

  1. Create and populate TSDB
(echo "["
for i in $(seq $(date +%s -d "1 month ago")000 1000 $(date +%s)000)
do echo '{"l":{"__name__":"test"}, "t":'$i', "v":'$i'},'
done) | ./ingest -input-file=/dev/stdin -output-dir 1month
  1. Start prometheus on top of it
prometheus --storage.tsdb.retention.time=99y --storage.tsdb.path=1month --config.file=$(mktemp)

Json format

[
    {"l":{"__name__":"test"}, "t":1, "v":1}
]

Array of metrics. Metric being objects with 3 fields: labels, timestamps (epoch milliseconds) and value.

There is no need to close the json:

[
    {"l":{"__name__":"test"}, "t":1, "v":1},
    {"l":{"__name__":"test"}, "t":2, "v":2},
    {"l":{"__name__":"test"}, "t":3, "v":3},
    {"l":{"__name__":"test"}, "t":4, "v":4},

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL