From aa20d91ee32b754bd496fbb680683e5674bfa5c3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Mar 2025 23:12:04 +0000 Subject: [PATCH] chore(deps): bump google.golang.org/api from 0.222.0 to 0.223.0 Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.222.0 to 0.223.0. - [Release notes](https://github.com/googleapis/google-api-go-client/releases) - [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md) - [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.222.0...v0.223.0) --- updated-dependencies: - dependency-name: google.golang.org/api dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 10 +- go.sum | 24 +-- vendor/cloud.google.com/go/auth/CHANGES.md | 7 + .../go/auth/credentials/compute.go | 24 ++- .../go/auth/credentials/detect.go | 21 +++ .../go/auth/grpctransport/grpctransport.go | 25 ++- .../go/auth/internal/transport/cba.go | 31 +++- .../go/auth/internal/transport/transport.go | 5 +- .../grpc/otelgrpc/version.go | 2 +- .../net/http/otelhttp/handler.go | 45 +++-- .../net/http/otelhttp/internal/semconv/env.go | 117 ++++++++---- .../net/http/otelhttp/internal/semconv/gen.go | 14 ++ .../otelhttp/internal/semconv/httpconv.go | 171 ++++++++++++++++++ .../http/otelhttp/internal/semconv/util.go | 13 ++ .../http/otelhttp/internal/semconv/v1.20.0.go | 18 +- .../net/http/otelhttp/transport.go | 2 +- .../net/http/otelhttp/version.go | 2 +- .../api/bigquery/v2/bigquery-api.json | 75 ++++++-- .../api/bigquery/v2/bigquery-gen.go | 61 +++++-- .../google.golang.org/api/internal/version.go | 2 +- .../api/transport/grpc/dial.go | 1 + vendor/modules.txt | 16 +- 22 files changed, 551 insertions(+), 135 deletions(-) create mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/gen.go diff --git a/go.mod b/go.mod index a6466aa0..4c7d7aa6 100644 --- a/go.mod +++ b/go.mod @@ -10,13 +10,13 @@ require ( github.com/prometheus/common v0.62.0 github.com/prometheus/prometheus v2.5.0+incompatible github.com/stretchr/testify v1.10.0 - google.golang.org/api v0.222.0 + google.golang.org/api v0.223.0 gopkg.in/alecthomas/kingpin.v2 v2.2.6 ) require ( cloud.google.com/go v0.118.1 // indirect - cloud.google.com/go/auth v0.14.1 // indirect + cloud.google.com/go/auth v0.15.0 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.7 // indirect cloud.google.com/go/compute/metadata v0.6.0 // indirect cloud.google.com/go/iam v1.3.1 // indirect @@ -46,8 +46,8 @@ require ( github.com/prometheus/procfs v0.15.1 // indirect github.com/zeebo/xxh3 v1.0.2 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect go.opentelemetry.io/otel v1.34.0 // indirect go.opentelemetry.io/otel/metric v1.34.0 // indirect go.opentelemetry.io/otel/trace v1.34.0 // indirect @@ -64,7 +64,7 @@ require ( golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect google.golang.org/genproto v0.0.0-20250122153221-138b5a5a4fd4 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250127172529-29210b9bc287 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250212204824-5a70512c5d8b // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 // indirect google.golang.org/grpc v1.70.0 // indirect google.golang.org/protobuf v1.36.5 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index f771f8c5..1a41b5b9 100644 --- a/go.sum +++ b/go.sum @@ -4,8 +4,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.118.1 h1:b8RATMcrK9A4BH0rj8yQupPXp+aP+cJ0l6H7V9osV1E= cloud.google.com/go v0.118.1/go.mod h1:CFO4UPEPi8oV21xoezZCrd3d81K4fFkDTEJu4R8K+9M= -cloud.google.com/go/auth v0.14.1 h1:AwoJbzUdxA/whv1qj3TLKwh3XX5sikny2fc40wUl+h0= -cloud.google.com/go/auth v0.14.1/go.mod h1:4JHUxlGXisL0AW8kXPtUF6ztuOksyfUQNFjfsOCXkPM= +cloud.google.com/go/auth v0.15.0 h1:Ly0u4aA5vG/fsSsxu98qCQBemXtAtJf+95z9HK+cxps= +cloud.google.com/go/auth v0.15.0/go.mod h1:WJDGqZ1o9E9wKIL+IwStfyn/+s59zl4Bi+1KQNVXLZ8= cloud.google.com/go/auth/oauth2adapt v0.2.7 h1:/Lc7xODdqcEw8IrZ9SvwnlLX6j9FHQM74z6cBk9Rw6M= cloud.google.com/go/auth/oauth2adapt v0.2.7/go.mod h1:NTbTTzfvPl1Y3V1nPpOgl2w6d/FjO7NNUQaWSox6ZMc= cloud.google.com/go/bigquery v1.66.2 h1:EKOSqjtO7jPpJoEzDmRctGea3c2EOGoexy8VyY9dNro= @@ -81,8 +81,8 @@ github.com/google/flatbuffers v23.5.26+incompatible h1:M9dgRyhJemaM4Sw8+66GHBu8i github.com/google/flatbuffers v23.5.26+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc= github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0= github.com/google/s2a-go v0.1.9 h1:LGD7gtMgezd8a/Xak7mEWL0PjoTQFvpRudN895yqKW0= @@ -144,10 +144,10 @@ go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJyS go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= go.opentelemetry.io/contrib/detectors/gcp v1.33.0 h1:FVPoXEoILwgbZUu4X7YSgsESsAmGRgoYcnXkzgQPhP4= go.opentelemetry.io/contrib/detectors/gcp v1.33.0/go.mod h1:ZHrLmr4ikK2AwRj9QL+c9s2SOlgoSRyMpNVzUj2fZqI= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0 h1:PS8wXpbyaDJQ2VDHHncMe9Vct0Zn1fEjpsjrLxGJoSc= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0/go.mod h1:HDBUsEjOuRC0EzKZ1bSaRGZWUBAzo+MhAcUUORSr4D0= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 h1:yd02MEjBdJkG3uabWP9apV+OuWRIXGDuJEUJbOHmCFU= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0/go.mod h1:umTcuxiv1n/s/S6/c2AT/g2CQ7u5C59sHDNmfSwgz7Q= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 h1:rgMkmiGfix9vFJDcDi1PK8WEQP4FLQwLDfhp5ZLpFeE= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0/go.mod h1:ijPqXp5P6IRRByFVVg9DY8P5HkxkHE5ARIa+86aXPf4= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 h1:CV7UdSGJt/Ao6Gp4CXckLxVRRsRgDHoI8XjbL3PDl8s= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0/go.mod h1:FRmFuRJfag1IZ2dPkHnEoSFVgTVPUd2qf5Vi69hLb8I= go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= @@ -229,8 +229,8 @@ golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhS golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= gonum.org/v1/gonum v0.12.0 h1:xKuo6hzt+gMav00meVPUlXwSdoEJP46BR+wdxQEFK2o= gonum.org/v1/gonum v0.12.0/go.mod h1:73TDxJfAAHeA8Mk9mf8NlIppyhQNo5GLTcYeqgo2lvY= -google.golang.org/api v0.222.0 h1:Aiewy7BKLCuq6cUCeOUrsAlzjXPqBkEeQ/iwGHVQa/4= -google.golang.org/api v0.222.0/go.mod h1:efZia3nXpWELrwMlN5vyQrD4GmJN1Vw0x68Et3r+a9c= +google.golang.org/api v0.223.0 h1:JUTaWEriXmEy5AhvdMgksGGPEFsYfUKaPEYXd4c3Wvc= +google.golang.org/api v0.223.0/go.mod h1:C+RS7Z+dDwds2b+zoAk5hN/eSfsiCn0UDrYof/M4d2M= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -240,8 +240,8 @@ google.golang.org/genproto v0.0.0-20250122153221-138b5a5a4fd4 h1:Pw6WnI9W/LIdRxq google.golang.org/genproto v0.0.0-20250122153221-138b5a5a4fd4/go.mod h1:qbZzneIOXSq+KFAFut9krLfRLZiFLzZL5u2t8SV83EE= google.golang.org/genproto/googleapis/api v0.0.0-20250127172529-29210b9bc287 h1:A2ni10G3UlplFrWdCDJTl7D7mJ7GSRm37S+PDimaKRw= google.golang.org/genproto/googleapis/api v0.0.0-20250127172529-29210b9bc287/go.mod h1:iYONQfRdizDB8JJBybql13nArx91jcUk7zCXEsOofM4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250212204824-5a70512c5d8b h1:FQtJ1MxbXoIIrZHZ33M+w5+dAP9o86rgpjoKr/ZmT7k= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250212204824-5a70512c5d8b/go.mod h1:8BS3B93F/U1juMFq9+EDk+qOT5CO1R9IzXxG3PTqiRk= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 h1:DMTIbak9GhdaSxEjvVzAeNZvyc03I61duqNbnm3SU0M= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2/go.mod h1:LuRYeWDFV6WOn90g357N17oMCaxpgCnbi/44qJvDn2I= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= diff --git a/vendor/cloud.google.com/go/auth/CHANGES.md b/vendor/cloud.google.com/go/auth/CHANGES.md index 18131a9c..500c34cf 100644 --- a/vendor/cloud.google.com/go/auth/CHANGES.md +++ b/vendor/cloud.google.com/go/auth/CHANGES.md @@ -1,5 +1,12 @@ # Changelog +## [0.15.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.14.1...auth/v0.15.0) (2025-02-19) + + +### Features + +* **auth:** Add hard-bound token request to compute token provider. ([#11588](https://github.com/googleapis/google-cloud-go/issues/11588)) ([0e608bb](https://github.com/googleapis/google-cloud-go/commit/0e608bb5ac3d694c8ad36ca4340071d3a2c78699)) + ## [0.14.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.14.0...auth/v0.14.1) (2025-01-24) diff --git a/vendor/cloud.google.com/go/auth/credentials/compute.go b/vendor/cloud.google.com/go/auth/credentials/compute.go index 8afd0472..e4a8078f 100644 --- a/vendor/cloud.google.com/go/auth/credentials/compute.go +++ b/vendor/cloud.google.com/go/auth/credentials/compute.go @@ -39,8 +39,9 @@ var ( // uses the metadata service to retrieve tokens. func computeTokenProvider(opts *DetectOptions, client *metadata.Client) auth.TokenProvider { return auth.NewCachedTokenProvider(&computeProvider{ - scopes: opts.Scopes, - client: client, + scopes: opts.Scopes, + client: client, + tokenBindingType: opts.TokenBindingType, }, &auth.CachedTokenProviderOptions{ ExpireEarly: opts.EarlyTokenRefresh, DisableAsyncRefresh: opts.DisableAsyncRefresh, @@ -49,8 +50,9 @@ func computeTokenProvider(opts *DetectOptions, client *metadata.Client) auth.Tok // computeProvider fetches tokens from the google cloud metadata service. type computeProvider struct { - scopes []string - client *metadata.Client + scopes []string + client *metadata.Client + tokenBindingType TokenBindingType } type metadataTokenResp struct { @@ -64,9 +66,19 @@ func (cs *computeProvider) Token(ctx context.Context) (*auth.Token, error) { if err != nil { return nil, err } - if len(cs.scopes) > 0 { + hasScopes := len(cs.scopes) > 0 + if hasScopes || cs.tokenBindingType != NoBinding { v := url.Values{} - v.Set("scopes", strings.Join(cs.scopes, ",")) + if hasScopes { + v.Set("scopes", strings.Join(cs.scopes, ",")) + } + switch cs.tokenBindingType { + case MTLSHardBinding: + v.Set("transport", "mtls") + v.Set("binding-enforcement", "on") + case ALTSHardBinding: + v.Set("transport", "alts") + } tokenURI.RawQuery = v.Encode() } tokenJSON, err := cs.client.GetWithContext(ctx, tokenURI.String()) diff --git a/vendor/cloud.google.com/go/auth/credentials/detect.go b/vendor/cloud.google.com/go/auth/credentials/detect.go index b84a90a8..d8f7d961 100644 --- a/vendor/cloud.google.com/go/auth/credentials/detect.go +++ b/vendor/cloud.google.com/go/auth/credentials/detect.go @@ -51,6 +51,23 @@ var ( allowOnGCECheck = true ) +// TokenBindingType specifies the type of binding used when requesting a token +// whether to request a hard-bound token using mTLS or an instance identity +// bound token using ALTS. +type TokenBindingType int + +const ( + // NoBinding specifies that requested tokens are not required to have a + // binding. This is the default option. + NoBinding TokenBindingType = iota + // MTLSHardBinding specifies that a hard-bound token should be requested + // using an mTLS with S2A channel. + MTLSHardBinding + // ALTSHardBinding specifies that an instance identity bound token should + // be requested using an ALTS channel. + ALTSHardBinding +) + // OnGCE reports whether this process is running in Google Cloud. func OnGCE() bool { // TODO(codyoss): once all libs use this auth lib move metadata check here @@ -121,6 +138,10 @@ type DetectOptions struct { // https://www.googleapis.com/auth/cloud-platform. Required if Audience is // not provided. Scopes []string + // TokenBindingType specifies the type of binding used when requesting a + // token whether to request a hard-bound token using mTLS or an instance + // identity bound token using ALTS. Optional. + TokenBindingType TokenBindingType // Audience that credentials tokens should have. Only applicable for 2LO // flows with service accounts. If specified, scopes should not be provided. Audience string diff --git a/vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go b/vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go index 95f25903..4610a485 100644 --- a/vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go +++ b/vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go @@ -204,6 +204,10 @@ type InternalOptions struct { EnableDirectPathXds bool // EnableJWTWithScope specifies if scope can be used with self-signed JWT. EnableJWTWithScope bool + // AllowHardBoundTokens allows libraries to request a hard-bound token. + // Obtaining hard-bound tokens requires the connection to be established + // using either ALTS or mTLS with S2A. + AllowHardBoundTokens []string // DefaultAudience specifies a default audience to be used as the audience // field ("aud") for the JWT token authentication. DefaultAudience string @@ -262,13 +266,13 @@ func dial(ctx context.Context, secure bool, opts *Options) (*grpc.ClientConn, er tOpts.EnableDirectPath = io.EnableDirectPath tOpts.EnableDirectPathXds = io.EnableDirectPathXds } - transportCreds, endpoint, err := transport.GetGRPCTransportCredsAndEndpoint(tOpts) + transportCreds, err := transport.GetGRPCTransportCredsAndEndpoint(tOpts) if err != nil { return nil, err } if !secure { - transportCreds = grpcinsecure.NewCredentials() + transportCreds.TransportCredentials = grpcinsecure.NewCredentials() } // Initialize gRPC dial options with transport-level security options. @@ -297,6 +301,18 @@ func dial(ctx context.Context, secure bool, opts *Options) (*grpc.ClientConn, er if opts.Credentials != nil { creds = opts.Credentials } else { + // This condition is only met for non-DirectPath clients because + // TransportTypeMTLSS2A is used only when InternalOptions.EnableDirectPath + // is false. + if transportCreds.TransportType == transport.TransportTypeMTLSS2A { + // Check that the client allows requesting hard-bound token for the transport type mTLS using S2A. + for _, ev := range opts.InternalOptions.AllowHardBoundTokens { + if ev == "MTLS_S2A" { + opts.DetectOpts.TokenBindingType = credentials.MTLSHardBinding + break + } + } + } var err error creds, err = credentials.DetectDefault(opts.resolveDetectOptions()) if err != nil { @@ -324,9 +340,8 @@ func dial(ctx context.Context, secure bool, opts *Options) (*grpc.ClientConn, er clientUniverseDomain: opts.UniverseDomain, }), ) - // Attempt Direct Path - grpcOpts, endpoint = configureDirectPath(grpcOpts, opts, endpoint, creds) + grpcOpts, transportCreds.Endpoint = configureDirectPath(grpcOpts, opts, transportCreds.Endpoint, creds) } // Add tracing, but before the other options, so that clients can override the @@ -335,7 +350,7 @@ func dial(ctx context.Context, secure bool, opts *Options) (*grpc.ClientConn, er grpcOpts = addOpenTelemetryStatsHandler(grpcOpts, opts) grpcOpts = append(grpcOpts, opts.GRPCDialOpts...) - return grpc.Dial(endpoint, grpcOpts...) + return grpc.Dial(transportCreds.Endpoint, grpcOpts...) } // grpcKeyProvider satisfies https://pkg.go.dev/google.golang.org/grpc/credentials#PerRPCCredentials. diff --git a/vendor/cloud.google.com/go/auth/internal/transport/cba.go b/vendor/cloud.google.com/go/auth/internal/transport/cba.go index 2f922f7d..b1f0fcf9 100644 --- a/vendor/cloud.google.com/go/auth/internal/transport/cba.go +++ b/vendor/cloud.google.com/go/auth/internal/transport/cba.go @@ -52,6 +52,16 @@ const ( mtlsMDSKey = "/run/google-mds-mtls/client.key" ) +// Type represents the type of transport used. +type Type int + +const ( + // TransportTypeUnknown represents an unknown transport type and is the default option. + TransportTypeUnknown Type = iota + // TransportTypeMTLSS2A represents the mTLS transport type using S2A. + TransportTypeMTLSS2A +) + // Options is a struct that is duplicated information from the individual // transport packages in order to avoid cyclic deps. It correlates 1:1 with // fields on httptransport.Options and grpctransport.Options. @@ -120,13 +130,20 @@ func fixScheme(baseURL string) string { return baseURL } +// GRPCTransportCredentials embeds interface TransportCredentials with additional data. +type GRPCTransportCredentials struct { + credentials.TransportCredentials + Endpoint string + TransportType Type +} + // GetGRPCTransportCredsAndEndpoint returns an instance of // [google.golang.org/grpc/credentials.TransportCredentials], and the -// corresponding endpoint to use for GRPC client. -func GetGRPCTransportCredsAndEndpoint(opts *Options) (credentials.TransportCredentials, string, error) { +// corresponding endpoint and transport type to use for GRPC client. +func GetGRPCTransportCredsAndEndpoint(opts *Options) (*GRPCTransportCredentials, error) { config, err := getTransportConfig(opts) if err != nil { - return nil, "", err + return nil, err } defaultTransportCreds := credentials.NewTLS(&tls.Config{ @@ -144,13 +161,13 @@ func GetGRPCTransportCredsAndEndpoint(opts *Options) (credentials.TransportCrede if config.s2aAddress != "" { s2aAddr = config.s2aAddress } else { - return defaultTransportCreds, config.endpoint, nil + return &GRPCTransportCredentials{defaultTransportCreds, config.endpoint, TransportTypeUnknown}, nil } } } else if config.s2aAddress != "" { s2aAddr = config.s2aAddress } else { - return defaultTransportCreds, config.endpoint, nil + return &GRPCTransportCredentials{defaultTransportCreds, config.endpoint, TransportTypeUnknown}, nil } var fallbackOpts *s2a.FallbackOptions @@ -168,9 +185,9 @@ func GetGRPCTransportCredsAndEndpoint(opts *Options) (credentials.TransportCrede }) if err != nil { // Use default if we cannot initialize S2A client transport credentials. - return defaultTransportCreds, config.endpoint, nil + return &GRPCTransportCredentials{defaultTransportCreds, config.endpoint, TransportTypeUnknown}, nil } - return s2aTransportCreds, config.s2aMTLSEndpoint, nil + return &GRPCTransportCredentials{s2aTransportCreds, config.s2aMTLSEndpoint, TransportTypeMTLSS2A}, nil } // GetHTTPTransportConfig returns a client certificate source and a function for diff --git a/vendor/cloud.google.com/go/auth/internal/transport/transport.go b/vendor/cloud.google.com/go/auth/internal/transport/transport.go index 992ac40d..5c8721ef 100644 --- a/vendor/cloud.google.com/go/auth/internal/transport/transport.go +++ b/vendor/cloud.google.com/go/auth/internal/transport/transport.go @@ -37,6 +37,7 @@ func CloneDetectOptions(oldDo *credentials.DetectOptions) *credentials.DetectOpt } newDo := &credentials.DetectOptions{ // Simple types + TokenBindingType: oldDo.TokenBindingType, Audience: oldDo.Audience, Subject: oldDo.Subject, EarlyTokenRefresh: oldDo.EarlyTokenRefresh, @@ -46,8 +47,8 @@ func CloneDetectOptions(oldDo *credentials.DetectOptions) *credentials.DetectOpt UseSelfSignedJWT: oldDo.UseSelfSignedJWT, UniverseDomain: oldDo.UniverseDomain, - // These fields are are pointer types that we just want to use exactly - // as the user set, copy the ref + // These fields are pointer types that we just want to use exactly as + // the user set, copy the ref Client: oldDo.Client, Logger: oldDo.Logger, AuthHandlerOptions: oldDo.AuthHandlerOptions, diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/version.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/version.go index 25a3a862..80e5f2f6 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/version.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/version.go @@ -5,7 +5,7 @@ package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.g // Version is the current release version of the gRPC instrumentation. func Version() string { - return "0.58.0" + return "0.59.0" // This string is updated by the pre_release.sh script during release } diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go index e555a475..3ea05d01 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go @@ -12,6 +12,7 @@ import ( "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv" "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/propagation" "go.opentelemetry.io/otel/trace" ) @@ -21,15 +22,16 @@ type middleware struct { operation string server string - tracer trace.Tracer - propagators propagation.TextMapPropagator - spanStartOptions []trace.SpanStartOption - readEvent bool - writeEvent bool - filters []Filter - spanNameFormatter func(string, *http.Request) string - publicEndpoint bool - publicEndpointFn func(*http.Request) bool + tracer trace.Tracer + propagators propagation.TextMapPropagator + spanStartOptions []trace.SpanStartOption + readEvent bool + writeEvent bool + filters []Filter + spanNameFormatter func(string, *http.Request) string + publicEndpoint bool + publicEndpointFn func(*http.Request) bool + metricAttributesFn func(*http.Request) []attribute.KeyValue semconv semconv.HTTPServer } @@ -79,6 +81,7 @@ func (h *middleware) configure(c *config) { h.publicEndpointFn = c.PublicEndpointFn h.server = c.ServerName h.semconv = semconv.NewHTTPServer(c.Meter) + h.metricAttributesFn = c.MetricAttributesFn } // serveHTTP sets up tracing and calls the given next http.Handler with the span @@ -189,14 +192,16 @@ func (h *middleware) serveHTTP(w http.ResponseWriter, r *http.Request, next http // Use floating point division here for higher precision (instead of Millisecond method). elapsedTime := float64(time.Since(requestStartTime)) / float64(time.Millisecond) + metricAttributes := semconv.MetricAttributes{ + Req: r, + StatusCode: statusCode, + AdditionalAttributes: append(labeler.Get(), h.metricAttributesFromRequest(r)...), + } + h.semconv.RecordMetrics(ctx, semconv.ServerMetricData{ - ServerName: h.server, - ResponseSize: bytesWritten, - MetricAttributes: semconv.MetricAttributes{ - Req: r, - StatusCode: statusCode, - AdditionalAttributes: labeler.Get(), - }, + ServerName: h.server, + ResponseSize: bytesWritten, + MetricAttributes: metricAttributes, MetricData: semconv.MetricData{ RequestSize: bw.BytesRead(), ElapsedTime: elapsedTime, @@ -204,6 +209,14 @@ func (h *middleware) serveHTTP(w http.ResponseWriter, r *http.Request, next http }) } +func (h *middleware) metricAttributesFromRequest(r *http.Request) []attribute.KeyValue { + var attributeForRequest []attribute.KeyValue + if h.metricAttributesFn != nil { + attributeForRequest = h.metricAttributesFn(r) + } + return attributeForRequest +} + // WithRouteTag annotates spans and metrics with the provided route name // with HTTP route attribute. func WithRouteTag(route string, h http.Handler) http.Handler { diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/env.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/env.go index 3b036f8a..eaf4c379 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/env.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/env.go @@ -1,3 +1,6 @@ +// Code created by gotmpl. DO NOT MODIFY. +// source: internal/shared/semconv/env.go.tmpl + // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 @@ -16,6 +19,10 @@ import ( "go.opentelemetry.io/otel/metric" ) +// OTelSemConvStabilityOptIn is an environment variable. +// That can be set to "old" or "http/dup" to opt into the new HTTP semantic conventions. +const OTelSemConvStabilityOptIn = "OTEL_SEMCONV_STABILITY_OPT_IN" + type ResponseTelemetry struct { StatusCode int ReadBytes int64 @@ -31,6 +38,11 @@ type HTTPServer struct { requestBytesCounter metric.Int64Counter responseBytesCounter metric.Int64Counter serverLatencyMeasure metric.Float64Histogram + + // New metrics + requestBodySizeHistogram metric.Int64Histogram + responseBodySizeHistogram metric.Int64Histogram + requestDurationHistogram metric.Float64Histogram } // RequestTraceAttrs returns trace attributes for an HTTP request received by a @@ -103,38 +115,56 @@ type MetricData struct { ElapsedTime float64 } -var metricAddOptionPool = &sync.Pool{ - New: func() interface{} { - return &[]metric.AddOption{} - }, -} +var ( + metricAddOptionPool = &sync.Pool{ + New: func() interface{} { + return &[]metric.AddOption{} + }, + } -func (s HTTPServer) RecordMetrics(ctx context.Context, md ServerMetricData) { - if s.requestBytesCounter == nil || s.responseBytesCounter == nil || s.serverLatencyMeasure == nil { - // This will happen if an HTTPServer{} is used instead of NewHTTPServer. - return + metricRecordOptionPool = &sync.Pool{ + New: func() interface{} { + return &[]metric.RecordOption{} + }, } +) - attributes := OldHTTPServer{}.MetricAttributes(md.ServerName, md.Req, md.StatusCode, md.AdditionalAttributes) - o := metric.WithAttributeSet(attribute.NewSet(attributes...)) - addOpts := metricAddOptionPool.Get().(*[]metric.AddOption) - *addOpts = append(*addOpts, o) - s.requestBytesCounter.Add(ctx, md.RequestSize, *addOpts...) - s.responseBytesCounter.Add(ctx, md.ResponseSize, *addOpts...) - s.serverLatencyMeasure.Record(ctx, md.ElapsedTime, o) - *addOpts = (*addOpts)[:0] - metricAddOptionPool.Put(addOpts) +func (s HTTPServer) RecordMetrics(ctx context.Context, md ServerMetricData) { + if s.requestBytesCounter != nil && s.responseBytesCounter != nil && s.serverLatencyMeasure != nil { + attributes := OldHTTPServer{}.MetricAttributes(md.ServerName, md.Req, md.StatusCode, md.AdditionalAttributes) + o := metric.WithAttributeSet(attribute.NewSet(attributes...)) + addOpts := metricAddOptionPool.Get().(*[]metric.AddOption) + *addOpts = append(*addOpts, o) + s.requestBytesCounter.Add(ctx, md.RequestSize, *addOpts...) + s.responseBytesCounter.Add(ctx, md.ResponseSize, *addOpts...) + s.serverLatencyMeasure.Record(ctx, md.ElapsedTime, o) + *addOpts = (*addOpts)[:0] + metricAddOptionPool.Put(addOpts) + } - // TODO: Duplicate Metrics + if s.duplicate && s.requestDurationHistogram != nil && s.requestBodySizeHistogram != nil && s.responseBodySizeHistogram != nil { + attributes := CurrentHTTPServer{}.MetricAttributes(md.ServerName, md.Req, md.StatusCode, md.AdditionalAttributes) + o := metric.WithAttributeSet(attribute.NewSet(attributes...)) + recordOpts := metricRecordOptionPool.Get().(*[]metric.RecordOption) + *recordOpts = append(*recordOpts, o) + s.requestBodySizeHistogram.Record(ctx, md.RequestSize, *recordOpts...) + s.responseBodySizeHistogram.Record(ctx, md.ResponseSize, *recordOpts...) + s.requestDurationHistogram.Record(ctx, md.ElapsedTime, o) + *recordOpts = (*recordOpts)[:0] + metricRecordOptionPool.Put(recordOpts) + } } func NewHTTPServer(meter metric.Meter) HTTPServer { - env := strings.ToLower(os.Getenv("OTEL_SEMCONV_STABILITY_OPT_IN")) + env := strings.ToLower(os.Getenv(OTelSemConvStabilityOptIn)) duplicate := env == "http/dup" server := HTTPServer{ duplicate: duplicate, } server.requestBytesCounter, server.responseBytesCounter, server.serverLatencyMeasure = OldHTTPServer{}.createMeasures(meter) + if duplicate { + server.requestBodySizeHistogram, server.responseBodySizeHistogram, server.requestDurationHistogram = CurrentHTTPServer{}.createMeasures(meter) + } return server } @@ -145,14 +175,23 @@ type HTTPClient struct { requestBytesCounter metric.Int64Counter responseBytesCounter metric.Int64Counter latencyMeasure metric.Float64Histogram + + // new metrics + requestBodySize metric.Int64Histogram + requestDuration metric.Float64Histogram } func NewHTTPClient(meter metric.Meter) HTTPClient { - env := strings.ToLower(os.Getenv("OTEL_SEMCONV_STABILITY_OPT_IN")) + env := strings.ToLower(os.Getenv(OTelSemConvStabilityOptIn)) + duplicate := env == "http/dup" client := HTTPClient{ - duplicate: env == "http/dup", + duplicate: duplicate, } client.requestBytesCounter, client.responseBytesCounter, client.latencyMeasure = OldHTTPClient{}.createMeasures(meter) + if duplicate { + client.requestBodySize, client.requestDuration = CurrentHTTPClient{}.createMeasures(meter) + } + return client } @@ -204,34 +243,48 @@ func (o MetricOpts) AddOptions() metric.AddOption { return o.addOptions } -func (c HTTPClient) MetricOptions(ma MetricAttributes) MetricOpts { +func (c HTTPClient) MetricOptions(ma MetricAttributes) map[string]MetricOpts { + opts := map[string]MetricOpts{} + attributes := OldHTTPClient{}.MetricAttributes(ma.Req, ma.StatusCode, ma.AdditionalAttributes) - // TODO: Duplicate Metrics set := metric.WithAttributeSet(attribute.NewSet(attributes...)) - return MetricOpts{ + opts["old"] = MetricOpts{ measurement: set, addOptions: set, } + + if c.duplicate { + attributes := CurrentHTTPClient{}.MetricAttributes(ma.Req, ma.StatusCode, ma.AdditionalAttributes) + set := metric.WithAttributeSet(attribute.NewSet(attributes...)) + opts["new"] = MetricOpts{ + measurement: set, + addOptions: set, + } + } + + return opts } -func (s HTTPClient) RecordMetrics(ctx context.Context, md MetricData, opts MetricOpts) { +func (s HTTPClient) RecordMetrics(ctx context.Context, md MetricData, opts map[string]MetricOpts) { if s.requestBytesCounter == nil || s.latencyMeasure == nil { // This will happen if an HTTPClient{} is used instead of NewHTTPClient(). return } - s.requestBytesCounter.Add(ctx, md.RequestSize, opts.AddOptions()) - s.latencyMeasure.Record(ctx, md.ElapsedTime, opts.MeasurementOption()) + s.requestBytesCounter.Add(ctx, md.RequestSize, opts["old"].AddOptions()) + s.latencyMeasure.Record(ctx, md.ElapsedTime, opts["old"].MeasurementOption()) - // TODO: Duplicate Metrics + if s.duplicate { + s.requestBodySize.Record(ctx, md.RequestSize, opts["new"].MeasurementOption()) + s.requestDuration.Record(ctx, md.ElapsedTime, opts["new"].MeasurementOption()) + } } -func (s HTTPClient) RecordResponseSize(ctx context.Context, responseData int64, opts metric.AddOption) { +func (s HTTPClient) RecordResponseSize(ctx context.Context, responseData int64, opts map[string]MetricOpts) { if s.responseBytesCounter == nil { // This will happen if an HTTPClient{} is used instead of NewHTTPClient(). return } - s.responseBytesCounter.Add(ctx, responseData, opts) - // TODO: Duplicate Metrics + s.responseBytesCounter.Add(ctx, responseData, opts["old"].AddOptions()) } diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/gen.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/gen.go new file mode 100644 index 00000000..32630864 --- /dev/null +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/gen.go @@ -0,0 +1,14 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv" + +// Generate semconv package: +//go:generate gotmpl --body=../../../../../../internal/shared/semconv/bench_test.go.tmpl "--data={}" --out=bench_test.go +//go:generate gotmpl --body=../../../../../../internal/shared/semconv/env.go.tmpl "--data={}" --out=env.go +//go:generate gotmpl --body=../../../../../../internal/shared/semconv/env_test.go.tmpl "--data={}" --out=env_test.go +//go:generate gotmpl --body=../../../../../../internal/shared/semconv/httpconv.go.tmpl "--data={}" --out=httpconv.go +//go:generate gotmpl --body=../../../../../../internal/shared/semconv/httpconv_test.go.tmpl "--data={}" --out=httpconv_test.go +//go:generate gotmpl --body=../../../../../../internal/shared/semconv/util.go.tmpl "--data={}" --out=util.go +//go:generate gotmpl --body=../../../../../../internal/shared/semconv/util_test.go.tmpl "--data={}" --out=util_test.go +//go:generate gotmpl --body=../../../../../../internal/shared/semconv/v1.20.0.go.tmpl "--data={}" --out=v1.20.0.go diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/httpconv.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/httpconv.go index dc9ec7bc..8c3c6275 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/httpconv.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/httpconv.go @@ -1,3 +1,6 @@ +// Code created by gotmpl. DO NOT MODIFY. +// source: internal/shared/semconv/httpconv.go.tmpl + // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 @@ -7,10 +10,13 @@ import ( "fmt" "net/http" "reflect" + "slices" "strconv" "strings" "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/metric/noop" semconvNew "go.opentelemetry.io/otel/semconv/v1.26.0" ) @@ -199,6 +205,86 @@ func (n CurrentHTTPServer) Route(route string) attribute.KeyValue { return semconvNew.HTTPRoute(route) } +func (n CurrentHTTPServer) createMeasures(meter metric.Meter) (metric.Int64Histogram, metric.Int64Histogram, metric.Float64Histogram) { + if meter == nil { + return noop.Int64Histogram{}, noop.Int64Histogram{}, noop.Float64Histogram{} + } + + var err error + requestBodySizeHistogram, err := meter.Int64Histogram( + semconvNew.HTTPServerRequestBodySizeName, + metric.WithUnit(semconvNew.HTTPServerRequestBodySizeUnit), + metric.WithDescription(semconvNew.HTTPServerRequestBodySizeDescription), + ) + handleErr(err) + + responseBodySizeHistogram, err := meter.Int64Histogram( + semconvNew.HTTPServerResponseBodySizeName, + metric.WithUnit(semconvNew.HTTPServerResponseBodySizeUnit), + metric.WithDescription(semconvNew.HTTPServerResponseBodySizeDescription), + ) + handleErr(err) + requestDurationHistogram, err := meter.Float64Histogram( + semconvNew.HTTPServerRequestDurationName, + metric.WithUnit(semconvNew.HTTPServerRequestDurationUnit), + metric.WithDescription(semconvNew.HTTPServerRequestDurationDescription), + ) + handleErr(err) + + return requestBodySizeHistogram, responseBodySizeHistogram, requestDurationHistogram +} + +func (n CurrentHTTPServer) MetricAttributes(server string, req *http.Request, statusCode int, additionalAttributes []attribute.KeyValue) []attribute.KeyValue { + num := len(additionalAttributes) + 3 + var host string + var p int + if server == "" { + host, p = SplitHostPort(req.Host) + } else { + // Prioritize the primary server name. + host, p = SplitHostPort(server) + if p < 0 { + _, p = SplitHostPort(req.Host) + } + } + hostPort := requiredHTTPPort(req.TLS != nil, p) + if hostPort > 0 { + num++ + } + protoName, protoVersion := netProtocol(req.Proto) + if protoName != "" { + num++ + } + if protoVersion != "" { + num++ + } + + if statusCode > 0 { + num++ + } + + attributes := slices.Grow(additionalAttributes, num) + attributes = append(attributes, + semconvNew.HTTPRequestMethodKey.String(standardizeHTTPMethod(req.Method)), + n.scheme(req.TLS != nil), + semconvNew.ServerAddress(host)) + + if hostPort > 0 { + attributes = append(attributes, semconvNew.ServerPort(hostPort)) + } + if protoName != "" { + attributes = append(attributes, semconvNew.NetworkProtocolName(protoName)) + } + if protoVersion != "" { + attributes = append(attributes, semconvNew.NetworkProtocolVersion(protoVersion)) + } + + if statusCode > 0 { + attributes = append(attributes, semconvNew.HTTPResponseStatusCode(statusCode)) + } + return attributes +} + type CurrentHTTPClient struct{} // RequestTraceAttrs returns trace attributes for an HTTP request made by a client. @@ -343,6 +429,91 @@ func (n CurrentHTTPClient) method(method string) (attribute.KeyValue, attribute. return semconvNew.HTTPRequestMethodGet, orig } +func (n CurrentHTTPClient) createMeasures(meter metric.Meter) (metric.Int64Histogram, metric.Float64Histogram) { + if meter == nil { + return noop.Int64Histogram{}, noop.Float64Histogram{} + } + + var err error + requestBodySize, err := meter.Int64Histogram( + semconvNew.HTTPClientRequestBodySizeName, + metric.WithUnit(semconvNew.HTTPClientRequestBodySizeUnit), + metric.WithDescription(semconvNew.HTTPClientRequestBodySizeDescription), + ) + handleErr(err) + + requestDuration, err := meter.Float64Histogram( + semconvNew.HTTPClientRequestDurationName, + metric.WithUnit(semconvNew.HTTPClientRequestDurationUnit), + metric.WithDescription(semconvNew.HTTPClientRequestDurationDescription), + ) + handleErr(err) + + return requestBodySize, requestDuration +} + +func (n CurrentHTTPClient) MetricAttributes(req *http.Request, statusCode int, additionalAttributes []attribute.KeyValue) []attribute.KeyValue { + num := len(additionalAttributes) + 2 + var h string + if req.URL != nil { + h = req.URL.Host + } + var requestHost string + var requestPort int + for _, hostport := range []string{h, req.Header.Get("Host")} { + requestHost, requestPort = SplitHostPort(hostport) + if requestHost != "" || requestPort > 0 { + break + } + } + + port := requiredHTTPPort(req.URL != nil && req.URL.Scheme == "https", requestPort) + if port > 0 { + num++ + } + + protoName, protoVersion := netProtocol(req.Proto) + if protoName != "" { + num++ + } + if protoVersion != "" { + num++ + } + + if statusCode > 0 { + num++ + } + + attributes := slices.Grow(additionalAttributes, num) + attributes = append(attributes, + semconvNew.HTTPRequestMethodKey.String(standardizeHTTPMethod(req.Method)), + semconvNew.ServerAddress(requestHost), + n.scheme(req.TLS != nil), + ) + + if port > 0 { + attributes = append(attributes, semconvNew.ServerPort(port)) + } + if protoName != "" { + attributes = append(attributes, semconvNew.NetworkProtocolName(protoName)) + } + if protoVersion != "" { + attributes = append(attributes, semconvNew.NetworkProtocolVersion(protoVersion)) + } + + if statusCode > 0 { + attributes = append(attributes, semconvNew.HTTPResponseStatusCode(statusCode)) + } + return attributes +} + +func (n CurrentHTTPClient) scheme(https bool) attribute.KeyValue { // nolint:revive + if https { + return semconvNew.URLScheme("https") + } + return semconvNew.URLScheme("http") +} + func isErrorStatusCode(code int) bool { return code >= 400 || code < 100 } diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go index 93e8d0f9..558efd05 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go @@ -1,3 +1,6 @@ +// Code created by gotmpl. DO NOT MODIFY. +// source: internal/shared/semconv/util.go.tmpl + // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 @@ -96,3 +99,13 @@ func handleErr(err error) { otel.Handle(err) } } + +func standardizeHTTPMethod(method string) string { + method = strings.ToUpper(method) + switch method { + case http.MethodConnect, http.MethodDelete, http.MethodGet, http.MethodHead, http.MethodOptions, http.MethodPatch, http.MethodPost, http.MethodPut, http.MethodTrace: + default: + method = "_OTHER" + } + return method +} diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/v1.20.0.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/v1.20.0.go index c042249d..57d1507b 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/v1.20.0.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/v1.20.0.go @@ -1,3 +1,6 @@ +// Code created by gotmpl. DO NOT MODIFY. +// source: internal/shared/semconv/v120.0.go.tmpl + // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 @@ -8,7 +11,6 @@ import ( "io" "net/http" "slices" - "strings" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil" "go.opentelemetry.io/otel/attribute" @@ -144,7 +146,7 @@ func (o OldHTTPServer) MetricAttributes(server string, req *http.Request, status attributes := slices.Grow(additionalAttributes, n) attributes = append(attributes, - standardizeHTTPMethodMetric(req.Method), + semconv.HTTPMethod(standardizeHTTPMethod(req.Method)), o.scheme(req.TLS != nil), semconv.NetHostName(host)) @@ -214,7 +216,7 @@ func (o OldHTTPClient) MetricAttributes(req *http.Request, statusCode int, addit attributes := slices.Grow(additionalAttributes, n) attributes = append(attributes, - standardizeHTTPMethodMetric(req.Method), + semconv.HTTPMethod(standardizeHTTPMethod(req.Method)), semconv.NetPeerName(requestHost), ) @@ -262,13 +264,3 @@ func (o OldHTTPClient) createMeasures(meter metric.Meter) (metric.Int64Counter, return requestBytesCounter, responseBytesCounter, latencyMeasure } - -func standardizeHTTPMethodMetric(method string) attribute.KeyValue { - method = strings.ToUpper(method) - switch method { - case http.MethodConnect, http.MethodDelete, http.MethodGet, http.MethodHead, http.MethodOptions, http.MethodPatch, http.MethodPost, http.MethodPut, http.MethodTrace: - default: - method = "_OTHER" - } - return semconv.HTTPMethod(method) -} diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go index 39681ad4..44b86ad8 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go @@ -153,7 +153,7 @@ func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) { // For handling response bytes we leverage a callback when the client reads the http response readRecordFunc := func(n int64) { - t.semconv.RecordResponseSize(ctx, n, metricOpts.AddOptions()) + t.semconv.RecordResponseSize(ctx, n, metricOpts) } // traces diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go index 353e43b9..386f09e1 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go @@ -5,7 +5,7 @@ package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http // Version is the current release version of the otelhttp instrumentation. func Version() string { - return "0.58.0" + return "0.59.0" // This string is updated by the pre_release.sh script during release } diff --git a/vendor/google.golang.org/api/bigquery/v2/bigquery-api.json b/vendor/google.golang.org/api/bigquery/v2/bigquery-api.json index c4399c20..e8bc4241 100644 --- a/vendor/google.golang.org/api/bigquery/v2/bigquery-api.json +++ b/vendor/google.golang.org/api/bigquery/v2/bigquery-api.json @@ -351,7 +351,7 @@ "type": "boolean" }, "filter": { - "description": "An expression for filtering the results of the request by label. The syntax is `labels.[:]`. Multiple filters can be ANDed together by connecting with a space. Example: `labels.department:receiving labels.active`. See [Filtering datasets using labels](https://cloud.google.com/bigquery/docs/filtering-labels#filtering_datasets_using_labels) for details.", + "description": "An expression for filtering the results of the request by label. The syntax is `labels.[:]`. Multiple filters can be AND-ed together by connecting with a space. Example: `labels.department:receiving labels.active`. See [Filtering datasets using labels](https://cloud.google.com/bigquery/docs/filtering-labels#filtering_datasets_using_labels) for details.", "location": "query", "type": "string" }, @@ -2256,7 +2256,7 @@ } } }, - "revision": "20250128", + "revision": "20250216", "rootUrl": "https://bigquery.googleapis.com/", "schemas": { "AggregateClassificationMetrics": { @@ -2294,7 +2294,7 @@ "type": "number" }, "threshold": { - "description": "Threshold at which the metrics are computed. For binary classification models this is the positive class threshold. For multi-class classfication models this is the confidence threshold.", + "description": "Threshold at which the metrics are computed. For binary classification models this is the positive class threshold. For multi-class classification models this is the confidence threshold.", "format": "double", "type": "number" } @@ -4346,8 +4346,16 @@ "$ref": "CsvOptions", "description": "Optional. Additional properties to set if sourceFormat is set to CSV." }, + "dateFormat": { + "description": "Optional. Format used to parse DATE values. Supports C-style and SQL-style values.", + "type": "string" + }, + "datetimeFormat": { + "description": "Optional. Format used to parse DATETIME values. Supports C-style and SQL-style values.", + "type": "string" + }, "decimalTargetTypes": { - "description": "Defines the list of possible SQL data types to which the source decimal values are converted. This list and the precision and the scale parameters of the decimal field determine the target type. In the order of NUMERIC, BIGNUMERIC, and STRING, a type is picked if it is in the specified list and if it supports the precision and the scale. STRING supports all precision and scale values. If none of the listed types supports the precision and the scale, the type supporting the widest range in the specified list is picked, and if a value exceeds the supported range when reading the data, an error will be thrown. Example: Suppose the value of this field is [\"NUMERIC\", \"BIGNUMERIC\"]. If (precision,scale) is: * (38,9) -\u003e NUMERIC; * (39,9) -\u003e BIGNUMERIC (NUMERIC cannot hold 30 integer digits); * (38,10) -\u003e BIGNUMERIC (NUMERIC cannot hold 10 fractional digits); * (76,38) -\u003e BIGNUMERIC; * (77,38) -\u003e BIGNUMERIC (error if value exeeds supported range). This field cannot contain duplicate types. The order of the types in this field is ignored. For example, [\"BIGNUMERIC\", \"NUMERIC\"] is the same as [\"NUMERIC\", \"BIGNUMERIC\"] and NUMERIC always takes precedence over BIGNUMERIC. Defaults to [\"NUMERIC\", \"STRING\"] for ORC and [\"NUMERIC\"] for the other file formats.", + "description": "Defines the list of possible SQL data types to which the source decimal values are converted. This list and the precision and the scale parameters of the decimal field determine the target type. In the order of NUMERIC, BIGNUMERIC, and STRING, a type is picked if it is in the specified list and if it supports the precision and the scale. STRING supports all precision and scale values. If none of the listed types supports the precision and the scale, the type supporting the widest range in the specified list is picked, and if a value exceeds the supported range when reading the data, an error will be thrown. Example: Suppose the value of this field is [\"NUMERIC\", \"BIGNUMERIC\"]. If (precision,scale) is: * (38,9) -\u003e NUMERIC; * (39,9) -\u003e BIGNUMERIC (NUMERIC cannot hold 30 integer digits); * (38,10) -\u003e BIGNUMERIC (NUMERIC cannot hold 10 fractional digits); * (76,38) -\u003e BIGNUMERIC; * (77,38) -\u003e BIGNUMERIC (error if value exceeds supported range). This field cannot contain duplicate types. The order of the types in this field is ignored. For example, [\"BIGNUMERIC\", \"NUMERIC\"] is the same as [\"NUMERIC\", \"BIGNUMERIC\"] and NUMERIC always takes precedence over BIGNUMERIC. Defaults to [\"NUMERIC\", \"STRING\"] for ORC and [\"NUMERIC\"] for the other file formats.", "items": { "enum": [ "DECIMAL_TARGET_TYPE_UNSPECIFIED", @@ -4396,7 +4404,7 @@ "GEOJSON" ], "enumDescriptions": [ - "The default if provided value is not one included in the enum, or the value is not specified. The source formate is parsed without any modification.", + "The default if provided value is not one included in the enum, or the value is not specified. The source format is parsed without any modification.", "Use GeoJSON variant of JSON. See https://tools.ietf.org/html/rfc7946." ], "type": "string" @@ -4460,6 +4468,18 @@ "type": "string" }, "type": "array" + }, + "timeFormat": { + "description": "Optional. Format used to parse TIME values. Supports C-style and SQL-style values.", + "type": "string" + }, + "timeZone": { + "description": "Optional. Time zone used when parsing timestamp values that do not have specific time zone information (e.g. 2024-04-20 12:34:56). The expected format is a IANA timezone string (e.g. America/Los_Angeles).", + "type": "string" + }, + "timestampFormat": { + "description": "Optional. Format used to parse TIMESTAMP values. Supports C-style and SQL-style values.", + "type": "string" } }, "type": "object" @@ -5360,8 +5380,16 @@ "description": "Optional. If this property is true, the job creates a new session using a randomly generated session_id. To continue using a created session with subsequent queries, pass the existing session identifier as a `ConnectionProperty` value. The session identifier is returned as part of the `SessionInfo` message within the query statistics. The new session's location will be set to `Job.JobReference.location` if it is present, otherwise it's set to the default location based on existing routing logic.", "type": "boolean" }, + "dateFormat": { + "description": "Optional. Date format used for parsing DATE values.", + "type": "string" + }, + "datetimeFormat": { + "description": "Optional. Date format used for parsing DATETIME values.", + "type": "string" + }, "decimalTargetTypes": { - "description": "Defines the list of possible SQL data types to which the source decimal values are converted. This list and the precision and the scale parameters of the decimal field determine the target type. In the order of NUMERIC, BIGNUMERIC, and STRING, a type is picked if it is in the specified list and if it supports the precision and the scale. STRING supports all precision and scale values. If none of the listed types supports the precision and the scale, the type supporting the widest range in the specified list is picked, and if a value exceeds the supported range when reading the data, an error will be thrown. Example: Suppose the value of this field is [\"NUMERIC\", \"BIGNUMERIC\"]. If (precision,scale) is: * (38,9) -\u003e NUMERIC; * (39,9) -\u003e BIGNUMERIC (NUMERIC cannot hold 30 integer digits); * (38,10) -\u003e BIGNUMERIC (NUMERIC cannot hold 10 fractional digits); * (76,38) -\u003e BIGNUMERIC; * (77,38) -\u003e BIGNUMERIC (error if value exeeds supported range). This field cannot contain duplicate types. The order of the types in this field is ignored. For example, [\"BIGNUMERIC\", \"NUMERIC\"] is the same as [\"NUMERIC\", \"BIGNUMERIC\"] and NUMERIC always takes precedence over BIGNUMERIC. Defaults to [\"NUMERIC\", \"STRING\"] for ORC and [\"NUMERIC\"] for the other file formats.", + "description": "Defines the list of possible SQL data types to which the source decimal values are converted. This list and the precision and the scale parameters of the decimal field determine the target type. In the order of NUMERIC, BIGNUMERIC, and STRING, a type is picked if it is in the specified list and if it supports the precision and the scale. STRING supports all precision and scale values. If none of the listed types supports the precision and the scale, the type supporting the widest range in the specified list is picked, and if a value exceeds the supported range when reading the data, an error will be thrown. Example: Suppose the value of this field is [\"NUMERIC\", \"BIGNUMERIC\"]. If (precision,scale) is: * (38,9) -\u003e NUMERIC; * (39,9) -\u003e BIGNUMERIC (NUMERIC cannot hold 30 integer digits); * (38,10) -\u003e BIGNUMERIC (NUMERIC cannot hold 10 fractional digits); * (76,38) -\u003e BIGNUMERIC; * (77,38) -\u003e BIGNUMERIC (error if value exceeds supported range). This field cannot contain duplicate types. The order of the types in this field is ignored. For example, [\"BIGNUMERIC\", \"NUMERIC\"] is the same as [\"NUMERIC\", \"BIGNUMERIC\"] and NUMERIC always takes precedence over BIGNUMERIC. Defaults to [\"NUMERIC\", \"STRING\"] for ORC and [\"NUMERIC\"] for the other file formats.", "items": { "enum": [ "DECIMAL_TARGET_TYPE_UNSPECIFIED", @@ -5426,7 +5454,7 @@ "GEOJSON" ], "enumDescriptions": [ - "The default if provided value is not one included in the enum, or the value is not specified. The source formate is parsed without any modification.", + "The default if provided value is not one included in the enum, or the value is not specified. The source format is parsed without any modification.", "Use GeoJSON variant of JSON. See https://tools.ietf.org/html/rfc7946." ], "type": "string" @@ -5504,10 +5532,22 @@ }, "type": "array" }, + "timeFormat": { + "description": "Optional. Date format used for parsing TIME values.", + "type": "string" + }, "timePartitioning": { "$ref": "TimePartitioning", "description": "Time-based partitioning specification for the destination table. Only one of timePartitioning and rangePartitioning should be specified." }, + "timeZone": { + "description": "Optional. [Experimental] Default time zone that will apply when parsing timestamp values that have no specific time zone.", + "type": "string" + }, + "timestampFormat": { + "description": "Optional. Date format used for parsing TIMESTAMP values.", + "type": "string" + }, "useAvroLogicalTypes": { "description": "Optional. If sourceFormat is set to \"AVRO\", indicates whether to interpret logical types as the corresponding BigQuery data type (for example, TIMESTAMP), instead of using the raw type (for example, INTEGER).", "type": "boolean" @@ -6701,7 +6741,7 @@ "type": "object" }, "MetadataCacheStatistics": { - "description": "Statistics for metadata caching in BigLake tables.", + "description": "Statistics for metadata caching in queried tables.", "id": "MetadataCacheStatistics", "properties": { "tableMetadataCacheUsage": { @@ -7453,6 +7493,10 @@ "$ref": "DatasetReference", "description": "Optional. Specifies the default datasetId and projectId to assume for any unqualified table names in the query. If not set, all table names in the query string must be qualified in the format 'datasetId.tableId'." }, + "destinationEncryptionConfiguration": { + "$ref": "EncryptionConfiguration", + "description": "Optional. Custom encryption configuration (e.g., Cloud KMS keys)" + }, "dryRun": { "description": "Optional. If set to true, BigQuery doesn't run the job. Instead, if the query is valid, BigQuery returns statistics about the job such as how many bytes would be processed. If the query is invalid, an error returns. The default value is false.", "type": "boolean" @@ -7475,6 +7519,11 @@ ], "type": "string" }, + "jobTimeoutMs": { + "description": "Optional. Job timeout in milliseconds. If this time limit is exceeded, BigQuery will attempt to stop a longer job, but may not always succeed in canceling it before the job completes. For example, a job that takes more than 60 seconds to complete has a better chance of being stopped than a job that takes 10 seconds to complete. This timeout applies to the query even if a job does not need to be created.", + "format": "int64", + "type": "string" + }, "kind": { "default": "bigquery#queryRequest", "description": "The resource type of the request.", @@ -9470,7 +9519,7 @@ "properties": { "privacyPolicy": { "$ref": "PrivacyPolicy", - "description": "Specifices the privacy policy for the view." + "description": "Specifies the privacy policy for the view." }, "useLegacySql": { "description": "True if view is defined in legacy SQL dialect, false if in GoogleSQL.", @@ -10085,7 +10134,7 @@ "Ukraine", "United States", "Venezuela", - "Viet Nam", + "Vietnam", "South Africa" ], "type": "string" @@ -10232,7 +10281,7 @@ "Ukraine", "United States", "Venezuela", - "Viet Nam", + "Vietnam", "South Africa" ], "type": "string" @@ -10278,7 +10327,7 @@ "Recall is the fraction of actual positive labels that were given a positive prediction. For multiclass this is a macro-averaged metric.", "Accuracy is the fraction of predictions given the correct label. For multiclass this is a globally micro-averaged metric.", "The F1 score is an average of recall and precision. For multiclass this is a macro-averaged metric.", - "Logorithmic Loss. For multiclass this is a macro-averaged metric.", + "Logarithmic Loss. For multiclass this is a macro-averaged metric.", "Area Under an ROC Curve. For multiclass this is a macro-averaged metric.", "Davies-Bouldin Index.", "Mean Average Precision.", @@ -10799,7 +10848,7 @@ }, "privacyPolicy": { "$ref": "PrivacyPolicy", - "description": "Optional. Specifices the privacy policy for the view." + "description": "Optional. Specifies the privacy policy for the view." }, "query": { "description": "Required. A query that BigQuery executes when the view is referenced.", diff --git a/vendor/google.golang.org/api/bigquery/v2/bigquery-gen.go b/vendor/google.golang.org/api/bigquery/v2/bigquery-gen.go index 7ab4ac8d..5888dd0a 100644 --- a/vendor/google.golang.org/api/bigquery/v2/bigquery-gen.go +++ b/vendor/google.golang.org/api/bigquery/v2/bigquery-gen.go @@ -312,7 +312,7 @@ type AggregateClassificationMetrics struct { RocAuc float64 `json:"rocAuc,omitempty"` // Threshold: Threshold at which the metrics are computed. For binary // classification models this is the positive class threshold. For multi-class - // classfication models this is the confidence threshold. + // classification models this is the confidence threshold. Threshold float64 `json:"threshold,omitempty"` // ForceSendFields is a list of field names (e.g. "Accuracy") to // unconditionally include in API requests. By default, fields with empty or @@ -3184,6 +3184,12 @@ type ExternalDataConfiguration struct { // CsvOptions: Optional. Additional properties to set if sourceFormat is set to // CSV. CsvOptions *CsvOptions `json:"csvOptions,omitempty"` + // DateFormat: Optional. Format used to parse DATE values. Supports C-style and + // SQL-style values. + DateFormat string `json:"dateFormat,omitempty"` + // DatetimeFormat: Optional. Format used to parse DATETIME values. Supports + // C-style and SQL-style values. + DatetimeFormat string `json:"datetimeFormat,omitempty"` // DecimalTargetTypes: Defines the list of possible SQL data types to which the // source decimal values are converted. This list and the precision and the // scale parameters of the decimal field determine the target type. In the @@ -3196,7 +3202,7 @@ type ExternalDataConfiguration struct { // of this field is ["NUMERIC", "BIGNUMERIC"]. If (precision,scale) is: * // (38,9) -> NUMERIC; * (39,9) -> BIGNUMERIC (NUMERIC cannot hold 30 integer // digits); * (38,10) -> BIGNUMERIC (NUMERIC cannot hold 10 fractional digits); - // * (76,38) -> BIGNUMERIC; * (77,38) -> BIGNUMERIC (error if value exeeds + // * (76,38) -> BIGNUMERIC; * (77,38) -> BIGNUMERIC (error if value exceeds // supported range). This field cannot contain duplicate types. The order of // the types in this field is ignored. For example, ["BIGNUMERIC", "NUMERIC"] // is the same as ["NUMERIC", "BIGNUMERIC"] and NUMERIC always takes precedence @@ -3248,7 +3254,7 @@ type ExternalDataConfiguration struct { // // Possible values: // "JSON_EXTENSION_UNSPECIFIED" - The default if provided value is not one - // included in the enum, or the value is not specified. The source formate is + // included in the enum, or the value is not specified. The source format is // parsed without any modification. // "GEOJSON" - Use GeoJSON variant of JSON. See // https://tools.ietf.org/html/rfc7946. @@ -3312,6 +3318,16 @@ type ExternalDataConfiguration struct { // Cloud Datastore backups, exactly one URI can be specified. Also, the '*' // wildcard character is not allowed. SourceUris []string `json:"sourceUris,omitempty"` + // TimeFormat: Optional. Format used to parse TIME values. Supports C-style and + // SQL-style values. + TimeFormat string `json:"timeFormat,omitempty"` + // TimeZone: Optional. Time zone used when parsing timestamp values that do not + // have specific time zone information (e.g. 2024-04-20 12:34:56). The expected + // format is a IANA timezone string (e.g. America/Los_Angeles). + TimeZone string `json:"timeZone,omitempty"` + // TimestampFormat: Optional. Format used to parse TIMESTAMP values. Supports + // C-style and SQL-style values. + TimestampFormat string `json:"timestampFormat,omitempty"` // ForceSendFields is a list of field names (e.g. "Autodetect") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See @@ -4466,6 +4482,10 @@ type JobConfigurationLoad struct { // location will be set to `Job.JobReference.location` if it is present, // otherwise it's set to the default location based on existing routing logic. CreateSession bool `json:"createSession,omitempty"` + // DateFormat: Optional. Date format used for parsing DATE values. + DateFormat string `json:"dateFormat,omitempty"` + // DatetimeFormat: Optional. Date format used for parsing DATETIME values. + DatetimeFormat string `json:"datetimeFormat,omitempty"` // DecimalTargetTypes: Defines the list of possible SQL data types to which the // source decimal values are converted. This list and the precision and the // scale parameters of the decimal field determine the target type. In the @@ -4478,7 +4498,7 @@ type JobConfigurationLoad struct { // of this field is ["NUMERIC", "BIGNUMERIC"]. If (precision,scale) is: * // (38,9) -> NUMERIC; * (39,9) -> BIGNUMERIC (NUMERIC cannot hold 30 integer // digits); * (38,10) -> BIGNUMERIC (NUMERIC cannot hold 10 fractional digits); - // * (76,38) -> BIGNUMERIC; * (77,38) -> BIGNUMERIC (error if value exeeds + // * (76,38) -> BIGNUMERIC; * (77,38) -> BIGNUMERIC (error if value exceeds // supported range). This field cannot contain duplicate types. The order of // the types in this field is ignored. For example, ["BIGNUMERIC", "NUMERIC"] // is the same as ["NUMERIC", "BIGNUMERIC"] and NUMERIC always takes precedence @@ -4557,7 +4577,7 @@ type JobConfigurationLoad struct { // // Possible values: // "JSON_EXTENSION_UNSPECIFIED" - The default if provided value is not one - // included in the enum, or the value is not specified. The source formate is + // included in the enum, or the value is not specified. The source format is // parsed without any modification. // "GEOJSON" - Use GeoJSON variant of JSON. See // https://tools.ietf.org/html/rfc7946. @@ -4661,10 +4681,17 @@ type JobConfigurationLoad struct { // Cloud Datastore backups: Exactly one URI can be specified. Also, the '*' // wildcard character is not allowed. SourceUris []string `json:"sourceUris,omitempty"` + // TimeFormat: Optional. Date format used for parsing TIME values. + TimeFormat string `json:"timeFormat,omitempty"` // TimePartitioning: Time-based partitioning specification for the destination // table. Only one of timePartitioning and rangePartitioning should be // specified. TimePartitioning *TimePartitioning `json:"timePartitioning,omitempty"` + // TimeZone: Optional. [Experimental] Default time zone that will apply when + // parsing timestamp values that have no specific time zone. + TimeZone string `json:"timeZone,omitempty"` + // TimestampFormat: Optional. Date format used for parsing TIMESTAMP values. + TimestampFormat string `json:"timestampFormat,omitempty"` // UseAvroLogicalTypes: Optional. If sourceFormat is set to "AVRO", indicates // whether to interpret logical types as the corresponding BigQuery data type // (for example, TIMESTAMP), instead of using the raw type (for example, @@ -6029,7 +6056,7 @@ func (s MaterializedViewStatus) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) } -// MetadataCacheStatistics: Statistics for metadata caching in BigLake tables. +// MetadataCacheStatistics: Statistics for metadata caching in queried tables. type MetadataCacheStatistics struct { // TableMetadataCacheUsage: Set for the Metadata caching eligible tables // referenced in the query. @@ -6937,6 +6964,9 @@ type QueryRequest struct { // names in the query string must be qualified in the format // 'datasetId.tableId'. DefaultDataset *DatasetReference `json:"defaultDataset,omitempty"` + // DestinationEncryptionConfiguration: Optional. Custom encryption + // configuration (e.g., Cloud KMS keys) + DestinationEncryptionConfiguration *EncryptionConfiguration `json:"destinationEncryptionConfiguration,omitempty"` // DryRun: Optional. If set to true, BigQuery doesn't run the job. Instead, if // the query is valid, BigQuery returns statistics about the job such as how // many bytes would be processed. If the query is invalid, an error returns. @@ -6958,6 +6988,13 @@ type QueryRequest struct { // a Job are subject to change. If Job creation is required, // JOB_CREATION_REQUIRED mode should be used, which is the default. JobCreationMode string `json:"jobCreationMode,omitempty"` + // JobTimeoutMs: Optional. Job timeout in milliseconds. If this time limit is + // exceeded, BigQuery will attempt to stop a longer job, but may not always + // succeed in canceling it before the job completes. For example, a job that + // takes more than 60 seconds to complete has a better chance of being stopped + // than a job that takes 10 seconds to complete. This timeout applies to the + // query even if a job does not need to be created. + JobTimeoutMs int64 `json:"jobTimeoutMs,omitempty,string"` // Kind: The resource type of the request. Kind string `json:"kind,omitempty"` // Labels: Optional. The labels associated with this query. Labels can be used @@ -9403,7 +9440,7 @@ func (s TableListTables) MarshalJSON() ([]byte, error) { // TableListTablesView: Information about a logical view. type TableListTablesView struct { - // PrivacyPolicy: Specifices the privacy policy for the view. + // PrivacyPolicy: Specifies the privacy policy for the view. PrivacyPolicy *PrivacyPolicy `json:"privacyPolicy,omitempty"` // UseLegacySql: True if view is defined in legacy SQL dialect, false if in // GoogleSQL. @@ -9912,7 +9949,7 @@ type TrainingOptions struct { // "UA" - Ukraine // "US" - United States // "VE" - Venezuela - // "VN" - Viet Nam + // "VN" - Vietnam // "ZA" - South Africa HolidayRegion string `json:"holidayRegion,omitempty"` // HolidayRegions: A list of geographical regions that are used for time series @@ -9987,7 +10024,7 @@ type TrainingOptions struct { // "UA" - Ukraine // "US" - United States // "VE" - Venezuela - // "VN" - Viet Nam + // "VN" - Vietnam // "ZA" - South Africa HolidayRegions []string `json:"holidayRegions,omitempty"` // Horizon: The number of periods ahead that need to be forecasted. @@ -10018,7 +10055,7 @@ type TrainingOptions struct { // label. For multiclass this is a globally micro-averaged metric. // "F1_SCORE" - The F1 score is an average of recall and precision. For // multiclass this is a macro-averaged metric. - // "LOG_LOSS" - Logorithmic Loss. For multiclass this is a macro-averaged + // "LOG_LOSS" - Logarithmic Loss. For multiclass this is a macro-averaged // metric. // "ROC_AUC" - Area Under an ROC Curve. For multiclass this is a // macro-averaged metric. @@ -10508,7 +10545,7 @@ func (s VectorSearchStatistics) MarshalJSON() ([]byte, error) { type ViewDefinition struct { // ForeignDefinitions: Optional. Foreign view representations. ForeignDefinitions []*ForeignViewDefinition `json:"foreignDefinitions,omitempty"` - // PrivacyPolicy: Optional. Specifices the privacy policy for the view. + // PrivacyPolicy: Optional. Specifies the privacy policy for the view. PrivacyPolicy *PrivacyPolicy `json:"privacyPolicy,omitempty"` // Query: Required. A query that BigQuery executes when the view is referenced. Query string `json:"query,omitempty"` @@ -10932,7 +10969,7 @@ func (c *DatasetsListCall) All(all bool) *DatasetsListCall { // Filter sets the optional parameter "filter": An expression for filtering the // results of the request by label. The syntax is `labels.[:]`. Multiple -// filters can be ANDed together by connecting with a space. Example: +// filters can be AND-ed together by connecting with a space. Example: // `labels.department:receiving labels.active`. See Filtering datasets using // labels // (https://cloud.google.com/bigquery/docs/filtering-labels#filtering_datasets_using_labels) diff --git a/vendor/google.golang.org/api/internal/version.go b/vendor/google.golang.org/api/internal/version.go index 15aac6a2..159afb08 100644 --- a/vendor/google.golang.org/api/internal/version.go +++ b/vendor/google.golang.org/api/internal/version.go @@ -5,4 +5,4 @@ package internal // Version is the current tagged release of the library. -const Version = "0.222.0" +const Version = "0.223.0" diff --git a/vendor/google.golang.org/api/transport/grpc/dial.go b/vendor/google.golang.org/api/transport/grpc/dial.go index a354d223..a6630a0e 100644 --- a/vendor/google.golang.org/api/transport/grpc/dial.go +++ b/vendor/google.golang.org/api/transport/grpc/dial.go @@ -242,6 +242,7 @@ func dialPoolNewAuth(ctx context.Context, secure bool, poolSize int, ds *interna EnableDirectPath: ds.EnableDirectPath, EnableDirectPathXds: ds.EnableDirectPathXds, EnableJWTWithScope: ds.EnableJwtWithScope, + AllowHardBoundTokens: ds.AllowHardBoundTokens, DefaultAudience: ds.DefaultAudience, DefaultEndpointTemplate: defaultEndpointTemplate, DefaultMTLSEndpoint: ds.DefaultMTLSEndpoint, diff --git a/vendor/modules.txt b/vendor/modules.txt index 1d50e181..c8e2f6a3 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -8,8 +8,8 @@ cloud.google.com/go/internal/optional cloud.google.com/go/internal/trace cloud.google.com/go/internal/uid cloud.google.com/go/internal/version -# cloud.google.com/go/auth v0.14.1 -## explicit; go 1.22.7 +# cloud.google.com/go/auth v0.15.0 +## explicit; go 1.23.0 cloud.google.com/go/auth cloud.google.com/go/auth/credentials cloud.google.com/go/auth/credentials/internal/externalaccount @@ -230,11 +230,11 @@ github.com/zeebo/xxh3 ## explicit; go 1.22.0 go.opentelemetry.io/auto/sdk go.opentelemetry.io/auto/sdk/internal/telemetry -# go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0 -## explicit; go 1.22.7 +# go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 +## explicit; go 1.22.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal -# go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 +# go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 ## explicit; go 1.22.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request @@ -351,7 +351,7 @@ golang.org/x/tools/internal/versions ## explicit; go 1.18 golang.org/x/xerrors golang.org/x/xerrors/internal -# google.golang.org/api v0.222.0 +# google.golang.org/api v0.223.0 ## explicit; go 1.23.0 google.golang.org/api/bigquery/v2 google.golang.org/api/googleapi @@ -376,8 +376,8 @@ google.golang.org/genproto/protobuf/field_mask google.golang.org/genproto/googleapis/api google.golang.org/genproto/googleapis/api/annotations google.golang.org/genproto/googleapis/api/httpbody -# google.golang.org/genproto/googleapis/rpc v0.0.0-20250212204824-5a70512c5d8b -## explicit; go 1.22 +# google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 +## explicit; go 1.23.0 google.golang.org/genproto/googleapis/rpc/code google.golang.org/genproto/googleapis/rpc/errdetails google.golang.org/genproto/googleapis/rpc/status