diff --git a/ci/resources/stemcell-version-bump/go.mod b/ci/resources/stemcell-version-bump/go.mod index b3eab83b..cc85db55 100644 --- a/ci/resources/stemcell-version-bump/go.mod +++ b/ci/resources/stemcell-version-bump/go.mod @@ -3,7 +3,7 @@ module stemcell-version-bump go 1.25.8 require ( - cloud.google.com/go/storage v1.67.1 + cloud.google.com/go/storage v1.68.0 github.com/stretchr/testify v1.12.1 google.golang.org/api v0.298.0 ) diff --git a/ci/resources/stemcell-version-bump/go.sum b/ci/resources/stemcell-version-bump/go.sum index 2f8159b3..9042f4ce 100644 --- a/ci/resources/stemcell-version-bump/go.sum +++ b/ci/resources/stemcell-version-bump/go.sum @@ -16,8 +16,8 @@ cloud.google.com/go/longrunning v1.2.0 h1:WjYH3YHBGCxGJP9M4dWGHBfXr/cFIjMkNgWcJj cloud.google.com/go/longrunning v1.2.0/go.mod h1:5KMQALFGOCtFoi2xSOA1u3H7WKlhmckgiyFw7+LGQp0= cloud.google.com/go/monitoring v1.30.0 h1:r/d+JUbyKmJ8b07iznuKfzVzrIXTWxHQ3lBRm3x2LlY= cloud.google.com/go/monitoring v1.30.0/go.mod h1:htlUR0QWVMrjFzZmN4LGnMAve9xB/eduwjmINxVZ8RM= -cloud.google.com/go/storage v1.67.1 h1:cDeyjY1ik/2IBs4/nLytL6Orrtbi5M0G6beyGRl/9EQ= -cloud.google.com/go/storage v1.67.1/go.mod h1:UsS9OgFg/XHOSYakQ8ZtLWWeyGkk1WnmD/GsGfN0BHM= +cloud.google.com/go/storage v1.68.0 h1:gqrAMJ51OZjYgU6AJ2U60um90YQhSjq8HEIQNtJ4C/8= +cloud.google.com/go/storage v1.68.0/go.mod h1:UsS9OgFg/XHOSYakQ8ZtLWWeyGkk1WnmD/GsGfN0BHM= cloud.google.com/go/trace v1.16.0 h1:GmQovzFc5F0CNfl0VLgL64aoTtu7xsM0YajW2GlG9+E= cloud.google.com/go/trace v1.16.0/go.mod h1:r+bdAn16dKLSV1G2D5v3e58IlQlizfxWrUfjx7kM7X0= github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.33.0 h1:l7+6kwRMJNwdCvYdDl7Eax+wzEYHSnNY7zrrfbhDdTA= diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/CHANGES.md b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/CHANGES.md index 9571abb7..102a5dd1 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/CHANGES.md +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/CHANGES.md @@ -1,6 +1,13 @@ # Changes +## [1.68.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.67.1...storage/v1.68.0) (2026-09-17) + + +### Bug Fixes + +* **storage:** Minor documentation fixes ([#20531](https://github.com/googleapis/google-cloud-go/issues/20531)) ([8a55dee](https://github.com/googleapis/google-cloud-go/commit/8a55dee7d694d1b0b35f9eaff8a0517bffec320d)) + ## [1.67.1](https://github.com/googleapis/google-cloud-go/compare/storage/v1.67.0...storage/v1.67.1) (2026-09-07) diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/doc.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/doc.go index c905741b..9e1cfd73 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/doc.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/doc.go @@ -183,7 +183,7 @@ subset using [Query.SetAttrSelection] may speed up the listing process: Both objects and buckets have ACLs (Access Control Lists). An ACL is a list of ACLRules, each of which specifies the role of a user, group or project. ACLs are suitable for fine-grained control, but you may prefer using IAM to control -access at the project level (see [Cloud Storage IAM docs]. +access at the project level (see [Cloud Storage IAM docs]). To list the ACLs of a bucket or object, obtain an [ACLHandle] and call [ACLHandle.List]: @@ -247,7 +247,7 @@ as the documentation of [BucketHandle.GenerateSignedPostPolicyV4]. if err != nil { // TODO: Handle error. } - fmt.Printf("URL: %s\nFields; %v\n", pv4.URL, pv4.Fields) + fmt.Printf("URL: %s\nFields: %v\n", pv4.URL, pv4.Fields) # Credential requirements for signing @@ -384,7 +384,7 @@ Requirements to use Direct Connectivity include: - Your application must be running inside Google Cloud. - Your Cloud Storage [bucket location] must overlap with your VM or compute - environment zone. For example, if your VM is in us-east1a, your bucket + environment zone. For example, if your VM is in us-east1-b, your bucket must be located in either us-east1 (single region), nam4 (dual region), or us (multi-region). - Your client must use service account authentication. @@ -462,7 +462,7 @@ use this strategy: factors; therefore, you should experiment with your specific workload to determine if parallel uploads provide a benefit. -**Note:** This feature is currently experimental and its API surface may change +Note: This feature is currently experimental and its API surface may change in future releases. It is not yet recommended for production use. # Storage Control API diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/experimental/buffer_pool.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/experimental/buffer_pool.go new file mode 100644 index 00000000..5c02617d --- /dev/null +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/experimental/buffer_pool.go @@ -0,0 +1,39 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package experimental + +import ( + "context" +) + +// BufferPool is not supported at the moment. +type BufferPool interface { + // Get retrieves a single chunk of memory. It returns a slice that is + // optimally sized by the pool, guaranteeing that len(buf) <= maxSize. + // It blocks until the request is satisfied. + // It returns an error if the context is cancelled (e.g., context.Canceled) + // or if the underlying allocation encounters a fatal failure. + Get(ctx context.Context, maxSize int) ([]byte, error) + + // TryGet retrieves a chunk of memory up to maxSize bytes. + // It is non-blocking and either returns a memory chunk or fails instantly + // by throwing an error. + TryGet(maxSize int) ([]byte, error) + + // Put returns a previously acquired buffer to the pool. + // After calling Put, the caller must not retain, read, or write to the buffer. + // The exact slice returned by Get or TryGet must be passed back. + Put(buf []byte) +} diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/experimental/experimental.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/experimental/experimental.go index 804db54e..7ed711a9 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/experimental/experimental.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/experimental/experimental.go @@ -103,3 +103,12 @@ func WithOtelMetrics() option.ClientOption { func WithOtelDebugMetrics() option.ClientOption { return internal.WithOtelDebugMetrics.(func() option.ClientOption)() } + +// WithBufferPool provides an [option.ClientOption] that may be passed to +// [cloud.google.com/go/storage.NewGRPCClient]. +// It sets the buffer pool used to allocate memory for parallel uploads. +// +// This option is not supported at the moment. +func WithBufferPool(pool BufferPool) option.ClientOption { + return internal.WithBufferPool.(func(BufferPool) option.ClientOption)(pool) +} diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/grpc_reader_multi_range.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/grpc_reader_multi_range.go index 7dc5bc5f..6c7d23e6 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/grpc_reader_multi_range.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/grpc_reader_multi_range.go @@ -22,6 +22,7 @@ import ( "io" "log" "sync" + "sync/atomic" "cloud.google.com/go/storage/internal/apiv2/storagepb" "google.golang.org/grpc" @@ -58,6 +59,7 @@ type internalMultiRangeDownloader interface { getHandle() []byte getPermanentError() error getSpanCtx() context.Context + getBytesRead() int64 } // streamPickerStrategy is an interface which each stream picker must implement. @@ -369,6 +371,7 @@ type multiRangeDownloaderManager struct { wg sync.WaitGroup // syncs completion of event loop. cmds chan mrdCommand sessionResps chan mrdSessionResult + bytesRead int64 // State mu sync.Mutex @@ -518,6 +521,10 @@ func (m *multiRangeDownloaderManager) getSpanCtx() context.Context { return m.spanCtx } +func (m *multiRangeDownloaderManager) getBytesRead() int64 { + return atomic.LoadInt64(&m.bytesRead) +} + func (m *multiRangeDownloaderManager) runCallback(origOffset, numBytes int64, err error, cb func(int64, int64, error)) { if cb == nil { return @@ -1068,6 +1075,7 @@ func (m *multiRangeDownloaderManager) processDataRanges(result mrdSessionResult, written, _, err := result.decoder.writeToAndUpdateCRC(req.output, readID, nil) req.bytesWritten += written + atomic.AddInt64(&m.bytesRead, written) mrdStream.updateCapacity(m, 0, -written) if err != nil { m.failRange(mrdStream, req, err) diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/internal/experimental.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/internal/experimental.go index 5f8a1fa0..089a452f 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/internal/experimental.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/internal/experimental.go @@ -46,4 +46,9 @@ var ( // WithOtelDebugMetrics is a function which is implemented by the storage package. // It enables debug client-side OpenTelemetry metrics. WithOtelDebugMetrics any // func() option.ClientOption + // WithBufferPool is a function which is implemented by the storage package. + // It sets the buffer pool used to allocate memory for parallel uploads. + // + // This option is not supported at the moment. + WithBufferPool any // func(BufferPool) option.ClientOption ) diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/internal/version.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/internal/version.go index a8f8994d..f2949ee9 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/internal/version.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/internal/version.go @@ -17,4 +17,4 @@ package internal // Version is the current tagged release of the library. -const Version = "1.67.1" +const Version = "1.68.0" diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/metrics.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/metrics.go index b698030b..dd68fb22 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/metrics.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/metrics.go @@ -39,6 +39,7 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric" sdkmetric "go.opentelemetry.io/otel/sdk/metric" + "go.opentelemetry.io/otel/sdk/metric/exemplar" "go.opentelemetry.io/otel/sdk/metric/metricdata" "go.opentelemetry.io/otel/sdk/resource" @@ -203,6 +204,7 @@ func initMetrics(ctx context.Context, projectID string, config *storageConfig) ( provider = sdkmetric.NewMeterProvider( sdkmetric.WithReader(reader), sdkmetric.WithResource(res), + sdkmetric.WithExemplarFilter(exemplar.TraceBasedFilter), sdkmetric.WithView( sdkmetric.NewView( sdkmetric.Instrument{Name: "rpc.client.call.duration", Kind: sdkmetric.InstrumentKindHistogram}, @@ -350,7 +352,7 @@ func initMetrics(ctx context.Context, projectID string, config *storageConfig) ( if isOtelDebugMetricsEnabled(config) { networkBytesSent, err = meter.Int64Counter( - "gcp.storage.client.network.egress_bytes_count", + "gcp.storage.client.network.bytes.sent", metric.WithDescription("Total physical bytes sent over the wire socket (gRPC only)."), metric.WithUnit("By"), ) @@ -359,7 +361,7 @@ func initMetrics(ctx context.Context, projectID string, config *storageConfig) ( } networkBytesReceived, err = meter.Int64Counter( - "gcp.storage.client.network.ingress_bytes_count", + "gcp.storage.client.network.bytes.received", metric.WithDescription("Total physical bytes received over the wire socket (gRPC only)."), metric.WithUnit("By"), ) @@ -385,7 +387,7 @@ func initMetrics(ctx context.Context, projectID string, config *storageConfig) ( return nil, nil, err } activeRequests, err = meter.Int64UpDownCounter( - "gcp.storage.client.active_requests", + "gcp.storage.client.request.active", metric.WithDescription("Number of active GCS client requests"), metric.WithUnit("1"), ) @@ -643,12 +645,14 @@ func (cm *clientMetrics) recordRPC(ctx context.Context, method, target string, d logicalMethod := methodName if state != nil { logicalMethod = state.method + state.setTarget(target) } attemptAttrs := make([]attribute.KeyValue, 0, 5) attemptAttrs = append(attemptAttrs, attribute.String("rpc.system.name", "grpc"), attribute.String("rpc.method", logicalMethod), attribute.Int64("rpc.grpc.status_code", statusCode), + attribute.String("server.address", stripPort(target)), attribute.String("error.type", errorType), ) cm.attempts.Add(ctx, 1, metric.WithAttributes(injectAPIMethod(ctx, attemptAttrs)...)) @@ -659,6 +663,7 @@ func (cm *clientMetrics) recordRPC(ctx context.Context, method, target string, d errorAttrs = append(errorAttrs, attribute.String("rpc.system.name", "grpc"), attribute.String("rpc.method", logicalMethod), + attribute.String("server.address", stripPort(target)), attribute.String("error.type", errorType), ) cm.errors.Add(ctx, 1, metric.WithAttributes(injectAPIMethod(ctx, errorAttrs)...)) @@ -667,7 +672,7 @@ func (cm *clientMetrics) recordRPC(ctx context.Context, method, target string, d // For unary calls, record TTFB equal to the total attempt latency. isStreaming := methodName == "ReadObject" || methodName == "WriteObject" || methodName == "BidiReadObject" || methodName == "BidiWriteObject" if !isStreaming { - ttfbAttrs := []attribute.KeyValue{attribute.String("rpc.method", logicalMethod)} + ttfbAttrs := []attribute.KeyValue{attribute.String("rpc.system.name", "grpc"), attribute.String("rpc.method", logicalMethod), attribute.String("server.address", stripPort(target))} cm.ttfb.Record(ctx, duration, metric.WithAttributes(injectAPIMethod(ctx, ttfbAttrs)...)) } } @@ -841,12 +846,17 @@ func (rt *metricsRoundTripper) RoundTrip(req *http.Request) (*http.Response, err errorType := computeErrorType(err, true, statusCode) if rt.metrics != nil { + state := metricsStateFromContext(req.Context()) + if state != nil { + state.setTarget(req.URL.Host) + } // Record attempt. attemptAttrs := make([]attribute.KeyValue, 0, 4) attemptAttrs = append(attemptAttrs, attribute.String("rpc.system.name", "http"), attribute.String("rpc.method", logicalMethod), attribute.Int64("http.response.status_code", statusCode), + attribute.String("server.address", stripPort(req.URL.Host)), attribute.String("error.type", errorType), ) rt.metrics.attempts.Add(req.Context(), 1, metric.WithAttributes(injectAPIMethod(req.Context(), attemptAttrs)...)) @@ -857,6 +867,7 @@ func (rt *metricsRoundTripper) RoundTrip(req *http.Request) (*http.Response, err errorAttrs = append(errorAttrs, attribute.String("rpc.system.name", "http"), attribute.String("rpc.method", logicalMethod), + attribute.String("server.address", stripPort(req.URL.Host)), attribute.String("error.type", errorType), ) rt.metrics.errors.Add(req.Context(), 1, metric.WithAttributes(injectAPIMethod(req.Context(), errorAttrs)...)) @@ -887,7 +898,7 @@ func (rt *metricsRoundTripper) RoundTrip(req *http.Request) (*http.Response, err isResumableInit := req.Method == "POST" && strings.Contains(req.URL.Path, "/upload/") && req.URL.Query().Get("uploadType") == "resumable" if !isDownload || isResumableInit { duration := time.Since(startTime).Seconds() - ttfbAttrs := []attribute.KeyValue{attribute.String("rpc.method", logicalMethod)} + ttfbAttrs := []attribute.KeyValue{attribute.String("rpc.system.name", "http"), attribute.String("rpc.method", logicalMethod), attribute.String("server.address", stripPort(req.URL.Host))} rt.metrics.ttfb.Record(req.Context(), duration, metric.WithAttributes(injectAPIMethod(req.Context(), ttfbAttrs)...)) } } @@ -938,7 +949,7 @@ func (w *wrappedResponseBody) Read(p []byte) (n int, err error) { if state != nil { logicalMethod = state.method } - w.metrics.ttfb.Record(w.req.Context(), duration, metric.WithAttributes(attribute.String("rpc.method", logicalMethod))) + w.metrics.ttfb.Record(w.req.Context(), duration, metric.WithAttributes(attribute.String("rpc.system.name", "http"), attribute.String("rpc.method", logicalMethod), attribute.String("server.address", stripPort(w.req.URL.Host)))) } n, err = w.ReadCloser.Read(p) if err != nil { @@ -1169,7 +1180,7 @@ func (w *wrappedClientStream) recordTTFB(m interface{}) { if state != nil { logicalMethod = state.method } - w.metrics.ttfb.Record(w.ctx, duration, metric.WithAttributes(attribute.String("rpc.method", logicalMethod))) + w.metrics.ttfb.Record(w.ctx, duration, metric.WithAttributes(attribute.String("rpc.system.name", "grpc"), attribute.String("rpc.method", logicalMethod), attribute.String("server.address", stripPort(w.target)))) } } @@ -1185,6 +1196,7 @@ func injectAPIMethod(ctx context.Context, attrs []attribute.KeyValue) []attribut } type metricsState struct { + target atomic.Pointer[string] method string startTime time.Time metrics *clientMetrics @@ -1192,6 +1204,33 @@ type metricsState struct { record func(error) } +func (s *metricsState) setTarget(t string) { + if s == nil { + return + } + s.target.Store(&t) +} + +func (s *metricsState) getSystemName() string { + if s == nil { + return "" + } + if s.isHTTP { + return "http" + } + return "grpc" +} + +func (s *metricsState) getTarget() string { + if s == nil { + return "" + } + if p := s.target.Load(); p != nil { + return *p + } + return "" +} + func contextWithMetricsState(ctx context.Context, state *metricsState) context.Context { return context.WithValue(ctx, metricsKey{}, state) } @@ -1231,7 +1270,9 @@ func (cm *clientMetrics) startOperation(ctx context.Context, method string, isHT errorType := computeErrorType(err, isHTTP, 0) attrs := []attribute.KeyValue{ + attribute.String("rpc.system.name", state.getSystemName()), attribute.String("rpc.method", method), + attribute.String("server.address", stripPort(state.getTarget())), attribute.String("error.type", errorType), } opts := metric.WithAttributes(injectAPIMethod(ctx, attrs)...) diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/option.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/option.go index 74a76233..6d963d12 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/option.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/option.go @@ -44,6 +44,7 @@ func init() { storageinternal.WithDirectConnectivityEnforced = withDirectConnectivityEnforced storageinternal.WithOtelMetrics = withOtelMetrics storageinternal.WithOtelDebugMetrics = withOtelDebugMetrics + storageinternal.WithBufferPool = withBufferPool } // getDynamicReadReqIncreaseRateFromEnv returns the value set in the env variable. @@ -91,6 +92,7 @@ type storageConfig struct { grpcBidiReads bool grpcAppendableUploads bool grpcDirectPathEnforced bool + bufferPool experimental.BufferPool } // newStorageConfig generates a new storageConfig with all the given @@ -338,3 +340,20 @@ type withOtelDebugMetricsConfig struct { func (w *withOtelDebugMetricsConfig) ApplyStorageOpt(c *storageConfig) { c.enableOtelDebugMetrics = true } + +// withBufferPool sets the buffer pool used to allocate memory for parallel +// uploads. It backs [cloud.google.com/go/storage/experimental.WithBufferPool]. +// +// This option is not supported at the moment. +func withBufferPool(pool experimental.BufferPool) option.ClientOption { + return &withBufferPoolConfig{pool: pool} +} + +type withBufferPoolConfig struct { + internaloption.EmbeddableAdapter + pool experimental.BufferPool +} + +func (w *withBufferPoolConfig) ApplyStorageOpt(c *storageConfig) { + c.bufferPool = w.pool +} diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/reader.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/reader.go index 59507a1c..9b3a38bc 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/reader.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/reader.go @@ -410,7 +410,7 @@ func (r *Reader) Close() error { if r.metricsState != nil { if r.metricsState.metrics != nil { if total := atomic.SwapInt64(&r.bytesRead, 0); total > 0 { - r.metricsState.metrics.responseBodySize.Record(r.ctx, total, metric.WithAttributes(attribute.String("rpc.method", "ReadObject"))) + r.metricsState.metrics.responseBodySize.Record(r.ctx, total, metric.WithAttributes(attribute.String("rpc.system.name", r.metricsState.getSystemName()), attribute.String("rpc.method", "ReadObject"), attribute.String("server.address", stripPort(r.metricsState.getTarget())))) } } if r.metricsState.record != nil { @@ -580,8 +580,15 @@ func (mrd *MultiRangeDownloader) Add(output io.Writer, offset, length int64, cal // it could lead to a deadlock. func (mrd *MultiRangeDownloader) Close() error { err := mrd.impl.close(nil) - if state := metricsStateFromContext(mrd.impl.getSpanCtx()); state != nil && state.record != nil { - state.record(err) + if state := metricsStateFromContext(mrd.impl.getSpanCtx()); state != nil { + if state.metrics != nil { + if total := mrd.impl.getBytesRead(); total > 0 { + state.metrics.responseBodySize.Record(mrd.impl.getSpanCtx(), total, metric.WithAttributes(attribute.String("rpc.system.name", state.getSystemName()), attribute.String("rpc.method", "ReadObject"), attribute.String("server.address", stripPort(state.getTarget())))) + } + } + if state.record != nil { + state.record(err) + } } endSpan(mrd.impl.getSpanCtx(), err) return err diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/writer.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/writer.go index a20a8e60..a660c834 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/writer.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/storage/writer.go @@ -270,7 +270,11 @@ func (w *Writer) wrapWriteError(n int, err error) (int, error) { } func (w *Writer) isGRPCClient() bool { - _, ok := w.o.c.tc.(*grpcStorageClient) + tc := w.o.c.tc + if mc, ok := tc.(*metricsStorageClient); ok { + tc = mc.storageClient + } + _, ok := tc.(*grpcStorageClient) return ok } @@ -432,6 +436,13 @@ func (w *Writer) Close() error { return w.markClosed(nil) } +// Abort is unimplemented and always returns an error. +// +// This is experimental and its signature can change in the future. +func (w *Writer) Abort() error { + return errMethodNotSupported +} + // markClosed marks the Writer as closed, records any closing error on Writer.err, // and records request body size metrics and trace span completion. func (w *Writer) markClosed(err error) error { @@ -446,7 +457,7 @@ func (w *Writer) markClosed(err error) error { if state := metricsStateFromContext(w.ctx); state != nil { if state.metrics != nil && total > 0 { - state.metrics.requestBodySize.Record(w.ctx, total, metric.WithAttributes(attribute.String("rpc.method", "WriteObject"))) + state.metrics.requestBodySize.Record(w.ctx, total, metric.WithAttributes(attribute.String("rpc.system.name", state.getSystemName()), attribute.String("rpc.method", "WriteObject"), attribute.String("server.address", stripPort(state.getTarget())))) } if state.record != nil { state.record(closingErr) diff --git a/ci/resources/stemcell-version-bump/vendor/modules.txt b/ci/resources/stemcell-version-bump/vendor/modules.txt index 260c2746..c1300fbf 100644 --- a/ci/resources/stemcell-version-bump/vendor/modules.txt +++ b/ci/resources/stemcell-version-bump/vendor/modules.txt @@ -44,7 +44,7 @@ cloud.google.com/go/iam/apiv1/iampb cloud.google.com/go/monitoring/apiv3/v2 cloud.google.com/go/monitoring/apiv3/v2/monitoringpb cloud.google.com/go/monitoring/internal -# cloud.google.com/go/storage v1.67.1 +# cloud.google.com/go/storage v1.68.0 ## explicit; go 1.25.0 cloud.google.com/go/storage cloud.google.com/go/storage/experimental