Documentation ¶
Index ¶
- Constants
- func ActivePeriodConfig(configs []PeriodConfig) int
- func UsingObjectStorageIndex(configs []PeriodConfig) bool
- type ActiveTableProvisionConfig
- type AutoScalingConfig
- type ChunkStoreConfig
- type DayTime
- type InactiveTableProvisionConfig
- type PeriodConfig
- type PeriodicTableConfig
- func (cfg PeriodicTableConfig) MarshalYAML() (interface{}, error)
- func (cfg *PeriodicTableConfig) PeriodicTables(from, through model.Time, pCfg ProvisionConfig, ...) []TableDesc
- func (cfg *PeriodicTableConfig) TableFor(t model.Time) string
- func (cfg *PeriodicTableConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
- type ProvisionConfig
- type SchemaConfig
- func (cfg SchemaConfig) ChunkTableFor(t model.Time) (string, error)
- func (cfg SchemaConfig) ExternalKey(ref logproto.ChunkRef) string
- func (cfg *SchemaConfig) ForEachAfter(t model.Time, f func(config *PeriodConfig))
- func (cfg *SchemaConfig) Load() error
- func (cfg *SchemaConfig) RegisterFlags(f *flag.FlagSet)
- func (cfg SchemaConfig) SchemaForTime(t model.Time) (PeriodConfig, error)
- func (cfg *SchemaConfig) Validate() error
- func (cfg SchemaConfig) VersionForChunk(ref logproto.ChunkRef) int
- type TableDesc
- type TableRange
- type TableRanges
- type Tags
Constants ¶
const ( StorageTypeAWS = "aws" StorageTypeAWSDynamo = "aws-dynamo" StorageTypeAzure = "azure" StorageTypeBOS = "bos" StorageTypeBoltDB = "boltdb" StorageTypeCassandra = "cassandra" StorageTypeInMemory = "inmemory" StorageTypeBigTable = "bigtable" StorageTypeBigTableHashed = "bigtable-hashed" StorageTypeFileSystem = "filesystem" StorageTypeGCP = "gcp" StorageTypeGCPColumnKey = "gcp-columnkey" StorageTypeGCS = "gcs" StorageTypeGrpc = "grpc-store" StorageTypeLocal = "local" StorageTypeS3 = "s3" StorageTypeSwift = "swift" // BoltDBShipperType holds the index type for using boltdb with shipper which keeps flushing them to a shared storage BoltDBShipperType = "boltdb-shipper" TSDBType = "tsdb" // ObjectStorageIndexRequiredPeriod defines the required index period for object storage based index stores like boltdb-shipper and tsdb ObjectStorageIndexRequiredPeriod = 24 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
func ActivePeriodConfig ¶
func ActivePeriodConfig(configs []PeriodConfig) int
ActivePeriodConfig returns index of active PeriodicConfig which would be applicable to logs that would be pushed starting now. Note: Another PeriodicConfig might be applicable for future logs which can change index type.
func UsingObjectStorageIndex ¶
func UsingObjectStorageIndex(configs []PeriodConfig) bool
Types ¶
type ActiveTableProvisionConfig ¶
type ActiveTableProvisionConfig struct { ProvisionedThroughputOnDemandMode bool `yaml:"enable_ondemand_throughput_mode"` ProvisionedWriteThroughput int64 `yaml:"provisioned_write_throughput"` ProvisionedReadThroughput int64 `yaml:"provisioned_read_throughput"` WriteScale AutoScalingConfig `yaml:"write_scale"` ReadScale AutoScalingConfig `yaml:"read_scale"` }
func (ActiveTableProvisionConfig) BuildTableDesc ¶
func (cfg ActiveTableProvisionConfig) BuildTableDesc(tableName string, tags Tags) TableDesc
func (*ActiveTableProvisionConfig) RegisterFlags ¶
func (cfg *ActiveTableProvisionConfig) RegisterFlags(argPrefix string, f *flag.FlagSet)
RegisterFlags adds the flags required to config this to the given FlagSet. Make sure defaults are set in the respective fields before calling RegisterFlags.
type AutoScalingConfig ¶
type AutoScalingConfig struct { Enabled bool `yaml:"enabled"` RoleARN string `yaml:"role_arn"` MinCapacity int64 `yaml:"min_capacity"` MaxCapacity int64 `yaml:"max_capacity"` OutCooldown int64 `yaml:"out_cooldown"` InCooldown int64 `yaml:"in_cooldown"` TargetValue float64 `yaml:"target"` }
AutoScalingConfig for DynamoDB tables.
func (*AutoScalingConfig) RegisterFlags ¶
func (cfg *AutoScalingConfig) RegisterFlags(argPrefix string, f *flag.FlagSet)
RegisterFlags adds the flags required to config this to the given FlagSet.
type ChunkStoreConfig ¶
type ChunkStoreConfig struct { ChunkCacheConfig cache.Config `yaml:"chunk_cache_config"` WriteDedupeCacheConfig cache.Config `yaml:"write_dedupe_cache_config"` CacheLookupsOlderThan model.Duration `yaml:"cache_lookups_older_than"` // When DisableIndexDeduplication is true and chunk is already there in cache, only index would be written to the store and not chunk. DisableIndexDeduplication bool `yaml:"-"` // Limits query start time to be greater than now() - MaxLookBackPeriod, if set. // Will be deprecated in the next major release. MaxLookBackPeriod model.Duration `yaml:"max_look_back_period"` // contains filtered or unexported fields }
func (*ChunkStoreConfig) ChunkCacheStubs ¶
func (cfg *ChunkStoreConfig) ChunkCacheStubs() bool
func (*ChunkStoreConfig) RegisterFlags ¶
func (cfg *ChunkStoreConfig) RegisterFlags(f *flag.FlagSet)
RegisterFlags adds the flags required to configure this flag set.
type DayTime ¶
DayTime is a model.Time what holds day-aligned values, and marshals to/from YAML in YYYY-MM-DD format.
func (DayTime) MarshalYAML ¶
MarshalYAML implements yaml.Marshaller.
func (*DayTime) UnmarshalYAML ¶
UnmarshalYAML implements yaml.Unmarshaller.
type InactiveTableProvisionConfig ¶
type InactiveTableProvisionConfig struct { InactiveThroughputOnDemandMode bool `yaml:"enable_inactive_throughput_on_demand_mode"` InactiveWriteThroughput int64 `yaml:"inactive_write_throughput"` InactiveReadThroughput int64 `yaml:"inactive_read_throughput"` InactiveWriteScale AutoScalingConfig `yaml:"inactive_write_scale"` InactiveReadScale AutoScalingConfig `yaml:"inactive_read_scale"` InactiveWriteScaleLastN int64 `yaml:"inactive_write_scale_lastn"` InactiveReadScaleLastN int64 `yaml:"inactive_read_scale_lastn"` }
func (InactiveTableProvisionConfig) BuildTableDesc ¶
func (cfg InactiveTableProvisionConfig) BuildTableDesc(tableName string, tags Tags, disableAutoscale bool) TableDesc
func (*InactiveTableProvisionConfig) RegisterFlags ¶
func (cfg *InactiveTableProvisionConfig) RegisterFlags(argPrefix string, f *flag.FlagSet)
RegisterFlags adds the flags required to config this to the given FlagSet.
type PeriodConfig ¶
type PeriodConfig struct { From DayTime `yaml:"from"` // used when working with config IndexType string `yaml:"store"` // type of index client to use. ObjectType string `yaml:"object_store"` // type of object client to use; if omitted, defaults to store. Schema string `yaml:"schema"` IndexTables PeriodicTableConfig `yaml:"index"` ChunkTables PeriodicTableConfig `yaml:"chunks"` RowShards uint32 `yaml:"row_shards"` // contains filtered or unexported fields }
PeriodConfig defines the schema and tables to use for a period of time
func (*PeriodConfig) GetIndexTableNumberRange ¶
func (cfg *PeriodConfig) GetIndexTableNumberRange(schemaEndDate DayTime) TableRange
GetIndexTableNumberRange returns the table number range calculated based on the configured schema start date, index table period and the given schemaEndDate
func (*PeriodConfig) UnmarshalYAML ¶
func (cfg *PeriodConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements yaml.Unmarshaller.
func (*PeriodConfig) VersionAsInt ¶
func (cfg *PeriodConfig) VersionAsInt() (int, error)
type PeriodicTableConfig ¶
PeriodicTableConfig is configuration for a set of time-sharded tables.
func (PeriodicTableConfig) MarshalYAML ¶
func (cfg PeriodicTableConfig) MarshalYAML() (interface{}, error)
MarshalYAML implements the yaml.Marshaler interface.
func (*PeriodicTableConfig) PeriodicTables ¶
func (cfg *PeriodicTableConfig) PeriodicTables(from, through model.Time, pCfg ProvisionConfig, beginGrace, endGrace time.Duration, retention time.Duration) []TableDesc
func (*PeriodicTableConfig) TableFor ¶
func (cfg *PeriodicTableConfig) TableFor(t model.Time) string
TableFor calculates the table shard for a given point in time.
func (*PeriodicTableConfig) UnmarshalYAML ¶
func (cfg *PeriodicTableConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements the yaml.Unmarshaler interface.
type ProvisionConfig ¶
type ProvisionConfig struct { ActiveTableProvisionConfig `yaml:",inline"` InactiveTableProvisionConfig `yaml:",inline"` }
ProvisionConfig holds config for provisioning capacity for index and chunk tables (on DynamoDB for now)
func (*ProvisionConfig) RegisterFlags ¶
func (cfg *ProvisionConfig) RegisterFlags(argPrefix string, f *flag.FlagSet)
RegisterFlags adds the flags required to config this to the given FlagSet.
type SchemaConfig ¶
type SchemaConfig struct { Configs []PeriodConfig `yaml:"configs"` // contains filtered or unexported fields }
SchemaConfig contains the config for our chunk index schemas
func (SchemaConfig) ChunkTableFor ¶
func (cfg SchemaConfig) ChunkTableFor(t model.Time) (string, error)
ChunkTableFor calculates the chunk table shard for a given point in time.
func (SchemaConfig) ExternalKey ¶
func (cfg SchemaConfig) ExternalKey(ref logproto.ChunkRef) string
Generate the appropriate external key based on cfg.Schema, chunk.Checksum, and chunk.From
func (*SchemaConfig) ForEachAfter ¶
func (cfg *SchemaConfig) ForEachAfter(t model.Time, f func(config *PeriodConfig))
ForEachAfter will call f() on every entry after t, splitting entries if necessary so there is an entry starting at t
func (*SchemaConfig) Load ¶
func (cfg *SchemaConfig) Load() error
Load the yaml file, or build the config from legacy command-line flags
func (*SchemaConfig) RegisterFlags ¶
func (cfg *SchemaConfig) RegisterFlags(f *flag.FlagSet)
RegisterFlags adds the flags required to config this to the given FlagSet.
func (SchemaConfig) SchemaForTime ¶
func (cfg SchemaConfig) SchemaForTime(t model.Time) (PeriodConfig, error)
SchemaForTime returns the Schema PeriodConfig to use for a given point in time.
func (*SchemaConfig) Validate ¶
func (cfg *SchemaConfig) Validate() error
Validate the schema config and returns an error if the validation doesn't pass
func (SchemaConfig) VersionForChunk ¶
func (cfg SchemaConfig) VersionForChunk(ref logproto.ChunkRef) int
VersionForChunk will return the schema version associated with the `From` timestamp of a chunk. The schema and chunk must be valid+compatible as the errors are not checked.
type TableDesc ¶
type TableDesc struct { Name string UseOnDemandIOMode bool ProvisionedRead int64 ProvisionedWrite int64 Tags Tags WriteScale AutoScalingConfig ReadScale AutoScalingConfig }
TableDesc describes a table.
type TableRange ¶
type TableRange struct {
Start, End int64
PeriodConfig *PeriodConfig
}
TableRange represents a range of table numbers built based on the configured schema start/end date and the table period. Both Start and End are inclusive.
type TableRanges ¶
type TableRanges []TableRange
TableRanges represents a list of table ranges for multiple schemas.
func (TableRanges) ConfigForTableNumber ¶
func (t TableRanges) ConfigForTableNumber(tableNumber int64) *PeriodConfig
func (TableRanges) TableInRange ¶
func (t TableRanges) TableInRange(tableNumber int64, tableName string) bool
TableInRange tells whether given table falls in any of the ranges and the tableName has the right prefix based on the schema config.