Skip to content

Commit 8a19e3c

Browse files
authored
Merge pull request #630 from andyzhangx/latency-logs
feat: provide latency data in logs
2 parents 0b554c9 + a5abd8b commit 8a19e3c

30 files changed

+417
-277
lines changed

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module sigs.k8s.io/blob-csi-driver
33
go 1.17
44

55
require (
6-
github.com/Azure/azure-sdk-for-go v62.1.0+incompatible
6+
github.com/Azure/azure-sdk-for-go v62.2.0+incompatible
77
github.com/Azure/go-autorest/autorest v0.11.24
88
github.com/Azure/go-autorest/autorest/adal v0.9.18
99
github.com/Azure/go-autorest/autorest/to v0.4.0
@@ -17,7 +17,7 @@ require (
1717
github.com/onsi/gomega v1.18.1
1818
github.com/pborman/uuid v1.2.0
1919
github.com/pelletier/go-toml v1.9.4
20-
github.com/stretchr/testify v1.7.0
20+
github.com/stretchr/testify v1.7.1
2121
golang.org/x/net v0.0.0-20211209124913-491a49abca63
2222
google.golang.org/grpc v1.42.0
2323
google.golang.org/protobuf v1.27.1
@@ -77,7 +77,7 @@ require (
7777
github.com/prometheus/client_model v0.2.0 // indirect
7878
github.com/prometheus/common v0.28.0 // indirect
7979
github.com/prometheus/procfs v0.6.0 // indirect
80-
github.com/spf13/cobra v1.3.0 // indirect
80+
github.com/spf13/cobra v1.4.0 // indirect
8181
github.com/spf13/pflag v1.0.5 // indirect
8282
go.opentelemetry.io/contrib v0.20.0 // indirect
8383
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0 // indirect
@@ -145,5 +145,5 @@ replace (
145145
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.23.3
146146
k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.23.3
147147
k8s.io/sample-controller => k8s.io/sample-controller v0.23.3
148-
sigs.k8s.io/cloud-provider-azure => sigs.k8s.io/cloud-provider-azure v0.7.4-0.20220309155012-8a8c170f3d02
148+
sigs.k8s.io/cloud-provider-azure => sigs.k8s.io/cloud-provider-azure v0.7.4-0.20220318124122-66e1bec130df
149149
)

go.sum

Lines changed: 8 additions & 142 deletions
Large diffs are not rendered by default.

pkg/blob/controllerserver.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,11 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
255255
parameters[containerNameField] = validContainerName
256256
}
257257

258+
var volumeID string
258259
mc := metrics.NewMetricContext(blobCSIDriverName, "controller_create_volume", d.cloud.ResourceGroup, d.cloud.SubscriptionID, d.Name)
259260
isOperationSucceeded := false
260261
defer func() {
261-
mc.ObserveOperationWithResult(isOperationSucceeded)
262+
mc.ObserveOperationWithResult(isOperationSucceeded, volumeID, "")
262263
}()
263264

264265
klog.V(2).Infof("begin to create container(%s) on account(%s) type(%s) rg(%s) location(%s) size(%d)", validContainerName, accountName, storageAccountType, resourceGroup, location, requestGiB)
@@ -283,7 +284,7 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
283284
}
284285
}
285286

286-
volumeID := fmt.Sprintf(volumeIDTemplate, resourceGroup, accountName, validContainerName)
287+
volumeID = fmt.Sprintf(volumeIDTemplate, resourceGroup, accountName, validContainerName)
287288
if containerName != "" {
288289
// add volume name as suffix to differentiate volumeID since "containerName" is specified
289290
// not necessary for dynamic container name creation since volumeID already contains volume name
@@ -345,7 +346,7 @@ func (d *Driver) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest)
345346
mc := metrics.NewMetricContext(blobCSIDriverName, "controller_delete_volume", d.cloud.ResourceGroup, d.cloud.SubscriptionID, d.Name)
346347
isOperationSucceeded := false
347348
defer func() {
348-
mc.ObserveOperationWithResult(isOperationSucceeded)
349+
mc.ObserveOperationWithResult(isOperationSucceeded, volumeID, "")
349350
}()
350351

351352
klog.V(2).Infof("deleting container(%s) rg(%s) account(%s) volumeID(%s)", containerName, resourceGroupName, accountName, volumeID)

vendor/github.com/Azure/azure-sdk-for-go/version/version.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/spf13/cobra/MAINTAINERS

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/spf13/cobra/Makefile

Lines changed: 2 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/spf13/cobra/README.md

Lines changed: 16 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/spf13/cobra/projects_using_cobra.md

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/spf13/cobra/shell_completions.md

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/spf13/cobra/user_guide.md

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)