Documentation ¶
Index ¶
Constants ¶
const ( // DeletionMarkFilename is the known json filename to store details about when block is marked for deletion. DeletionMarkFilename = "deletion-mark.json" // DeletionMarkVersion1 is the version of deletion-mark file supported by Thanos. DeletionMarkVersion1 = 1 )
const (
// MetaFilename is the known JSON filename for meta information.
MetaFilename = "meta.json"
)
const ( // MetaVersion is a enumeration of meta versions supported by Thanos. MetaVersion1 = iota + 1 )
Variables ¶
var ErrorDeletionMarkNotFound = errors.New("deletion-mark.json not found")
ErrorDeletionMarkNotFound is the error when deletion-mark.json file is not found.
var ErrorUnmarshalDeletionMark = errors.New("unmarshal deletion-mark.json")
ErrorUnmarshalDeletionMark is the error when unmarshalling deletion-mark.json file. This error can occur because deletion-mark.json has been partially uploaded to block storage or the deletion-mark.json file is not a valid json file.
Functions ¶
Types ¶
type DeletionMark ¶ added in v0.12.0
type DeletionMark struct { // ID of the tsdb block. ID ulid.ULID `json:"id"` // DeletionTime is a unix timestamp of when the block was marked to be deleted. DeletionTime int64 `json:"deletion_time"` // Version of the file. Version int `json:"version"` }
DeletionMark stores block id and when block was marked for deletion.
func ReadDeletionMark ¶ added in v0.12.0
func ReadDeletionMark(ctx context.Context, bkt objstore.InstrumentedBucketReader, logger log.Logger, dir string) (*DeletionMark, error)
ReadDeletionMark reads the given deletion mark file from <dir>/deletion-mark.json in bucket.
type Meta ¶
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.
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"`
}