diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/tsdb/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from .github/PULL_REQUEST_TEMPLATE.md rename to tsdb/.github/PULL_REQUEST_TEMPLATE.md diff --git a/.gitignore b/tsdb/.gitignore similarity index 100% rename from .gitignore rename to tsdb/.gitignore diff --git a/.golangci.yml b/tsdb/.golangci.yml similarity index 100% rename from .golangci.yml rename to tsdb/.golangci.yml diff --git a/.travis.yml b/tsdb/.travis.yml similarity index 100% rename from .travis.yml rename to tsdb/.travis.yml diff --git a/CHANGELOG.md b/tsdb/CHANGELOG.md similarity index 100% rename from CHANGELOG.md rename to tsdb/CHANGELOG.md diff --git a/LICENSE b/tsdb/LICENSE similarity index 100% rename from LICENSE rename to tsdb/LICENSE diff --git a/MAINTAINERS.md b/tsdb/MAINTAINERS.md similarity index 100% rename from MAINTAINERS.md rename to tsdb/MAINTAINERS.md diff --git a/Makefile b/tsdb/Makefile similarity index 100% rename from Makefile rename to tsdb/Makefile diff --git a/Makefile.common b/tsdb/Makefile.common similarity index 100% rename from Makefile.common rename to tsdb/Makefile.common diff --git a/README.md b/tsdb/README.md similarity index 100% rename from README.md rename to tsdb/README.md diff --git a/block.go b/tsdb/block.go similarity index 100% rename from block.go rename to tsdb/block.go diff --git a/block_test.go b/tsdb/block_test.go similarity index 100% rename from block_test.go rename to tsdb/block_test.go diff --git a/checkpoint.go b/tsdb/checkpoint.go similarity index 100% rename from checkpoint.go rename to tsdb/checkpoint.go diff --git a/checkpoint_test.go b/tsdb/checkpoint_test.go similarity index 100% rename from checkpoint_test.go rename to tsdb/checkpoint_test.go diff --git a/chunkenc/bstream.go b/tsdb/chunkenc/bstream.go similarity index 100% rename from chunkenc/bstream.go rename to tsdb/chunkenc/bstream.go diff --git a/chunkenc/chunk.go b/tsdb/chunkenc/chunk.go similarity index 100% rename from chunkenc/chunk.go rename to tsdb/chunkenc/chunk.go diff --git a/chunkenc/chunk_test.go b/tsdb/chunkenc/chunk_test.go similarity index 100% rename from chunkenc/chunk_test.go rename to tsdb/chunkenc/chunk_test.go diff --git a/chunkenc/xor.go b/tsdb/chunkenc/xor.go similarity index 100% rename from chunkenc/xor.go rename to tsdb/chunkenc/xor.go diff --git a/chunks/chunks.go b/tsdb/chunks/chunks.go similarity index 100% rename from chunks/chunks.go rename to tsdb/chunks/chunks.go diff --git a/chunks/chunks_test.go b/tsdb/chunks/chunks_test.go similarity index 100% rename from chunks/chunks_test.go rename to tsdb/chunks/chunks_test.go diff --git a/cmd/tsdb/.gitignore b/tsdb/cmd/tsdb/.gitignore similarity index 100% rename from cmd/tsdb/.gitignore rename to tsdb/cmd/tsdb/.gitignore diff --git a/cmd/tsdb/README.md b/tsdb/cmd/tsdb/README.md similarity index 100% rename from cmd/tsdb/README.md rename to tsdb/cmd/tsdb/README.md diff --git a/cmd/tsdb/main.go b/tsdb/cmd/tsdb/main.go similarity index 100% rename from cmd/tsdb/main.go rename to tsdb/cmd/tsdb/main.go diff --git a/compact.go b/tsdb/compact.go similarity index 100% rename from compact.go rename to tsdb/compact.go diff --git a/compact_test.go b/tsdb/compact_test.go similarity index 100% rename from compact_test.go rename to tsdb/compact_test.go diff --git a/db.go b/tsdb/db.go similarity index 100% rename from db.go rename to tsdb/db.go diff --git a/db_test.go b/tsdb/db_test.go similarity index 100% rename from db_test.go rename to tsdb/db_test.go diff --git a/docs/format/README.md b/tsdb/docs/format/README.md similarity index 100% rename from docs/format/README.md rename to tsdb/docs/format/README.md diff --git a/docs/format/chunks.md b/tsdb/docs/format/chunks.md similarity index 100% rename from docs/format/chunks.md rename to tsdb/docs/format/chunks.md diff --git a/docs/format/index.md b/tsdb/docs/format/index.md similarity index 100% rename from docs/format/index.md rename to tsdb/docs/format/index.md diff --git a/docs/format/tombstones.md b/tsdb/docs/format/tombstones.md similarity index 100% rename from docs/format/tombstones.md rename to tsdb/docs/format/tombstones.md diff --git a/docs/format/wal.md b/tsdb/docs/format/wal.md similarity index 100% rename from docs/format/wal.md rename to tsdb/docs/format/wal.md diff --git a/encoding/encoding.go b/tsdb/encoding/encoding.go similarity index 100% rename from encoding/encoding.go rename to tsdb/encoding/encoding.go diff --git a/errors/errors.go b/tsdb/errors/errors.go similarity index 100% rename from errors/errors.go rename to tsdb/errors/errors.go diff --git a/fileutil/dir_unix.go b/tsdb/fileutil/dir_unix.go similarity index 100% rename from fileutil/dir_unix.go rename to tsdb/fileutil/dir_unix.go diff --git a/fileutil/dir_windows.go b/tsdb/fileutil/dir_windows.go similarity index 100% rename from fileutil/dir_windows.go rename to tsdb/fileutil/dir_windows.go diff --git a/fileutil/fileutil.go b/tsdb/fileutil/fileutil.go similarity index 100% rename from fileutil/fileutil.go rename to tsdb/fileutil/fileutil.go diff --git a/fileutil/flock.go b/tsdb/fileutil/flock.go similarity index 100% rename from fileutil/flock.go rename to tsdb/fileutil/flock.go diff --git a/fileutil/flock_plan9.go b/tsdb/fileutil/flock_plan9.go similarity index 100% rename from fileutil/flock_plan9.go rename to tsdb/fileutil/flock_plan9.go diff --git a/fileutil/flock_solaris.go b/tsdb/fileutil/flock_solaris.go similarity index 100% rename from fileutil/flock_solaris.go rename to tsdb/fileutil/flock_solaris.go diff --git a/fileutil/flock_test.go b/tsdb/fileutil/flock_test.go similarity index 100% rename from fileutil/flock_test.go rename to tsdb/fileutil/flock_test.go diff --git a/fileutil/flock_unix.go b/tsdb/fileutil/flock_unix.go similarity index 100% rename from fileutil/flock_unix.go rename to tsdb/fileutil/flock_unix.go diff --git a/fileutil/flock_windows.go b/tsdb/fileutil/flock_windows.go similarity index 100% rename from fileutil/flock_windows.go rename to tsdb/fileutil/flock_windows.go diff --git a/fileutil/mmap.go b/tsdb/fileutil/mmap.go similarity index 100% rename from fileutil/mmap.go rename to tsdb/fileutil/mmap.go diff --git a/fileutil/mmap_386.go b/tsdb/fileutil/mmap_386.go similarity index 100% rename from fileutil/mmap_386.go rename to tsdb/fileutil/mmap_386.go diff --git a/fileutil/mmap_amd64.go b/tsdb/fileutil/mmap_amd64.go similarity index 100% rename from fileutil/mmap_amd64.go rename to tsdb/fileutil/mmap_amd64.go diff --git a/fileutil/mmap_unix.go b/tsdb/fileutil/mmap_unix.go similarity index 100% rename from fileutil/mmap_unix.go rename to tsdb/fileutil/mmap_unix.go diff --git a/fileutil/mmap_windows.go b/tsdb/fileutil/mmap_windows.go similarity index 100% rename from fileutil/mmap_windows.go rename to tsdb/fileutil/mmap_windows.go diff --git a/fileutil/preallocate.go b/tsdb/fileutil/preallocate.go similarity index 100% rename from fileutil/preallocate.go rename to tsdb/fileutil/preallocate.go diff --git a/fileutil/preallocate_darwin.go b/tsdb/fileutil/preallocate_darwin.go similarity index 100% rename from fileutil/preallocate_darwin.go rename to tsdb/fileutil/preallocate_darwin.go diff --git a/fileutil/preallocate_linux.go b/tsdb/fileutil/preallocate_linux.go similarity index 100% rename from fileutil/preallocate_linux.go rename to tsdb/fileutil/preallocate_linux.go diff --git a/fileutil/preallocate_other.go b/tsdb/fileutil/preallocate_other.go similarity index 100% rename from fileutil/preallocate_other.go rename to tsdb/fileutil/preallocate_other.go diff --git a/fileutil/sync.go b/tsdb/fileutil/sync.go similarity index 100% rename from fileutil/sync.go rename to tsdb/fileutil/sync.go diff --git a/fileutil/sync_darwin.go b/tsdb/fileutil/sync_darwin.go similarity index 100% rename from fileutil/sync_darwin.go rename to tsdb/fileutil/sync_darwin.go diff --git a/fileutil/sync_linux.go b/tsdb/fileutil/sync_linux.go similarity index 100% rename from fileutil/sync_linux.go rename to tsdb/fileutil/sync_linux.go diff --git a/go.mod b/tsdb/go.mod similarity index 100% rename from go.mod rename to tsdb/go.mod diff --git a/go.sum b/tsdb/go.sum similarity index 100% rename from go.sum rename to tsdb/go.sum diff --git a/goversion/goversio_test.go b/tsdb/goversion/goversio_test.go similarity index 100% rename from goversion/goversio_test.go rename to tsdb/goversion/goversio_test.go diff --git a/goversion/goversion.go b/tsdb/goversion/goversion.go similarity index 100% rename from goversion/goversion.go rename to tsdb/goversion/goversion.go diff --git a/goversion/init.go b/tsdb/goversion/init.go similarity index 100% rename from goversion/init.go rename to tsdb/goversion/init.go diff --git a/head.go b/tsdb/head.go similarity index 100% rename from head.go rename to tsdb/head.go diff --git a/head_bench_test.go b/tsdb/head_bench_test.go similarity index 100% rename from head_bench_test.go rename to tsdb/head_bench_test.go diff --git a/head_test.go b/tsdb/head_test.go similarity index 100% rename from head_test.go rename to tsdb/head_test.go diff --git a/index/index.go b/tsdb/index/index.go similarity index 100% rename from index/index.go rename to tsdb/index/index.go diff --git a/index/index_test.go b/tsdb/index/index_test.go similarity index 100% rename from index/index_test.go rename to tsdb/index/index_test.go diff --git a/index/postings.go b/tsdb/index/postings.go similarity index 100% rename from index/postings.go rename to tsdb/index/postings.go diff --git a/index/postings_test.go b/tsdb/index/postings_test.go similarity index 100% rename from index/postings_test.go rename to tsdb/index/postings_test.go diff --git a/labels/labels.go b/tsdb/labels/labels.go similarity index 100% rename from labels/labels.go rename to tsdb/labels/labels.go diff --git a/labels/labels_test.go b/tsdb/labels/labels_test.go similarity index 100% rename from labels/labels_test.go rename to tsdb/labels/labels_test.go diff --git a/labels/selector.go b/tsdb/labels/selector.go similarity index 100% rename from labels/selector.go rename to tsdb/labels/selector.go diff --git a/mocks_test.go b/tsdb/mocks_test.go similarity index 100% rename from mocks_test.go rename to tsdb/mocks_test.go diff --git a/querier.go b/tsdb/querier.go similarity index 100% rename from querier.go rename to tsdb/querier.go diff --git a/querier_test.go b/tsdb/querier_test.go similarity index 100% rename from querier_test.go rename to tsdb/querier_test.go diff --git a/record.go b/tsdb/record.go similarity index 100% rename from record.go rename to tsdb/record.go diff --git a/record_test.go b/tsdb/record_test.go similarity index 100% rename from record_test.go rename to tsdb/record_test.go diff --git a/repair.go b/tsdb/repair.go similarity index 100% rename from repair.go rename to tsdb/repair.go diff --git a/repair_test.go b/tsdb/repair_test.go similarity index 100% rename from repair_test.go rename to tsdb/repair_test.go diff --git a/test/conv_test.go b/tsdb/test/conv_test.go similarity index 100% rename from test/conv_test.go rename to tsdb/test/conv_test.go diff --git a/test/hash_test.go b/tsdb/test/hash_test.go similarity index 100% rename from test/hash_test.go rename to tsdb/test/hash_test.go diff --git a/test/labels_test.go b/tsdb/test/labels_test.go similarity index 100% rename from test/labels_test.go rename to tsdb/test/labels_test.go diff --git a/testdata/20kseries.json b/tsdb/testdata/20kseries.json similarity index 100% rename from testdata/20kseries.json rename to tsdb/testdata/20kseries.json diff --git a/testdata/repair_index_version/01BZJ9WJQPWHGNC2W4J9TA62KC/index b/tsdb/testdata/repair_index_version/01BZJ9WJQPWHGNC2W4J9TA62KC/index similarity index 100% rename from testdata/repair_index_version/01BZJ9WJQPWHGNC2W4J9TA62KC/index rename to tsdb/testdata/repair_index_version/01BZJ9WJQPWHGNC2W4J9TA62KC/index diff --git a/testdata/repair_index_version/01BZJ9WJQPWHGNC2W4J9TA62KC/meta.json b/tsdb/testdata/repair_index_version/01BZJ9WJQPWHGNC2W4J9TA62KC/meta.json similarity index 100% rename from testdata/repair_index_version/01BZJ9WJQPWHGNC2W4J9TA62KC/meta.json rename to tsdb/testdata/repair_index_version/01BZJ9WJQPWHGNC2W4J9TA62KC/meta.json diff --git a/testutil/directory.go b/tsdb/testutil/directory.go similarity index 100% rename from testutil/directory.go rename to tsdb/testutil/directory.go diff --git a/testutil/logging.go b/tsdb/testutil/logging.go similarity index 100% rename from testutil/logging.go rename to tsdb/testutil/logging.go diff --git a/testutil/testutil.go b/tsdb/testutil/testutil.go similarity index 100% rename from testutil/testutil.go rename to tsdb/testutil/testutil.go diff --git a/tombstones.go b/tsdb/tombstones.go similarity index 100% rename from tombstones.go rename to tsdb/tombstones.go diff --git a/tombstones_test.go b/tsdb/tombstones_test.go similarity index 100% rename from tombstones_test.go rename to tsdb/tombstones_test.go diff --git a/tsdbutil/buffer.go b/tsdb/tsdbutil/buffer.go similarity index 100% rename from tsdbutil/buffer.go rename to tsdb/tsdbutil/buffer.go diff --git a/tsdbutil/buffer_test.go b/tsdb/tsdbutil/buffer_test.go similarity index 100% rename from tsdbutil/buffer_test.go rename to tsdb/tsdbutil/buffer_test.go diff --git a/tsdbutil/chunks.go b/tsdb/tsdbutil/chunks.go similarity index 100% rename from tsdbutil/chunks.go rename to tsdb/tsdbutil/chunks.go diff --git a/wal.go b/tsdb/wal.go similarity index 100% rename from wal.go rename to tsdb/wal.go diff --git a/wal/live_reader.go b/tsdb/wal/live_reader.go similarity index 100% rename from wal/live_reader.go rename to tsdb/wal/live_reader.go diff --git a/wal/reader.go b/tsdb/wal/reader.go similarity index 100% rename from wal/reader.go rename to tsdb/wal/reader.go diff --git a/wal/reader_test.go b/tsdb/wal/reader_test.go similarity index 100% rename from wal/reader_test.go rename to tsdb/wal/reader_test.go diff --git a/wal/wal.go b/tsdb/wal/wal.go similarity index 100% rename from wal/wal.go rename to tsdb/wal/wal.go diff --git a/wal/wal_test.go b/tsdb/wal/wal_test.go similarity index 100% rename from wal/wal_test.go rename to tsdb/wal/wal_test.go diff --git a/wal_test.go b/tsdb/wal_test.go similarity index 100% rename from wal_test.go rename to tsdb/wal_test.go