metadata

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// MetaFilename is the known JSON filename for meta information.
	MetaFilename = "meta.json"
)
View Source
const (
	// MetaVersion is a enumeration of meta versions supported by Thanos.
	MetaVersion1 = iota + 1
)

Variables

This section is empty.

Functions

func Write

func Write(logger log.Logger, dir string, meta *Meta) error

Write writes the given meta into <dir>/meta.json.

Types

type Meta

type Meta struct {
	Version int `json:"version"`

	tsdb.BlockMeta

	Thanos Thanos `json:"thanos"`
}

Meta describes the a block's meta. It wraps the known TSDB meta structure and extends it by Thanos-specific fields.

func InjectThanos

func InjectThanos(logger log.Logger, bdir string, meta Thanos, downsampledMeta *tsdb.BlockMeta) (*Meta, error)

InjectThanos sets Thanos meta to the block meta JSON and saves it to the disk. NOTE: It should be used after writing any block by any Thanos component, otherwise we will miss crucial metadata.

func Read

func Read(dir string) (*Meta, error)

Read reads the given meta from <dir>/meta.json.

type SourceType

type SourceType string
const (
	UnknownSource         SourceType = ""
	SidecarSource         SourceType = "sidecar"
	ReceiveSource         SourceType = "receive"
	CompactorSource       SourceType = "compactor"
	CompactorRepairSource SourceType = "compactor.repair"
	RulerSource           SourceType = "ruler"
	BucketRepairSource    SourceType = "bucket.repair"
	TestSource            SourceType = "test"
)

type Thanos

type Thanos struct {
	Labels     map[string]string `json:"labels"`
	Downsample ThanosDownsample  `json:"downsample"`

	// Source is a real upload source of the block.
	Source SourceType `json:"source"`
}

Thanos holds block meta information specific to Thanos.

type ThanosDownsample

type ThanosDownsample struct {
	Resolution int64 `json:"resolution"`
}

Jump to

Keyboard shortcuts

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