diff --git a/go.mod b/go.mod index ec32274b2a..9372a451e2 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.26.0 require ( cloud.google.com/go/auth v0.22.0 cloud.google.com/go/compute/metadata v0.9.0 - cloud.google.com/go/logging v1.18.0 + cloud.google.com/go/logging v1.19.0 cloud.google.com/go/monitoring v1.29.0 cloud.google.com/go/trace v1.16.0 github.com/GoogleContainerTools/kpt-functions-catalog/functions/go/set-namespace v0.4.1-0.20220713210718-d955e7d3a800 @@ -72,8 +72,8 @@ require ( al.essio.dev/pkg/shellescape v1.5.1 // indirect cloud.google.com/go v0.123.0 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect - cloud.google.com/go/iam v1.7.0 // indirect - cloud.google.com/go/longrunning v0.9.0 // indirect + cloud.google.com/go/iam v1.11.0 // indirect + cloud.google.com/go/longrunning v1.2.0 // indirect github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/BurntSushi/toml v1.4.0 // indirect github.com/MakeNowJust/heredoc v1.0.0 // indirect diff --git a/go.sum b/go.sum index 55ddf6d762..5d5629fd09 100644 --- a/go.sum +++ b/go.sum @@ -11,16 +11,16 @@ cloud.google.com/go/auth/oauth2adapt v0.2.8 h1:keo8NaayQZ6wimpNSmW5OPc283g65QNIi cloud.google.com/go/auth/oauth2adapt v0.2.8/go.mod h1:XQ9y31RkqZCcwJWNSx2Xvric3RrU88hAYYbjDWYDL+c= cloud.google.com/go/compute/metadata v0.9.0 h1:pDUj4QMoPejqq20dK0Pg2N4yG9zIkYGdBtwLoEkH9Zs= cloud.google.com/go/compute/metadata v0.9.0/go.mod h1:E0bWwX5wTnLPedCKqk3pJmVgCBSM6qQI1yTBdEb3C10= -cloud.google.com/go/iam v1.7.0 h1:JD3zh0C6LHl16aCn5Akff0+GELdp1+4hmh6ndoFLl8U= -cloud.google.com/go/iam v1.7.0/go.mod h1:tetWZW1PD/m6vcuY2Zj/aU0eCHNPuxedbnbRTyKXvdY= -cloud.google.com/go/logging v1.18.0 h1:KhzZq+1cSkPH9YUaKLLhLtQxIHitVayBmk0sGfoM9+k= -cloud.google.com/go/logging v1.18.0/go.mod h1:ZGKnpBaURITh+g/uom2VhbiFoFWvejcrHPDhxFtU/gI= -cloud.google.com/go/longrunning v0.9.0 h1:0EzbDEGsAvOZNbqXopgniY0w0a1phvu5IdUFq8grmqY= -cloud.google.com/go/longrunning v0.9.0/go.mod h1:pkTz846W7bF4o2SzdWJ40Hu0Re+UoNT6Q5t+igIcb8E= +cloud.google.com/go/iam v1.11.0 h1:KieQ9Pb+LLPak1O3Rv3GgCxhnmkYf7Xyh0P5HfF1jFM= +cloud.google.com/go/iam v1.11.0/go.mod h1:KP+nKGugNJW4LcLx1uEZcq1ok5sQHFaQehQNl4QDgV4= +cloud.google.com/go/logging v1.19.0 h1:NCqhdVUg3wQ8Cobdf16FDSuTGi3+6+hdSBHrY5TsR6Q= +cloud.google.com/go/logging v1.19.0/go.mod h1:i40NZCHC9Gqvod4yE+yQfDWwlgwW/SrshkkGibCHxcA= +cloud.google.com/go/longrunning v1.2.0 h1:WjYH3YHBGCxGJP9M4dWGHBfXr/cFIjMkNgWcJj7/iMM= +cloud.google.com/go/longrunning v1.2.0/go.mod h1:5KMQALFGOCtFoi2xSOA1u3H7WKlhmckgiyFw7+LGQp0= cloud.google.com/go/monitoring v1.29.0 h1:AHhDsFaSax1/4k+qlIDX/SDGe6hggnfXJ9dkgD9qBPY= cloud.google.com/go/monitoring v1.29.0/go.mod h1:72NOVjJXHY/HBfoLT0+qlCZBT059+9VXLeAnL2PeeVM= -cloud.google.com/go/storage v1.62.0 h1:w2pQJhpUqVerMON45vatE2FpCYsNTf7OHjkn6ux5mMU= -cloud.google.com/go/storage v1.62.0/go.mod h1:T5hz3qzcpnxZ5LdKc7y8Tw7lh4v9zeeVyrD/cLJAzZU= +cloud.google.com/go/storage v1.62.3 h1:SZq1t23NCI+e96dH77Dg3PEfsNNEjqO8zE5AnD8gVD0= +cloud.google.com/go/storage v1.62.3/go.mod h1:cpYz/kRVZ+UQAF1uHeea10/9ewcRbxGoGNKsS9daSXA= 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/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= diff --git a/vendor/cloud.google.com/go/iam/apiv1/iampb/iam_policy.pb.go b/vendor/cloud.google.com/go/iam/apiv1/iampb/iam_policy.pb.go index e6dc60ff19..a15659c6e4 100644 --- a/vendor/cloud.google.com/go/iam/apiv1/iampb/iam_policy.pb.go +++ b/vendor/cloud.google.com/go/iam/apiv1/iampb/iam_policy.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.7 +// protoc v6.33.2 // source: google/iam/v1/iam_policy.proto package iampb diff --git a/vendor/cloud.google.com/go/iam/apiv1/iampb/iam_policy_grpc.pb.go b/vendor/cloud.google.com/go/iam/apiv1/iampb/iam_policy_grpc.pb.go index 064cb92713..f5f3c903de 100644 --- a/vendor/cloud.google.com/go/iam/apiv1/iampb/iam_policy_grpc.pb.go +++ b/vendor/cloud.google.com/go/iam/apiv1/iampb/iam_policy_grpc.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.7 +// - protoc v6.33.2 // source: google/iam/v1/iam_policy.proto package iampb diff --git a/vendor/cloud.google.com/go/iam/apiv1/iampb/options.pb.go b/vendor/cloud.google.com/go/iam/apiv1/iampb/options.pb.go index dcd7697048..d2c127f851 100644 --- a/vendor/cloud.google.com/go/iam/apiv1/iampb/options.pb.go +++ b/vendor/cloud.google.com/go/iam/apiv1/iampb/options.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.7 +// protoc v6.33.2 // source: google/iam/v1/options.proto package iampb diff --git a/vendor/cloud.google.com/go/iam/apiv1/iampb/policy.pb.go b/vendor/cloud.google.com/go/iam/apiv1/iampb/policy.pb.go index 5c5dec2ff7..04760b42d7 100644 --- a/vendor/cloud.google.com/go/iam/apiv1/iampb/policy.pb.go +++ b/vendor/cloud.google.com/go/iam/apiv1/iampb/policy.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.7 +// protoc v6.33.2 // source: google/iam/v1/policy.proto package iampb diff --git a/vendor/cloud.google.com/go/iam/apiv1/iampb/resource_policy_member.pb.go b/vendor/cloud.google.com/go/iam/apiv1/iampb/resource_policy_member.pb.go index ef86d278b5..045e393123 100644 --- a/vendor/cloud.google.com/go/iam/apiv1/iampb/resource_policy_member.pb.go +++ b/vendor/cloud.google.com/go/iam/apiv1/iampb/resource_policy_member.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.7 +// protoc v6.33.2 // source: google/iam/v1/resource_policy_member.proto package iampb diff --git a/vendor/cloud.google.com/go/logging/CHANGES.md b/vendor/cloud.google.com/go/logging/CHANGES.md index 0361443906..b02fd86e88 100644 --- a/vendor/cloud.google.com/go/logging/CHANGES.md +++ b/vendor/cloud.google.com/go/logging/CHANGES.md @@ -1,5 +1,12 @@ # Changes +## [1.19.0](https://github.com/googleapis/google-cloud-go/compare/logging/v1.18.0...logging/v1.19.0) (2026-07-13) + + +### Features + +* **o11y:** Regenerate clients for LRO tracing ([#20107](https://github.com/googleapis/google-cloud-go/issues/20107)) ([779074e](https://github.com/googleapis/google-cloud-go/commit/779074edd267a26520bae459307660953129eb07)) + ## [1.18.0](https://github.com/googleapis/google-cloud-go/releases/tag/logging%2Fv1.18.0) (2026-05-07) ## [1.17.0](https://github.com/googleapis/google-cloud-go/releases/tag/logging%2Fv1.17.0) (2026-04-30) diff --git a/vendor/cloud.google.com/go/logging/apiv2/config_client.go b/vendor/cloud.google.com/go/logging/apiv2/config_client.go index 5c50486bb8..53a18eca2f 100644 --- a/vendor/cloud.google.com/go/logging/apiv2/config_client.go +++ b/vendor/cloud.google.com/go/logging/apiv2/config_client.go @@ -32,6 +32,7 @@ import ( longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" gax "github.com/googleapis/gax-go/v2" "github.com/googleapis/gax-go/v2/callctx" + trace "go.opentelemetry.io/otel/trace" "google.golang.org/api/iterator" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" @@ -433,7 +434,7 @@ type ConfigClient struct { // Wrapper methods routed to the internal client. -// Close closes the connection to the API service. The user should invoke this when +// Close closes the connection to the API service. **Always** call Close() when // the client is no longer required. func (c *ConfigClient) Close() error { return c.internalClient.Close() @@ -446,6 +447,16 @@ func (c *ConfigClient) setGoogleClientInfo(keyval ...string) { c.internalClient.setGoogleClientInfo(keyval...) } +// SetGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +// +// SetGoogleClientInfo is not concurrency-safe and should only be invoked +// sequentially before concurrent operations begin. +func (c *ConfigClient) SetGoogleClientInfo(keyval ...string) { + c.setGoogleClientInfo(keyval...) +} + // Connection returns a connection to the API service. // // Deprecated: Connections are now pooled so this method does not always @@ -894,7 +905,7 @@ func (c *configGRPCClient) setGoogleClientInfo(keyval ...string) { } } -// Close closes the connection to the API service. The user should invoke this when +// Close closes the connection to the API service. **Always** call Close() when // the client is no longer required. func (c *configGRPCClient) Close() error { return c.connPool.Close() @@ -1036,7 +1047,7 @@ func (c *configRESTClient) setGoogleClientInfo(keyval ...string) { } } -// Close closes the connection to the API service. The user should invoke this when +// Close closes the connection to the API service. **Always** call Close() when // the client is no longer required. func (c *configRESTClient) Close() error { // Replace httpClient with nil to force cleanup. @@ -1147,8 +1158,12 @@ func (c *configGRPCClient) CreateBucketAsync(ctx context.Context, req *loggingpb if err != nil { return nil, err } + lro := longrunning.InternalNewOperationWithMetadata(*c.LROClient, resp, "*logging.CreateBucketAsyncOperation") + if gax.IsFeatureEnabled("TRACING") { + lro.SetParentSpanContext(trace.SpanContextFromContext(ctx)) + } return &CreateBucketAsyncOperation{ - lro: longrunning.InternalNewOperation(*c.LROClient, resp), + lro: lro, }, nil } @@ -1173,8 +1188,12 @@ func (c *configGRPCClient) UpdateBucketAsync(ctx context.Context, req *loggingpb if err != nil { return nil, err } + lro := longrunning.InternalNewOperationWithMetadata(*c.LROClient, resp, "*logging.UpdateBucketAsyncOperation") + if gax.IsFeatureEnabled("TRACING") { + lro.SetParentSpanContext(trace.SpanContextFromContext(ctx)) + } return &UpdateBucketAsyncOperation{ - lro: longrunning.InternalNewOperation(*c.LROClient, resp), + lro: lro, }, nil } @@ -1566,8 +1585,12 @@ func (c *configGRPCClient) CreateLink(ctx context.Context, req *loggingpb.Create if err != nil { return nil, err } + lro := longrunning.InternalNewOperationWithMetadata(*c.LROClient, resp, "*logging.CreateLinkOperation") + if gax.IsFeatureEnabled("TRACING") { + lro.SetParentSpanContext(trace.SpanContextFromContext(ctx)) + } return &CreateLinkOperation{ - lro: longrunning.InternalNewOperation(*c.LROClient, resp), + lro: lro, }, nil } @@ -1592,8 +1615,12 @@ func (c *configGRPCClient) DeleteLink(ctx context.Context, req *loggingpb.Delete if err != nil { return nil, err } + lro := longrunning.InternalNewOperationWithMetadata(*c.LROClient, resp, "*logging.DeleteLinkOperation") + if gax.IsFeatureEnabled("TRACING") { + lro.SetParentSpanContext(trace.SpanContextFromContext(ctx)) + } return &DeleteLinkOperation{ - lro: longrunning.InternalNewOperation(*c.LROClient, resp), + lro: lro, }, nil } @@ -1922,8 +1949,12 @@ func (c *configGRPCClient) CopyLogEntries(ctx context.Context, req *loggingpb.Co if err != nil { return nil, err } + lro := longrunning.InternalNewOperationWithMetadata(*c.LROClient, resp, "*logging.CopyLogEntriesOperation") + if gax.IsFeatureEnabled("TRACING") { + lro.SetParentSpanContext(trace.SpanContextFromContext(ctx)) + } return &CopyLogEntriesOperation{ - lro: longrunning.InternalNewOperation(*c.LROClient, resp), + lro: lro, }, nil } @@ -2213,8 +2244,12 @@ func (c *configRESTClient) CreateBucketAsync(ctx context.Context, req *loggingpb } override := fmt.Sprintf("/v2/%s", resp.GetName()) + lro := longrunning.InternalNewOperationWithMetadata(*c.LROClient, resp, "*logging.CreateBucketAsyncOperation") + if gax.IsFeatureEnabled("TRACING") { + lro.SetParentSpanContext(trace.SpanContextFromContext(ctx)) + } return &CreateBucketAsyncOperation{ - lro: longrunning.InternalNewOperation(*c.LROClient, resp), + lro: lro, pollPath: override, }, nil } @@ -2292,8 +2327,12 @@ func (c *configRESTClient) UpdateBucketAsync(ctx context.Context, req *loggingpb } override := fmt.Sprintf("/v2/%s", resp.GetName()) + lro := longrunning.InternalNewOperationWithMetadata(*c.LROClient, resp, "*logging.UpdateBucketAsyncOperation") + if gax.IsFeatureEnabled("TRACING") { + lro.SetParentSpanContext(trace.SpanContextFromContext(ctx)) + } return &UpdateBucketAsyncOperation{ - lro: longrunning.InternalNewOperation(*c.LROClient, resp), + lro: lro, pollPath: override, }, nil } @@ -3240,8 +3279,12 @@ func (c *configRESTClient) CreateLink(ctx context.Context, req *loggingpb.Create } override := fmt.Sprintf("/v2/%s", resp.GetName()) + lro := longrunning.InternalNewOperationWithMetadata(*c.LROClient, resp, "*logging.CreateLinkOperation") + if gax.IsFeatureEnabled("TRACING") { + lro.SetParentSpanContext(trace.SpanContextFromContext(ctx)) + } return &CreateLinkOperation{ - lro: longrunning.InternalNewOperation(*c.LROClient, resp), + lro: lro, pollPath: override, }, nil } @@ -3301,8 +3344,12 @@ func (c *configRESTClient) DeleteLink(ctx context.Context, req *loggingpb.Delete } override := fmt.Sprintf("/v2/%s", resp.GetName()) + lro := longrunning.InternalNewOperationWithMetadata(*c.LROClient, resp, "*logging.DeleteLinkOperation") + if gax.IsFeatureEnabled("TRACING") { + lro.SetParentSpanContext(trace.SpanContextFromContext(ctx)) + } return &DeleteLinkOperation{ - lro: longrunning.InternalNewOperation(*c.LROClient, resp), + lro: lro, pollPath: override, }, nil } @@ -4108,8 +4155,12 @@ func (c *configRESTClient) CopyLogEntries(ctx context.Context, req *loggingpb.Co } override := fmt.Sprintf("/v2/%s", resp.GetName()) + lro := longrunning.InternalNewOperationWithMetadata(*c.LROClient, resp, "*logging.CopyLogEntriesOperation") + if gax.IsFeatureEnabled("TRACING") { + lro.SetParentSpanContext(trace.SpanContextFromContext(ctx)) + } return &CopyLogEntriesOperation{ - lro: longrunning.InternalNewOperation(*c.LROClient, resp), + lro: lro, pollPath: override, }, nil } @@ -4301,7 +4352,7 @@ func (c *configRESTClient) ListOperations(ctx context.Context, req *longrunningp // The name must be that of a previously created CopyLogEntriesOperation, possibly from a different process. func (c *configGRPCClient) CopyLogEntriesOperation(name string) *CopyLogEntriesOperation { return &CopyLogEntriesOperation{ - lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + lro: longrunning.InternalNewOperationWithMetadata(*c.LROClient, &longrunningpb.Operation{Name: name}, "*logging.CopyLogEntriesOperation"), } } @@ -4310,7 +4361,7 @@ func (c *configGRPCClient) CopyLogEntriesOperation(name string) *CopyLogEntriesO func (c *configRESTClient) CopyLogEntriesOperation(name string) *CopyLogEntriesOperation { override := fmt.Sprintf("/v2/%s", name) return &CopyLogEntriesOperation{ - lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + lro: longrunning.InternalNewOperationWithMetadata(*c.LROClient, &longrunningpb.Operation{Name: name}, "*logging.CopyLogEntriesOperation"), pollPath: override, } } @@ -4319,7 +4370,7 @@ func (c *configRESTClient) CopyLogEntriesOperation(name string) *CopyLogEntriesO // The name must be that of a previously created CreateBucketAsyncOperation, possibly from a different process. func (c *configGRPCClient) CreateBucketAsyncOperation(name string) *CreateBucketAsyncOperation { return &CreateBucketAsyncOperation{ - lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + lro: longrunning.InternalNewOperationWithMetadata(*c.LROClient, &longrunningpb.Operation{Name: name}, "*logging.CreateBucketAsyncOperation"), } } @@ -4328,7 +4379,7 @@ func (c *configGRPCClient) CreateBucketAsyncOperation(name string) *CreateBucket func (c *configRESTClient) CreateBucketAsyncOperation(name string) *CreateBucketAsyncOperation { override := fmt.Sprintf("/v2/%s", name) return &CreateBucketAsyncOperation{ - lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + lro: longrunning.InternalNewOperationWithMetadata(*c.LROClient, &longrunningpb.Operation{Name: name}, "*logging.CreateBucketAsyncOperation"), pollPath: override, } } @@ -4337,7 +4388,7 @@ func (c *configRESTClient) CreateBucketAsyncOperation(name string) *CreateBucket // The name must be that of a previously created CreateLinkOperation, possibly from a different process. func (c *configGRPCClient) CreateLinkOperation(name string) *CreateLinkOperation { return &CreateLinkOperation{ - lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + lro: longrunning.InternalNewOperationWithMetadata(*c.LROClient, &longrunningpb.Operation{Name: name}, "*logging.CreateLinkOperation"), } } @@ -4346,7 +4397,7 @@ func (c *configGRPCClient) CreateLinkOperation(name string) *CreateLinkOperation func (c *configRESTClient) CreateLinkOperation(name string) *CreateLinkOperation { override := fmt.Sprintf("/v2/%s", name) return &CreateLinkOperation{ - lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + lro: longrunning.InternalNewOperationWithMetadata(*c.LROClient, &longrunningpb.Operation{Name: name}, "*logging.CreateLinkOperation"), pollPath: override, } } @@ -4355,7 +4406,7 @@ func (c *configRESTClient) CreateLinkOperation(name string) *CreateLinkOperation // The name must be that of a previously created DeleteLinkOperation, possibly from a different process. func (c *configGRPCClient) DeleteLinkOperation(name string) *DeleteLinkOperation { return &DeleteLinkOperation{ - lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + lro: longrunning.InternalNewOperationWithMetadata(*c.LROClient, &longrunningpb.Operation{Name: name}, "*logging.DeleteLinkOperation"), } } @@ -4364,7 +4415,7 @@ func (c *configGRPCClient) DeleteLinkOperation(name string) *DeleteLinkOperation func (c *configRESTClient) DeleteLinkOperation(name string) *DeleteLinkOperation { override := fmt.Sprintf("/v2/%s", name) return &DeleteLinkOperation{ - lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + lro: longrunning.InternalNewOperationWithMetadata(*c.LROClient, &longrunningpb.Operation{Name: name}, "*logging.DeleteLinkOperation"), pollPath: override, } } @@ -4373,7 +4424,7 @@ func (c *configRESTClient) DeleteLinkOperation(name string) *DeleteLinkOperation // The name must be that of a previously created UpdateBucketAsyncOperation, possibly from a different process. func (c *configGRPCClient) UpdateBucketAsyncOperation(name string) *UpdateBucketAsyncOperation { return &UpdateBucketAsyncOperation{ - lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + lro: longrunning.InternalNewOperationWithMetadata(*c.LROClient, &longrunningpb.Operation{Name: name}, "*logging.UpdateBucketAsyncOperation"), } } @@ -4382,7 +4433,7 @@ func (c *configGRPCClient) UpdateBucketAsyncOperation(name string) *UpdateBucket func (c *configRESTClient) UpdateBucketAsyncOperation(name string) *UpdateBucketAsyncOperation { override := fmt.Sprintf("/v2/%s", name) return &UpdateBucketAsyncOperation{ - lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + lro: longrunning.InternalNewOperationWithMetadata(*c.LROClient, &longrunningpb.Operation{Name: name}, "*logging.UpdateBucketAsyncOperation"), pollPath: override, } } diff --git a/vendor/cloud.google.com/go/logging/apiv2/info.go b/vendor/cloud.google.com/go/logging/apiv2/info.go deleted file mode 100644 index 5e15a8fcc4..0000000000 --- a/vendor/cloud.google.com/go/logging/apiv2/info.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2020 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 logging - -// SetGoogleClientInfo sets the name and version of the application in -// the `x-goog-api-client` header passed on each request. Also passes any -// provided key-value pairs. Intended for use by Google-written clients. -// -// Internal use only. -func (c *Client) SetGoogleClientInfo(keyval ...string) { - c.setGoogleClientInfo(keyval...) -} - -// SetGoogleClientInfo sets the name and version of the application in -// the `x-goog-api-client` header passed on each request. Also passes any -// provided key-value pairs. Intended for use by Google-written clients. -// -// Internal use only. -func (mc *MetricsClient) SetGoogleClientInfo(keyval ...string) { - mc.setGoogleClientInfo(keyval...) -} - -// SetGoogleClientInfo sets the name and version of the application in -// the `x-goog-api-client` header passed on each request. Also passes any -// provided key-value pairs. Intended for use by Google-written clients. -// -// Internal use only. -func (cc *ConfigClient) SetGoogleClientInfo(keyval ...string) { - cc.setGoogleClientInfo(keyval...) -} diff --git a/vendor/cloud.google.com/go/logging/apiv2/logging_client.go b/vendor/cloud.google.com/go/logging/apiv2/logging_client.go index 236cf3f200..7e251da1dd 100644 --- a/vendor/cloud.google.com/go/logging/apiv2/logging_client.go +++ b/vendor/cloud.google.com/go/logging/apiv2/logging_client.go @@ -281,7 +281,7 @@ type Client struct { // Wrapper methods routed to the internal client. -// Close closes the connection to the API service. The user should invoke this when +// Close closes the connection to the API service. **Always** call Close() when // the client is no longer required. func (c *Client) Close() error { return c.internalClient.Close() @@ -294,6 +294,16 @@ func (c *Client) setGoogleClientInfo(keyval ...string) { c.internalClient.setGoogleClientInfo(keyval...) } +// SetGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +// +// SetGoogleClientInfo is not concurrency-safe and should only be invoked +// sequentially before concurrent operations begin. +func (c *Client) SetGoogleClientInfo(keyval ...string) { + c.setGoogleClientInfo(keyval...) +} + // Connection returns a connection to the API service. // // Deprecated: Connections are now pooled so this method does not always @@ -469,7 +479,7 @@ func (c *gRPCClient) setGoogleClientInfo(keyval ...string) { } } -// Close closes the connection to the API service. The user should invoke this when +// Close closes the connection to the API service. **Always** call Close() when // the client is no longer required. func (c *gRPCClient) Close() error { return c.connPool.Close() @@ -570,7 +580,7 @@ func (c *restClient) setGoogleClientInfo(keyval ...string) { } } -// Close closes the connection to the API service. The user should invoke this when +// Close closes the connection to the API service. **Always** call Close() when // the client is no longer required. func (c *restClient) Close() error { // Replace httpClient with nil to force cleanup. diff --git a/vendor/cloud.google.com/go/logging/apiv2/metrics_client.go b/vendor/cloud.google.com/go/logging/apiv2/metrics_client.go index c3a5d1eeda..44dfe29f46 100644 --- a/vendor/cloud.google.com/go/logging/apiv2/metrics_client.go +++ b/vendor/cloud.google.com/go/logging/apiv2/metrics_client.go @@ -230,7 +230,7 @@ type MetricsClient struct { // Wrapper methods routed to the internal client. -// Close closes the connection to the API service. The user should invoke this when +// Close closes the connection to the API service. **Always** call Close() when // the client is no longer required. func (c *MetricsClient) Close() error { return c.internalClient.Close() @@ -243,6 +243,16 @@ func (c *MetricsClient) setGoogleClientInfo(keyval ...string) { c.internalClient.setGoogleClientInfo(keyval...) } +// SetGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +// +// SetGoogleClientInfo is not concurrency-safe and should only be invoked +// sequentially before concurrent operations begin. +func (c *MetricsClient) SetGoogleClientInfo(keyval ...string) { + c.setGoogleClientInfo(keyval...) +} + // Connection returns a connection to the API service. // // Deprecated: Connections are now pooled so this method does not always @@ -396,7 +406,7 @@ func (c *metricsGRPCClient) setGoogleClientInfo(keyval ...string) { } } -// Close closes the connection to the API service. The user should invoke this when +// Close closes the connection to the API service. **Always** call Close() when // the client is no longer required. func (c *metricsGRPCClient) Close() error { return c.connPool.Close() @@ -496,7 +506,7 @@ func (c *metricsRESTClient) setGoogleClientInfo(keyval ...string) { } } -// Close closes the connection to the API service. The user should invoke this when +// Close closes the connection to the API service. **Always** call Close() when // the client is no longer required. func (c *metricsRESTClient) Close() error { // Replace httpClient with nil to force cleanup. diff --git a/vendor/cloud.google.com/go/logging/internal/version.go b/vendor/cloud.google.com/go/logging/internal/version.go index c43b132414..ebecc2cee5 100644 --- a/vendor/cloud.google.com/go/logging/internal/version.go +++ b/vendor/cloud.google.com/go/logging/internal/version.go @@ -17,4 +17,4 @@ package internal // Version is the current tagged release of the library. -const Version = "1.18.0" +const Version = "1.19.0" diff --git a/vendor/cloud.google.com/go/longrunning/CHANGES.md b/vendor/cloud.google.com/go/longrunning/CHANGES.md index 536eb68fe2..fff22c29e8 100644 --- a/vendor/cloud.google.com/go/longrunning/CHANGES.md +++ b/vendor/cloud.google.com/go/longrunning/CHANGES.md @@ -1,5 +1,35 @@ # Changes +## [1.2.0](https://github.com/googleapis/google-cloud-go/compare/longrunning/v1.1.0...longrunning/v1.2.0) (2026-07-08) + + +### Features + +* **o11y:** Instrument LRO loop with poll attempt and sleep child spans ([#20089](https://github.com/googleapis/google-cloud-go/issues/20089)) ([1c513de](https://github.com/googleapis/google-cloud-go/commit/1c513decf2bdadf29dacf2049934500aae4165c5)) +* **o11y:** Wrap wait loop in T2 LRO Wait span with feature gating ([#20055](https://github.com/googleapis/google-cloud-go/issues/20055)) ([05f3d64](https://github.com/googleapis/google-cloud-go/commit/05f3d6498b3564141bdeb3f54c0d068f1291243a)) + + +### Bug Fixes + +* **longrunning:** Correct go min version ([#20101](https://github.com/googleapis/google-cloud-go/issues/20101)) ([7e21cfb](https://github.com/googleapis/google-cloud-go/commit/7e21cfb2d91eb425a7d7a3f39ab706b4e8363bad)) + +## [1.1.0](https://github.com/googleapis/google-cloud-go/compare/longrunning/v1.0.0...longrunning/v1.1.0) (2026-06-26) + + +### Features + +* **o11y:** Add experimental trace fields and construction API ([#19968](https://github.com/googleapis/google-cloud-go/issues/19968)) ([c71dd55](https://github.com/googleapis/google-cloud-go/commit/c71dd55685bf2437011b580973a7c28d7ade93b0)), closes [#19969](https://github.com/googleapis/google-cloud-go/issues/19969) + +## [1.0.0](https://github.com/googleapis/google-cloud-go/releases/tag/longrunning%2Fv1.0.0) (2026-05-08) + +## [0.13.0](https://github.com/googleapis/google-cloud-go/releases/tag/longrunning%2Fv0.13.0) (2026-05-07) + +## [0.12.0](https://github.com/googleapis/google-cloud-go/releases/tag/longrunning%2Fv0.12.0) (2026-04-30) + +## [0.11.0](https://github.com/googleapis/google-cloud-go/releases/tag/longrunning%2Fv0.11.0) (2026-04-13) + +## [0.10.0](https://github.com/googleapis/google-cloud-go/releases/tag/longrunning%2Fv0.10.0) (2026-04-09) + ## [0.9.0](https://github.com/googleapis/google-cloud-go/releases/tag/longrunning%2Fv0.9.0) (2026-04-02) ## [0.8.0](https://github.com/googleapis/google-cloud-go/releases/tag/longrunning%2Fv0.8.0) (2026-01-08) @@ -195,4 +225,3 @@ ## v0.1.0 Initial release. - diff --git a/vendor/cloud.google.com/go/longrunning/autogen/longrunningpb/operations.pb.go b/vendor/cloud.google.com/go/longrunning/autogen/longrunningpb/operations.pb.go index 3efdc7cfe2..4e4f31d689 100644 --- a/vendor/cloud.google.com/go/longrunning/autogen/longrunningpb/operations.pb.go +++ b/vendor/cloud.google.com/go/longrunning/autogen/longrunningpb/operations.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.7 +// protoc v6.33.2 // source: google/longrunning/operations.proto package longrunningpb diff --git a/vendor/cloud.google.com/go/longrunning/autogen/longrunningpb/operations_grpc.pb.go b/vendor/cloud.google.com/go/longrunning/autogen/longrunningpb/operations_grpc.pb.go index 2b6407e49b..11c531be5d 100644 --- a/vendor/cloud.google.com/go/longrunning/autogen/longrunningpb/operations_grpc.pb.go +++ b/vendor/cloud.google.com/go/longrunning/autogen/longrunningpb/operations_grpc.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.7 +// - protoc v6.33.2 // source: google/longrunning/operations.proto package longrunningpb diff --git a/vendor/cloud.google.com/go/longrunning/autogen/operations_client.go b/vendor/cloud.google.com/go/longrunning/autogen/operations_client.go index c7e9273829..90e90d6c59 100644 --- a/vendor/cloud.google.com/go/longrunning/autogen/operations_client.go +++ b/vendor/cloud.google.com/go/longrunning/autogen/operations_client.go @@ -28,6 +28,7 @@ import ( longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" gax "github.com/googleapis/gax-go/v2" + "github.com/googleapis/gax-go/v2/callctx" "google.golang.org/api/iterator" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" @@ -203,7 +204,7 @@ type OperationsClient struct { // Wrapper methods routed to the internal client. -// Close closes the connection to the API service. The user should invoke this when +// Close closes the connection to the API service. **Always** call Close() when // the client is no longer required. func (c *OperationsClient) Close() error { return c.internalClient.Close() @@ -306,6 +307,16 @@ type operationsGRPCClient struct { // developers can have a consistent client experience. func NewOperationsClient(ctx context.Context, opts ...option.ClientOption) (*OperationsClient, error) { clientOpts := defaultOperationsGRPCClientOptions() + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{ + "gcp.client.service": "longrunning", + "gcp.client.version": getVersionClient(), + "gcp.client.repo": "googleapis/google-cloud-go", + "gcp.client.artifact": "cloud.google.com/go/longrunning/autogen", + "gcp.client.language": "go", + "url.domain": "longrunning.googleapis.com", + })) + } if newOperationsClientHook != nil { hookOpts, err := newOperationsClientHook(ctx, clientHookParams{}) if err != nil { @@ -327,6 +338,24 @@ func NewOperationsClient(ctx context.Context, opts ...option.ClientOption) (*Ope logger: internaloption.GetLogger(opts), } c.setGoogleClientInfo() + if gax.IsFeatureEnabled("METRICS") { + metrics := gax.NewClientMetrics( + gax.WithTelemetryLogger(c.logger), + gax.WithTelemetryAttributes(map[string]string{ + gax.ClientService: "longrunning", + gax.ClientVersion: getVersionClient(), + gax.ClientArtifact: "cloud.google.com/go/longrunning/autogen", + gax.RPCSystem: "grpc", + gax.URLDomain: "longrunning.googleapis.com", + }), + ) + + client.CallOptions.ListOperations = append(client.CallOptions.ListOperations, gax.WithClientMetrics(metrics)) + client.CallOptions.GetOperation = append(client.CallOptions.GetOperation, gax.WithClientMetrics(metrics)) + client.CallOptions.DeleteOperation = append(client.CallOptions.DeleteOperation, gax.WithClientMetrics(metrics)) + client.CallOptions.CancelOperation = append(client.CallOptions.CancelOperation, gax.WithClientMetrics(metrics)) + client.CallOptions.WaitOperation = append(client.CallOptions.WaitOperation, gax.WithClientMetrics(metrics)) + } client.internalClient = c @@ -352,7 +381,7 @@ func (c *operationsGRPCClient) setGoogleClientInfo(keyval ...string) { } } -// Close closes the connection to the API service. The user should invoke this when +// Close closes the connection to the API service. **Always** call Close() when // the client is no longer required. func (c *operationsGRPCClient) Close() error { return c.connPool.Close() @@ -388,6 +417,16 @@ type operationsRESTClient struct { // developers can have a consistent client experience. func NewOperationsRESTClient(ctx context.Context, opts ...option.ClientOption) (*OperationsClient, error) { clientOpts := append(defaultOperationsRESTClientOptions(), opts...) + if gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + clientOpts = append(clientOpts, internaloption.WithTelemetryAttributes(map[string]string{ + "gcp.client.service": "longrunning", + "gcp.client.version": getVersionClient(), + "gcp.client.repo": "googleapis/google-cloud-go", + "gcp.client.artifact": "cloud.google.com/go/longrunning/autogen", + "gcp.client.language": "go", + "url.domain": "longrunning.googleapis.com", + })) + } httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) if err != nil { return nil, err @@ -402,6 +441,25 @@ func NewOperationsRESTClient(ctx context.Context, opts ...option.ClientOption) ( } c.setGoogleClientInfo() + if gax.IsFeatureEnabled("METRICS") { + metrics := gax.NewClientMetrics( + gax.WithTelemetryLogger(c.logger), + gax.WithTelemetryAttributes(map[string]string{ + gax.ClientService: "longrunning", + gax.ClientVersion: getVersionClient(), + gax.ClientArtifact: "cloud.google.com/go/longrunning/autogen", + gax.RPCSystem: "http", + gax.URLDomain: "longrunning.googleapis.com", + }), + ) + + callOpts.ListOperations = append(callOpts.ListOperations, gax.WithClientMetrics(metrics)) + callOpts.GetOperation = append(callOpts.GetOperation, gax.WithClientMetrics(metrics)) + callOpts.DeleteOperation = append(callOpts.DeleteOperation, gax.WithClientMetrics(metrics)) + callOpts.CancelOperation = append(callOpts.CancelOperation, gax.WithClientMetrics(metrics)) + callOpts.WaitOperation = append(callOpts.WaitOperation, gax.WithClientMetrics(metrics)) + } + return &OperationsClient{internalClient: c, CallOptions: callOpts}, nil } @@ -428,7 +486,7 @@ func (c *operationsRESTClient) setGoogleClientInfo(keyval ...string) { } } -// Close closes the connection to the API service. The user should invoke this when +// Close closes the connection to the API service. **Always** call Close() when // the client is no longer required. func (c *operationsRESTClient) Close() error { // Replace httpClient with nil to force cleanup. @@ -447,9 +505,12 @@ func (c *operationsGRPCClient) ListOperations(ctx context.Context, req *longrunn hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.longrunning.Operations/ListOperations") + } opts = append((*c.CallOptions).ListOperations[0:len((*c.CallOptions).ListOperations):len((*c.CallOptions).ListOperations)], opts...) it := &OperationIterator{} - req = proto.Clone(req).(*longrunningpb.ListOperationsRequest) + req = proto.CloneOf(req) it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) { resp := &longrunningpb.ListOperationsResponse{} if pageToken != "" { @@ -493,6 +554,9 @@ func (c *operationsGRPCClient) GetOperation(ctx context.Context, req *longrunnin hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.longrunning.Operations/GetOperation") + } opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) var resp *longrunningpb.Operation err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -511,6 +575,9 @@ func (c *operationsGRPCClient) DeleteOperation(ctx context.Context, req *longrun hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.longrunning.Operations/DeleteOperation") + } opts = append((*c.CallOptions).DeleteOperation[0:len((*c.CallOptions).DeleteOperation):len((*c.CallOptions).DeleteOperation)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error @@ -525,6 +592,9 @@ func (c *operationsGRPCClient) CancelOperation(ctx context.Context, req *longrun hds = append(c.xGoogHeaders, hds...) ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.longrunning.Operations/CancelOperation") + } opts = append((*c.CallOptions).CancelOperation[0:len((*c.CallOptions).CancelOperation):len((*c.CallOptions).CancelOperation)], opts...) err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { var err error @@ -536,6 +606,9 @@ func (c *operationsGRPCClient) CancelOperation(ctx context.Context, req *longrun func (c *operationsGRPCClient) WaitOperation(ctx context.Context, req *longrunningpb.WaitOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.longrunning.Operations/WaitOperation") + } opts = append((*c.CallOptions).WaitOperation[0:len((*c.CallOptions).WaitOperation):len((*c.CallOptions).WaitOperation)], opts...) var resp *longrunningpb.Operation err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { @@ -553,7 +626,7 @@ func (c *operationsGRPCClient) WaitOperation(ctx context.Context, req *longrunni // server doesn’t support this method, it returns UNIMPLEMENTED. func (c *operationsRESTClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator { it := &OperationIterator{} - req = proto.Clone(req).(*longrunningpb.ListOperationsRequest) + req = proto.CloneOf(req) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} it.InternalFetch = func(pageSize int, pageToken string) ([]*longrunningpb.Operation, string, error) { resp := &longrunningpb.ListOperationsResponse{} @@ -649,6 +722,10 @@ func (c *operationsRESTClient) GetOperation(ctx context.Context, req *longrunnin hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.longrunning.Operations/GetOperation") + ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{name=operations/**}") + } opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &longrunningpb.Operation{} @@ -697,6 +774,10 @@ func (c *operationsRESTClient) DeleteOperation(ctx context.Context, req *longrun hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.longrunning.Operations/DeleteOperation") + ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{name=operations/**}") + } return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path @@ -743,6 +824,10 @@ func (c *operationsRESTClient) CancelOperation(ctx context.Context, req *longrun hds = append(c.xGoogHeaders, hds...) hds = append(hds, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.longrunning.Operations/CancelOperation") + ctx = callctx.WithTelemetryContext(ctx, "url_template", "/v1/{name=operations/**}:cancel") + } return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { if settings.Path != "" { baseUrl.Path = settings.Path @@ -792,6 +877,9 @@ func (c *operationsRESTClient) WaitOperation(ctx context.Context, req *longrunni // Build HTTP headers from client and context metadata. hds := append(c.xGoogHeaders, "Content-Type", "application/json") headers := gax.BuildHeaders(ctx, hds...) + if gax.IsFeatureEnabled("METRICS") || gax.IsFeatureEnabled("TRACING") || gax.IsFeatureEnabled("LOGGING") { + ctx = callctx.WithTelemetryContext(ctx, "rpc_method", "google.longrunning.Operations/WaitOperation") + } opts = append((*c.CallOptions).WaitOperation[0:len((*c.CallOptions).WaitOperation):len((*c.CallOptions).WaitOperation)], opts...) unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} resp := &longrunningpb.Operation{} diff --git a/vendor/cloud.google.com/go/longrunning/internal/version.go b/vendor/cloud.google.com/go/longrunning/internal/version.go index 059c6e2f5a..c4bf107939 100644 --- a/vendor/cloud.google.com/go/longrunning/internal/version.go +++ b/vendor/cloud.google.com/go/longrunning/internal/version.go @@ -17,4 +17,4 @@ package internal // Version is the current tagged release of the library. -const Version = "0.9.0" +const Version = "1.2.0" diff --git a/vendor/cloud.google.com/go/longrunning/longrunning.go b/vendor/cloud.google.com/go/longrunning/longrunning.go index 3c75b761e4..666ea6b768 100644 --- a/vendor/cloud.google.com/go/longrunning/longrunning.go +++ b/vendor/cloud.google.com/go/longrunning/longrunning.go @@ -31,6 +31,11 @@ import ( pb "cloud.google.com/go/longrunning/autogen/longrunningpb" gax "github.com/googleapis/gax-go/v2" "github.com/googleapis/gax-go/v2/apierror" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/codes" + "go.opentelemetry.io/otel/trace" + grpccodes "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/protoadapt" @@ -42,8 +47,10 @@ var ErrNoMetadata = errors.New("operation contains no metadata") // Operation represents the result of an API call that may not be ready yet. type Operation struct { - c operationsClient - proto *pb.Operation + c operationsClient + proto *pb.Operation + opName string + initSpanContext trace.SpanContext } type operationsClient interface { @@ -52,17 +59,35 @@ type operationsClient interface { DeleteOperation(context.Context, *pb.DeleteOperationRequest, ...gax.CallOption) error } -// InternalNewOperation is for use by the google Cloud Libraries only. +// InternalNewOperation is for use by the Google Cloud Libraries only. // // InternalNewOperation returns an long-running operation, abstracting the raw pb.Operation. -// The conn parameter refers to a server that proto was received from. func InternalNewOperation(inner *autogen.OperationsClient, proto *pb.Operation) *Operation { + return InternalNewOperationWithMetadata(inner, proto, "") +} + +// InternalNewOperationWithMetadata is for use by the Google Cloud Libraries only. +// +// InternalNewOperationWithMetadata returns a long-running operation, abstracting the raw pb.Operation, +// and storing the service-specific operation metadata/type name for tracing. +// +// InternalNewOperationWithMetadata is an EXPERIMENTAL API and may be changed or removed in the future. +func InternalNewOperationWithMetadata(inner *autogen.OperationsClient, proto *pb.Operation, opName string) *Operation { return &Operation{ - c: inner, - proto: proto, + c: inner, + proto: proto, + opName: opName, } } +// SetParentSpanContext sets the parent/initiating span context for the operation, +// which is used to create a Span Link from the LRO Wait span. +// +// SetParentSpanContext is an EXPERIMENTAL API and may be changed or removed in the future. +func (op *Operation) SetParentSpanContext(sc trace.SpanContext) { + op.initSpanContext = sc +} + // Name returns the name of the long-running operation. // The name is assigned by the server and is unique within the service // from which the operation is created. @@ -135,6 +160,10 @@ func (op *Operation) Wait(ctx context.Context, resp protoadapt.MessageV1, opts . // // See documentation of Poll for error-handling information. func (op *Operation) WaitWithInterval(ctx context.Context, resp protoadapt.MessageV1, interval time.Duration, opts ...gax.CallOption) error { + return op.waitWithInterval(ctx, resp, interval, gax.Sleep, opts...) +} + +func (op *Operation) waitWithInterval(ctx context.Context, resp protoadapt.MessageV1, interval time.Duration, sl sleeper, opts ...gax.CallOption) error { bo := gax.Backoff{ Initial: 1 * time.Second, Max: interval, @@ -142,7 +171,36 @@ func (op *Operation) WaitWithInterval(ctx context.Context, resp protoadapt.Messa if bo.Max < bo.Initial { bo.Max = bo.Initial } - return op.wait(ctx, resp, &bo, gax.Sleep, opts...) + + if !gax.IsFeatureEnabled("TRACING") { + return op.wait(ctx, resp, &bo, sl, opts...) + } + + spanName := op.opName + if spanName == "" { + spanName = "*longrunning.Operation.Wait" + } else { + spanName = spanName + ".Wait" + } + + var startOpts []trace.SpanStartOption + if op.initSpanContext.IsValid() { + startOpts = append(startOpts, trace.WithLinks(trace.Link{SpanContext: op.initSpanContext})) + } + + tracer := otel.GetTracerProvider().Tracer("cloud.google.com/go") + ctx, span := tracer.Start(ctx, spanName, startOpts...) + defer span.End() + span.SetAttributes( + attribute.String("gcp.resource.destination.id", op.Name()), + ) + + err := op.waitTraced(ctx, resp, &bo, sl, opts...) + if err != nil { + span.SetStatus(codes.Error, err.Error()) + span.RecordError(err) + } + return err } type sleeper func(context.Context, time.Duration) error @@ -162,6 +220,60 @@ func (op *Operation) wait(ctx context.Context, resp protoadapt.MessageV1, bo *ga } } +func (op *Operation) waitTraced(ctx context.Context, resp protoadapt.MessageV1, bo *gax.Backoff, sl sleeper, opts ...gax.CallOption) error { + tracer := otel.GetTracerProvider().Tracer("cloud.google.com/go") + pollAttempt := 0 + + for { + pollAttempt++ + pollSpanName := "*longrunning.OperationsClient.GetOperation" + + pollCtx, pollSpan := tracer.Start(ctx, pollSpanName) + pollSpan.SetAttributes( + attribute.String("gcp.resource.destination.id", op.Name()), + attribute.Int("gcp.longrunning.poll_attempt_count", pollAttempt), + ) + + err := op.Poll(pollCtx, resp, opts...) + + pollSpan.SetAttributes(attribute.Bool("gcp.longrunning.done", op.Done())) + if op.Done() { + var statusCode int + if err != nil { + if apiErr, ok := apierror.FromError(err); ok { + statusCode = int(apiErr.GRPCStatus().Code()) + } else { + statusCode = int(grpccodes.Unknown) + } + } + pollSpan.SetAttributes(attribute.Int("gcp.longrunning.status_code", statusCode)) + } + + if err != nil { + pollSpan.SetStatus(codes.Error, err.Error()) + pollSpan.RecordError(err) + pollSpan.End() + return err + } + + pollSpan.End() + + if op.Done() { + return nil + } + + _, sleepSpan := tracer.Start(ctx, "LRO Sleep") + sleepErr := sl(ctx, bo.Pause()) + if sleepErr != nil { + sleepSpan.SetStatus(codes.Error, sleepErr.Error()) + sleepSpan.RecordError(sleepErr) + sleepSpan.End() + return sleepErr + } + sleepSpan.End() + } +} + // Cancel starts asynchronous cancellation on a long-running operation. The server // makes a best effort to cancel the operation, but success is not // guaranteed. If the server doesn't support this method, it returns diff --git a/vendor/modules.txt b/vendor/modules.txt index a9e1f54705..d3412bca73 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -30,17 +30,17 @@ cloud.google.com/go/auth/oauth2adapt # cloud.google.com/go/compute/metadata v0.9.0 ## explicit; go 1.24.0 cloud.google.com/go/compute/metadata -# cloud.google.com/go/iam v1.7.0 +# cloud.google.com/go/iam v1.11.0 ## explicit; go 1.25.0 cloud.google.com/go/iam/apiv1/iampb -# cloud.google.com/go/logging v1.18.0 +# cloud.google.com/go/logging v1.19.0 ## explicit; go 1.25.0 cloud.google.com/go/logging cloud.google.com/go/logging/apiv2 cloud.google.com/go/logging/apiv2/loggingpb cloud.google.com/go/logging/internal cloud.google.com/go/logging/logadmin -# cloud.google.com/go/longrunning v0.9.0 +# cloud.google.com/go/longrunning v1.2.0 ## explicit; go 1.25.0 cloud.google.com/go/longrunning cloud.google.com/go/longrunning/autogen