-
Notifications
You must be signed in to change notification settings - Fork 818
Experimental TSDB: Enable Azure Storage Backend #2083
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
Merged
pracucci
merged 4 commits into
cortexproject:master
from
khaines:khaines/tsdb-azure-storage
Feb 6, 2020
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
ec3aeaf
Adding Microsoft Azure backend support for TSDB storage engine.
khaines cfac884
correcting minor typo caught by linter
khaines 1e5679a
updating the vendor's module for thanos to include azure file
khaines bd2d9ac
a few more doc tweaks for consistency
khaines File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package azure | ||
|
||
import ( | ||
"github.com/go-kit/kit/log" | ||
"github.com/thanos-io/thanos/pkg/objstore" | ||
"github.com/thanos-io/thanos/pkg/objstore/azure" | ||
yaml "gopkg.in/yaml.v2" | ||
) | ||
|
||
func NewBucketClient(cfg Config, name string, logger log.Logger) (objstore.Bucket, error) { | ||
bucketConfig := azure.Config{ | ||
StorageAccountName: cfg.StorageAccountName, | ||
StorageAccountKey: cfg.StorageAccountKey, | ||
ContainerName: cfg.ContainerName, | ||
Endpoint: cfg.Endpoint, | ||
MaxRetries: cfg.MaxRetries, | ||
} | ||
|
||
// Thanos currently doesn't support passing the config as is, but expects a YAML, | ||
// so we're going to serialize it. | ||
serialized, err := yaml.Marshal(bucketConfig) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return azure.NewBucket(logger, serialized, name) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package azure | ||
|
||
import ( | ||
"flag" | ||
) | ||
|
||
// Config holds the config options for an Azure backend | ||
type Config struct { | ||
StorageAccountName string `yaml:"account_name"` | ||
StorageAccountKey string `yaml:"account_key"` | ||
ContainerName string `yaml:"container_name"` | ||
Endpoint string `yaml:"endpoint_suffix"` | ||
MaxRetries int `yaml:"max_retries"` | ||
} | ||
|
||
// RegisterFlags registers the flags for TSDB Azure storage | ||
func (cfg *Config) RegisterFlags(f *flag.FlagSet) { | ||
f.StringVar(&cfg.StorageAccountName, "experimental.tsdb.azure.account-name", "", "Azure storage account name") | ||
f.StringVar(&cfg.StorageAccountKey, "experimental.tsdb.azure.account-key", "", "Azure storage account key") | ||
f.StringVar(&cfg.ContainerName, "experimental.tsdb.azure.container-name", "", "Azure storage container name") | ||
f.StringVar(&cfg.Endpoint, "experimental.tsdb.azure.endpoint-suffix", "", "Azure storage endpoint suffix without schema. The account name will be prefixed to this value to create the FQDN") | ||
f.IntVar(&cfg.MaxRetries, "experimental.tsdb.azure.max-retries", 20, "Number of retries for recoverable errors") | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.