compact

package
v0.0.0-...-df1d07e Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name is the name of the Thanos Compact component.
	Name = "thanos-compact"

	// ComponentName is the name of the Thanos Compact component.
	ComponentName = "thanos-compactor"

	// HTTPPort is the port used by the HTTP server.
	HTTPPort     = 10902
	HTTPPortName = "http"
)

Variables

This section is empty.

Functions

func GetLabels

func GetLabels(opts Options) map[string]string

GetLabels returns the ObjectMeta labels for Thanos Compact.

func GetRequiredLabels

func GetRequiredLabels() map[string]string

GetRequiredLabels returns a map of labels that can be used to look up ThanosCompact resources.

func NewService

func NewService(opts Options) *corev1.Service

NewService creates a new Service for each Thanos Compact shard. The Service name will be the same as the Shard name if provided. The Service name will be the same as the Options.Name if Shard name is not provided.

func NewStatefulSet

func NewStatefulSet(opts Options) *appsv1.StatefulSet

NewStatefulSet creates a new StatefulSet for the Thanos Compact shard.

Types

type BlockConfigOptions

type BlockConfigOptions struct {
	// BlockDiscoveryStrategy is the discovery strategy to use for block discovery in storage.
	BlockDiscoveryStrategy *string
	// BlockFilesConcurrency is the number of goroutines to use when to use when
	BlockFilesConcurrency *int32
	// BlockMetaFetchConcurrency is the number of goroutines to use when fetching block metadata from object storage.
	BlockMetaFetchConcurrency *int32
	// BlockViewerGlobalSyncInterval for syncing the blocks between local and remote view for /global Block Viewer UI.
	BlockViewerGlobalSyncInterval *manifests.Duration
	// BlockViewerGlobalSyncTimeout is the maximum time for syncing the blocks between local and remote view for /global Block Viewer UI.
	BlockViewerGlobalSyncTimeout *manifests.Duration
}

BlockConfigOptions for Thanos Compact

type CompactionOptions

type CompactionOptions struct {
	// CompactConcurrency is the number of goroutines to use when compacting blocks.
	CompactConcurrency *int32
	// CompactBlockFetchConcurrency is the number of goroutines to use when fetching blocks from object storage.
	CompactBlockFetchConcurrency *int32 `json:"compactBlockFetchConcurrency,omitempty"`
	// CompactCleanupInterval configures how often we should clean up partially uploaded blocks and blocks that are marked for deletion.
	CompactCleanupInterval *manifests.Duration `json:"compactCleanupInterval,omitempty"`
	// ConsistencyDelay is the minimum age of fresh (non-compacted) blocks before they are being processed.
	// Malformed blocks older than the maximum of consistency-delay and 48h0m0s will be removed.
	ConsistencyDelay *manifests.Duration `json:"blockConsistencyDelay,omitempty"`
}

type DebugConfigOptions

type DebugConfigOptions struct {
	// AcceptMalformedIndex allows compact to accept blocks with malformed index.
	AcceptMalformedIndex bool
	// MaxCompactionLevel is the maximum compaction level to use when compacting blocks.
	MaxCompactionLevel int32
	// HaltOnError halts the compact process on critical compaction error.
	HaltOnError bool
}

type DownsamplingOptions

type DownsamplingOptions struct {
	// Disable downsampling.
	Disable bool
	// Concurrency is the number of goroutines to use when downsampling blocks.
	Concurrency *int32
}

type Options

type Options struct {
	manifests.Options
	RetentionOptions *RetentionOptions
	BlockConfig      *BlockConfigOptions
	Compaction       *CompactionOptions
	Downsampling     *DownsamplingOptions
	DebugConfig      *DebugConfigOptions
	// RelabelConfig is the relabel configuration for the Thanos Compact shard.
	RelabelConfigs manifests.RelabelConfigs
	// StorageSize is the size of the PVC to create for the Thanos Compact shard.
	StorageSize resource.Quantity
	// ObjStoreSecret is the secret key selector for the object store configuration.
	ObjStoreSecret corev1.SecretKeySelector
	// Min and Max time for the compactor
	Min, Max   *manifests.Duration
	ShardName  *string
	ShardIndex *int
}

Options for Thanos Compact

func (Options) Build

func (opts Options) Build() []client.Object

Build compiles all the Kubernetes objects for the Thanos Compact shard. This includes the ServiceAccount, StatefulSet, and Service. Build ignores any manifests.PodDisruptionBudgetOptions as well as replicas set in the Options since enforce running compactor as a single replica.

func (Options) GetGeneratedResourceName

func (opts Options) GetGeneratedResourceName() string

GetGeneratedResourceName returns the generated name for the Thanos Compact or shard. If no sharding is configured, the name will be generated from the Options.Owner. If sharding is configured, the name will be generated from the Options.Owner, ShardName, and ShardIndex.

func (Options) GetSelectorLabels

func (opts Options) GetSelectorLabels() map[string]string

GetSelectorLabels returns a map of labels that can be used to look up ThanosCompact resources.

type RetentionOptions

type RetentionOptions struct {
	// Raw is the retention configuration for the raw samples.
	Raw *manifests.Duration
	// FiveMinutes is the retention configuration for samples of resolution 1 (5 minutes).
	FiveMinutes *manifests.Duration
	// OneHour is the retention configuration for samples of resolution 2 (1 hour).
	OneHour *manifests.Duration
}

RetentionOptions for Thanos Compact

Jump to

Keyboard shortcuts

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