docs(thanos): unhide configuration docs for thanos storage clients (backport k239) (#16142)

Co-authored-by: Ashwanth <iamashwanth@gmail.com>
pull/16163/head
loki-gh-app[bot] 3 months ago committed by GitHub
parent 6098466cea
commit 0ab9121aff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1207
      docs/sources/shared/configuration.md
  2. 2
      pkg/loki/common/common.go
  3. 2
      pkg/loki/loki.go
  4. 4
      pkg/ruler/rulestore/config.go
  5. 4
      pkg/storage/factory.go
  6. 21
      tools/doc-generator/parse/parser.go
  7. 15
      tools/doc-generator/parse/root_blocks.go
  8. 6
      tools/doc-generator/writer.go

File diff suppressed because it is too large Load Diff

@ -80,7 +80,7 @@ type Storage struct {
Hedging hedging.Config `yaml:"hedging"`
COS ibmcloud.COSConfig `yaml:"cos"`
CongestionControl congestion.Config `yaml:"congestion_control,omitempty"`
ObjectStore bucket.Config `yaml:"object_store" doc:"hidden"`
ObjectStore bucket.Config `yaml:"object_store"`
}
func (s *Storage) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet) {

@ -89,7 +89,7 @@ type Config struct {
Frontend lokifrontend.Config `yaml:"frontend,omitempty"`
QueryRange queryrange.Config `yaml:"query_range,omitempty"`
Ruler ruler.Config `yaml:"ruler,omitempty"`
RulerStorage rulestore.Config `yaml:"ruler_storage,omitempty" doc:"hidden"`
RulerStorage rulestore.Config `yaml:"ruler_storage,omitempty"`
IngesterClient ingester_client.Config `yaml:"ingester_client,omitempty"`
Ingester ingester.Config `yaml:"ingester,omitempty"`
BlockBuilder blockbuilder.Config `yaml:"block_builder,omitempty"`

@ -2,7 +2,9 @@ package rulestore
import (
"flag"
"fmt"
"reflect"
"strings"
"github.com/grafana/dskit/flagext"
@ -23,7 +25,7 @@ func (cfg *Config) RegisterFlags(f *flag.FlagSet) {
cfg.ExtraBackends = []string{local.Name}
cfg.Local.RegisterFlagsWithPrefix(prefix, f)
f.StringVar(&cfg.Backend, prefix+"backend", "filesystem", "Backend storage to use. Supported backends are: s3, gcs, azure, swift, filesystem.")
f.StringVar(&cfg.Backend, prefix+"backend", "filesystem", fmt.Sprintf("Backend storage to use. Supported backends are: local, %s", strings.Join(bucket.SupportedBackends, ", ")))
cfg.RegisterFlagsWithPrefix(prefix, f)
}

@ -295,8 +295,8 @@ type Config struct {
DisableBroadIndexQueries bool `yaml:"disable_broad_index_queries"`
MaxParallelGetChunk int `yaml:"max_parallel_get_chunk"`
UseThanosObjstore bool `yaml:"use_thanos_objstore" doc:"hidden"`
ObjectStore bucket.ConfigWithNamedStores `yaml:"object_store" doc:"hidden"`
UseThanosObjstore bool `yaml:"use_thanos_objstore"`
ObjectStore bucket.ConfigWithNamedStores `yaml:"object_store"`
MaxChunkBatchSize int `yaml:"max_chunk_batch_size"`
BoltDBShipperConfig boltdb.IndexCfg `yaml:"boltdb_shipper" doc:"description=Configures storing index in an Object Store (GCS/S3/Azure/Swift/COS/Filesystem) in the form of boltdb files. Required fields only required when boltdb-shipper is defined in config."`

@ -80,6 +80,7 @@ type ConfigEntry struct {
Block *ConfigBlock
BlockDesc string
Root bool
Inline bool
// In case the Kind is KindField
FieldFlag string
@ -228,7 +229,25 @@ func config(block *ConfigBlock, cfg interface{}, flags map[uintptr]*flag.Flag, r
blocks = append(blocks, subBlock)
}
} else {
subBlock = block
// For inline fields, we still want to add them to the root blocks list
if isRoot {
subBlock = &ConfigBlock{
Name: rootName,
Desc: getFieldDescription(cfg, field, rootDesc),
}
blocks = append(blocks, subBlock)
// Add a field entry that references the root block
block.Add(&ConfigEntry{
Kind: KindBlock,
Block: subBlock,
BlockDesc: subBlock.Desc,
Root: true,
Inline: true,
})
} else {
subBlock = block
}
}
if field.Type.Kind() == reflect.Ptr {

@ -30,11 +30,10 @@ import (
"github.com/grafana/loki/v3/pkg/querier/queryrange"
querier_worker "github.com/grafana/loki/v3/pkg/querier/worker"
"github.com/grafana/loki/v3/pkg/ruler"
"github.com/grafana/loki/v3/pkg/ruler/rulestore"
"github.com/grafana/loki/v3/pkg/runtime"
"github.com/grafana/loki/v3/pkg/scheduler"
"github.com/grafana/loki/v3/pkg/storage"
"github.com/grafana/loki/v3/pkg/storage/bucket/gcs"
"github.com/grafana/loki/v3/pkg/storage/bucket"
"github.com/grafana/loki/v3/pkg/storage/chunk/cache"
"github.com/grafana/loki/v3/pkg/storage/chunk/client/alibaba"
"github.com/grafana/loki/v3/pkg/storage/chunk/client/aws"
@ -298,15 +297,9 @@ Named store from this example can be used by setting object_store to store-1 in
Desc: "Define actions for matching OpenTelemetry (OTEL) attributes.",
},
{
Name: "gcs_storage_backend",
StructType: []reflect.Type{reflect.TypeOf(gcs.Config{})},
Desc: "The gcs_storage_backend block configures the connection to Google Cloud Storage object storage backend.",
},
{
Name: "ruler_storage_config",
StructType: []reflect.Type{reflect.TypeOf(rulestore.Config{})},
Desc: `The ruler_storage_config configures ruler storage backend.
It uses thanos-io/objstore clients for connecting to object storage backends. This will become the default way of configuring object store clients in future releases.
Name: "thanos_object_store_config",
StructType: []reflect.Type{reflect.TypeOf(bucket.Config{})},
Desc: `The thanos_object_store_config block configures the connection to object storage backend using thanos-io/objstore clients. This will become the default way of configuring object store clients in future releases.
Currently this is opt-in and takes effect only when ` + "`-use-thanos-objstore` " + "is set to true.",
},
}

@ -52,7 +52,11 @@ func (w *specWriter) writeConfigEntry(e *parse.ConfigEntry, indent int) (written
}
// Block reference without entries, because it's a root block
w.out.WriteString(pad(indent) + "[" + e.Name + ": <" + e.Block.Name + ">]\n")
if e.Inline {
w.out.WriteString(pad(indent) + "[<" + e.Block.Name + ">]\n")
} else {
w.out.WriteString(pad(indent) + "[" + e.Name + ": <" + e.Block.Name + ">]\n")
}
} else {
// Description
w.writeComment(e.BlockDesc, indent, 0)

Loading…
Cancel
Save