Skip to content

Commit

Permalink
docs: fixed docs
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaoBraveCoding committed Oct 30, 2024
1 parent bc2eeb8 commit e64f09e
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 20 deletions.
14 changes: 10 additions & 4 deletions docs/sources/shared/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -5846,6 +5846,10 @@ The `swift_storage_config` block configures the connection to OpenStack Object S
 

```yaml
# Set this to true to use the internal OpenStack Swift endpoint URL
# CLI flag: -<prefix>.swift.internal
[internal: <boolean> | default = false]
# OpenStack Swift authentication API version. 0 to autodetect.
# CLI flag: -<prefix>.swift.auth-version
[auth_version: <int> | default = 0]
Expand All @@ -5854,10 +5858,6 @@ The `swift_storage_config` block configures the connection to OpenStack Object S
# CLI flag: -<prefix>.swift.auth-url
[auth_url: <string> | default = ""]
# Set this to true to use the internal OpenStack Swift endpoint URL
# CLI flag: -<prefix>.swift.internal
[internal: <boolean> | default = false]
# OpenStack Swift username.
# CLI flag: -<prefix>.swift.username
[username: <string> | default = ""]
Expand Down Expand Up @@ -5925,6 +5925,12 @@ The `swift_storage_config` block configures the connection to OpenStack Object S
# is received on a request.
# CLI flag: -<prefix>.swift.request-timeout
[request_timeout: <duration> | default = 5s]
http_config:
# Path to the CA certificates to validate server certificate against. If not
# set, the host's root CA certificates are used.
# CLI flag: -<prefix>.swift.http.tls-ca-path
[tls_ca_path: <string> | default = ""]
```

### table_manager
Expand Down
26 changes: 15 additions & 11 deletions pkg/storage/bucket/http/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,21 @@ import (
"time"
)

// NOTE some of the fields are hidden in the documentation due to this struct
// being by the old Swift storage backend. The hidden fields can be unhidden
// when we deprecate the old clients.

// Config stores the http.Client configuration for the storage clients.
type Config struct {
IdleConnTimeout time.Duration `yaml:"idle_conn_timeout"`
ResponseHeaderTimeout time.Duration `yaml:"response_header_timeout"`
InsecureSkipVerify bool `yaml:"insecure_skip_verify"`
IdleConnTimeout time.Duration `yaml:"idle_conn_timeout" doc:"hidden"`
ResponseHeaderTimeout time.Duration `yaml:"response_header_timeout" doc:"hidden"`
InsecureSkipVerify bool `yaml:"insecure_skip_verify" doc:"hidden"`

TLSHandshakeTimeout time.Duration `yaml:"tls_handshake_timeout"`
ExpectContinueTimeout time.Duration `yaml:"expect_continue_timeout"`
MaxIdleConns int `yaml:"max_idle_connections"`
MaxIdleConnsPerHost int `yaml:"max_idle_connections_per_host"`
MaxConnsPerHost int `yaml:"max_connections_per_host"`
TLSHandshakeTimeout time.Duration `yaml:"tls_handshake_timeout" doc:"hidden"`
ExpectContinueTimeout time.Duration `yaml:"expect_continue_timeout" doc:"hidden"`
MaxIdleConns int `yaml:"max_idle_connections" doc:"hidden"`
MaxIdleConnsPerHost int `yaml:"max_idle_connections_per_host" doc:"hidden"`
MaxConnsPerHost int `yaml:"max_connections_per_host" doc:"hidden"`

// Allow upstream callers to inject a round tripper
Transport http.RoundTripper `yaml:"-"`
Expand All @@ -27,9 +31,9 @@ type Config struct {
// TLSConfig configures the options for TLS connections.
type TLSConfig struct {
CAPath string `yaml:"tls_ca_path" category:"advanced"`
CertPath string `yaml:"tls_cert_path" category:"advanced"`
KeyPath string `yaml:"tls_key_path" category:"advanced"`
ServerName string `yaml:"tls_server_name" category:"advanced"`
CertPath string `yaml:"tls_cert_path" category:"advanced" doc:"hidden"`
KeyPath string `yaml:"tls_key_path" category:"advanced" doc:"hidden"`
ServerName string `yaml:"tls_server_name" category:"advanced" doc:"hidden"`
}

// RegisterFlags registers the flags for the storage HTTP client.
Expand Down
10 changes: 7 additions & 3 deletions pkg/storage/bucket/swift/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ import (
"github.com/grafana/loki/v3/pkg/storage/bucket/http"
)

// NOTE some of the fields are hidden in the documentation due to this struct
// being by the old Swift storage backend. The hidden fields can be unhidden
// when we deprecate the old clients.

// Config holds the config options for Swift backend
type Config struct {
ApplicationCredentialID string `yaml:"application_credential_id"`
ApplicationCredentialName string `yaml:"application_credential_name"`
ApplicationCredentialSecret flagext.Secret `yaml:"application_credential_secret"`
ApplicationCredentialID string `yaml:"application_credential_id" doc:"hidden"`
ApplicationCredentialName string `yaml:"application_credential_name" doc:"hidden"`
ApplicationCredentialSecret flagext.Secret `yaml:"application_credential_secret" doc:"hidden"`
AuthVersion int `yaml:"auth_version"`
AuthURL string `yaml:"auth_url"`
Username string `yaml:"username"`
Expand Down
4 changes: 2 additions & 2 deletions pkg/storage/chunk/client/openstack/swift_object_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ func defaultTransport(config bucket_http.Config) (http.RoundTripper, error) {

return &http.Transport{
Proxy: http.ProxyFromEnvironment,
MaxIdleConns: config.MaxIdleConns,
MaxIdleConnsPerHost: config.MaxIdleConnsPerHost,
MaxIdleConns: 200,
MaxIdleConnsPerHost: 200,
ExpectContinueTimeout: 5 * time.Second,
// Set this value so that the underlying transport round-tripper
// doesn't try to auto decode the body of objects with
Expand Down

0 comments on commit e64f09e

Please sign in to comment.