Skip to content
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(thanos): add support for named stores #14638

Merged
merged 18 commits into from
Nov 25, 2024
Merged

Conversation

ashwanthgoli
Copy link
Contributor

@ashwanthgoli ashwanthgoli commented Oct 29, 2024

What this PR does / why we need it:

This pr adds named store support for thanos based object clients. -use-thanos-objstore flag has to be set to true to use these configs.

Below is an example of how to configure a named s3 store. store-1 can then be set as the object_store in your period_configs

storage_config:
  object_store:
    named_stores:
      s3:
        store-1:
          endpoint: s3://foo-bucket
          region: us-west1

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
    • Note that Promtail is considered to be feature complete, and future development for logs collection will be in Grafana Alloy. As such, feat PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

@ashwanthgoli ashwanthgoli changed the title Thanos named stores feat(thanos): support named stores Oct 29, 2024
@ashwanthgoli ashwanthgoli changed the title feat(thanos): support named stores feat(thanos): add support for named stores Oct 29, 2024
@ashwanthgoli ashwanthgoli marked this pull request as ready for review October 30, 2024 11:37
@ashwanthgoli ashwanthgoli requested a review from a team as a code owner October 30, 2024 11:37
Comment on lines 28 to 39
var (
storeType = backend
storeCfg = cfg.Config
)

if st, ok := cfg.NamedStores.LookupStoreType(backend); ok {
storeType = st
// override config with values from named store config
if err := cfg.NamedStores.OverrideConfig(&storeCfg, backend, storeType); err != nil {
return nil, err
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused by this part. We set storeType using backend but then also use backend to search for a namedStore.

@ashwanthgoli ashwanthgoli merged commit 8958eb9 into main Nov 25, 2024
58 checks passed
@ashwanthgoli ashwanthgoli deleted the thanos-named-stores branch November 25, 2024 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants