Documentation
¶
Index ¶
- Constants
- Variables
- func NewDynamoDBChunkClient(cfg DynamoDBConfig, schemaCfg chunk.SchemaConfig, reg prometheus.Registerer) (chunk.Client, error)
- func NewDynamoDBIndexClient(cfg DynamoDBConfig, schemaCfg chunk.SchemaConfig, reg prometheus.Registerer) (chunk.IndexClient, error)
- func NewDynamoDBTableClient(cfg DynamoDBConfig, reg prometheus.Registerer) (chunk.TableClient, error)
- type DynamoDBConfig
- type HTTPConfig
- type InjectRequestMiddleware
- type MetricsAutoScalingConfig
- type S3Config
- type S3ObjectClient
- func (a *S3ObjectClient) DeleteObject(ctx context.Context, objectKey string) error
- func (a *S3ObjectClient) GetObject(ctx context.Context, objectKey string) (io.ReadCloser, error)
- func (a *S3ObjectClient) List(ctx context.Context, prefix, delimiter string) ([]chunk.StorageObject, []chunk.StorageCommonPrefix, error)
- func (a *S3ObjectClient) PutObject(ctx context.Context, objectKey string, object io.ReadSeeker) error
- func (a *S3ObjectClient) Stop()
- type SSEParsedConfig
- type StorageConfig
Constants ¶
const (
SignatureVersionV4 = "v4"
SignatureVersionV2 = "v2"
)
Variables ¶
var Fixtures = []testutils.Fixture{
fixture{
// contains filtered or unexported fields
},
dynamoDBFixture(0, 10, 20),
dynamoDBFixture(0, 0, 20),
dynamoDBFixture(2, 10, 20),
}
Fixtures for testing the various configuration of AWS storage.
Functions ¶
func NewDynamoDBChunkClient ¶ added in v0.7.0
func NewDynamoDBChunkClient(cfg DynamoDBConfig, schemaCfg chunk.SchemaConfig, reg prometheus.Registerer) (chunk.Client, error)
NewDynamoDBChunkClient makes a new DynamoDB-backed chunk.Client.
func NewDynamoDBIndexClient ¶
func NewDynamoDBIndexClient(cfg DynamoDBConfig, schemaCfg chunk.SchemaConfig, reg prometheus.Registerer) (chunk.IndexClient, error)
NewDynamoDBIndexClient makes a new DynamoDB-backed IndexClient.
func NewDynamoDBTableClient ¶
func NewDynamoDBTableClient(cfg DynamoDBConfig, reg prometheus.Registerer) (chunk.TableClient, error)
NewDynamoDBTableClient makes a new DynamoTableClient.
Types ¶
type DynamoDBConfig ¶
type DynamoDBConfig struct {
DynamoDB flagext.URLValue `yaml:"dynamodb_url"`
APILimit float64 `yaml:"api_limit"`
ThrottleLimit float64 `yaml:"throttle_limit"`
Metrics MetricsAutoScalingConfig `yaml:"metrics"`
ChunkGangSize int `yaml:"chunk_gang_size"`
ChunkGetMaxParallelism int `yaml:"chunk_get_max_parallelism"`
BackoffConfig util.BackoffConfig `yaml:"backoff_config"`
}
DynamoDBConfig specifies config for a DynamoDB database.
func (*DynamoDBConfig) RegisterFlags ¶
func (cfg *DynamoDBConfig) RegisterFlags(f *flag.FlagSet)
RegisterFlags adds the flags required to config this to the given FlagSet
type HTTPConfig ¶ added in v1.3.0
type HTTPConfig struct {
IdleConnTimeout time.Duration `yaml:"idle_conn_timeout"`
ResponseHeaderTimeout time.Duration `yaml:"response_header_timeout"`
InsecureSkipVerify bool `yaml:"insecure_skip_verify"`
}
HTTPConfig stores the http.Transport configuration
type InjectRequestMiddleware ¶ added in v1.3.0
type InjectRequestMiddleware func(next http.RoundTripper) http.RoundTripper
InjectRequestMiddleware gives users of this client the ability to make arbitrary changes to outgoing requests.
type MetricsAutoScalingConfig ¶
type MetricsAutoScalingConfig struct {
URL string `yaml:"url"` // URL to contact Prometheus store on
TargetQueueLen int64 `yaml:"target_queue_length"` // Queue length above which we will scale up capacity
ScaleUpFactor float64 `yaml:"scale_up_factor"` // Scale up capacity by this multiple
MinThrottling float64 `yaml:"ignore_throttle_below"` // Ignore throttling below this level
QueueLengthQuery string `yaml:"queue_length_query"` // Promql query to fetch ingester queue length
ThrottleQuery string `yaml:"write_throttle_query"` // Promql query to fetch throttle rate per table
UsageQuery string `yaml:"write_usage_query"` // Promql query to fetch write capacity usage per table
ReadUsageQuery string `yaml:"read_usage_query"` // Promql query to fetch read usage per table
ReadErrorQuery string `yaml:"read_error_query"` // Promql query to fetch read errors per table
}
MetricsAutoScalingConfig holds parameters to configure how it works
func (*MetricsAutoScalingConfig) RegisterFlags ¶
func (cfg *MetricsAutoScalingConfig) RegisterFlags(f *flag.FlagSet)
RegisterFlags adds the flags required to config this to the given FlagSet
type S3Config ¶ added in v0.7.0
type S3Config struct {
S3 flagext.URLValue
S3ForcePathStyle bool
BucketNames string
Endpoint string `yaml:"endpoint"`
Region string `yaml:"region"`
AccessKeyID string `yaml:"access_key_id"`
SecretAccessKey string `yaml:"secret_access_key"`
Insecure bool `yaml:"insecure"`
SSEEncryption bool `yaml:"sse_encryption"`
HTTPConfig HTTPConfig `yaml:"http_config"`
SignatureVersion string `yaml:"signature_version"`
SSEConfig cortex_s3.SSEConfig `yaml:"sse"`
Inject InjectRequestMiddleware `yaml:"-"`
}
S3Config specifies config for storing chunks on AWS S3.
func (*S3Config) RegisterFlags ¶ added in v0.7.0
func (cfg *S3Config) RegisterFlags(f *flag.FlagSet)
RegisterFlags adds the flags required to config this to the given FlagSet
func (*S3Config) RegisterFlagsWithPrefix ¶ added in v0.7.0
func (cfg *S3Config) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)
RegisterFlagsWithPrefix adds the flags required to config this to the given FlagSet with a specified prefix
type S3ObjectClient ¶ added in v0.7.0
type S3ObjectClient struct {
S3 s3iface.S3API
// contains filtered or unexported fields
}
func NewS3ObjectClient ¶
func NewS3ObjectClient(cfg S3Config) (*S3ObjectClient, error)
NewS3ObjectClient makes a new S3-backed ObjectClient.
func (*S3ObjectClient) DeleteObject ¶ added in v0.7.0
func (a *S3ObjectClient) DeleteObject(ctx context.Context, objectKey string) error
DeleteObject deletes the specified objectKey from the appropriate S3 bucket
func (*S3ObjectClient) GetObject ¶ added in v0.7.0
func (a *S3ObjectClient) GetObject(ctx context.Context, objectKey string) (io.ReadCloser, error)
GetObject returns a reader for the specified object key from the configured S3 bucket. If the key does not exist a generic chunk.ErrStorageObjectNotFound error is returned.
func (*S3ObjectClient) List ¶ added in v0.7.0
func (a *S3ObjectClient) List(ctx context.Context, prefix, delimiter string) ([]chunk.StorageObject, []chunk.StorageCommonPrefix, error)
List implements chunk.ObjectClient.
type SSEParsedConfig ¶ added in v1.8.0
type SSEParsedConfig struct {
ServerSideEncryption string
KMSKeyID *string
KMSEncryptionContext *string
}
SSEParsedConfig configures server side encryption (SSE) struct used internally to configure AWS S3
func NewSSEParsedConfig ¶ added in v1.8.0
func NewSSEParsedConfig(cfg cortex_s3.SSEConfig) (*SSEParsedConfig, error)
NewSSEParsedConfig creates a struct to configure server side encryption (SSE)
type StorageConfig ¶
type StorageConfig struct {
DynamoDBConfig `yaml:"dynamodb"`
S3Config `yaml:",inline"`
}
StorageConfig specifies config for storing data on AWS.
func (*StorageConfig) RegisterFlags ¶
func (cfg *StorageConfig) RegisterFlags(f *flag.FlagSet)
RegisterFlags adds the flags required to config this to the given FlagSet