Skip to content

Commit

Permalink
[cloud/azure] Use account name for metrics
Browse files Browse the repository at this point in the history
Release note: none
  • Loading branch information
benbardin committed Oct 25, 2024
1 parent dd0f061 commit 7e2fec0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/cloud/azure/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//pkg/base",
"//pkg/ccl/changefeedccl",
"//pkg/cloud",
"//pkg/cloud/cloudpb",
"//pkg/cloud/externalconn",
Expand Down
11 changes: 10 additions & 1 deletion pkg/cloud/azure/azure_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/service"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/cockroachdb/cockroach/pkg/base"
"github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl"
"github.com/cockroachdb/cockroach/pkg/cloud"
"github.com/cockroachdb/cockroach/pkg/cloud/cloudpb"
"github.com/cockroachdb/cockroach/pkg/server/telemetry"
Expand Down Expand Up @@ -221,7 +222,15 @@ func makeAzureStorage(
}

options := args.ExternalStorageOptions()
t, err := cloud.MakeHTTPClient(args.Settings, args.MetricsRecorder, "azure", dest.AzureConfig.Container, options.ClientName)
bucket := dest.AzureConfig.Container
if changefeedccl.EnableCloudBillingAccounting {
// Azure is special in that its bucket names are not unique. So for
// the moment, Cloud needs to track Account Name, since it is in fact
// unique. We may eventually choose bucket names derived from the
// account name to ensure uniqueness and bypass this hack.
bucket = dest.AzureConfig.AccountName
}
t, err := cloud.MakeHTTPClient(args.Settings, args.MetricsRecorder, "azure", bucket, options.ClientName)
if err != nil {
return nil, errors.Wrap(err, "azure: unable to create transport")
}
Expand Down

0 comments on commit 7e2fec0

Please sign in to comment.