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

objstore/azure: Disable Azure syslog exception logging #3341

Merged
merged 1 commit into from
Oct 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re
### Fixed
- [#3257](https://github.com/thanos-io/thanos/pull/3257) Ruler: Prevent Ruler from crashing when using default DNS to lookup hosts that results in "No such hosts" errors.
- [#3331](https://github.com/thanos-io/thanos/pull/3331) Disable Azure blob exception logging
- [#3341](https://github.com/thanos-io/thanos/pull/3341) Disable Azure blob syslog exception logging

## [v0.16.0](https://github.com/thanos-io/thanos/releases) - Release in progress

Expand Down
11 changes: 11 additions & 0 deletions pkg/objstore/azure/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ const DirDelim = "/"

var errorCodeRegex = regexp.MustCompile(`X-Ms-Error-Code:\D*\[(\w+)\]`)

func init() {
// Disable `ForceLog` in Azure storage module
// As the time of this patch, the logging function in the storage module isn't correctly
// detecting expected REST errors like 404 and so outputs them to syslog along with a stacktrace.
// https://github.com/Azure/azure-storage-blob-go/issues/214
//
// This needs to be done at startup because the underlying variable is not thread safe.
kakkoyun marked this conversation as resolved.
Show resolved Hide resolved
// https://github.com/Azure/azure-pipeline-go/blob/dc95902f1d32034f8f743ccc6c3f2eb36b84da27/pipeline/core.go#L276-L283
pipeline.SetForceLogEnabled(false)
kakkoyun marked this conversation as resolved.
Show resolved Hide resolved
}

func getContainerURL(ctx context.Context, conf Config) (blob.ContainerURL, error) {
c, err := blob.NewSharedKeyCredential(conf.StorageAccountName, conf.StorageAccountKey)
if err != nil {
Expand Down