-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add objstore support for Swift using thanos.io/objstore #11672
Changes from 8 commits
0a946a2
88df54d
5f821dd
749f64b
f5bcc9c
06ef15b
fb562c4
b1b203b
7b23e51
d5ad3e7
6b70293
6a266e0
fd98f34
959aa77
05acfd9
ce0c7e6
3659f19
7fe24b8
53fd4ee
b02afa8
0c6526e
5a511b9
bc2eeb8
e64f09e
11970b9
380c0b8
61c50f3
776c5c4
99a0cf3
32f92fe
ad09648
bc652bd
340b953
fb3f953
dd26273
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,16 @@ type Config struct { | |
MaxRetries int `yaml:"max_retries"` | ||
ConnectTimeout time.Duration `yaml:"connect_timeout"` | ||
RequestTimeout time.Duration `yaml:"request_timeout"` | ||
HTTPConfig HTTPConfig `yaml:"http_config"` | ||
} | ||
|
||
// HTTPConfig stores the http.Transport configuration | ||
type HTTPConfig struct { | ||
Timeout time.Duration `yaml:"timeout"` | ||
IdleConnTimeout time.Duration `yaml:"idle_conn_timeout"` | ||
ResponseHeaderTimeout time.Duration `yaml:"response_header_timeout"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These values are define here but I don't see anywhere they are actually being used to configure the underlying transport? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, you're right I had assumed that this was the struct being used inside the Following @periklis 's advice to reuse the
|
||
InsecureSkipVerify bool `yaml:"insecure_skip_verify"` | ||
CAFile string `yaml:"ca_file"` | ||
} | ||
|
||
// RegisterFlags registers the flags for Swift storage | ||
|
@@ -54,6 +64,11 @@ func (cfg *Config) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet) { | |
f.IntVar(&cfg.MaxRetries, prefix+"swift.max-retries", 3, "Max retries on requests error.") | ||
f.DurationVar(&cfg.ConnectTimeout, prefix+"swift.connect-timeout", 10*time.Second, "Time after which a connection attempt is aborted.") | ||
f.DurationVar(&cfg.RequestTimeout, prefix+"swift.request-timeout", 5*time.Second, "Time after which an idle request is aborted. The timeout watchdog is reset each time some data is received, so the timeout triggers after X time no data is received on a request.") | ||
f.DurationVar(&cfg.HTTPConfig.IdleConnTimeout, prefix+"swift.http.idle-conn-timeout", 90*time.Second, "The maximum amount of time an idle connection will be held open.") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would be a change from the currently used default value of Also as mentioned above I don't see where this value actually configures the underlying transport There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @slim-bean AFAICS, GCS, Azure and S3 all define as default 90sec. Maybe you refer to some different place? |
||
f.DurationVar(&cfg.HTTPConfig.Timeout, prefix+"swift.http.timeout", 0, "Timeout specifies a time limit for requests made by swift Client.") | ||
f.DurationVar(&cfg.HTTPConfig.ResponseHeaderTimeout, prefix+"swift.http.response-header-timeout", 0, "If non-zero, specifies the amount of time to wait for a server's response headers after fully writing the request.") | ||
f.BoolVar(&cfg.HTTPConfig.InsecureSkipVerify, prefix+"swift.http.insecure-skip-verify", false, "Set to true to skip verifying the certificate chain and hostname.") | ||
f.StringVar(&cfg.HTTPConfig.CAFile, prefix+"swift.http.ca-file", "", "Path to the trusted CA file that signed the SSL certificate of the swift endpoint.") | ||
} | ||
|
||
func (cfg *Config) Validate() error { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you edit this file directly? Or is this change automatically generated? The configuration reference should be updated in docs/sources/configure/index.template.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did so directly.. thanks for pointing this out!