From c19d6bc0eef3a07af9ebac37ba7314b1f3caac23 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Apr 2026 02:08:52 +0000 Subject: [PATCH] :seedling: Bump github.com/operator-framework/operator-registry Bumps [github.com/operator-framework/operator-registry](https://github.com/operator-framework/operator-registry) from 1.65.0 to 1.66.0. - [Release notes](https://github.com/operator-framework/operator-registry/releases) - [Commits](https://github.com/operator-framework/operator-registry/compare/v1.65.0...v1.66.0) --- updated-dependencies: - dependency-name: github.com/operator-framework/operator-registry dependency-version: 1.66.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 30 +- go.sum | 120 +- .../containerd/containerd/archive/tar_unix.go | 2 +- .../containerd/containerd/version/version.go | 2 +- vendor/github.com/docker/cli/AUTHORS | 17 +- .../docker/cli/cli/config/configfile/file.go | 2 +- .../cli/cli/config/credentials/file_store.go | 11 +- .../cli/cli/config/memorystore/store.go | 2 +- .../grpc-gateway/v2/runtime/handler.go | 4 +- .../grpc-gateway/v2/runtime/mux.go | 11 + .../github.com/klauspost/compress/README.md | 23 +- .../klauspost/compress/zstd/decoder.go | 28 +- .../compress/zstd/decoder_options.go | 60 +- .../klauspost/compress/zstd/encoder.go | 16 + .../compress/zstd/encoder_options.go | 44 +- vendor/github.com/mattn/go-sqlite3/sqlite3.go | 587 +++-- .../mattn/go-sqlite3/sqlite3_opt_vtable.go | 16 +- .../{sqlite3_go18.go => sqlite3_sql.go} | 7 +- .../prometheus/procfs/.golangci.yml | 8 + .../prometheus/procfs/Makefile.common | 247 +- .../github.com/prometheus/procfs/cpuinfo.go | 3 +- .../prometheus/procfs/cpuinfo_armx.go | 2 - .../prometheus/procfs/cpuinfo_loong64.go | 1 - .../prometheus/procfs/cpuinfo_mipsx.go | 2 - .../prometheus/procfs/cpuinfo_others.go | 1 - .../prometheus/procfs/cpuinfo_ppcx.go | 2 - .../prometheus/procfs/cpuinfo_riscvx.go | 2 - .../prometheus/procfs/cpuinfo_s390x.go | 1 - .../prometheus/procfs/cpuinfo_x86.go | 2 - .../prometheus/procfs/fs_statfs_notype.go | 1 - .../prometheus/procfs/fs_statfs_type.go | 1 - .../procfs/internal/util/sysreadfile.go | 2 - .../internal/util/sysreadfile_compat.go | 1 - .../prometheus/procfs/kernel_hung.go | 1 - .../prometheus/procfs/kernel_random.go | 1 - .../github.com/prometheus/procfs/net_tcp.go | 4 + .../prometheus/procfs/proc_interrupts.go | 2 +- .../github.com/prometheus/procfs/proc_maps.go | 2 - .../prometheus/procfs/proc_smaps.go | 1 - .../prometheus/procfs/proc_statm.go | 1 + .../prometheus/procfs/proc_status.go | 43 + vendor/github.com/prometheus/procfs/vm.go | 1 - .../github.com/prometheus/procfs/zoneinfo.go | 1 - .../net/http/otelhttp/config.go | 3 + .../net/http/otelhttp/handler.go | 26 +- .../internal/request/resp_writer_wrapper.go | 9 +- .../http/otelhttp/internal/semconv/client.go | 50 +- .../http/otelhttp/internal/semconv/server.go | 29 +- .../http/otelhttp/internal/semconv/util.go | 8 +- .../net/http/otelhttp/transport.go | 90 +- .../net/http/otelhttp/version.go | 2 +- .../otlp/otlptrace/otlptracegrpc/client.go | 4 +- .../internal/observ/instrumentation.go | 36 +- .../otlptracegrpc/internal/version.go | 2 +- .../otel/exporters/otlp/otlptrace/version.go | 2 +- .../otel/semconv/v1.39.0/otelconv/metric.go | 2222 ----------------- .../{v1.39.0 => v1.40.0}/httpconv/metric.go | 20 +- vendor/modules.txt | 47 +- 58 files changed, 1163 insertions(+), 2702 deletions(-) rename vendor/github.com/mattn/go-sqlite3/{sqlite3_go18.go => sqlite3_sql.go} (97%) delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.39.0/otelconv/metric.go rename vendor/go.opentelemetry.io/otel/semconv/{v1.39.0 => v1.40.0}/httpconv/metric.go (99%) diff --git a/go.mod b/go.mod index b0ada195bb..b2a2fccdb7 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( github.com/openshift/client-go v0.0.0-20260108185524-48f4ccfc4e13 github.com/openshift/library-go v0.0.0-20260204111611-b7d4fa0e292a github.com/operator-framework/api v0.42.0 - github.com/operator-framework/operator-registry v1.65.0 + github.com/operator-framework/operator-registry v1.66.0 github.com/otiai10/copy v1.14.1 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.23.2 @@ -67,7 +67,7 @@ require ( github.com/cenkalti/backoff/v5 v5.0.3 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/containerd/cgroups/v3 v3.1.2 // indirect - github.com/containerd/containerd v1.7.30 // indirect + github.com/containerd/containerd v1.7.31 // indirect github.com/containerd/containerd/api v1.10.0 // indirect github.com/containerd/continuity v0.4.5 // indirect github.com/containerd/errdefs v1.0.0 // indirect @@ -80,7 +80,7 @@ require ( github.com/containers/ocicrypt v1.2.1 // indirect github.com/coreos/go-systemd/v22 v22.7.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/docker/cli v29.3.1+incompatible // indirect + github.com/docker/cli v29.4.1+incompatible // indirect github.com/docker/distribution v2.8.3+incompatible // indirect github.com/docker/docker v28.5.2+incompatible // indirect github.com/docker/docker-credential-helpers v0.9.5 // indirect @@ -120,17 +120,17 @@ require ( github.com/google/uuid v1.6.0 // indirect github.com/gorilla/mux v1.8.1 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.7 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 // indirect github.com/h2non/filetype v1.1.3 // indirect github.com/h2non/go-is-svg v0.0.0-20160927212452-35e8c4b0612c // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/itchyny/timefmt-go v0.1.8 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.18.3 // indirect + github.com/klauspost/compress v1.18.4 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-sqlite3 v1.14.37 // indirect + github.com/mattn/go-sqlite3 v1.14.42 // indirect github.com/moby/locker v1.0.1 // indirect github.com/moby/sys/capability v0.4.0 // indirect github.com/moby/sys/mountinfo v0.7.2 // indirect @@ -145,7 +145,7 @@ require ( github.com/opencontainers/runtime-spec v1.3.0 // indirect github.com/otiai10/mint v1.6.3 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/procfs v0.19.2 // indirect + github.com/prometheus/procfs v0.20.1 // indirect github.com/x448/float16 v0.8.4 // indirect go.etcd.io/bbolt v1.4.3 // indirect go.etcd.io/etcd/api/v3 v3.6.7 // indirect @@ -154,15 +154,15 @@ require ( go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.65.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.65.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.67.0 // indirect go.opentelemetry.io/otel v1.43.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.40.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.40.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.42.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.42.0 // indirect go.opentelemetry.io/otel/metric v1.43.0 // indirect go.opentelemetry.io/otel/sdk v1.43.0 // indirect go.opentelemetry.io/otel/trace v1.43.0 // indirect go.opentelemetry.io/proto/otlp v1.9.0 // indirect - go.podman.io/common v0.67.0 // indirect + go.podman.io/common v0.67.1 // indirect go.podman.io/storage v1.62.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.1 // indirect @@ -170,16 +170,16 @@ require ( go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/crypto v0.50.0 // indirect golang.org/x/exp v0.0.0-20260112195511-716be5621a96 // indirect - golang.org/x/mod v0.34.0 // indirect - golang.org/x/oauth2 v0.34.0 // indirect + golang.org/x/mod v0.35.0 // indirect + golang.org/x/oauth2 v0.35.0 // indirect golang.org/x/sys v0.43.0 // indirect golang.org/x/term v0.42.0 // indirect golang.org/x/text v0.36.0 // indirect golang.org/x/tools v0.43.0 // indirect gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect google.golang.org/genproto v0.0.0-20260203192932-546029d2fa20 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260203192932-546029d2fa20 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260203192932-546029d2fa20 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260226221140-a57be14db171 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260226221140-a57be14db171 // indirect google.golang.org/protobuf v1.36.11 // indirect gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect diff --git a/go.sum b/go.sum index b07d465aa3..655f4f4460 100644 --- a/go.sum +++ b/go.sum @@ -39,8 +39,8 @@ github.com/clipperhouse/uax29/v2 v2.5.0/go.mod h1:Wn1g7MK6OoeDT0vL+Q0SQLDz/KpfsV github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/containerd/cgroups/v3 v3.1.2 h1:OSosXMtkhI6Qove637tg1XgK4q+DhR0mX8Wi8EhrHa4= github.com/containerd/cgroups/v3 v3.1.2/go.mod h1:PKZ2AcWmSBsY/tJUVhtS/rluX0b1uq1GmPO1ElCmbOw= -github.com/containerd/containerd v1.7.30 h1:/2vezDpLDVGGmkUXmlNPLCCNKHJ5BbC5tJB5JNzQhqE= -github.com/containerd/containerd v1.7.30/go.mod h1:fek494vwJClULlTpExsmOyKCMUAbuVjlFsJQc4/j44M= +github.com/containerd/containerd v1.7.31 h1:jn3IMuTV4Bb1Uwb0MFPW2ASJAD3W1lh6QqqZHIZwDh4= +github.com/containerd/containerd v1.7.31/go.mod h1:jdwD6s/BhV4XVJGrvtziNPVA+83n66TwptVaPKprq4E= github.com/containerd/containerd/api v1.10.0 h1:5n0oHYVBwN4VhoX9fFykCV9dF1/BvAXeg2F8W6UYq1o= github.com/containerd/containerd/api v1.10.0/go.mod h1:NBm1OAk8ZL+LG8R0ceObGxT5hbUYj7CzTmR3xh0DlMM= github.com/containerd/continuity v0.4.5 h1:ZRoN1sXq9u7V6QoHMcVWGhOwDFqZ4B9i5H6un1Wh0x4= @@ -74,12 +74,12 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/distribution/distribution/v3 v3.0.0 h1:q4R8wemdRQDClzoNNStftB2ZAfqOiN6UX90KJc4HjyM= -github.com/distribution/distribution/v3 v3.0.0/go.mod h1:tRNuFoZsUdyRVegq8xGNeds4KLjwLCRin/tTo6i1DhU= +github.com/distribution/distribution/v3 v3.1.0 h1:u1v788HreKTLGdNY6s7px8Exgrs9mZ9UrCDjSrpCM8g= +github.com/distribution/distribution/v3 v3.1.0/go.mod h1:73BuF5/ziMHNVt7nnL1roYpH4Eg/FgUlKZm3WryIx/o= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/cli v29.3.1+incompatible h1:M04FDj2TRehDacrosh7Vlkgc7AuQoWloQkf1PA5hmoI= -github.com/docker/cli v29.3.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v29.4.1+incompatible h1:02RT8QqqwtGRn+6SYypv8IUEbD/ltY6sfKCJIoUcGzk= +github.com/docker/cli v29.4.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v28.5.2+incompatible h1:DBX0Y0zAjZbSrm1uzOkdr1onVghKaftjlSWt4AFexzM= @@ -130,8 +130,8 @@ github.com/go-git/go-billy/v5 v5.7.0 h1:83lBUJhGWhYp0ngzCMSgllhUSuoHP1iEWYjsPl9n github.com/go-git/go-billy/v5 v5.7.0/go.mod h1:/1IUejTKH8xipsAcdfcSAlUlo2J7lkYV8GTKxAT/L3E= github.com/go-git/go-git/v5 v5.16.4 h1:7ajIEZHZJULcyJebDLo99bGgS0jRrOxzZG4uCk2Yb2Y= github.com/go-git/go-git/v5 v5.16.4/go.mod h1:4Ge4alE/5gPs30F2H1esi2gPd69R0C39lolkucHBOp8= -github.com/go-jose/go-jose/v4 v4.1.3 h1:CVLmWDhDVRa6Mi/IgCgaopNosCaHz7zrMeF9MlZRkrs= -github.com/go-jose/go-jose/v4 v4.1.3/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08= +github.com/go-jose/go-jose/v4 v4.1.4 h1:moDMcTHmvE6Groj34emNPLs/qtYXRVcd6S7NHbHz3kA= +github.com/go-jose/go-jose/v4 v4.1.4/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -240,8 +240,8 @@ github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.3 h1:B+8ClL/kCQkRiU82d9xajR github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.3/go.mod h1:NbCUVmiS4foBGBHOYlCT25+YmGpJ32dZPi75pGEUpj4= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.7 h1:X+2YciYSxvMQK0UZ7sg45ZVabVZBeBuvMkmuI2V3Fak= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.7/go.mod h1:lW34nIZuQ8UDPdkon5fmfp2l3+ZkQ2me/+oecHYLOII= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 h1:HWRh5R2+9EifMyIHV7ZV+MIZqgz+PMpZ14Jynv3O2Zs= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0/go.mod h1:JfhWUomR1baixubs02l85lZYYOm7LV6om4ceouMv45c= github.com/h2non/filetype v1.1.3 h1:FKkx9QbD7HR/zjK1Ia5XiBsq9zdLi5Kf3zGyFTAFkGg= github.com/h2non/filetype v1.1.3/go.mod h1:319b3zT68BvV+WRj7cwy856M2ehB3HqNOt6sy1HndBY= github.com/h2non/go-is-svg v0.0.0-20160927212452-35e8c4b0612c h1:fEE5/5VNnYUoBOj2I9TP8Jc+a7lge3QWn9DKE7NCwfc= @@ -269,8 +269,8 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.18.3 h1:9PJRvfbmTabkOX8moIpXPbMMbYN60bWImDDU7L+/6zw= -github.com/klauspost/compress v1.18.3/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4= +github.com/klauspost/compress v1.18.4 h1:RPhnKRAQ4Fh8zU2FY/6ZFDwTVTxgJ/EMydqSTzE9a2c= +github.com/klauspost/compress v1.18.4/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4= github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU= github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -290,8 +290,8 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.19 h1:v++JhqYnZuu5jSKrk9RbgF5v4CGUjqRfBm05byFGLdw= github.com/mattn/go-runewidth v0.0.19/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= -github.com/mattn/go-sqlite3 v1.14.37 h1:3DOZp4cXis1cUIpCfXLtmlGolNLp2VEqhiB/PARNBIg= -github.com/mattn/go-sqlite3 v1.14.37/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= +github.com/mattn/go-sqlite3 v1.14.42 h1:MigqEP4ZmHw3aIdIT7T+9TLa90Z6smwcthx+Azv4Cgo= +github.com/mattn/go-sqlite3 v1.14.42/go.mod h1:pjEuOr8IwzLJP2MfGeTb0A35jauH+C2kbHKBr7yXKVQ= github.com/maxbrunsfeld/counterfeiter/v6 v6.12.2 h1:V23nK2R2B63g2GhygF9zVGpnigmhvoZoH8d0hrZwMGY= github.com/maxbrunsfeld/counterfeiter/v6 v6.12.2/go.mod h1:Mr897yU9FmyKaQDPtRlVKibrjz40XXyOHUfyZBPSyZU= github.com/mfridman/tparse v0.18.0 h1:wh6dzOKaIwkUGyKgOntDW4liXSo37qg5AXbIhkMV3vE= @@ -344,8 +344,8 @@ github.com/openshift/library-go v0.0.0-20260204111611-b7d4fa0e292a h1:YLnZtVfqGU github.com/openshift/library-go v0.0.0-20260204111611-b7d4fa0e292a/go.mod h1:DCRz1EgdayEmr9b6KXKDL+DWBN0rGHu/VYADeHzPoOk= github.com/operator-framework/api v0.42.0 h1:rkc5V3zW8RxZMjePAe12jdL7Co/hwsYo1pLnkkhuR7s= github.com/operator-framework/api v0.42.0/go.mod h1:bMEj+wl/8tGqcGNtxt38cLUYagu9chNsbYzb/5HQaUQ= -github.com/operator-framework/operator-registry v1.65.0 h1:SBNp8qPRWHwMVk4WBBWeQ5pOAq/fBusacIn5zVH03rk= -github.com/operator-framework/operator-registry v1.65.0/go.mod h1:psQG9kYyTR+2RNHgdwTvGjSbebmk9/Lzk3jS3kI36bc= +github.com/operator-framework/operator-registry v1.66.0 h1:qxvT35WHDAU1OMhdwtKTM7js8sH20w+e+PeqWDEGz3E= +github.com/operator-framework/operator-registry v1.66.0/go.mod h1:+zkDD/xCnoc8GEK8I3HYmK0xecg7sSvVK4LvR2PdHB0= github.com/otiai10/copy v1.14.1 h1:5/7E6qsUMBaH5AnQ0sSLzzTg1oTECmcCmT6lvF45Na8= github.com/otiai10/copy v1.14.1/go.mod h1:oQwrEDDOci3IM8dJF0d8+jnbfPDllW6vUjNc3DoZm9I= github.com/otiai10/mint v1.6.3 h1:87qsV/aw1F5as1eH1zS/yqHY85ANKVMgkDrf9rcxbQs= @@ -366,8 +366,8 @@ github.com/prometheus/common v0.67.5 h1:pIgK94WWlQt1WLwAC5j2ynLaBRDiinoAb86HZHTU github.com/prometheus/common v0.67.5/go.mod h1:SjE/0MzDEEAyrdr5Gqc6G+sXI67maCxzaT3A2+HqjUw= github.com/prometheus/otlptranslator v1.0.0 h1:s0LJW/iN9dkIH+EnhiD3BlkkP5QVIUVEoIwkU+A6qos= github.com/prometheus/otlptranslator v1.0.0/go.mod h1:vRYWnXvI6aWGpsdY/mOT/cbeVRBlPWtBNDb7kGR3uKM= -github.com/prometheus/procfs v0.19.2 h1:zUMhqEW66Ex7OXIiDkll3tl9a1ZdilUOd/F6ZXw4Vws= -github.com/prometheus/procfs v0.19.2/go.mod h1:M0aotyiemPhBCM0z5w87kL22CxfcH05ZpYlu+b4J7mw= +github.com/prometheus/procfs v0.20.1 h1:XwbrGOIplXW/AU3YhIhLODXMJYyC1isLFfYCsTEycfc= +github.com/prometheus/procfs v0.20.1/go.mod h1:o9EMBZGRyvDrSPH1RqdxhojkuXstoe4UlK79eF5TGGo= github.com/redis/go-redis/extra/rediscmd/v9 v9.17.3 h1:v9RNP5ynWkruvzscrIoDyyv20c9YeyVn12L9nYnaexw= github.com/redis/go-redis/extra/rediscmd/v9 v9.17.3/go.mod h1:gdthSemCkR3WxTmzV2XxYIxClunkUJZAhL0zPHaB0Ww= github.com/redis/go-redis/extra/redisotel/v9 v9.17.3 h1:bF0e3fV7PL0knd1UHDtMud8wA7CZt3RSWtyTMhpnWd8= @@ -453,54 +453,54 @@ go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= -go.opentelemetry.io/contrib/bridges/prometheus v0.65.0 h1:I/7S/yWobR3QHFLqHsJ8QOndoiFsj1VgHpQiq43KlUI= -go.opentelemetry.io/contrib/bridges/prometheus v0.65.0/go.mod h1:jPF6gn3y1E+nozCAEQj3c6NZ8KY+tvAgSVfvoOJUFac= -go.opentelemetry.io/contrib/exporters/autoexport v0.65.0 h1:2gApdml7SznX9szEKFjKjM4qGcGSvAybYLBY319XG3g= -go.opentelemetry.io/contrib/exporters/autoexport v0.65.0/go.mod h1:0QqAGlbHXhmPYACG3n5hNzO5DnEqqtg4VcK5pr22RI0= +go.opentelemetry.io/contrib/bridges/prometheus v0.67.0 h1:dkBzNEAIKADEaFnuESzcXvpd09vxvDZsOjx11gjUqLk= +go.opentelemetry.io/contrib/bridges/prometheus v0.67.0/go.mod h1:Z5RIwRkZgauOIfnG5IpidvLpERjhTninpP1dTG2jTl4= +go.opentelemetry.io/contrib/exporters/autoexport v0.67.0 h1:4fnRcNpc6YFtG3zsFw9achKn3XgmxPxuMuqIL5rE8e8= +go.opentelemetry.io/contrib/exporters/autoexport v0.67.0/go.mod h1:qTvIHMFKoxW7HXg02gm6/Wofhq5p3Ib/A/NNt1EoBSQ= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.65.0 h1:XmiuHzgJt067+a6kwyAzkhXooYVv3/TOw9cM2VfJgUM= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.65.0/go.mod h1:KDgtbWKTQs4bM+VPUr6WlL9m/WXcmkCcBlIzqxPGzmI= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.65.0 h1:7iP2uCb7sGddAr30RRS6xjKy7AZ2JtTOPA3oolgVSw8= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.65.0/go.mod h1:c7hN3ddxs/z6q9xwvfLPk+UHlWRQyaeR1LdgfL/66l0= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.67.0 h1:OyrsyzuttWTSur2qN/Lm0m2a8yqyIjUVBZcxFPuXq2o= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.67.0/go.mod h1:C2NGBr+kAB4bk3xtMXfZ94gqFDtg/GkI7e9zqGh5Beg= go.opentelemetry.io/otel v1.43.0 h1:mYIM03dnh5zfN7HautFE4ieIig9amkNANT+xcVxAj9I= go.opentelemetry.io/otel v1.43.0/go.mod h1:JuG+u74mvjvcm8vj8pI5XiHy1zDeoCS2LB1spIq7Ay0= -go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.16.0 h1:ZVg+kCXxd9LtAaQNKBxAvJ5NpMf7LpvEr4MIZqb0TMQ= -go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.16.0/go.mod h1:hh0tMeZ75CCXrHd9OXRYxTlCAdxcXioWHFIpYw2rZu8= -go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.16.0 h1:djrxvDxAe44mJUrKataUbOhCKhR3F8QCyWucO16hTQs= -go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.16.0/go.mod h1:dt3nxpQEiSoKvfTVxp3TUg5fHPLhKtbcnN3Z1I1ePD0= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.40.0 h1:NOyNnS19BF2SUDApbOKbDtWZ0IK7b8FJ2uAGdIWOGb0= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.40.0/go.mod h1:VL6EgVikRLcJa9ftukrHu/ZkkhFBSo1lzvdBC9CF1ss= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.40.0 h1:9y5sHvAxWzft1WQ4BwqcvA+IFVUJ1Ya75mSAUnFEVwE= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.40.0/go.mod h1:eQqT90eR3X5Dbs1g9YSM30RavwLF725Ris5/XSXWvqE= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.40.0 h1:QKdN8ly8zEMrByybbQgv8cWBcdAarwmIPZ6FThrWXJs= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.40.0/go.mod h1:bTdK1nhqF76qiPoCCdyFIV+N/sRHYXYCTQc+3VCi3MI= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.40.0 h1:DvJDOPmSWQHWywQS6lKL+pb8s3gBLOZUtw4N+mavW1I= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.40.0/go.mod h1:EtekO9DEJb4/jRyN4v4Qjc2yA7AtfCBuz2FynRUWTXs= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.40.0 h1:wVZXIWjQSeSmMoxF74LzAnpVQOAFDo3pPji9Y4SOFKc= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.40.0/go.mod h1:khvBS2IggMFNwZK/6lEeHg/W57h/IX6J4URh57fuI40= -go.opentelemetry.io/otel/exporters/prometheus v0.62.0 h1:krvC4JMfIOVdEuNPTtQ0ZjCiXrybhv+uOHMfHRmnvVo= -go.opentelemetry.io/otel/exporters/prometheus v0.62.0/go.mod h1:fgOE6FM/swEnsVQCqCnbOfRV4tOnWPg7bVeo4izBuhQ= -go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.16.0 h1:ivlbaajBWJqhcCPniDqDJmRwj4lc6sRT+dCAVKNmxlQ= -go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.16.0/go.mod h1:u/G56dEKDDwXNCVLsbSrllB2o8pbtFLUC4HpR66r2dc= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.40.0 h1:ZrPRak/kS4xI3AVXy8F7pipuDXmDsrO8Lg+yQjBLjw0= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.40.0/go.mod h1:3y6kQCWztq6hyW8Z9YxQDDm0Je9AJoFar2G0yDcmhRk= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.40.0 h1:MzfofMZN8ulNqobCmCAVbqVL5syHw+eB2qPRkCMA/fQ= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.40.0/go.mod h1:E73G9UFtKRXrxhBsHtG00TB5WxX57lpsQzogDkqBTz8= -go.opentelemetry.io/otel/log v0.16.0 h1:DeuBPqCi6pQwtCK0pO4fvMB5eBq6sNxEnuTs88pjsN4= -go.opentelemetry.io/otel/log v0.16.0/go.mod h1:rWsmqNVTLIA8UnwYVOItjyEZDbKIkMxdQunsIhpUMes= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.18.0 h1:deI9UQMoGFgrg5iLPgzueqFPHevDl+28YKfSpPTI6rY= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.18.0/go.mod h1:PFx9NgpNUKXdf7J4Q3agRxMs3Y07QhTCVipKmLsMKnU= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.18.0 h1:icqq3Z34UrEFk2u+HMhTtRsvo7Ues+eiJVjaJt62njs= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.18.0/go.mod h1:W2m8P+d5Wn5kipj4/xmbt9uMqezEKfBjzVJadfABSBE= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.42.0 h1:MdKucPl/HbzckWWEisiNqMPhRrAOQX8r4jTuGr636gk= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.42.0/go.mod h1:RolT8tWtfHcjajEH5wFIZ4Dgh5jpPdFXYV9pTAk/qjc= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.42.0 h1:H7O6RlGOMTizyl3R08Kn5pdM06bnH8oscSj7o11tmLA= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.42.0/go.mod h1:mBFWu/WOVDkWWsR7Tx7h6EpQB8wsv7P0Yrh0Pb7othc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.42.0 h1:THuZiwpQZuHPul65w4WcwEnkX2QIuMT+UFoOrygtoJw= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.42.0/go.mod h1:J2pvYM5NGHofZ2/Ru6zw/TNWnEQp5crgyDeSrYpXkAw= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.42.0 h1:zWWrB1U6nqhS/k6zYB74CjRpuiitRtLLi68VcgmOEto= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.42.0/go.mod h1:2qXPNBX1OVRC0IwOnfo1ljoid+RD0QK3443EaqVlsOU= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.42.0 h1:uLXP+3mghfMf7XmV4PkGfFhFKuNWoCvvx5wP/wOXo0o= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.42.0/go.mod h1:v0Tj04armyT59mnURNUJf7RCKcKzq+lgJs6QSjHjaTc= +go.opentelemetry.io/otel/exporters/prometheus v0.64.0 h1:g0LRDXMX/G1SEZtK8zl8Chm4K6GBwRkjPKE36LxiTYs= +go.opentelemetry.io/otel/exporters/prometheus v0.64.0/go.mod h1:UrgcjnarfdlBDP3GjDIJWe6HTprwSazNjwsI+Ru6hro= +go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.18.0 h1:KJVjPD3rcPb98rIs3HznyJlrfx9ge5oJvxxlGR+P/7s= +go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.18.0/go.mod h1:K3kRa2ckmHWQaTWQdPRHc7qGXASuVuoEQXzrvlA98Ws= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.42.0 h1:lSZHgNHfbmQTPfuTmWVkEu8J8qXaQwuV30pjCcAUvP8= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.42.0/go.mod h1:so9ounLcuoRDu033MW/E0AD4hhUjVqswrMF5FoZlBcw= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.42.0 h1:s/1iRkCKDfhlh1JF26knRneorus8aOwVIDhvYx9WoDw= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.42.0/go.mod h1:UI3wi0FXg1Pofb8ZBiBLhtMzgoTm1TYkMvn71fAqDzs= +go.opentelemetry.io/otel/log v0.18.0 h1:XgeQIIBjZZrliksMEbcwMZefoOSMI1hdjiLEiiB0bAg= +go.opentelemetry.io/otel/log v0.18.0/go.mod h1:KEV1kad0NofR3ycsiDH4Yjcoj0+8206I6Ox2QYFSNgI= go.opentelemetry.io/otel/metric v1.43.0 h1:d7638QeInOnuwOONPp4JAOGfbCEpYb+K6DVWvdxGzgM= go.opentelemetry.io/otel/metric v1.43.0/go.mod h1:RDnPtIxvqlgO8GRW18W6Z/4P462ldprJtfxHxyKd2PY= go.opentelemetry.io/otel/sdk v1.43.0 h1:pi5mE86i5rTeLXqoF/hhiBtUNcrAGHLKQdhg4h4V9Dg= go.opentelemetry.io/otel/sdk v1.43.0/go.mod h1:P+IkVU3iWukmiit/Yf9AWvpyRDlUeBaRg6Y+C58QHzg= -go.opentelemetry.io/otel/sdk/log v0.16.0 h1:e/b4bdlQwC5fnGtG3dlXUrNOnP7c8YLVSpSfEBIkTnI= -go.opentelemetry.io/otel/sdk/log v0.16.0/go.mod h1:JKfP3T6ycy7QEuv3Hj8oKDy7KItrEkus8XJE6EoSzw4= +go.opentelemetry.io/otel/sdk/log v0.18.0 h1:n8OyZr7t7otkeTnPTbDNom6rW16TBYGtvyy2Gk6buQw= +go.opentelemetry.io/otel/sdk/log v0.18.0/go.mod h1:C0+wxkTwKpOCZLrlJ3pewPiiQwpzycPI/u6W0Z9fuYk= go.opentelemetry.io/otel/sdk/metric v1.43.0 h1:S88dyqXjJkuBNLeMcVPRFXpRw2fuwdvfCGLEo89fDkw= go.opentelemetry.io/otel/sdk/metric v1.43.0/go.mod h1:C/RJtwSEJ5hzTiUz5pXF1kILHStzb9zFlIEe85bhj6A= go.opentelemetry.io/otel/trace v1.43.0 h1:BkNrHpup+4k4w+ZZ86CZoHHEkohws8AY+WTX09nk+3A= go.opentelemetry.io/otel/trace v1.43.0/go.mod h1:/QJhyVBUUswCphDVxq+8mld+AvhXZLhe+8WVFxiFff0= go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A= go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4= -go.podman.io/common v0.67.0 h1:6Ci5oU1ek08OAxBLkHEqSyWmjNh5zf03PRqZ04cPdwU= -go.podman.io/common v0.67.0/go.mod h1:sB9L8LMtmf5Hpek2qkEyRrcSzpb+gYpG3vq5Khima3U= +go.podman.io/common v0.67.1 h1:HddYLJfkfFUmFJ0V3PVoewguFM9eHkqk0g+fOc2B9R4= +go.podman.io/common v0.67.1/go.mod h1:XVmSLtnhJwGb+ImYn6BXiozxVE3mYZJgiiBuDOiOquk= go.podman.io/image/v5 v5.39.2 h1:EJua/pRtvgLV/a5y8/RvA+ekKukZh0UuKMvLdTmEWFk= go.podman.io/image/v5 v5.39.2/go.mod h1:SlaR6Pra1ATIx4BcuZ16oafb3QcCHISaKcJbtlN/G/0= go.podman.io/storage v1.62.0 h1:0QjX1XlzVmbiaulb+aR/CG6p9+pzaqwIeZPe3tEjHbY= @@ -530,8 +530,8 @@ golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvx golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI= -golang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY= +golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM= +golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -544,8 +544,8 @@ golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.53.0 h1:d+qAbo5L0orcWAr0a9JweQpjXF19LMXJE8Ey7hwOdUA= golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw= -golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= +golang.org/x/oauth2 v0.35.0 h1:Mv2mzuHuZuY2+bkyWXIHMfhNdJAdwW3FuWeCPYN5GVQ= +golang.org/x/oauth2 v0.35.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -598,10 +598,10 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20260203192932-546029d2fa20 h1:/CU1zrxTpGylJJbe3Ru94yy6sZRbzALq2/oxl3pGB3U= google.golang.org/genproto v0.0.0-20260203192932-546029d2fa20/go.mod h1:Tt+08/KdKEt3l8x3Pby3HLQxMB3uk/MzaQ4ZIv0ORTs= -google.golang.org/genproto/googleapis/api v0.0.0-20260203192932-546029d2fa20 h1:7ei4lp52gK1uSejlA8AZl5AJjeLUOHBQscRQZUgAcu0= -google.golang.org/genproto/googleapis/api v0.0.0-20260203192932-546029d2fa20/go.mod h1:ZdbssH/1SOVnjnDlXzxDHK2MCidiqXtbYccJNzNYPEE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260203192932-546029d2fa20 h1:Jr5R2J6F6qWyzINc+4AM8t5pfUz6beZpHp678GNrMbE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260203192932-546029d2fa20/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ= +google.golang.org/genproto/googleapis/api v0.0.0-20260226221140-a57be14db171 h1:tu/dtnW1o3wfaxCOjSLn5IRX4YDcJrtlpzYkhHhGaC4= +google.golang.org/genproto/googleapis/api v0.0.0-20260226221140-a57be14db171/go.mod h1:M5krXqk4GhBKvB596udGL3UyjL4I1+cTbK0orROM9ng= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260226221140-a57be14db171 h1:ggcbiqK8WWh6l1dnltU4BgWGIGo+EVYxCaAPih/zQXQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260226221140-a57be14db171/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= 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/github.com/containerd/containerd/archive/tar_unix.go b/vendor/github.com/containerd/containerd/archive/tar_unix.go index fa61100609..684ea5783d 100644 --- a/vendor/github.com/containerd/containerd/archive/tar_unix.go +++ b/vendor/github.com/containerd/containerd/archive/tar_unix.go @@ -80,7 +80,7 @@ func openFile(name string, flag int, perm os.FileMode) (*os.File, error) { return nil, err } // Call chmod to avoid permission mask - if err := os.Chmod(name, perm); err != nil { + if err := f.Chmod(perm); err != nil { f.Close() return nil, err } diff --git a/vendor/github.com/containerd/containerd/version/version.go b/vendor/github.com/containerd/containerd/version/version.go index f20a57a35f..6344da5983 100644 --- a/vendor/github.com/containerd/containerd/version/version.go +++ b/vendor/github.com/containerd/containerd/version/version.go @@ -23,7 +23,7 @@ var ( Package = "github.com/containerd/containerd" // Version holds the complete version number. Filled in at linking time. - Version = "1.7.30+unknown" + Version = "1.7.31+unknown" // Revision is filled with the VCS (e.g. git) revision being used to build // the program at linking time. diff --git a/vendor/github.com/docker/cli/AUTHORS b/vendor/github.com/docker/cli/AUTHORS index 57af08b204..accbf6c52b 100644 --- a/vendor/github.com/docker/cli/AUTHORS +++ b/vendor/github.com/docker/cli/AUTHORS @@ -2,6 +2,7 @@ # This file lists all contributors to the repository. # See scripts/docs/generate-authors.sh to make modifications. +4RH1T3CT0R7 A. Lester Buck III Aanand Prasad Aaron L. Xu @@ -42,6 +43,7 @@ Alexander Larsson Alexander Morozov Alexander Ryabov Alexandre González +Alexandre Vallières-Lagacé Alexey Igrychev Alexis Couvreur Alfred Landrum @@ -64,6 +66,7 @@ Andres G. Aragoneses Andres Leon Rangel Andrew France Andrew He +Andrew Hopp Andrew Hsu Andrew Macpherson Andrew McDonnell @@ -127,6 +130,7 @@ Brian Goff Brian Tracy Brian Wieder Bruno Sousa +Bruno Verachten Bryan Bess Bryan Boreham Bryan Murphy @@ -178,6 +182,7 @@ Christopher Svensson Christy Norman Chun Chen Clinton Kitson +Codex Coenraad Loubser Colin Hebert Collin Guarino @@ -234,6 +239,7 @@ David Sheets David Williamson David Xia David Young +Davlat Davydov Deng Guangxing Denis Defreyne Denis Gladkikh @@ -241,6 +247,7 @@ Denis Ollier Dennis Docter dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Derek McGowan +Derek Misler Des Preston Deshi Xiao Dharmit Shah @@ -260,6 +267,7 @@ Dominik Braun Don Kjer Dong Chen DongGeon Lee +Dorin Geman Doug Davis Drew Erny Ed Costello @@ -358,7 +366,7 @@ Hugo Gabriel Eyherabide huqun Huu Nguyen Hyzhou Zhy -Iain MacDonald +Iain MacDonald Iain Samuel McLean Elder Ian Campbell Ian Philpot @@ -471,6 +479,7 @@ Justyn Temme Jyrki Puttonen Jérémie Drouet Jérôme Petazzoni +Jörg Sommer Jörg Thalheim Kai Blin Kai Qiang Wu (Kennan) @@ -539,10 +548,12 @@ Lovekesh Kumar Luca Favatella Luca Marturana Lucas Chan +Ludovic Temgoua Abanda Luis Henrique Mulinari Luka Hartwig Lukas Heeren Lukasz Zajaczkowski +Luo Jiyin Lydell Manganti Lénaïc Huard Ma Shimiao @@ -603,6 +614,7 @@ Michael Spetsiotis Michael Steinert Michael Tews Michael West +Michael Zampani Michal Minář Michał Czeraszkiewicz Miguel Angel Alvarez Cabrerizo @@ -617,6 +629,7 @@ Mike Goelzer Mike MacCana mikelinjie <294893458@qq.com> Mikhail Vasin +Milas Bowman Milind Chawre Mindaugas Rukas Miroslav Gula @@ -887,6 +900,7 @@ Vincent Batts Vincent Bernat Vincent Demeester Vincent Woo +Vineet Kumar Vishnu Kannan Vivek Goyal Wang Jie @@ -916,6 +930,7 @@ Yanqiang Miao Yassine Tijani Yi EungJun Ying Li +Yoan Wainmann Yong Tang Yosef Fertel Yu Peng diff --git a/vendor/github.com/docker/cli/cli/config/configfile/file.go b/vendor/github.com/docker/cli/cli/config/configfile/file.go index 246f23e983..1a0e5b46ca 100644 --- a/vendor/github.com/docker/cli/cli/config/configfile/file.go +++ b/vendor/github.com/docker/cli/cli/config/configfile/file.go @@ -1,5 +1,5 @@ // FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.24 +//go:build go1.25 package configfile diff --git a/vendor/github.com/docker/cli/cli/config/credentials/file_store.go b/vendor/github.com/docker/cli/cli/config/credentials/file_store.go index c69312b014..e3ef8e25ed 100644 --- a/vendor/github.com/docker/cli/cli/config/credentials/file_store.go +++ b/vendor/github.com/docker/cli/cli/config/credentials/file_store.go @@ -99,9 +99,14 @@ func (c *fileStore) Store(authConfig types.AuthConfig) error { return nil } -// ConvertToHostname converts a registry url which has http|https prepended -// to just an hostname. -// Copied from github.com/docker/docker/registry.ConvertToHostname to reduce dependencies. +// ConvertToHostname normalizes a registry URL which has http|https prepended +// to just its hostname. It is used to match credentials, which may be either +// stored as hostname or as hostname including scheme (in legacy configuration +// files). +// +// It's the equivalent to [registry.ConvertToHostname] in the daemon. +// +// [registry.ConvertToHostname]: https://pkg.go.dev/github.com/moby/moby/v2@v2.0.0-beta.7/daemon/pkg/registry#ConvertToHostname func ConvertToHostname(maybeURL string) string { stripped := maybeURL if strings.Contains(stripped, "://") { diff --git a/vendor/github.com/docker/cli/cli/config/memorystore/store.go b/vendor/github.com/docker/cli/cli/config/memorystore/store.go index f8ec62b95a..44523d392b 100644 --- a/vendor/github.com/docker/cli/cli/config/memorystore/store.go +++ b/vendor/github.com/docker/cli/cli/config/memorystore/store.go @@ -1,5 +1,5 @@ // FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: -//go:build go1.24 +//go:build go1.25 package memorystore diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go index 2f0b9e9e0f..4c9083d790 100644 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go +++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/handler.go @@ -28,7 +28,9 @@ func ForwardResponseStream(ctx context.Context, mux *ServeMux, marshaler Marshal } handleForwardResponseServerMetadata(w, mux, md) - w.Header().Set("Transfer-Encoding", "chunked") + if !mux.disableChunkedEncoding { + w.Header().Set("Transfer-Encoding", "chunked") + } if err := handleForwardResponseOptions(ctx, w, nil, opts); err != nil { HTTPError(ctx, mux, marshaler, w, req, err) return diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/mux.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/mux.go index 3eb1616717..4e684c7de6 100644 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/mux.go +++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/mux.go @@ -73,6 +73,7 @@ type ServeMux struct { disablePathLengthFallback bool unescapingMode UnescapingMode writeContentLength bool + disableChunkedEncoding bool } // ServeMuxOption is an option that can be given to a ServeMux on construction. @@ -125,6 +126,16 @@ func WithMiddlewares(middlewares ...Middleware) ServeMuxOption { } } +// WithDisableChunkedEncoding disables the Transfer-Encoding: chunked header +// for streaming responses. This is useful for streaming implementations that use +// Content-Length, which is mutually exclusive with Transfer-Encoding:chunked. +// Note that this option will not automatically add Content-Length headers, so it should be used with caution. +func WithDisableChunkedEncoding() ServeMuxOption { + return func(mux *ServeMux) { + mux.disableChunkedEncoding = true + } +} + // SetQueryParameterParser sets the query parameter parser, used to populate message from query parameters. // Configuring this will mean the generated OpenAPI output is no longer correct, and it should be // done with careful consideration. diff --git a/vendor/github.com/klauspost/compress/README.md b/vendor/github.com/klauspost/compress/README.md index af2ef63953..5125c1f267 100644 --- a/vendor/github.com/klauspost/compress/README.md +++ b/vendor/github.com/klauspost/compress/README.md @@ -7,7 +7,7 @@ This package provides various compression algorithms. * Optimized [deflate](https://godoc.org/github.com/klauspost/compress/flate) packages which can be used as a dropin replacement for [gzip](https://godoc.org/github.com/klauspost/compress/gzip), [zip](https://godoc.org/github.com/klauspost/compress/zip) and [zlib](https://godoc.org/github.com/klauspost/compress/zlib). * [snappy](https://github.com/klauspost/compress/tree/master/snappy) is a drop-in replacement for `github.com/golang/snappy` offering better compression and concurrent streams. * [huff0](https://github.com/klauspost/compress/tree/master/huff0) and [FSE](https://github.com/klauspost/compress/tree/master/fse) implementations for raw entropy encoding. -* [gzhttp](https://github.com/klauspost/compress/tree/master/gzhttp) Provides client and server wrappers for handling gzipped requests efficiently. +* [gzhttp](https://github.com/klauspost/compress/tree/master/gzhttp) Provides client and server wrappers for handling gzipped/zstd HTTP requests efficiently. * [pgzip](https://github.com/klauspost/pgzip) is a separate package that provides a very fast parallel gzip implementation. [![Go Reference](https://pkg.go.dev/badge/klauspost/compress.svg)](https://pkg.go.dev/github.com/klauspost/compress?tab=subdirectories) @@ -26,8 +26,14 @@ This package will support the current Go version and 2 versions back. Use the links above for more information on each. # changelog +* Jan 16th, 2026 [1.18.3](https://github.com/klauspost/compress/releases/tag/v1.18.3) + * Downstream CVE-2025-61728. See [golang/go#77102](https://github.com/golang/go/issues/77102). -* Oct 20, 2025 - [1.18.1](https://github.com/klauspost/compress/releases/tag/v1.18.1) +* Dec 1st, 2025 - [1.18.2](https://github.com/klauspost/compress/releases/tag/v1.18.2) + * flate: Fix invalid encoding on level 9 with single value input in https://github.com/klauspost/compress/pull/1115 + * flate: reduce stateless allocations by @RXamzin in https://github.com/klauspost/compress/pull/1106 + +* Oct 20, 2025 - [1.18.1](https://github.com/klauspost/compress/releases/tag/v1.18.1) - RETRACTED * zstd: Add simple zstd EncodeTo/DecodeTo functions https://github.com/klauspost/compress/pull/1079 * zstd: Fix incorrect buffer size in dictionary encodes https://github.com/klauspost/compress/pull/1059 * s2: check for cap, not len of buffer in EncodeBetter/Best by @vdarulis in https://github.com/klauspost/compress/pull/1080 @@ -603,7 +609,7 @@ While the release has been extensively tested, it is recommended to testing when # deflate usage -The packages are drop-in replacements for standard libraries. Simply replace the import path to use them: +The packages are drop-in replacements for standard library [deflate](https://godoc.org/github.com/klauspost/compress/flate), [gzip](https://godoc.org/github.com/klauspost/compress/gzip), [zip](https://godoc.org/github.com/klauspost/compress/zip), and [zlib](https://godoc.org/github.com/klauspost/compress/zlib). Simply replace the import path to use them: Typical speed is about 2x of the standard library packages. @@ -614,17 +620,15 @@ Typical speed is about 2x of the standard library packages. | `archive/zip` | `github.com/klauspost/compress/zip` | [zip](https://pkg.go.dev/github.com/klauspost/compress/zip?tab=doc) | | `compress/flate` | `github.com/klauspost/compress/flate` | [flate](https://pkg.go.dev/github.com/klauspost/compress/flate?tab=doc) | -* Optimized [deflate](https://godoc.org/github.com/klauspost/compress/flate) packages which can be used as a dropin replacement for [gzip](https://godoc.org/github.com/klauspost/compress/gzip), [zip](https://godoc.org/github.com/klauspost/compress/zip) and [zlib](https://godoc.org/github.com/klauspost/compress/zlib). - -You may also be interested in [pgzip](https://github.com/klauspost/pgzip), which is a drop in replacement for gzip, which support multithreaded compression on big files and the optimized [crc32](https://github.com/klauspost/crc32) package used by these packages. +You may also be interested in [pgzip](https://github.com/klauspost/pgzip), which is a drop-in replacement for gzip, which support multithreaded compression on big files and the optimized [crc32](https://github.com/klauspost/crc32) package used by these packages. -The packages contains the same as the standard library, so you can use the godoc for that: [gzip](http://golang.org/pkg/compress/gzip/), [zip](http://golang.org/pkg/archive/zip/), [zlib](http://golang.org/pkg/compress/zlib/), [flate](http://golang.org/pkg/compress/flate/). +The packages implement the same API as the standard library, so you can use the original godoc documentation: [gzip](http://golang.org/pkg/compress/gzip/), [zip](http://golang.org/pkg/archive/zip/), [zlib](http://golang.org/pkg/compress/zlib/), [flate](http://golang.org/pkg/compress/flate/). Currently there is only minor speedup on decompression (mostly CRC32 calculation). Memory usage is typically 1MB for a Writer. stdlib is in the same range. If you expect to have a lot of concurrently allocated Writers consider using -the stateless compress described below. +the stateless compression described below. For compression performance, see: [this spreadsheet](https://docs.google.com/spreadsheets/d/1nuNE2nPfuINCZJRMt6wFWhKpToF95I47XjSsc-1rbPQ/edit?usp=sharing). @@ -684,3 +688,6 @@ Here are other packages of good quality and pure Go (no cgo wrappers or autoconv This code is licensed under the same conditions as the original Go code. See LICENSE file. + + + diff --git a/vendor/github.com/klauspost/compress/zstd/decoder.go b/vendor/github.com/klauspost/compress/zstd/decoder.go index 30df5513d5..c7e500f02a 100644 --- a/vendor/github.com/klauspost/compress/zstd/decoder.go +++ b/vendor/github.com/klauspost/compress/zstd/decoder.go @@ -39,9 +39,6 @@ type Decoder struct { frame *frameDec - // Custom dictionaries. - dicts map[uint32]*dict - // streamWg is the waitgroup for all streams streamWg sync.WaitGroup } @@ -101,12 +98,10 @@ func NewReader(r io.Reader, opts ...DOption) (*Decoder, error) { d.current.err = ErrDecoderNilInput } - // Transfer option dicts. - d.dicts = make(map[uint32]*dict, len(d.o.dicts)) - for _, dc := range d.o.dicts { - d.dicts[dc.id] = dc + // Initialize dict map if needed. + if d.o.dicts == nil { + d.o.dicts = make(map[uint32]*dict) } - d.o.dicts = nil // Create decoders d.decoders = make(chan *blockDec, d.o.concurrent) @@ -238,6 +233,21 @@ func (d *Decoder) Reset(r io.Reader) error { return nil } +// ResetWithOptions will reset the decoder and apply the given options +// for the next stream or DecodeAll operation. +// Options are applied on top of the existing options. +// Some options cannot be changed on reset and will return an error. +func (d *Decoder) ResetWithOptions(r io.Reader, opts ...DOption) error { + d.o.resetOpt = true + defer func() { d.o.resetOpt = false }() + for _, o := range opts { + if err := o(&d.o); err != nil { + return err + } + } + return d.Reset(r) +} + // drainOutput will drain the output until errEndOfStream is sent. func (d *Decoder) drainOutput() { if d.current.cancel != nil { @@ -930,7 +940,7 @@ decodeStream: } func (d *Decoder) setDict(frame *frameDec) (err error) { - dict, ok := d.dicts[frame.DictionaryID] + dict, ok := d.o.dicts[frame.DictionaryID] if ok { if debugDecoder { println("setting dict", frame.DictionaryID) diff --git a/vendor/github.com/klauspost/compress/zstd/decoder_options.go b/vendor/github.com/klauspost/compress/zstd/decoder_options.go index 774c5f00fe..537627a078 100644 --- a/vendor/github.com/klauspost/compress/zstd/decoder_options.go +++ b/vendor/github.com/klauspost/compress/zstd/decoder_options.go @@ -20,10 +20,11 @@ type decoderOptions struct { concurrent int maxDecodedSize uint64 maxWindowSize uint64 - dicts []*dict + dicts map[uint32]*dict ignoreChecksum bool limitToCap bool decodeBufsBelow int + resetOpt bool } func (o *decoderOptions) setDefault() { @@ -42,8 +43,15 @@ func (o *decoderOptions) setDefault() { // WithDecoderLowmem will set whether to use a lower amount of memory, // but possibly have to allocate more while running. +// Cannot be changed with ResetWithOptions. func WithDecoderLowmem(b bool) DOption { - return func(o *decoderOptions) error { o.lowMem = b; return nil } + return func(o *decoderOptions) error { + if o.resetOpt && b != o.lowMem { + return errors.New("WithDecoderLowmem cannot be changed on Reset") + } + o.lowMem = b + return nil + } } // WithDecoderConcurrency sets the number of created decoders. @@ -53,18 +61,23 @@ func WithDecoderLowmem(b bool) DOption { // inflight blocks. // When decoding streams and setting maximum to 1, // no async decoding will be done. +// The value supplied must be at least 0. // When a value of 0 is provided GOMAXPROCS will be used. // By default this will be set to 4 or GOMAXPROCS, whatever is lower. +// Cannot be changed with ResetWithOptions. func WithDecoderConcurrency(n int) DOption { return func(o *decoderOptions) error { if n < 0 { - return errors.New("concurrency must be at least 1") + return errors.New("concurrency must be at least 0") } + newVal := n if n == 0 { - o.concurrent = runtime.GOMAXPROCS(0) - } else { - o.concurrent = n + newVal = runtime.GOMAXPROCS(0) } + if o.resetOpt && newVal != o.concurrent { + return errors.New("WithDecoderConcurrency cannot be changed on Reset") + } + o.concurrent = newVal return nil } } @@ -73,6 +86,7 @@ func WithDecoderConcurrency(n int) DOption { // non-streaming operations or maximum window size for streaming operations. // This can be used to control memory usage of potentially hostile content. // Maximum is 1 << 63 bytes. Default is 64GiB. +// Can be changed with ResetWithOptions. func WithDecoderMaxMemory(n uint64) DOption { return func(o *decoderOptions) error { if n == 0 { @@ -92,16 +106,20 @@ func WithDecoderMaxMemory(n uint64) DOption { // "zstd --train" from the Zstandard reference implementation. // // If several dictionaries with the same ID are provided, the last one will be used. +// Can be changed with ResetWithOptions. // // [dictionary format]: https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#dictionary-format func WithDecoderDicts(dicts ...[]byte) DOption { return func(o *decoderOptions) error { + if o.dicts == nil { + o.dicts = make(map[uint32]*dict) + } for _, b := range dicts { d, err := loadDict(b) if err != nil { return err } - o.dicts = append(o.dicts, d) + o.dicts[d.id] = d } return nil } @@ -109,12 +127,16 @@ func WithDecoderDicts(dicts ...[]byte) DOption { // WithDecoderDictRaw registers a dictionary that may be used by the decoder. // The slice content can be arbitrary data. +// Can be changed with ResetWithOptions. func WithDecoderDictRaw(id uint32, content []byte) DOption { return func(o *decoderOptions) error { if bits.UintSize > 32 && uint(len(content)) > dictMaxLength { return fmt.Errorf("dictionary of size %d > 2GiB too large", len(content)) } - o.dicts = append(o.dicts, &dict{id: id, content: content, offsets: [3]int{1, 4, 8}}) + if o.dicts == nil { + o.dicts = make(map[uint32]*dict) + } + o.dicts[id] = &dict{id: id, content: content, offsets: [3]int{1, 4, 8}} return nil } } @@ -124,6 +146,7 @@ func WithDecoderDictRaw(id uint32, content []byte) DOption { // The Decoder will likely allocate more memory based on the WithDecoderLowmem setting. // If WithDecoderMaxMemory is set to a lower value, that will be used. // Default is 512MB, Maximum is ~3.75 TB as per zstandard spec. +// Can be changed with ResetWithOptions. func WithDecoderMaxWindow(size uint64) DOption { return func(o *decoderOptions) error { if size < MinWindowSize { @@ -141,6 +164,7 @@ func WithDecoderMaxWindow(size uint64) DOption { // or any size set in WithDecoderMaxMemory. // This can be used to limit decoding to a specific maximum output size. // Disabled by default. +// Can be changed with ResetWithOptions. func WithDecodeAllCapLimit(b bool) DOption { return func(o *decoderOptions) error { o.limitToCap = b @@ -153,17 +177,37 @@ func WithDecodeAllCapLimit(b bool) DOption { // This typically uses less allocations but will have the full decompressed object in memory. // Note that DecodeAllCapLimit will disable this, as well as giving a size of 0 or less. // Default is 128KiB. +// Cannot be changed with ResetWithOptions. func WithDecodeBuffersBelow(size int) DOption { return func(o *decoderOptions) error { + if o.resetOpt && size != o.decodeBufsBelow { + return errors.New("WithDecodeBuffersBelow cannot be changed on Reset") + } o.decodeBufsBelow = size return nil } } // IgnoreChecksum allows to forcibly ignore checksum checking. +// Can be changed with ResetWithOptions. func IgnoreChecksum(b bool) DOption { return func(o *decoderOptions) error { o.ignoreChecksum = b return nil } } + +// WithDecoderDictDelete removes dictionaries by ID. +// If no ids are passed, all dictionaries are deleted. +// Should be used with ResetWithOptions. +func WithDecoderDictDelete(ids ...uint32) DOption { + return func(o *decoderOptions) error { + if len(ids) == 0 { + clear(o.dicts) + } + for _, id := range ids { + delete(o.dicts, id) + } + return nil + } +} diff --git a/vendor/github.com/klauspost/compress/zstd/encoder.go b/vendor/github.com/klauspost/compress/zstd/encoder.go index 8f8223cd3a..19e730acc2 100644 --- a/vendor/github.com/klauspost/compress/zstd/encoder.go +++ b/vendor/github.com/klauspost/compress/zstd/encoder.go @@ -131,6 +131,22 @@ func (e *Encoder) Reset(w io.Writer) { s.frameContentSize = 0 } +// ResetWithOptions will re-initialize the writer and apply the given options +// as a new, independent stream. +// Options are applied on top of the existing options. +// Some options cannot be changed on reset and will return an error. +func (e *Encoder) ResetWithOptions(w io.Writer, opts ...EOption) error { + e.o.resetOpt = true + defer func() { e.o.resetOpt = false }() + for _, o := range opts { + if err := o(&e.o); err != nil { + return err + } + } + e.Reset(w) + return nil +} + // ResetContentSize will reset and set a content size for the next stream. // If the bytes written does not match the size given an error will be returned // when calling Close(). diff --git a/vendor/github.com/klauspost/compress/zstd/encoder_options.go b/vendor/github.com/klauspost/compress/zstd/encoder_options.go index 20671dcb91..8e0f5cac71 100644 --- a/vendor/github.com/klauspost/compress/zstd/encoder_options.go +++ b/vendor/github.com/klauspost/compress/zstd/encoder_options.go @@ -14,6 +14,7 @@ type EOption func(*encoderOptions) error // options retains accumulated state of multiple options. type encoderOptions struct { + resetOpt bool concurrent int level EncoderLevel single *bool @@ -71,19 +72,28 @@ func (o encoderOptions) encoder() encoder { // WithEncoderCRC will add CRC value to output. // Output will be 4 bytes larger. +// Can be changed with ResetWithOptions. func WithEncoderCRC(b bool) EOption { return func(o *encoderOptions) error { o.crc = b; return nil } } // WithEncoderConcurrency will set the concurrency, // meaning the maximum number of encoders to run concurrently. -// The value supplied must be at least 1. +// The value supplied must be at least 0. +// When a value of 0 is provided GOMAXPROCS will be used. // For streams, setting a value of 1 will disable async compression. // By default this will be set to GOMAXPROCS. +// Cannot be changed with ResetWithOptions. func WithEncoderConcurrency(n int) EOption { return func(o *encoderOptions) error { - if n <= 0 { - return fmt.Errorf("concurrency must be at least 1") + if n < 0 { + return errors.New("concurrency must at least 0") + } + if n == 0 { + n = runtime.GOMAXPROCS(0) + } + if o.resetOpt && n != o.concurrent { + return errors.New("WithEncoderConcurrency cannot be changed on Reset") } o.concurrent = n return nil @@ -95,6 +105,7 @@ func WithEncoderConcurrency(n int) EOption { // A larger value will enable better compression but allocate more memory and, // for above-default values, take considerably longer. // The default value is determined by the compression level and max 8MB. +// Cannot be changed with ResetWithOptions. func WithWindowSize(n int) EOption { return func(o *encoderOptions) error { switch { @@ -105,6 +116,9 @@ func WithWindowSize(n int) EOption { case (n & (n - 1)) != 0: return errors.New("window size must be a power of 2") } + if o.resetOpt && n != o.windowSize { + return errors.New("WithWindowSize cannot be changed on Reset") + } o.windowSize = n o.customWindow = true @@ -122,6 +136,7 @@ func WithWindowSize(n int) EOption { // n must be > 0 and <= 1GB, 1<<30 bytes. // The padded area will be filled with data from crypto/rand.Reader. // If `EncodeAll` is used with data already in the destination, the total size will be multiple of this. +// Can be changed with ResetWithOptions. func WithEncoderPadding(n int) EOption { return func(o *encoderOptions) error { if n <= 0 { @@ -215,12 +230,16 @@ func (e EncoderLevel) String() string { } // WithEncoderLevel specifies a predefined compression level. +// Cannot be changed with ResetWithOptions. func WithEncoderLevel(l EncoderLevel) EOption { return func(o *encoderOptions) error { switch { case l <= speedNotSet || l >= speedLast: return fmt.Errorf("unknown encoder level") } + if o.resetOpt && l != o.level { + return errors.New("WithEncoderLevel cannot be changed on Reset") + } o.level = l if !o.customWindow { switch o.level { @@ -248,6 +267,7 @@ func WithEncoderLevel(l EncoderLevel) EOption { // WithZeroFrames will encode 0 length input as full frames. // This can be needed for compatibility with zstandard usage, // but is not needed for this package. +// Can be changed with ResetWithOptions. func WithZeroFrames(b bool) EOption { return func(o *encoderOptions) error { o.fullZero = b @@ -259,6 +279,7 @@ func WithZeroFrames(b bool) EOption { // Disabling this will skip incompressible data faster, but in cases with no matches but // skewed character distribution compression is lost. // Default value depends on the compression level selected. +// Can be changed with ResetWithOptions. func WithAllLitEntropyCompression(b bool) EOption { return func(o *encoderOptions) error { o.customALEntropy = true @@ -270,6 +291,7 @@ func WithAllLitEntropyCompression(b bool) EOption { // WithNoEntropyCompression will always skip entropy compression of literals. // This can be useful if content has matches, but unlikely to benefit from entropy // compression. Usually the slight speed improvement is not worth enabling this. +// Can be changed with ResetWithOptions. func WithNoEntropyCompression(b bool) EOption { return func(o *encoderOptions) error { o.noEntropy = b @@ -287,6 +309,7 @@ func WithNoEntropyCompression(b bool) EOption { // This is only a recommendation, each decoder is free to support higher or lower limits, depending on local limitations. // If this is not specified, block encodes will automatically choose this based on the input size and the window size. // This setting has no effect on streamed encodes. +// Can be changed with ResetWithOptions. func WithSingleSegment(b bool) EOption { return func(o *encoderOptions) error { o.single = &b @@ -298,8 +321,12 @@ func WithSingleSegment(b bool) EOption { // slower encoding speed. // This will not change the window size which is the primary function for reducing // memory usage. See WithWindowSize. +// Cannot be changed with ResetWithOptions. func WithLowerEncoderMem(b bool) EOption { return func(o *encoderOptions) error { + if o.resetOpt && b != o.lowMem { + return errors.New("WithLowerEncoderMem cannot be changed on Reset") + } o.lowMem = b return nil } @@ -311,6 +338,7 @@ func WithLowerEncoderMem(b bool) EOption { // "zstd --train" from the Zstandard reference implementation. // // The encoder *may* choose to use no dictionary instead for certain payloads. +// Can be changed with ResetWithOptions. // // [dictionary format]: https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#dictionary-format func WithEncoderDict(dict []byte) EOption { @@ -328,6 +356,7 @@ func WithEncoderDict(dict []byte) EOption { // // The slice content may contain arbitrary data. It will be used as an initial // history. +// Can be changed with ResetWithOptions. func WithEncoderDictRaw(id uint32, content []byte) EOption { return func(o *encoderOptions) error { if bits.UintSize > 32 && uint(len(content)) > dictMaxLength { @@ -337,3 +366,12 @@ func WithEncoderDictRaw(id uint32, content []byte) EOption { return nil } } + +// WithEncoderDictDelete clears the dictionary, so no dictionary will be used. +// Should be used with ResetWithOptions. +func WithEncoderDictDelete() EOption { + return func(o *encoderOptions) error { + o.dict = nil + return nil + } +} diff --git a/vendor/github.com/mattn/go-sqlite3/sqlite3.go b/vendor/github.com/mattn/go-sqlite3/sqlite3.go index dffc2bda2d..1a5433c7ed 100644 --- a/vendor/github.com/mattn/go-sqlite3/sqlite3.go +++ b/vendor/github.com/mattn/go-sqlite3/sqlite3.go @@ -78,6 +78,42 @@ _sqlite3_bind_blob(sqlite3_stmt *stmt, int n, void *p, int np) { return sqlite3_bind_blob(stmt, n, p, np, SQLITE_TRANSIENT); } +typedef struct { + int typ; + sqlite3_int64 i64; + double f64; + const void *ptr; + int n; +} sqlite3_go_col; + +static void +_sqlite3_column_values(sqlite3_stmt *stmt, int ncol, sqlite3_go_col *cols) { + for (int i = 0; i < ncol; i++) { + sqlite3_go_col *col = &cols[i]; + col->typ = sqlite3_column_type(stmt, i); + col->ptr = 0; + col->n = 0; + switch (col->typ) { + case SQLITE_INTEGER: + col->i64 = sqlite3_column_int64(stmt, i); + break; + case SQLITE_FLOAT: + col->f64 = sqlite3_column_double(stmt, i); + break; + case SQLITE_BLOB: + col->ptr = sqlite3_column_blob(stmt, i); + col->n = sqlite3_column_bytes(stmt, i); + break; + case SQLITE_TEXT: + col->ptr = sqlite3_column_text(stmt, i); + col->n = sqlite3_column_bytes(stmt, i); + break; + default: + break; + } + } +} + #include #include @@ -90,10 +126,57 @@ _sqlite3_exec(sqlite3* db, const char* pcmd, long long* rowid, long long* change return rv; } +// Combined reset + clear_bindings in a single C call to reduce CGO crossings. +static int +_sqlite3_reset_clear(sqlite3_stmt* stmt) +{ + int rv = sqlite3_reset(stmt); + sqlite3_clear_bindings(stmt); + return rv; +} + #ifdef SQLITE_ENABLE_UNLOCK_NOTIFY extern int _sqlite3_step_blocking(sqlite3_stmt *stmt); extern int _sqlite3_step_row_blocking(sqlite3_stmt* stmt, long long* rowid, long long* changes); extern int _sqlite3_prepare_v2_blocking(sqlite3 *db, const char *zSql, int nBytes, sqlite3_stmt **ppStmt, const char **pzTail); +#endif + +// Combined prepare+step+finalize for simple exec without parameters. +// Reduces CGO crossings from ~6 to 1 for the common no-args exec case. +static int +_sqlite3_exec_no_args(sqlite3* db, const char* zSql, int nBytes, long long* rowid, long long* changes, const char** pzTail) +{ + sqlite3_stmt *stmt = 0; + const char *tail = 0; +#ifdef SQLITE_ENABLE_UNLOCK_NOTIFY + int rv = _sqlite3_prepare_v2_blocking(db, zSql, nBytes, &stmt, &tail); +#else + int rv = sqlite3_prepare_v2(db, zSql, nBytes, &stmt, &tail); +#endif + if (rv != SQLITE_OK) { + *pzTail = 0; + return rv; + } + if (stmt == 0) { + // Empty statement + *rowid = 0; + *changes = 0; + *pzTail = tail; + return SQLITE_OK; + } +#ifdef SQLITE_ENABLE_UNLOCK_NOTIFY + rv = _sqlite3_step_row_blocking(stmt, rowid, changes); +#else + rv = sqlite3_step(stmt); + *rowid = (long long) sqlite3_last_insert_rowid(db); + *changes = (long long) sqlite3_changes(db); +#endif + sqlite3_finalize(stmt); + *pzTail = tail; + return rv; +} + +#ifdef SQLITE_ENABLE_UNLOCK_NOTIFY static int _sqlite3_step_internal(sqlite3_stmt *stmt) @@ -210,6 +293,7 @@ import ( "errors" "fmt" "io" + "math" "net/url" "reflect" "runtime" @@ -361,12 +445,15 @@ type SQLiteDriver struct { // SQLiteConn implements driver.Conn. type SQLiteConn struct { - mu sync.Mutex - db *C.sqlite3 - loc *time.Location - txlock string - funcs []*functionInfo - aggregators []*aggInfo + mu sync.Mutex + db *C.sqlite3 + loc *time.Location + txlock string + funcs []*functionInfo + aggregators []*aggInfo + stmtCache map[string][]*SQLiteStmt + stmtCacheSize int + stmtCacheCount int } // SQLiteTx implements driver.Tx. @@ -376,12 +463,14 @@ type SQLiteTx struct { // SQLiteStmt implements driver.Stmt. type SQLiteStmt struct { - mu sync.Mutex - c *SQLiteConn - s *C.sqlite3_stmt - t string - closed bool - cls bool // True if the statement was created by SQLiteConn.Query + mu sync.Mutex + c *SQLiteConn + s *C.sqlite3_stmt + t string + closed bool + cls bool // True if the statement was created by SQLiteConn.Query + namedParams map[string][3]int + cacheKey string } // SQLiteResult implements sql.Result. @@ -397,6 +486,7 @@ type SQLiteRows struct { cls bool // True if we need to close the parent statement in Close cols []string decltype []string + colvals *C.sqlite3_go_col ctx context.Context // no better alternative to pass context into Next() method closemu sync.Mutex } @@ -847,45 +937,29 @@ func lastError(db *C.sqlite3) error { // Exec implements Execer. func (c *SQLiteConn) Exec(query string, args []driver.Value) (driver.Result, error) { - list := make([]driver.NamedValue, len(args)) - for i, v := range args { - list[i] = driver.NamedValue{ - Ordinal: i + 1, - Value: v, - } - } - return c.exec(context.Background(), query, list) + return c.exec(context.Background(), query, valueToNamedValue(args)) } func (c *SQLiteConn) exec(ctx context.Context, query string, args []driver.NamedValue) (driver.Result, error) { + // Fast path: no args, no context cancellation → single CGO call per statement + if len(args) == 0 && ctx.Done() == nil { + return c.execNoArgs(query) + } + start := 0 for { - s, err := c.prepare(ctx, query) + s, err := c.prepareWithCache(ctx, query) if err != nil { return nil, err } var res driver.Result if s.(*SQLiteStmt).s != nil { - stmtArgs := make([]driver.NamedValue, 0, len(args)) na := s.NumInput() if len(args)-start < na { s.Close() return nil, fmt.Errorf("not enough args to execute query: want %d got %d", na, len(args)) } - // consume the number of arguments used in the current - // statement and append all named arguments not - // contained therein - if len(args[start:start+na]) > 0 { - stmtArgs = append(stmtArgs, args[start:start+na]...) - for i := range args { - if (i < start || i >= na) && args[i].Name != "" { - stmtArgs = append(stmtArgs, args[i]) - } - } - for i := range stmtArgs { - stmtArgs[i].Ordinal = i + 1 - } - } + stmtArgs := stmtArgs(args, start, na) res, err = s.(*SQLiteStmt).exec(ctx, stmtArgs) if err != nil && err != driver.ErrSkip { s.Close() @@ -906,23 +980,40 @@ func (c *SQLiteConn) exec(ctx context.Context, query string, args []driver.Named } } -// Query implements Queryer. -func (c *SQLiteConn) Query(query string, args []driver.Value) (driver.Rows, error) { - list := make([]driver.NamedValue, len(args)) - for i, v := range args { - list[i] = driver.NamedValue{ - Ordinal: i + 1, - Value: v, +// execNoArgs executes a query with no parameters in a single CGO call per statement. +func (c *SQLiteConn) execNoArgs(query string) (driver.Result, error) { + var res *SQLiteResult + for len(query) > 0 { + var rowid, changes C.longlong + var tail *C.char + pquery := C.CString(query) + rv := C._sqlite3_exec_no_args(c.db, pquery, C.int(len(query)), &rowid, &changes, &tail) + if tail != nil && *tail != '\000' { + query = strings.TrimSpace(C.GoString(tail)) + } else { + query = "" } + C.free(unsafe.Pointer(pquery)) + if rv != C.SQLITE_ROW && rv != C.SQLITE_OK && rv != C.SQLITE_DONE { + return nil, c.lastError() + } + res = &SQLiteResult{id: int64(rowid), changes: int64(changes)} + } + if res == nil { + res = &SQLiteResult{0, 0} } - return c.query(context.Background(), query, list) + return res, nil +} + +// Query implements Queryer. +func (c *SQLiteConn) Query(query string, args []driver.Value) (driver.Rows, error) { + return c.query(context.Background(), query, valueToNamedValue(args)) } func (c *SQLiteConn) query(ctx context.Context, query string, args []driver.NamedValue) (driver.Rows, error) { start := 0 for { - stmtArgs := make([]driver.NamedValue, 0, len(args)) - s, err := c.prepare(ctx, query) + s, err := c.prepareWithCache(ctx, query) if err != nil { return nil, err } @@ -932,18 +1023,7 @@ func (c *SQLiteConn) query(ctx context.Context, query string, args []driver.Name s.Close() return nil, fmt.Errorf("not enough args to execute query: want %d got %d", na, len(args)-start) } - // consume the number of arguments used in the current - // statement and append all named arguments not contained - // therein - stmtArgs = append(stmtArgs, args[start:start+na]...) - for i := range args { - if (i < start || i >= na) && args[i].Name != "" { - stmtArgs = append(stmtArgs, args[i]) - } - } - for i := range stmtArgs { - stmtArgs[i].Ordinal = i + 1 - } + stmtArgs := stmtArgs(args, start, na) rows, err := s.(*SQLiteStmt).query(ctx, stmtArgs) if err != nil && err != driver.ErrSkip { s.Close() @@ -1109,6 +1189,7 @@ func (d *SQLiteDriver) Open(dsn string) (driver.Conn, error) { writableSchema := -1 vfsName := "" var cacheSize *int64 + stmtCacheSize := 0 pos := strings.IndexRune(dsn, '?') if pos >= 1 { @@ -1444,6 +1525,20 @@ func (d *SQLiteDriver) Open(dsn string) (driver.Conn, error) { cacheSize = &iv } + // _stmt_cache_size sets the maximum number of prepared statements + // cached per connection. Note that sql.DB is a connection pool, so + // each connection maintains its own independent cache. + if val := params.Get("_stmt_cache_size"); val != "" { + iv, err := strconv.Atoi(val) + if err != nil { + return nil, fmt.Errorf("Invalid _stmt_cache_size: %v: %v", val, err) + } + if iv < 0 { + return nil, fmt.Errorf("Invalid _stmt_cache_size: %v, expecting non-negative integer", val) + } + stmtCacheSize = iv + } + if val := params.Get("vfs"); val != "" { vfsName = val } @@ -1516,7 +1611,10 @@ func (d *SQLiteDriver) Open(dsn string) (driver.Conn, error) { // // Create connection to SQLite - conn := &SQLiteConn{db: db, loc: loc, txlock: txlock} + conn := &SQLiteConn{db: db, loc: loc, txlock: txlock, stmtCacheSize: stmtCacheSize} + if stmtCacheSize > 0 { + conn.stmtCache = make(map[string][]*SQLiteStmt) + } // Password Cipher has to be registered before authentication if len(authCrypt) > 0 { @@ -1789,6 +1887,7 @@ func (c *SQLiteConn) Close() error { return nil } runtime.SetFinalizer(c, nil) + c.closeCachedStmtsLocked() rv := C.sqlite3_close_v2(c.db) if rv != C.SQLITE_OK { return lastError(c.db) @@ -1807,6 +1906,70 @@ func (c *SQLiteConn) dbConnOpen() bool { return c.db != nil } +func (c *SQLiteConn) takeCachedStmt(query string) *SQLiteStmt { + if c == nil || query == "" || c.stmtCacheSize <= 0 { + return nil + } + + c.mu.Lock() + defer c.mu.Unlock() + + if c.db == nil { + return nil + } + stmts := c.stmtCache[query] + if len(stmts) == 0 { + return nil + } + s := stmts[len(stmts)-1] + if len(stmts) == 1 { + delete(c.stmtCache, query) + } else { + c.stmtCache[query] = stmts[:len(stmts)-1] + } + c.stmtCacheCount-- + s.closed = false + s.cls = false + s.t = "" + return s +} + +func (c *SQLiteConn) putCachedStmt(s *SQLiteStmt) bool { + if c == nil || s == nil || s.s == nil || s.cacheKey == "" { + return false + } + + c.mu.Lock() + defer c.mu.Unlock() + + if c.db == nil || c.stmtCacheCount >= c.stmtCacheSize { + return false + } + rv := C._sqlite3_reset_clear(s.s) + if rv != C.SQLITE_ROW && rv != C.SQLITE_OK && rv != C.SQLITE_DONE { + return false + } + c.stmtCache[s.cacheKey] = append(c.stmtCache[s.cacheKey], s) + c.stmtCacheCount++ + return true +} + +func (c *SQLiteConn) closeCachedStmtsLocked() { + for key, stmts := range c.stmtCache { + for _, s := range stmts { + if s == nil || s.s == nil { + continue + } + runtime.SetFinalizer(s, nil) + C.sqlite3_finalize(s.s) + s.s = nil + s.c = nil + } + delete(c.stmtCache, key) + } + c.stmtCacheCount = 0 +} + // Prepare the query string. Return a new statement. func (c *SQLiteConn) Prepare(query string) (driver.Stmt, error) { return c.prepare(context.Background(), query) @@ -1817,7 +1980,7 @@ func (c *SQLiteConn) prepare(ctx context.Context, query string) (driver.Stmt, er defer C.free(unsafe.Pointer(pquery)) var s *C.sqlite3_stmt var tail *C.char - rv := C._sqlite3_prepare_v2_internal(c.db, pquery, C.int(-1), &s, &tail) + rv := C._sqlite3_prepare_v2_internal(c.db, pquery, C.int(len(query)), &s, &tail) if rv != C.SQLITE_OK { return nil, c.lastError() } @@ -1830,6 +1993,21 @@ func (c *SQLiteConn) prepare(ctx context.Context, query string) (driver.Stmt, er return ss, nil } +func (c *SQLiteConn) prepareWithCache(ctx context.Context, query string) (driver.Stmt, error) { + if stmt := c.takeCachedStmt(query); stmt != nil { + return stmt, nil + } + stmt, err := c.prepare(ctx, query) + if err != nil { + return nil, err + } + ss := stmt.(*SQLiteStmt) + if ss.t == "" { + ss.cacheKey = query + } + return ss, nil +} + // Run-Time Limit Categories. // See: http://www.sqlite.org/c3ref/c_limit_attached.html const ( @@ -1938,11 +2116,18 @@ func (s *SQLiteStmt) Close() error { runtime.SetFinalizer(s, nil) conn := s.c stmt := s.s - s.s = nil - s.c = nil + if stmt == nil { + s.c = nil + return nil + } if !conn.dbConnOpen() { return errors.New("sqlite statement with already closed database connection") } + if s.cacheKey != "" && conn.putCachedStmt(s) { + return nil + } + s.s = nil + s.c = nil rv := C.sqlite3_finalize(stmt) if rv != C.SQLITE_OK { return conn.lastError() @@ -1957,68 +2142,141 @@ func (s *SQLiteStmt) NumInput() int { var placeHolder = []byte{0} +func bindText(s *C.sqlite3_stmt, n C.int, v string) C.int { + if len(v) == 0 { + return C._sqlite3_bind_text(s, n, (*C.char)(unsafe.Pointer(&placeHolder[0])), C.int(0)) + } + return C._sqlite3_bind_text(s, n, (*C.char)(unsafe.Pointer(unsafe.StringData(v))), C.int(len(v))) +} + +func bindValue(s *C.sqlite3_stmt, n C.int, value driver.Value) C.int { + switch v := value.(type) { + case nil: + return C.sqlite3_bind_null(s, n) + case string: + return bindText(s, n, v) + case int64: + return C.sqlite3_bind_int64(s, n, C.sqlite3_int64(v)) + case bool: + if v { + return C.sqlite3_bind_int(s, n, 1) + } + return C.sqlite3_bind_int(s, n, 0) + case float64: + return C.sqlite3_bind_double(s, n, C.double(v)) + case []byte: + if v == nil { + return C.sqlite3_bind_null(s, n) + } + ln := len(v) + if ln == 0 { + v = placeHolder + } + return C._sqlite3_bind_blob(s, n, unsafe.Pointer(&v[0]), C.int(ln)) + case time.Time: + var buf [64]byte + b := v.AppendFormat(buf[:0], SQLiteTimestampFormats[0]) + if len(b) == 0 { + return C._sqlite3_bind_text(s, n, (*C.char)(unsafe.Pointer(&placeHolder[0])), C.int(0)) + } + return C._sqlite3_bind_text(s, n, (*C.char)(unsafe.Pointer(&b[0])), C.int(len(b))) + default: + return C.SQLITE_MISUSE + } +} + +func (s *SQLiteStmt) bindNamedIndices(name string) [3]int { + if s.namedParams == nil { + s.namedParams = make(map[string][3]int) + } else if indices, ok := s.namedParams[name]; ok { + return indices + } + + // Build ":name\0" once and rewrite prefix byte to avoid 3 C.CString allocs. + buf := make([]byte, 1+len(name)+1) // prefix + name + null terminator + copy(buf[1:], name) + buf[len(buf)-1] = 0 + cname := (*C.char)(unsafe.Pointer(&buf[0])) + + var indices [3]int + prefixes := [3]byte{':', '@', '$'} + for i, p := range prefixes { + buf[0] = p + indices[i] = int(C.sqlite3_bind_parameter_index(s.s, cname)) + } + s.namedParams[name] = indices + return indices +} + +func stmtArgs(args []driver.NamedValue, start, na int) []driver.NamedValue { + if na == 0 { + return nil + } + + end := start + na + hasNamedOutside := false + for i := range args { + if args[i].Name != "" && (i < start || i >= end) { + hasNamedOutside = true + break + } + } + if start == 0 && !hasNamedOutside { + return args[start:end] + } + + stmtArgs := make([]driver.NamedValue, 0, len(args)) + stmtArgs = append(stmtArgs, args[start:end]...) + for i := range args { + if args[i].Name != "" && (i < start || i >= end) { + stmtArgs = append(stmtArgs, args[i]) + } + } + for i := range stmtArgs { + stmtArgs[i].Ordinal = i + 1 + } + return stmtArgs +} + func (s *SQLiteStmt) bind(args []driver.NamedValue) error { - rv := C.sqlite3_reset(s.s) + rv := C._sqlite3_reset_clear(s.s) if rv != C.SQLITE_ROW && rv != C.SQLITE_OK && rv != C.SQLITE_DONE { return s.c.lastError() } - C.sqlite3_clear_bindings(s.s) + hasNamed := false + for i := range args { + if args[i].Name != "" { + hasNamed = true + break + } + } - bindIndices := make([][3]int, len(args)) - prefixes := []string{":", "@", "$"} - for i, v := range args { - bindIndices[i][0] = args[i].Ordinal - if v.Name != "" { - for j := range prefixes { - cname := C.CString(prefixes[j] + v.Name) - bindIndices[i][j] = int(C.sqlite3_bind_parameter_index(s.s, cname)) - C.free(unsafe.Pointer(cname)) + if !hasNamed { + for _, arg := range args { + n := C.int(arg.Ordinal) + rv = bindValue(s.s, n, arg.Value) + if rv != C.SQLITE_OK { + return s.c.lastError() } - args[i].Ordinal = bindIndices[i][0] } + return nil } - for i, arg := range args { - for j := range bindIndices[i] { - if bindIndices[i][j] == 0 { - continue + for _, arg := range args { + if arg.Name == "" { + rv = bindValue(s.s, C.int(arg.Ordinal), arg.Value) + if rv != C.SQLITE_OK { + return s.c.lastError() } - n := C.int(bindIndices[i][j]) - switch v := arg.Value.(type) { - case nil: - rv = C.sqlite3_bind_null(s.s, n) - case string: - if len(v) == 0 { - rv = C._sqlite3_bind_text(s.s, n, (*C.char)(unsafe.Pointer(&placeHolder[0])), C.int(0)) - } else { - b := []byte(v) - rv = C._sqlite3_bind_text(s.s, n, (*C.char)(unsafe.Pointer(&b[0])), C.int(len(b))) - } - case int64: - rv = C.sqlite3_bind_int64(s.s, n, C.sqlite3_int64(v)) - case bool: - if v { - rv = C.sqlite3_bind_int(s.s, n, 1) - } else { - rv = C.sqlite3_bind_int(s.s, n, 0) - } - case float64: - rv = C.sqlite3_bind_double(s.s, n, C.double(v)) - case []byte: - if v == nil { - rv = C.sqlite3_bind_null(s.s, n) - } else { - ln := len(v) - if ln == 0 { - v = placeHolder - } - rv = C._sqlite3_bind_blob(s.s, n, unsafe.Pointer(&v[0]), C.int(ln)) - } - case time.Time: - b := []byte(v.Format(SQLiteTimestampFormats[0])) - rv = C._sqlite3_bind_text(s.s, n, (*C.char)(unsafe.Pointer(&b[0])), C.int(len(b))) + continue + } + indices := s.bindNamedIndices(arg.Name) + for _, idx := range indices { + if idx == 0 { + continue } + rv = bindValue(s.s, C.int(idx), arg.Value) if rv != C.SQLITE_OK { return s.c.lastError() } @@ -2029,14 +2287,7 @@ func (s *SQLiteStmt) bind(args []driver.NamedValue) error { // Query the statement with arguments. Return records. func (s *SQLiteStmt) Query(args []driver.Value) (driver.Rows, error) { - list := make([]driver.NamedValue, len(args)) - for i, v := range args { - list[i] = driver.NamedValue{ - Ordinal: i + 1, - Value: v, - } - } - return s.query(context.Background(), list) + return s.query(context.Background(), valueToNamedValue(args)) } func (s *SQLiteStmt) query(ctx context.Context, args []driver.NamedValue) (driver.Rows, error) { @@ -2050,8 +2301,15 @@ func (s *SQLiteStmt) query(ctx context.Context, args []driver.NamedValue) (drive cls: s.cls, cols: nil, decltype: nil, + colvals: nil, ctx: ctx, } + if rows.nc > 0 { + rows.colvals = (*C.sqlite3_go_col)(C.malloc(C.size_t(rows.nc) * C.size_t(unsafe.Sizeof(C.sqlite3_go_col{})))) + if rows.colvals == nil { + return nil, errors.New("sqlite3: failed to allocate row buffer") + } + } return rows, nil } @@ -2068,6 +2326,10 @@ func (r *SQLiteResult) RowsAffected() (int64, error) { // Exec execute the statement with arguments. Return result object. func (s *SQLiteStmt) Exec(args []driver.Value) (driver.Result, error) { + return s.exec(context.Background(), valueToNamedValue(args)) +} + +func valueToNamedValue(args []driver.Value) []driver.NamedValue { list := make([]driver.NamedValue, len(args)) for i, v := range args { list[i] = driver.NamedValue{ @@ -2075,7 +2337,7 @@ func (s *SQLiteStmt) Exec(args []driver.Value) (driver.Result, error) { Value: v, } } - return s.exec(context.Background(), list) + return list } func isInterruptErr(err error) bool { @@ -2092,38 +2354,35 @@ func (s *SQLiteStmt) exec(ctx context.Context, args []driver.NamedValue) (driver return s.execSync(args) } - type result struct { - r driver.Result - err error - } - resultCh := make(chan result) - defer close(resultCh) + sema := make(chan struct{}) + var r driver.Result + var err error go func() { - r, err := s.execSync(args) - resultCh <- result{r, err} + r, err = s.execSync(args) + close(sema) }() - var rv result select { - case rv = <-resultCh: + case <-sema: + return r, err case <-ctx.Done(): select { - case rv = <-resultCh: // no need to interrupt, operation completed in db + case <-sema: // no need to interrupt, operation completed in db + return r, err default: // this is still racy and can be no-op if executed between sqlite3_* calls in execSync. C.sqlite3_interrupt(s.c.db) - rv = <-resultCh // wait for goroutine completed - if isInterruptErr(rv.err) { + <-sema // wait for goroutine completed + if isInterruptErr(err) { return nil, ctx.Err() } + return r, err } } - return rv.r, rv.err } func (s *SQLiteStmt) execSync(args []driver.NamedValue) (driver.Result, error) { if err := s.bind(args); err != nil { - C.sqlite3_reset(s.s) - C.sqlite3_clear_bindings(s.s) + C._sqlite3_reset_clear(s.s) return nil, err } @@ -2131,8 +2390,7 @@ func (s *SQLiteStmt) execSync(args []driver.NamedValue) (driver.Result, error) { rv := C._sqlite3_step_row_internal(s.s, &rowid, &changes) if rv != C.SQLITE_ROW && rv != C.SQLITE_OK && rv != C.SQLITE_DONE { err := s.c.lastError() - C.sqlite3_reset(s.s) - C.sqlite3_clear_bindings(s.s) + C._sqlite3_reset_clear(s.s) return nil, err } @@ -2152,9 +2410,17 @@ func (rc *SQLiteRows) Close() error { defer rc.closemu.Unlock() s := rc.s if s == nil { + if rc.colvals != nil { + C.free(unsafe.Pointer(rc.colvals)) + rc.colvals = nil + } return nil } rc.s = nil // remove reference to SQLiteStmt + if rc.colvals != nil { + C.free(unsafe.Pointer(rc.colvals)) + rc.colvals = nil + } s.mu.Lock() if s.closed { s.mu.Unlock() @@ -2179,7 +2445,7 @@ func (rc *SQLiteRows) Columns() []string { defer rc.s.mu.Unlock() if rc.s.s != nil && int(rc.nc) != len(rc.cols) { rc.cols = make([]string, rc.nc) - for i := 0; i < int(rc.nc); i++ { + for i := range rc.cols { rc.cols[i] = C.GoString(C.sqlite3_column_name(rc.s.s, C.int(i))) } } @@ -2189,7 +2455,7 @@ func (rc *SQLiteRows) Columns() []string { func (rc *SQLiteRows) declTypes() []string { if rc.s.s != nil && rc.decltype == nil { rc.decltype = make([]string, rc.nc) - for i := 0; i < int(rc.nc); i++ { + for i := range rc.decltype { rc.decltype[i] = strings.ToLower(C.GoString(C.sqlite3_column_decltype(rc.s.s, C.int(i)))) } } @@ -2215,21 +2481,22 @@ func (rc *SQLiteRows) Next(dest []driver.Value) error { if rc.ctx.Done() == nil { return rc.nextSyncLocked(dest) } - resultCh := make(chan error) - defer close(resultCh) + sema := make(chan struct{}) + var err error go func() { - resultCh <- rc.nextSyncLocked(dest) + err = rc.nextSyncLocked(dest) + close(sema) }() select { - case err := <-resultCh: + case <-sema: return err case <-rc.ctx.Done(): select { - case <-resultCh: // no need to interrupt + case <-sema: // no need to interrupt default: // this is still racy and can be no-op if executed between sqlite3_* calls in nextSyncLocked. C.sqlite3_interrupt(rc.s.c.db) - <-resultCh // ensure goroutine completed + <-sema // ensure goroutine completed } return rc.ctx.Err() } @@ -2250,12 +2517,20 @@ func (rc *SQLiteRows) nextSyncLocked(dest []driver.Value) error { } rc.declTypes() + if len(dest) == 0 { + return nil + } + C._sqlite3_column_values(rc.s.s, C.int(len(dest)), rc.colvals) + colvals := (*[(math.MaxInt32 - 1) / unsafe.Sizeof(C.sqlite3_go_col{})]C.sqlite3_go_col)(unsafe.Pointer(rc.colvals))[:len(dest):len(dest)] + decltype := rc.decltype + _ = decltype[len(dest)-1] for i := range dest { - switch C.sqlite3_column_type(rc.s.s, C.int(i)) { + col := &colvals[i] + switch col.typ { case C.SQLITE_INTEGER: - val := int64(C.sqlite3_column_int64(rc.s.s, C.int(i))) - switch rc.decltype[i] { + val := int64(col.i64) + switch decltype[i] { case columnTimestamp, columnDatetime, columnDate: var t time.Time // Assume a millisecond unix timestamp if it's 13 digits -- too @@ -2277,14 +2552,14 @@ func (rc *SQLiteRows) nextSyncLocked(dest []driver.Value) error { dest[i] = val } case C.SQLITE_FLOAT: - dest[i] = float64(C.sqlite3_column_double(rc.s.s, C.int(i))) + dest[i] = float64(col.f64) case C.SQLITE_BLOB: - p := C.sqlite3_column_blob(rc.s.s, C.int(i)) + p := col.ptr if p == nil { dest[i] = []byte{} continue } - n := C.sqlite3_column_bytes(rc.s.s, C.int(i)) + n := col.n dest[i] = C.GoBytes(p, n) case C.SQLITE_NULL: dest[i] = nil @@ -2292,10 +2567,10 @@ func (rc *SQLiteRows) nextSyncLocked(dest []driver.Value) error { var err error var timeVal time.Time - n := int(C.sqlite3_column_bytes(rc.s.s, C.int(i))) - s := C.GoStringN((*C.char)(unsafe.Pointer(C.sqlite3_column_text(rc.s.s, C.int(i)))), C.int(n)) + n := int(col.n) + s := C.GoStringN((*C.char)(unsafe.Pointer(col.ptr)), C.int(n)) - switch rc.decltype[i] { + switch decltype[i] { case columnTimestamp, columnDatetime, columnDate: var t time.Time s = strings.TrimSuffix(s, "Z") diff --git a/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_vtable.go b/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_vtable.go index 9b164b3e0b..9761bf3570 100644 --- a/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_vtable.go +++ b/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_vtable.go @@ -301,10 +301,18 @@ const ( OpLT = 16 OpGE = 32 OpMATCH = 64 - OpLIKE = 65 /* 3.10.0 and later only */ - OpGLOB = 66 /* 3.10.0 and later only */ - OpREGEXP = 67 /* 3.10.0 and later only */ - OpScanUnique = 1 /* Scan visits at most 1 row */ + OpLIKE = 65 /* 3.10.0 and later only */ + OpGLOB = 66 /* 3.10.0 and later only */ + OpREGEXP = 67 /* 3.10.0 and later only */ + OpNE = 68 /* 3.21.0 and later only */ + OpISNOT = 69 /* 3.21.0 and later */ + OpISNOTNULL = 70 /* 3.21.0 and later */ + OpISNULL = 71 /* 3.21.0 and later */ + OpIS = 72 /* 3.21.0 and later */ + OpLIMIT = 73 /* 3.38.0 and later */ + OpOFFSET = 74 /* 3.38.0 and later */ + OpFUNCTION = 150 /* 3.25.0 and later */ + OpScanUnique = 1 /* Scan visits at most 1 row */ ) // InfoConstraint give information of constraint. diff --git a/vendor/github.com/mattn/go-sqlite3/sqlite3_go18.go b/vendor/github.com/mattn/go-sqlite3/sqlite3_sql.go similarity index 97% rename from vendor/github.com/mattn/go-sqlite3/sqlite3_go18.go rename to vendor/github.com/mattn/go-sqlite3/sqlite3_sql.go index 34cad08e42..47c522f488 100644 --- a/vendor/github.com/mattn/go-sqlite3/sqlite3_go18.go +++ b/vendor/github.com/mattn/go-sqlite3/sqlite3_sql.go @@ -3,15 +3,14 @@ // Use of this source code is governed by an MIT-style // license that can be found in the LICENSE file. -//go:build cgo && go1.8 -// +build cgo,go1.8 +//go:build cgo +// +build cgo package sqlite3 import ( - "database/sql/driver" - "context" + "database/sql/driver" ) // Ping implement Pinger. diff --git a/vendor/github.com/prometheus/procfs/.golangci.yml b/vendor/github.com/prometheus/procfs/.golangci.yml index 23ecd4505b..eac920ba80 100644 --- a/vendor/github.com/prometheus/procfs/.golangci.yml +++ b/vendor/github.com/prometheus/procfs/.golangci.yml @@ -34,6 +34,14 @@ linters: capital: true misspell: locale: US + revive: + rules: + - name: var-naming + # TODO(SuperQ): See: https://github.com/prometheus/prometheus/issues/17766 + arguments: + - [] + - [] + - - skip-package-name-checks: true exclusions: presets: - comments diff --git a/vendor/github.com/prometheus/procfs/Makefile.common b/vendor/github.com/prometheus/procfs/Makefile.common index 6f61bec48f..cce3ef1d16 100644 --- a/vendor/github.com/prometheus/procfs/Makefile.common +++ b/vendor/github.com/prometheus/procfs/Makefile.common @@ -1,4 +1,4 @@ -# Copyright 2018 The Prometheus Authors +# Copyright The Prometheus Authors # 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 @@ -55,13 +55,13 @@ ifneq ($(shell command -v gotestsum 2> /dev/null),) endif endif -PROMU_VERSION ?= 0.17.0 +PROMU_VERSION ?= 0.18.0 PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz SKIP_GOLANGCI_LINT := GOLANGCI_LINT := GOLANGCI_LINT_OPTS ?= -GOLANGCI_LINT_VERSION ?= v2.1.5 +GOLANGCI_LINT_VERSION ?= v2.10.1 GOLANGCI_FMT_OPTS ?= # golangci-lint only supports linux, darwin and windows platforms on i386/amd64/arm64. # windows isn't included here because of the path separator being different. @@ -82,11 +82,50 @@ endif PREFIX ?= $(shell pwd) BIN_DIR ?= $(shell pwd) DOCKER_IMAGE_TAG ?= $(subst /,-,$(shell git rev-parse --abbrev-ref HEAD)) -DOCKERFILE_PATH ?= ./Dockerfile DOCKERBUILD_CONTEXT ?= ./ DOCKER_REPO ?= prom +# Check if deprecated DOCKERFILE_PATH is set +ifdef DOCKERFILE_PATH +$(error DOCKERFILE_PATH is deprecated. Use DOCKERFILE_VARIANTS ?= $(DOCKERFILE_PATH) in the Makefile) +endif + DOCKER_ARCHS ?= amd64 +DOCKERFILE_VARIANTS ?= Dockerfile $(wildcard Dockerfile.*) + +# Function to extract variant from Dockerfile label. +# Returns the variant name from io.prometheus.image.variant label, or "default" if not found. +define dockerfile_variant +$(strip $(or $(shell sed -n 's/.*io\.prometheus\.image\.variant="\([^"]*\)".*/\1/p' $(1)),default)) +endef + +# Check for duplicate variant names (including default for Dockerfiles without labels). +DOCKERFILE_VARIANT_NAMES := $(foreach df,$(DOCKERFILE_VARIANTS),$(call dockerfile_variant,$(df))) +DOCKERFILE_VARIANT_NAMES_SORTED := $(sort $(DOCKERFILE_VARIANT_NAMES)) +ifneq ($(words $(DOCKERFILE_VARIANT_NAMES)),$(words $(DOCKERFILE_VARIANT_NAMES_SORTED))) +$(error Duplicate variant names found. Each Dockerfile must have a unique io.prometheus.image.variant label, and only one can be without a label (default)) +endif + +# Build variant:dockerfile pairs for shell iteration. +DOCKERFILE_VARIANTS_WITH_NAMES := $(foreach df,$(DOCKERFILE_VARIANTS),$(call dockerfile_variant,$(df)):$(df)) + +# Shell helper to check whether a dockerfile/arch pair is excluded. +define dockerfile_arch_is_excluded +case " $(DOCKERFILE_ARCH_EXCLUSIONS) " in \ + *" $$dockerfile:$(1) "*) true ;; \ + *) false ;; \ +esac +endef + +# Shell helper to check whether a registry/arch pair is excluded. +# Extracts registry from DOCKER_REPO (e.g., quay.io/prometheus -> quay.io) +define registry_arch_is_excluded +registry=$$(echo "$(DOCKER_REPO)" | cut -d'/' -f1); \ +case " $(DOCKER_REGISTRY_ARCH_EXCLUSIONS) " in \ + *" $$registry:$(1) "*) true ;; \ + *) false ;; \ +esac +endef BUILD_DOCKER_ARCHS = $(addprefix common-docker-,$(DOCKER_ARCHS)) PUBLISH_DOCKER_ARCHS = $(addprefix common-docker-publish-,$(DOCKER_ARCHS)) @@ -112,7 +151,7 @@ common-all: precheck style check_license lint yamllint unused build test .PHONY: common-style common-style: @echo ">> checking code style" - @fmtRes=$$($(GOFMT) -d $$(find . -path ./vendor -prune -o -name '*.go' -print)); \ + @fmtRes=$$($(GOFMT) -d $$(git ls-files '*.go' ':!:vendor/*' || find . -path ./vendor -prune -o -name '*.go' -print)); \ if [ -n "$${fmtRes}" ]; then \ echo "gofmt checking failed!"; echo "$${fmtRes}"; echo; \ echo "Please ensure you are using $$($(GO) version) for formatting code."; \ @@ -122,13 +161,19 @@ common-style: .PHONY: common-check_license common-check_license: @echo ">> checking license header" - @licRes=$$(for file in $$(find . -type f -iname '*.go' ! -path './vendor/*') ; do \ + @licRes=$$(for file in $$(git ls-files '*.go' ':!:vendor/*' || find . -path ./vendor -prune -o -type f -iname '*.go' -print) ; do \ awk 'NR<=3' $$file | grep -Eq "(Copyright|generated|GENERATED)" || echo $$file; \ done); \ if [ -n "$${licRes}" ]; then \ echo "license header checking failed:"; echo "$${licRes}"; \ exit 1; \ fi + @echo ">> checking for copyright years 2026 or later" + @futureYearRes=$$(git grep -E 'Copyright (202[6-9]|20[3-9][0-9])' -- '*.go' ':!:vendor/*' || true); \ + if [ -n "$${futureYearRes}" ]; then \ + echo "Files with copyright year 2026 or later found (should use 'Copyright The Prometheus Authors'):"; echo "$${futureYearRes}"; \ + exit 1; \ + fi .PHONY: common-deps common-deps: @@ -220,28 +265,194 @@ common-docker-repo-name: .PHONY: common-docker $(BUILD_DOCKER_ARCHS) common-docker: $(BUILD_DOCKER_ARCHS) $(BUILD_DOCKER_ARCHS): common-docker-%: - docker build -t "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)" \ - -f $(DOCKERFILE_PATH) \ - --build-arg ARCH="$*" \ - --build-arg OS="linux" \ - $(DOCKERBUILD_CONTEXT) + @for variant in $(DOCKERFILE_VARIANTS_WITH_NAMES); do \ + dockerfile=$${variant#*:}; \ + variant_name=$${variant%%:*}; \ + if $(call dockerfile_arch_is_excluded,$*); then \ + echo "Skipping $$variant_name variant for linux-$* (excluded by DOCKERFILE_ARCH_EXCLUSIONS)"; \ + continue; \ + fi; \ + distroless_arch="$*"; \ + if [ "$*" = "armv7" ]; then \ + distroless_arch="arm"; \ + fi; \ + if [ "$$dockerfile" = "Dockerfile" ]; then \ + echo "Building default variant ($$variant_name) for linux-$* using $$dockerfile"; \ + docker build -t "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)" \ + -f $$dockerfile \ + --build-arg ARCH="$*" \ + --build-arg OS="linux" \ + --build-arg DISTROLESS_ARCH="$$distroless_arch" \ + $(DOCKERBUILD_CONTEXT); \ + if [ "$$variant_name" != "default" ]; then \ + echo "Tagging default variant with $$variant_name suffix"; \ + docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)" \ + "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)-$$variant_name"; \ + fi; \ + else \ + echo "Building $$variant_name variant for linux-$* using $$dockerfile"; \ + docker build -t "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)-$$variant_name" \ + -f $$dockerfile \ + --build-arg ARCH="$*" \ + --build-arg OS="linux" \ + --build-arg DISTROLESS_ARCH="$$distroless_arch" \ + $(DOCKERBUILD_CONTEXT); \ + fi; \ + done .PHONY: common-docker-publish $(PUBLISH_DOCKER_ARCHS) common-docker-publish: $(PUBLISH_DOCKER_ARCHS) $(PUBLISH_DOCKER_ARCHS): common-docker-publish-%: - docker push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)" + @for variant in $(DOCKERFILE_VARIANTS_WITH_NAMES); do \ + dockerfile=$${variant#*:}; \ + variant_name=$${variant%%:*}; \ + if $(call dockerfile_arch_is_excluded,$*); then \ + echo "Skipping push for $$variant_name variant on linux-$* (excluded by DOCKERFILE_ARCH_EXCLUSIONS)"; \ + continue; \ + fi; \ + if $(call registry_arch_is_excluded,$*); then \ + echo "Skipping push for $$variant_name variant on linux-$* to $(DOCKER_REPO) (excluded by DOCKER_REGISTRY_ARCH_EXCLUSIONS)"; \ + continue; \ + fi; \ + if [ "$$dockerfile" != "Dockerfile" ] || [ "$$variant_name" != "default" ]; then \ + echo "Pushing $$variant_name variant for linux-$*"; \ + docker push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)-$$variant_name"; \ + fi; \ + if [ "$$dockerfile" = "Dockerfile" ]; then \ + echo "Pushing default variant ($$variant_name) for linux-$*"; \ + docker push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)"; \ + fi; \ + if [ "$(DOCKER_IMAGE_TAG)" = "latest" ]; then \ + if [ "$$dockerfile" != "Dockerfile" ] || [ "$$variant_name" != "default" ]; then \ + echo "Pushing $$variant_name variant version tags for linux-$*"; \ + docker push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:v$(DOCKER_MAJOR_VERSION_TAG)-$$variant_name"; \ + fi; \ + if [ "$$dockerfile" = "Dockerfile" ]; then \ + echo "Pushing default variant version tag for linux-$*"; \ + docker push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:v$(DOCKER_MAJOR_VERSION_TAG)"; \ + fi; \ + fi; \ + done DOCKER_MAJOR_VERSION_TAG = $(firstword $(subst ., ,$(shell cat VERSION))) .PHONY: common-docker-tag-latest $(TAG_DOCKER_ARCHS) common-docker-tag-latest: $(TAG_DOCKER_ARCHS) $(TAG_DOCKER_ARCHS): common-docker-tag-latest-%: - docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:latest" - docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:v$(DOCKER_MAJOR_VERSION_TAG)" + @for variant in $(DOCKERFILE_VARIANTS_WITH_NAMES); do \ + dockerfile=$${variant#*:}; \ + variant_name=$${variant%%:*}; \ + if $(call dockerfile_arch_is_excluded,$*); then \ + echo "Skipping tag for $$variant_name variant on linux-$* (excluded by DOCKERFILE_ARCH_EXCLUSIONS)"; \ + continue; \ + fi; \ + if $(call registry_arch_is_excluded,$*); then \ + echo "Skipping tag for $$variant_name variant on linux-$* for $(DOCKER_REPO) (excluded by DOCKER_REGISTRY_ARCH_EXCLUSIONS)"; \ + continue; \ + fi; \ + if [ "$$dockerfile" != "Dockerfile" ] || [ "$$variant_name" != "default" ]; then \ + echo "Tagging $$variant_name variant for linux-$* as latest"; \ + docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)-$$variant_name" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:latest-$$variant_name"; \ + docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)-$$variant_name" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:v$(DOCKER_MAJOR_VERSION_TAG)-$$variant_name"; \ + fi; \ + if [ "$$dockerfile" = "Dockerfile" ]; then \ + echo "Tagging default variant ($$variant_name) for linux-$* as latest"; \ + docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:latest"; \ + docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:v$(DOCKER_MAJOR_VERSION_TAG)"; \ + fi; \ + done .PHONY: common-docker-manifest common-docker-manifest: - DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create -a "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(SANITIZED_DOCKER_IMAGE_TAG)" $(foreach ARCH,$(DOCKER_ARCHS),$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$(ARCH):$(SANITIZED_DOCKER_IMAGE_TAG)) - DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(SANITIZED_DOCKER_IMAGE_TAG)" + @for variant in $(DOCKERFILE_VARIANTS_WITH_NAMES); do \ + dockerfile=$${variant#*:}; \ + variant_name=$${variant%%:*}; \ + if [ "$$dockerfile" != "Dockerfile" ] || [ "$$variant_name" != "default" ]; then \ + echo "Creating manifest for $$variant_name variant"; \ + refs=""; \ + for arch in $(DOCKER_ARCHS); do \ + if $(call dockerfile_arch_is_excluded,$$arch); then \ + echo " Skipping $$arch for $$variant_name (excluded by DOCKERFILE_ARCH_EXCLUSIONS)"; \ + continue; \ + fi; \ + if $(call registry_arch_is_excluded,$$arch); then \ + echo " Skipping $$arch for $$variant_name on $(DOCKER_REPO) (excluded by DOCKER_REGISTRY_ARCH_EXCLUSIONS)"; \ + continue; \ + fi; \ + refs="$$refs $(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$$arch:$(SANITIZED_DOCKER_IMAGE_TAG)-$$variant_name"; \ + done; \ + if [ -z "$$refs" ]; then \ + echo "Skipping manifest for $$variant_name variant (no supported architectures)"; \ + continue; \ + fi; \ + DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create -a "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(SANITIZED_DOCKER_IMAGE_TAG)-$$variant_name" $$refs; \ + DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(SANITIZED_DOCKER_IMAGE_TAG)-$$variant_name"; \ + fi; \ + if [ "$$dockerfile" = "Dockerfile" ]; then \ + echo "Creating default variant ($$variant_name) manifest"; \ + refs=""; \ + for arch in $(DOCKER_ARCHS); do \ + if $(call dockerfile_arch_is_excluded,$$arch); then \ + echo " Skipping $$arch for default variant (excluded by DOCKERFILE_ARCH_EXCLUSIONS)"; \ + continue; \ + fi; \ + if $(call registry_arch_is_excluded,$$arch); then \ + echo " Skipping $$arch for default variant on $(DOCKER_REPO) (excluded by DOCKER_REGISTRY_ARCH_EXCLUSIONS)"; \ + continue; \ + fi; \ + refs="$$refs $(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$$arch:$(SANITIZED_DOCKER_IMAGE_TAG)"; \ + done; \ + if [ -z "$$refs" ]; then \ + echo "Skipping default variant manifest (no supported architectures)"; \ + continue; \ + fi; \ + DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create -a "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(SANITIZED_DOCKER_IMAGE_TAG)" $$refs; \ + DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(SANITIZED_DOCKER_IMAGE_TAG)"; \ + fi; \ + if [ "$(DOCKER_IMAGE_TAG)" = "latest" ]; then \ + if [ "$$dockerfile" != "Dockerfile" ] || [ "$$variant_name" != "default" ]; then \ + echo "Creating manifest for $$variant_name variant version tag"; \ + refs=""; \ + for arch in $(DOCKER_ARCHS); do \ + if $(call dockerfile_arch_is_excluded,$$arch); then \ + echo " Skipping $$arch for $$variant_name version tag (excluded by DOCKERFILE_ARCH_EXCLUSIONS)"; \ + continue; \ + fi; \ + if $(call registry_arch_is_excluded,$$arch); then \ + echo " Skipping $$arch for $$variant_name version tag on $(DOCKER_REPO) (excluded by DOCKER_REGISTRY_ARCH_EXCLUSIONS)"; \ + continue; \ + fi; \ + refs="$$refs $(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$$arch:v$(DOCKER_MAJOR_VERSION_TAG)-$$variant_name"; \ + done; \ + if [ -z "$$refs" ]; then \ + echo "Skipping version-tag manifest for $$variant_name variant (no supported architectures)"; \ + continue; \ + fi; \ + DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create -a "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):v$(DOCKER_MAJOR_VERSION_TAG)-$$variant_name" $$refs; \ + DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):v$(DOCKER_MAJOR_VERSION_TAG)-$$variant_name"; \ + fi; \ + if [ "$$dockerfile" = "Dockerfile" ]; then \ + echo "Creating default variant version tag manifest"; \ + refs=""; \ + for arch in $(DOCKER_ARCHS); do \ + if $(call dockerfile_arch_is_excluded,$$arch); then \ + echo " Skipping $$arch for default variant version tag (excluded by DOCKERFILE_ARCH_EXCLUSIONS)"; \ + continue; \ + fi; \ + if $(call registry_arch_is_excluded,$$arch); then \ + echo " Skipping $$arch for default variant version tag on $(DOCKER_REPO) (excluded by DOCKER_REGISTRY_ARCH_EXCLUSIONS)"; \ + continue; \ + fi; \ + refs="$$refs $(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$$arch:v$(DOCKER_MAJOR_VERSION_TAG)"; \ + done; \ + if [ -z "$$refs" ]; then \ + echo "Skipping default variant version-tag manifest (no supported architectures)"; \ + continue; \ + fi; \ + DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create -a "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):v$(DOCKER_MAJOR_VERSION_TAG)" $$refs; \ + DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):v$(DOCKER_MAJOR_VERSION_TAG)"; \ + fi; \ + fi; \ + done .PHONY: promu promu: $(PROMU) @@ -266,6 +477,10 @@ $(GOLANGCI_LINT): | sh -s -- -b $(FIRST_GOPATH)/bin $(GOLANGCI_LINT_VERSION) endif +.PHONY: common-print-golangci-lint-version +common-print-golangci-lint-version: + @echo $(GOLANGCI_LINT_VERSION) + .PHONY: precheck precheck:: diff --git a/vendor/github.com/prometheus/procfs/cpuinfo.go b/vendor/github.com/prometheus/procfs/cpuinfo.go index 5fe6cecd3d..4b23d8d6b5 100644 --- a/vendor/github.com/prometheus/procfs/cpuinfo.go +++ b/vendor/github.com/prometheus/procfs/cpuinfo.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package procfs @@ -502,7 +501,7 @@ func parseCPUInfoRISCV(info []byte) ([]CPUInfo, error) { return cpuinfo, nil } -func parseCPUInfoDummy(_ []byte) ([]CPUInfo, error) { // nolint:unused,deadcode +func parseCPUInfoDummy(_ []byte) ([]CPUInfo, error) { //nolint:unused return nil, errors.New("not implemented") } diff --git a/vendor/github.com/prometheus/procfs/cpuinfo_armx.go b/vendor/github.com/prometheus/procfs/cpuinfo_armx.go index 8f155551e5..b09035ff38 100644 --- a/vendor/github.com/prometheus/procfs/cpuinfo_armx.go +++ b/vendor/github.com/prometheus/procfs/cpuinfo_armx.go @@ -12,8 +12,6 @@ // limitations under the License. //go:build linux && (arm || arm64) -// +build linux -// +build arm arm64 package procfs diff --git a/vendor/github.com/prometheus/procfs/cpuinfo_loong64.go b/vendor/github.com/prometheus/procfs/cpuinfo_loong64.go index e81a5db949..7bb20211f9 100644 --- a/vendor/github.com/prometheus/procfs/cpuinfo_loong64.go +++ b/vendor/github.com/prometheus/procfs/cpuinfo_loong64.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package procfs diff --git a/vendor/github.com/prometheus/procfs/cpuinfo_mipsx.go b/vendor/github.com/prometheus/procfs/cpuinfo_mipsx.go index 4be2b1cc54..fd75d0f79d 100644 --- a/vendor/github.com/prometheus/procfs/cpuinfo_mipsx.go +++ b/vendor/github.com/prometheus/procfs/cpuinfo_mipsx.go @@ -12,8 +12,6 @@ // limitations under the License. //go:build linux && (mips || mipsle || mips64 || mips64le) -// +build linux -// +build mips mipsle mips64 mips64le package procfs diff --git a/vendor/github.com/prometheus/procfs/cpuinfo_others.go b/vendor/github.com/prometheus/procfs/cpuinfo_others.go index e713bae8df..3d36ba0e6b 100644 --- a/vendor/github.com/prometheus/procfs/cpuinfo_others.go +++ b/vendor/github.com/prometheus/procfs/cpuinfo_others.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux && !386 && !amd64 && !arm && !arm64 && !loong64 && !mips && !mips64 && !mips64le && !mipsle && !ppc64 && !ppc64le && !riscv64 && !s390x -// +build linux,!386,!amd64,!arm,!arm64,!loong64,!mips,!mips64,!mips64le,!mipsle,!ppc64,!ppc64le,!riscv64,!s390x package procfs diff --git a/vendor/github.com/prometheus/procfs/cpuinfo_ppcx.go b/vendor/github.com/prometheus/procfs/cpuinfo_ppcx.go index 0825aa1a83..b3425051ef 100644 --- a/vendor/github.com/prometheus/procfs/cpuinfo_ppcx.go +++ b/vendor/github.com/prometheus/procfs/cpuinfo_ppcx.go @@ -12,8 +12,6 @@ // limitations under the License. //go:build linux && (ppc64 || ppc64le) -// +build linux -// +build ppc64 ppc64le package procfs diff --git a/vendor/github.com/prometheus/procfs/cpuinfo_riscvx.go b/vendor/github.com/prometheus/procfs/cpuinfo_riscvx.go index 496770b05f..72598230c3 100644 --- a/vendor/github.com/prometheus/procfs/cpuinfo_riscvx.go +++ b/vendor/github.com/prometheus/procfs/cpuinfo_riscvx.go @@ -12,8 +12,6 @@ // limitations under the License. //go:build linux && (riscv || riscv64) -// +build linux -// +build riscv riscv64 package procfs diff --git a/vendor/github.com/prometheus/procfs/cpuinfo_s390x.go b/vendor/github.com/prometheus/procfs/cpuinfo_s390x.go index b3228ce3d8..50a8239cbc 100644 --- a/vendor/github.com/prometheus/procfs/cpuinfo_s390x.go +++ b/vendor/github.com/prometheus/procfs/cpuinfo_s390x.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build linux -// +build linux package procfs diff --git a/vendor/github.com/prometheus/procfs/cpuinfo_x86.go b/vendor/github.com/prometheus/procfs/cpuinfo_x86.go index 575eb022eb..00edb30a5c 100644 --- a/vendor/github.com/prometheus/procfs/cpuinfo_x86.go +++ b/vendor/github.com/prometheus/procfs/cpuinfo_x86.go @@ -12,8 +12,6 @@ // limitations under the License. //go:build linux && (386 || amd64) -// +build linux -// +build 386 amd64 package procfs diff --git a/vendor/github.com/prometheus/procfs/fs_statfs_notype.go b/vendor/github.com/prometheus/procfs/fs_statfs_notype.go index 3c53023c54..0bef25bdd9 100644 --- a/vendor/github.com/prometheus/procfs/fs_statfs_notype.go +++ b/vendor/github.com/prometheus/procfs/fs_statfs_notype.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build !freebsd && !linux -// +build !freebsd,!linux package procfs diff --git a/vendor/github.com/prometheus/procfs/fs_statfs_type.go b/vendor/github.com/prometheus/procfs/fs_statfs_type.go index 80fce48478..d183330390 100644 --- a/vendor/github.com/prometheus/procfs/fs_statfs_type.go +++ b/vendor/github.com/prometheus/procfs/fs_statfs_type.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build freebsd || linux -// +build freebsd linux package procfs diff --git a/vendor/github.com/prometheus/procfs/internal/util/sysreadfile.go b/vendor/github.com/prometheus/procfs/internal/util/sysreadfile.go index 8318d8dfd5..f6a4a4de62 100644 --- a/vendor/github.com/prometheus/procfs/internal/util/sysreadfile.go +++ b/vendor/github.com/prometheus/procfs/internal/util/sysreadfile.go @@ -12,8 +12,6 @@ // limitations under the License. //go:build (linux || darwin) && !appengine -// +build linux darwin -// +build !appengine package util diff --git a/vendor/github.com/prometheus/procfs/internal/util/sysreadfile_compat.go b/vendor/github.com/prometheus/procfs/internal/util/sysreadfile_compat.go index 15bb096ee2..c80e082cb9 100644 --- a/vendor/github.com/prometheus/procfs/internal/util/sysreadfile_compat.go +++ b/vendor/github.com/prometheus/procfs/internal/util/sysreadfile_compat.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build (linux && appengine) || (!linux && !darwin) -// +build linux,appengine !linux,!darwin package util diff --git a/vendor/github.com/prometheus/procfs/kernel_hung.go b/vendor/github.com/prometheus/procfs/kernel_hung.go index 539c111514..0c7a69f99f 100644 --- a/vendor/github.com/prometheus/procfs/kernel_hung.go +++ b/vendor/github.com/prometheus/procfs/kernel_hung.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build !windows -// +build !windows package procfs diff --git a/vendor/github.com/prometheus/procfs/kernel_random.go b/vendor/github.com/prometheus/procfs/kernel_random.go index b66565a104..e7c5b8cf2b 100644 --- a/vendor/github.com/prometheus/procfs/kernel_random.go +++ b/vendor/github.com/prometheus/procfs/kernel_random.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build !windows -// +build !windows package procfs diff --git a/vendor/github.com/prometheus/procfs/net_tcp.go b/vendor/github.com/prometheus/procfs/net_tcp.go index 610ea78e56..2c7f9bc7c3 100644 --- a/vendor/github.com/prometheus/procfs/net_tcp.go +++ b/vendor/github.com/prometheus/procfs/net_tcp.go @@ -25,6 +25,7 @@ type ( // NetTCP returns the IPv4 kernel/networking statistics for TCP datagrams // read from /proc/net/tcp. +// // Deprecated: Use github.com/mdlayher/netlink#Conn (with syscall.AF_INET) instead. func (fs FS) NetTCP() (NetTCP, error) { return newNetTCP(fs.proc.Path("net/tcp")) @@ -32,6 +33,7 @@ func (fs FS) NetTCP() (NetTCP, error) { // NetTCP6 returns the IPv6 kernel/networking statistics for TCP datagrams // read from /proc/net/tcp6. +// // Deprecated: Use github.com/mdlayher/netlink#Conn (with syscall.AF_INET6) instead. func (fs FS) NetTCP6() (NetTCP, error) { return newNetTCP(fs.proc.Path("net/tcp6")) @@ -39,6 +41,7 @@ func (fs FS) NetTCP6() (NetTCP, error) { // NetTCPSummary returns already computed statistics like the total queue lengths // for TCP datagrams read from /proc/net/tcp. +// // Deprecated: Use github.com/mdlayher/netlink#Conn (with syscall.AF_INET) instead. func (fs FS) NetTCPSummary() (*NetTCPSummary, error) { return newNetTCPSummary(fs.proc.Path("net/tcp")) @@ -46,6 +49,7 @@ func (fs FS) NetTCPSummary() (*NetTCPSummary, error) { // NetTCP6Summary returns already computed statistics like the total queue lengths // for TCP datagrams read from /proc/net/tcp6. +// // Deprecated: Use github.com/mdlayher/netlink#Conn (with syscall.AF_INET6) instead. func (fs FS) NetTCP6Summary() (*NetTCPSummary, error) { return newNetTCPSummary(fs.proc.Path("net/tcp6")) diff --git a/vendor/github.com/prometheus/procfs/proc_interrupts.go b/vendor/github.com/prometheus/procfs/proc_interrupts.go index b942c50723..643b500d5d 100644 --- a/vendor/github.com/prometheus/procfs/proc_interrupts.go +++ b/vendor/github.com/prometheus/procfs/proc_interrupts.go @@ -42,7 +42,7 @@ type Interrupts map[string]Interrupt // Interrupts creates a new instance from a given Proc instance. func (p Proc) Interrupts() (Interrupts, error) { - data, err := util.ReadFileNoStat(p.path("interrupts")) + data, err := util.ReadFileNoStat(p.fs.proc.Path("interrupts")) if err != nil { return nil, err } diff --git a/vendor/github.com/prometheus/procfs/proc_maps.go b/vendor/github.com/prometheus/procfs/proc_maps.go index cc519f92f9..08b89a6eb9 100644 --- a/vendor/github.com/prometheus/procfs/proc_maps.go +++ b/vendor/github.com/prometheus/procfs/proc_maps.go @@ -12,8 +12,6 @@ // limitations under the License. //go:build (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris) && !js -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris -// +build !js package procfs diff --git a/vendor/github.com/prometheus/procfs/proc_smaps.go b/vendor/github.com/prometheus/procfs/proc_smaps.go index 3e48afd1d3..f637309b3d 100644 --- a/vendor/github.com/prometheus/procfs/proc_smaps.go +++ b/vendor/github.com/prometheus/procfs/proc_smaps.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build !windows -// +build !windows package procfs diff --git a/vendor/github.com/prometheus/procfs/proc_statm.go b/vendor/github.com/prometheus/procfs/proc_statm.go index b0a9360167..6bcc97ec9c 100644 --- a/vendor/github.com/prometheus/procfs/proc_statm.go +++ b/vendor/github.com/prometheus/procfs/proc_statm.go @@ -45,6 +45,7 @@ type ProcStatm struct { } // NewStatm returns the current status information of the process. +// // Deprecated: Use p.Statm() instead. func (p Proc) NewStatm() (ProcStatm, error) { return p.Statm() diff --git a/vendor/github.com/prometheus/procfs/proc_status.go b/vendor/github.com/prometheus/procfs/proc_status.go index 1ed2bced41..12d65581c8 100644 --- a/vendor/github.com/prometheus/procfs/proc_status.go +++ b/vendor/github.com/prometheus/procfs/proc_status.go @@ -83,6 +83,19 @@ type ProcStatus struct { // CpusAllowedList: List of cpu cores processes are allowed to run on. CpusAllowedList []uint64 + + // CapInh is the bitmap of inheritable capabilities + // + // See: https://www.kernel.org/doc/man-pages/online/pages/man7/capabilities.7.html + CapInh uint64 + // CapPrm is the bitmap of permitted capabilities + CapPrm uint64 + // CapEff is the bitmap of effective capabilities + CapEff uint64 + // CapBnd is the bitmap of bounding capabilities + CapBnd uint64 + // CapAmb is the bitmap of ambient capabilities + CapAmb uint64 } // NewStatus returns the current status information of the process. @@ -190,6 +203,36 @@ func (s *ProcStatus) fillStatus(k string, vString string, vUint uint64, vUintByt s.NonVoluntaryCtxtSwitches = vUint case "Cpus_allowed_list": s.CpusAllowedList = calcCpusAllowedList(vString) + case "CapInh": + var err error + s.CapInh, err = strconv.ParseUint(vString, 16, 64) + if err != nil { + return err + } + case "CapPrm": + var err error + s.CapPrm, err = strconv.ParseUint(vString, 16, 64) + if err != nil { + return err + } + case "CapEff": + var err error + s.CapEff, err = strconv.ParseUint(vString, 16, 64) + if err != nil { + return err + } + case "CapBnd": + var err error + s.CapBnd, err = strconv.ParseUint(vString, 16, 64) + if err != nil { + return err + } + case "CapAmb": + var err error + s.CapAmb, err = strconv.ParseUint(vString, 16, 64) + if err != nil { + return err + } } return nil diff --git a/vendor/github.com/prometheus/procfs/vm.go b/vendor/github.com/prometheus/procfs/vm.go index 2a8d763909..52180c03e2 100644 --- a/vendor/github.com/prometheus/procfs/vm.go +++ b/vendor/github.com/prometheus/procfs/vm.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build !windows -// +build !windows package procfs diff --git a/vendor/github.com/prometheus/procfs/zoneinfo.go b/vendor/github.com/prometheus/procfs/zoneinfo.go index 806e171147..63d1898bc8 100644 --- a/vendor/github.com/prometheus/procfs/zoneinfo.go +++ b/vendor/github.com/prometheus/procfs/zoneinfo.go @@ -12,7 +12,6 @@ // limitations under the License. //go:build !windows -// +build !windows package procfs diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go index f7338b7e52..a7d4b2a815 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go @@ -194,6 +194,9 @@ func WithServerName(server string) Option { // WithMetricAttributesFn returns an Option to set a function that maps an HTTP request to a slice of attribute.KeyValue. // These attributes will be included in metrics for every request. +// +// Deprecated: WithMetricAttributesFn is deprecated and will be removed in a +// future release. Use [Labeler] instead. func WithMetricAttributesFn(metricAttributesFn func(r *http.Request) []attribute.KeyValue) Option { return optionFunc(func(c *config) { c.MetricAttributesFn = metricAttributesFn 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 1ecd4be2dd..a269fce0f7 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 @@ -184,30 +184,26 @@ func (h *middleware) serveHTTP(w http.ResponseWriter, r *http.Request, next http statusCode := rww.StatusCode() bytesWritten := rww.BytesWritten() span.SetStatus(h.semconv.Status(statusCode)) + bytesRead := bw.BytesRead() span.SetAttributes(h.semconv.ResponseTraceAttrs(semconv.ResponseTelemetry{ StatusCode: statusCode, - ReadBytes: bw.BytesRead(), + ReadBytes: bytesRead, ReadError: bw.Error(), WriteBytes: bytesWritten, WriteError: rww.Error(), })...) - // 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: metricAttributes, + ServerName: h.server, + ResponseSize: bytesWritten, + MetricAttributes: semconv.MetricAttributes{ + Req: r, + StatusCode: statusCode, + AdditionalAttributes: append(labeler.Get(), h.metricAttributesFromRequest(r)...), + }, MetricData: semconv.MetricData{ - RequestSize: bw.BytesRead(), - ElapsedTime: elapsedTime, + RequestSize: bytesRead, + RequestDuration: time.Since(requestStartTime), }, }) } diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/resp_writer_wrapper.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/resp_writer_wrapper.go index ca2e4c14c7..f29f9b7c96 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/resp_writer_wrapper.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/resp_writer_wrapper.go @@ -61,7 +61,7 @@ func (w *RespWriterWrapper) Write(p []byte) (int, error) { // WriteHeader persists initial statusCode for span attribution. // All calls to WriteHeader will be propagated to the underlying ResponseWriter -// and will persist the statusCode from the first call. +// and will persist the statusCode from the first call (except for informational response status codes). // Blocking consecutive calls to WriteHeader alters expected behavior and will // remove warning logs from net/http where developers will notice incorrect handler implementations. func (w *RespWriterWrapper) WriteHeader(statusCode int) { @@ -77,6 +77,13 @@ func (w *RespWriterWrapper) WriteHeader(statusCode int) { // parent method. func (w *RespWriterWrapper) writeHeader(statusCode int) { if !w.wroteHeader { + // Ignore informational response status codes. + // Based on https://github.com/golang/go/blob/go1.24.1/src/net/http/server.go#L1216 + if statusCode >= 100 && statusCode <= 199 && statusCode != http.StatusSwitchingProtocols { + w.ResponseWriter.WriteHeader(statusCode) + return + } + w.wroteHeader = true w.statusCode = statusCode } diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/client.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/client.go index 29d6f508c1..1398d85c2e 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/client.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/client.go @@ -19,11 +19,11 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/semconv/v1.39.0" - "go.opentelemetry.io/otel/semconv/v1.39.0/httpconv" + "go.opentelemetry.io/otel/semconv/v1.40.0" + "go.opentelemetry.io/otel/semconv/v1.40.0/httpconv" ) -type HTTPClient struct{ +type HTTPClient struct { requestBodySize httpconv.ClientRequestBodySize requestDuration httpconv.ClientRequestDuration } @@ -57,14 +57,14 @@ func (n HTTPClient) Status(code int) (codes.Code, string) { // RequestTraceAttrs returns trace attributes for an HTTP request made by a client. func (n HTTPClient) RequestTraceAttrs(req *http.Request) []attribute.KeyValue { /* - below attributes are returned: - - http.request.method - - http.request.method.original - - url.full - - server.address - - server.port - - network.protocol.name - - network.protocol.version + below attributes are returned: + - http.request.method + - http.request.method.original + - url.full + - server.address + - server.port + - network.protocol.name + - network.protocol.version */ numOfAttributes := 3 // URL, server address, proto, and method. @@ -139,9 +139,9 @@ func (n HTTPClient) RequestTraceAttrs(req *http.Request) []attribute.KeyValue { // ResponseTraceAttrs returns trace attributes for an HTTP response made by a client. func (n HTTPClient) ResponseTraceAttrs(resp *http.Response) []attribute.KeyValue { /* - below attributes are returned: - - http.response.status_code - - error.type + below attributes are returned: + - http.response.status_code + - error.type */ var count int if resp.StatusCode > 0 { @@ -247,22 +247,26 @@ func (o MetricOpts) AddOptions() metric.AddOption { return o.addOptions } -func (n HTTPClient) MetricOptions(ma MetricAttributes) map[string]MetricOpts { - opts := map[string]MetricOpts{} - +func (n HTTPClient) MetricOptions(ma MetricAttributes) MetricOpts { attributes := n.MetricAttributes(ma.Req, ma.StatusCode, ma.AdditionalAttributes) set := metric.WithAttributeSet(attribute.NewSet(attributes...)) - opts["new"] = MetricOpts{ + + return MetricOpts{ measurement: set, addOptions: set, } - - return opts } -func (n HTTPClient) RecordMetrics(ctx context.Context, md MetricData, opts map[string]MetricOpts) { - n.requestBodySize.Inst().Record(ctx, md.RequestSize, opts["new"].MeasurementOption()) - n.requestDuration.Inst().Record(ctx, md.ElapsedTime/1000, opts["new"].MeasurementOption()) +func (n HTTPClient) RecordMetrics(ctx context.Context, md MetricData, opts MetricOpts) { + recordOpts := metricRecordOptionPool.Get().(*[]metric.RecordOption) + defer func() { + *recordOpts = (*recordOpts)[:0] + metricRecordOptionPool.Put(recordOpts) + }() + *recordOpts = append(*recordOpts, opts.MeasurementOption()) + + n.requestBodySize.Inst().Record(ctx, md.RequestSize, *recordOpts...) + n.requestDuration.Inst().Record(ctx, durationToSeconds(md.RequestDuration), *recordOpts...) } // TraceAttributes returns attributes for httptrace. diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/server.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/server.go index e0e9ebc05d..6dcf1b5b52 100644 --- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/server.go +++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/server.go @@ -15,12 +15,13 @@ import ( "slices" "strings" "sync" + "time" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/semconv/v1.39.0" - "go.opentelemetry.io/otel/semconv/v1.39.0/httpconv" + "go.opentelemetry.io/otel/semconv/v1.40.0" + "go.opentelemetry.io/otel/semconv/v1.40.0/httpconv" ) type RequestTraceAttrsOpts struct { @@ -36,7 +37,7 @@ type ResponseTelemetry struct { WriteError error } -type HTTPServer struct{ +type HTTPServer struct { requestBodySizeHistogram httpconv.ServerRequestBodySize responseBodySizeHistogram httpconv.ServerResponseBodySize requestDurationHistogram httpconv.ServerRequestDuration @@ -245,19 +246,11 @@ type MetricAttributes struct { } type MetricData struct { - RequestSize int64 - - // The request duration, in milliseconds - ElapsedTime float64 + RequestSize int64 + RequestDuration time.Duration } var ( - metricAddOptionPool = &sync.Pool{ - New: func() any { - return &[]metric.AddOption{} - }, - } - metricRecordOptionPool = &sync.Pool{ New: func() any { return &[]metric.RecordOption{} @@ -272,7 +265,7 @@ func (n HTTPServer) RecordMetrics(ctx context.Context, md ServerMetricData) { *recordOpts = append(*recordOpts, o) n.requestBodySizeHistogram.Inst().Record(ctx, md.RequestSize, *recordOpts...) n.responseBodySizeHistogram.Inst().Record(ctx, md.ResponseSize, *recordOpts...) - n.requestDurationHistogram.Inst().Record(ctx, md.ElapsedTime/1000.0, o) + n.requestDurationHistogram.Inst().Record(ctx, durationToSeconds(md.RequestDuration), o) *recordOpts = (*recordOpts)[:0] metricRecordOptionPool.Put(recordOpts) } @@ -373,8 +366,8 @@ func (n HTTPServer) MetricAttributes(server string, req *http.Request, statusCod } if route != "" { - num++ - } + num++ + } attributes := slices.Grow(additionalAttributes, num) attributes = append(attributes, @@ -397,7 +390,7 @@ func (n HTTPServer) MetricAttributes(server string, req *http.Request, statusCod } if route != "" { - attributes = append(attributes, semconv.HTTPRoute(route)) - } + attributes = append(attributes, semconv.HTTPRoute(route)) + } return attributes } 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 131fda489b..2eab2ecabd 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 @@ -11,10 +11,11 @@ import ( "net/http" "strconv" "strings" + "time" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" - semconvNew "go.opentelemetry.io/otel/semconv/v1.39.0" + semconvNew "go.opentelemetry.io/otel/semconv/v1.40.0" ) // SplitHostPort splits a network address hostport of the form "host", @@ -125,3 +126,8 @@ func standardizeHTTPMethod(method string) string { } return method } + +func durationToSeconds(d time.Duration) float64 { + // Use floating point division here for higher precision (instead of Seconds method). + return float64(d) / float64(time.Second) +} 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 59b6c5498d..d8d204d1f8 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 @@ -5,7 +5,6 @@ package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http import ( "context" - "fmt" "io" "net/http" "net/http/httptrace" @@ -16,7 +15,7 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/propagation" - otelsemconv "go.opentelemetry.io/otel/semconv/v1.39.0" + otelsemconv "go.opentelemetry.io/otel/semconv/v1.40.0" "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request" @@ -85,8 +84,6 @@ func defaultTransportFormatter(_ string, r *http.Request) string { // RoundTrip creates a Span and propagates its context via the provided request's headers // before handing the request to the configured base RoundTripper. The created span will // end when the response body is closed or when a read from the body returns io.EOF. -// If GetBody returns an error, the error is reported via otel.Handle and the request -// continues with the original Body. func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) { requestStartTime := time.Now() for _, f := range t.filters { @@ -106,9 +103,7 @@ func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) { } } - opts := append([]trace.SpanStartOption{}, t.spanStartOptions...) // start with the configured options - - ctx, span := tracer.Start(r.Context(), t.spanNameFormatter("", r), opts...) + ctx, span := tracer.Start(r.Context(), t.spanNameFormatter("", r), t.spanStartOptions...) if t.clientTrace != nil { ctx = httptrace.WithClientTrace(ctx, t.clientTrace(ctx)) @@ -121,23 +116,26 @@ func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) { r = r.Clone(ctx) // According to RoundTripper spec, we shouldn't modify the origin request. - // GetBody is preferred over direct access to Body if the function is set. - // If the resulting body is nil or is NoBody, we don't want to mutate the body as it - // will affect the identity of it in an unforeseeable way because we assert - // ReadCloser fulfills a certain interface and it is indeed nil or NoBody. - body := r.Body - if r.GetBody != nil { - b, err := r.GetBody() - if err != nil { - otel.Handle(fmt.Errorf("http.Request GetBody returned an error: %w", err)) - } else { - body = b + var lastBW *request.BodyWrapper // Records the last body wrapper. Can be nil. + maybeWrapBody := func(body io.ReadCloser) io.ReadCloser { + if body == nil || body == http.NoBody { + return body } + bw := request.NewBodyWrapper(body, func(int64) {}) + lastBW = bw + return bw } - - bw := request.NewBodyWrapper(body, func(int64) {}) - if body != nil && body != http.NoBody { - r.Body = bw + r.Body = maybeWrapBody(r.Body) + if r.GetBody != nil { + originalGetBody := r.GetBody + r.GetBody = func() (io.ReadCloser, error) { + b, err := originalGetBody() + if err != nil { + lastBW = nil // The underlying transport will fail to make a retry request, hence, record no data. + return nil, err + } + return maybeWrapBody(b), nil + } } span.SetAttributes(t.semconv.RequestTraceAttrs(r)...) @@ -145,35 +143,27 @@ func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) { res, err := t.rt.RoundTrip(r) - // Defer metrics recording function to record the metrics on error or no error. - defer func() { - metricAttributes := semconv.MetricAttributes{ + // Record the metrics on error or no error. + statusCode := 0 + if err == nil { + statusCode = res.StatusCode + } + var requestSize int64 + if lastBW != nil { + requestSize = lastBW.BytesRead() + } + t.semconv.RecordMetrics( + ctx, + semconv.MetricData{ + RequestSize: requestSize, + RequestDuration: time.Since(requestStartTime), + }, + t.semconv.MetricOptions(semconv.MetricAttributes{ Req: r, + StatusCode: statusCode, AdditionalAttributes: append(labeler.Get(), t.metricAttributesFromRequest(r)...), - } - - if err == nil { - metricAttributes.StatusCode = res.StatusCode - } - - metricOpts := t.semconv.MetricOptions(metricAttributes) - - metricData := semconv.MetricData{ - RequestSize: bw.BytesRead(), - } - - if err == nil { - readRecordFunc := func(int64) {} - res.Body = newWrappedBody(span, readRecordFunc, res.Body) - } - - // Use floating point division here for higher precision (instead of Millisecond method). - elapsedTime := float64(time.Since(requestStartTime)) / float64(time.Millisecond) - - metricData.ElapsedTime = elapsedTime - - t.semconv.RecordMetrics(ctx, metricData, metricOpts) - }() + }), + ) if err != nil { span.SetAttributes(otelsemconv.ErrorType(err)) @@ -183,6 +173,8 @@ func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) { return res, err } + readRecordFunc := func(int64) {} + res.Body = newWrappedBody(span, readRecordFunc, res.Body) // traces span.SetAttributes(t.semconv.ResponseTraceAttrs(res)...) span.SetStatus(t.semconv.Status(res.StatusCode)) 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 d0107952e1..1d90fc264d 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 @@ -4,4 +4,4 @@ package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" // Version is the current release version of the otelhttp instrumentation. -const Version = "0.65.0" +const Version = "0.67.0" diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/client.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/client.go index 76b7cd461b..258d0ca6a5 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/client.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/client.go @@ -62,7 +62,7 @@ func NewClient(opts ...Option) otlptrace.Client { func newClient(opts ...Option) *client { cfg := otlpconfig.NewGRPCConfig(asGRPCOptions(opts)...) - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithCancel(context.Background()) //nolint:gosec // cancel called in client shutdown. c := &client{ endpoint: cfg.Traces.Endpoint, @@ -248,7 +248,7 @@ func (c *client) exportContext(parent context.Context) (context.Context, context if c.exportTimeout > 0 { ctx, cancel = context.WithTimeoutCause(parent, c.exportTimeout, errors.New("exporter export timeout")) } else { - ctx, cancel = context.WithCancel(parent) + ctx, cancel = context.WithCancel(parent) //nolint:gosec // cancel called by caller when export is complete. } if c.metadata.Len() > 0 { diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/observ/instrumentation.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/observ/instrumentation.go index d4a69f4d7c..a84733174e 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/observ/instrumentation.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/observ/instrumentation.go @@ -18,8 +18,8 @@ import ( "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/x" "go.opentelemetry.io/otel/internal/global" "go.opentelemetry.io/otel/metric" - semconv "go.opentelemetry.io/otel/semconv/v1.39.0" - "go.opentelemetry.io/otel/semconv/v1.39.0/otelconv" + semconv "go.opentelemetry.io/otel/semconv/v1.40.0" + "go.opentelemetry.io/otel/semconv/v1.40.0/otelconv" ) const ( @@ -208,10 +208,12 @@ func BaseAttrs(id int64, target string) []attribute.KeyValue { func (i *Instrumentation) ExportSpans(ctx context.Context, nSpans int) ExportOp { start := time.Now() - addOpt := get[metric.AddOption](addOptPool) - defer put(addOptPool, addOpt) - *addOpt = append(*addOpt, i.addOpt) - i.inflightSpans.Add(ctx, int64(nSpans), *addOpt...) + if i.inflightSpans.Enabled(ctx) { + addOpt := get[metric.AddOption](addOptPool) + defer put(addOptPool, addOpt) + *addOpt = append(*addOpt, i.addOpt) + i.inflightSpans.Add(ctx, int64(nSpans), *addOpt...) + } return ExportOp{ ctx: ctx, @@ -244,14 +246,18 @@ func (e ExportOp) End(err error, code codes.Code) { defer put(addOptPool, addOpt) *addOpt = append(*addOpt, e.inst.addOpt) - e.inst.inflightSpans.Add(e.ctx, -e.nSpans, *addOpt...) + if e.inst.inflightSpans.Enabled(e.ctx) { + e.inst.inflightSpans.Add(e.ctx, -e.nSpans, *addOpt...) + } success := successful(e.nSpans, err) // Record successfully exported spans, even if the value is 0 which are // meaningful to distribution aggregations. - e.inst.exportedSpans.Add(e.ctx, success, *addOpt...) + if e.inst.exportedSpans.Enabled(e.ctx) { + e.inst.exportedSpans.Add(e.ctx, success, *addOpt...) + } - if err != nil { + if err != nil && e.inst.exportedSpans.Enabled(e.ctx) { attrs := get[attribute.KeyValue](measureAttrsPool) defer put(measureAttrsPool, attrs) *attrs = append(*attrs, e.inst.attrs...) @@ -266,12 +272,14 @@ func (e ExportOp) End(err error, code codes.Code) { e.inst.exportedSpans.Add(e.ctx, e.nSpans-success, *addOpt...) } - recOpt := get[metric.RecordOption](recordOptPool) - defer put(recordOptPool, recOpt) - *recOpt = append(*recOpt, e.inst.recordOption(err, code)) + if e.inst.opDuration.Enabled(e.ctx) { + recOpt := get[metric.RecordOption](recordOptPool) + defer put(recordOptPool, recOpt) + *recOpt = append(*recOpt, e.inst.recordOption(err, code)) - d := time.Since(e.start).Seconds() - e.inst.opDuration.Record(e.ctx, d, *recOpt...) + d := time.Since(e.start).Seconds() + e.inst.opDuration.Record(e.ctx, d, *recOpt...) + } } // recordOption returns a RecordOption with attributes representing the diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/version.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/version.go index 19fac1b725..9d4b311920 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/version.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/version.go @@ -5,4 +5,4 @@ package internal // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/ot // Version is the current release version of the OpenTelemetry OTLP gRPC trace // exporter in use. -const Version = "1.40.0" +const Version = "1.42.0" diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go index 370cd2a6f8..d1b43c3ba4 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go @@ -5,5 +5,5 @@ package otlptrace // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace" // Version is the current release version of the OpenTelemetry OTLP trace exporter in use. func Version() string { - return "1.40.0" + return "1.42.0" } diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.39.0/otelconv/metric.go b/vendor/go.opentelemetry.io/otel/semconv/v1.39.0/otelconv/metric.go deleted file mode 100644 index 901da86985..0000000000 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.39.0/otelconv/metric.go +++ /dev/null @@ -1,2222 +0,0 @@ -// Code generated from semantic convention specification. DO NOT EDIT. - -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// Package otelconv provides types and functionality for OpenTelemetry semantic -// conventions in the "otel" namespace. -package otelconv - -import ( - "context" - "sync" - - "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/metric/noop" -) - -var ( - addOptPool = &sync.Pool{New: func() any { return &[]metric.AddOption{} }} - recOptPool = &sync.Pool{New: func() any { return &[]metric.RecordOption{} }} -) - -// ErrorTypeAttr is an attribute conforming to the error.type semantic -// conventions. It represents the describes a class of error the operation ended -// with. -type ErrorTypeAttr string - -var ( - // ErrorTypeOther is a fallback error value to be used when the instrumentation - // doesn't define a custom value. - ErrorTypeOther ErrorTypeAttr = "_OTHER" -) - -// ComponentTypeAttr is an attribute conforming to the otel.component.type -// semantic conventions. It represents a name identifying the type of the -// OpenTelemetry component. -type ComponentTypeAttr string - -var ( - // ComponentTypeBatchingSpanProcessor is the builtin SDK batching span - // processor. - ComponentTypeBatchingSpanProcessor ComponentTypeAttr = "batching_span_processor" - // ComponentTypeSimpleSpanProcessor is the builtin SDK simple span processor. - ComponentTypeSimpleSpanProcessor ComponentTypeAttr = "simple_span_processor" - // ComponentTypeBatchingLogProcessor is the builtin SDK batching log record - // processor. - ComponentTypeBatchingLogProcessor ComponentTypeAttr = "batching_log_processor" - // ComponentTypeSimpleLogProcessor is the builtin SDK simple log record - // processor. - ComponentTypeSimpleLogProcessor ComponentTypeAttr = "simple_log_processor" - // ComponentTypeOtlpGRPCSpanExporter is the OTLP span exporter over gRPC with - // protobuf serialization. - ComponentTypeOtlpGRPCSpanExporter ComponentTypeAttr = "otlp_grpc_span_exporter" - // ComponentTypeOtlpHTTPSpanExporter is the OTLP span exporter over HTTP with - // protobuf serialization. - ComponentTypeOtlpHTTPSpanExporter ComponentTypeAttr = "otlp_http_span_exporter" - // ComponentTypeOtlpHTTPJSONSpanExporter is the OTLP span exporter over HTTP - // with JSON serialization. - ComponentTypeOtlpHTTPJSONSpanExporter ComponentTypeAttr = "otlp_http_json_span_exporter" - // ComponentTypeZipkinHTTPSpanExporter is the zipkin span exporter over HTTP. - ComponentTypeZipkinHTTPSpanExporter ComponentTypeAttr = "zipkin_http_span_exporter" - // ComponentTypeOtlpGRPCLogExporter is the OTLP log record exporter over gRPC - // with protobuf serialization. - ComponentTypeOtlpGRPCLogExporter ComponentTypeAttr = "otlp_grpc_log_exporter" - // ComponentTypeOtlpHTTPLogExporter is the OTLP log record exporter over HTTP - // with protobuf serialization. - ComponentTypeOtlpHTTPLogExporter ComponentTypeAttr = "otlp_http_log_exporter" - // ComponentTypeOtlpHTTPJSONLogExporter is the OTLP log record exporter over - // HTTP with JSON serialization. - ComponentTypeOtlpHTTPJSONLogExporter ComponentTypeAttr = "otlp_http_json_log_exporter" - // ComponentTypePeriodicMetricReader is the builtin SDK periodically exporting - // metric reader. - ComponentTypePeriodicMetricReader ComponentTypeAttr = "periodic_metric_reader" - // ComponentTypeOtlpGRPCMetricExporter is the OTLP metric exporter over gRPC - // with protobuf serialization. - ComponentTypeOtlpGRPCMetricExporter ComponentTypeAttr = "otlp_grpc_metric_exporter" - // ComponentTypeOtlpHTTPMetricExporter is the OTLP metric exporter over HTTP - // with protobuf serialization. - ComponentTypeOtlpHTTPMetricExporter ComponentTypeAttr = "otlp_http_metric_exporter" - // ComponentTypeOtlpHTTPJSONMetricExporter is the OTLP metric exporter over HTTP - // with JSON serialization. - ComponentTypeOtlpHTTPJSONMetricExporter ComponentTypeAttr = "otlp_http_json_metric_exporter" - // ComponentTypePrometheusHTTPTextMetricExporter is the prometheus metric - // exporter over HTTP with the default text-based format. - ComponentTypePrometheusHTTPTextMetricExporter ComponentTypeAttr = "prometheus_http_text_metric_exporter" -) - -// SpanParentOriginAttr is an attribute conforming to the otel.span.parent.origin -// semantic conventions. It represents the determines whether the span has a -// parent span, and if so, [whether it is a remote parent]. -// -// [whether it is a remote parent]: https://opentelemetry.io/docs/specs/otel/trace/api/#isremote -type SpanParentOriginAttr string - -var ( - // SpanParentOriginNone is the span does not have a parent, it is a root span. - SpanParentOriginNone SpanParentOriginAttr = "none" - // SpanParentOriginLocal is the span has a parent and the parent's span context - // [isRemote()] is false. - // - // [isRemote()]: https://opentelemetry.io/docs/specs/otel/trace/api/#isremote - SpanParentOriginLocal SpanParentOriginAttr = "local" - // SpanParentOriginRemote is the span has a parent and the parent's span context - // [isRemote()] is true. - // - // [isRemote()]: https://opentelemetry.io/docs/specs/otel/trace/api/#isremote - SpanParentOriginRemote SpanParentOriginAttr = "remote" -) - -// SpanSamplingResultAttr is an attribute conforming to the -// otel.span.sampling_result semantic conventions. It represents the result value -// of the sampler for this span. -type SpanSamplingResultAttr string - -var ( - // SpanSamplingResultDrop is the span is not sampled and not recording. - SpanSamplingResultDrop SpanSamplingResultAttr = "DROP" - // SpanSamplingResultRecordOnly is the span is not sampled, but recording. - SpanSamplingResultRecordOnly SpanSamplingResultAttr = "RECORD_ONLY" - // SpanSamplingResultRecordAndSample is the span is sampled and recording. - SpanSamplingResultRecordAndSample SpanSamplingResultAttr = "RECORD_AND_SAMPLE" -) - -// SDKExporterLogExported is an instrument used to record metric values -// conforming to the "otel.sdk.exporter.log.exported" semantic conventions. It -// represents the number of log records for which the export has finished, either -// successful or failed. -type SDKExporterLogExported struct { - metric.Int64Counter -} - -var newSDKExporterLogExportedOpts = []metric.Int64CounterOption{ - metric.WithDescription("The number of log records for which the export has finished, either successful or failed."), - metric.WithUnit("{log_record}"), -} - -// NewSDKExporterLogExported returns a new SDKExporterLogExported instrument. -func NewSDKExporterLogExported( - m metric.Meter, - opt ...metric.Int64CounterOption, -) (SDKExporterLogExported, error) { - // Check if the meter is nil. - if m == nil { - return SDKExporterLogExported{noop.Int64Counter{}}, nil - } - - if len(opt) == 0 { - opt = newSDKExporterLogExportedOpts - } else { - opt = append(opt, newSDKExporterLogExportedOpts...) - } - - i, err := m.Int64Counter( - "otel.sdk.exporter.log.exported", - opt..., - ) - if err != nil { - return SDKExporterLogExported{noop.Int64Counter{}}, err - } - return SDKExporterLogExported{i}, nil -} - -// Inst returns the underlying metric instrument. -func (m SDKExporterLogExported) Inst() metric.Int64Counter { - return m.Int64Counter -} - -// Name returns the semantic convention name of the instrument. -func (SDKExporterLogExported) Name() string { - return "otel.sdk.exporter.log.exported" -} - -// Unit returns the semantic convention unit of the instrument -func (SDKExporterLogExported) Unit() string { - return "{log_record}" -} - -// Description returns the semantic convention description of the instrument -func (SDKExporterLogExported) Description() string { - return "The number of log records for which the export has finished, either successful or failed." -} - -// Add adds incr to the existing count for attrs. -// -// All additional attrs passed are included in the recorded value. -// -// For successful exports, `error.type` MUST NOT be set. For failed exports, -// `error.type` MUST contain the failure cause. -// For exporters with partial success semantics (e.g. OTLP with -// `rejected_log_records`), rejected log records MUST count as failed and only -// non-rejected log records count as success. -// If no rejection reason is available, `rejected` SHOULD be used as value for -// `error.type`. -func (m SDKExporterLogExported) Add( - ctx context.Context, - incr int64, - attrs ...attribute.KeyValue, -) { - if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) - return - } - - o := addOptPool.Get().(*[]metric.AddOption) - defer func() { - *o = (*o)[:0] - addOptPool.Put(o) - }() - - *o = append( - *o, - metric.WithAttributes( - attrs..., - ), - ) - - m.Int64Counter.Add(ctx, incr, *o...) -} - -// AddSet adds incr to the existing count for set. -// -// For successful exports, `error.type` MUST NOT be set. For failed exports, -// `error.type` MUST contain the failure cause. -// For exporters with partial success semantics (e.g. OTLP with -// `rejected_log_records`), rejected log records MUST count as failed and only -// non-rejected log records count as success. -// If no rejection reason is available, `rejected` SHOULD be used as value for -// `error.type`. -func (m SDKExporterLogExported) AddSet(ctx context.Context, incr int64, set attribute.Set) { - if set.Len() == 0 { - m.Int64Counter.Add(ctx, incr) - return - } - - o := addOptPool.Get().(*[]metric.AddOption) - defer func() { - *o = (*o)[:0] - addOptPool.Put(o) - }() - - *o = append(*o, metric.WithAttributeSet(set)) - m.Int64Counter.Add(ctx, incr, *o...) -} - -// AttrErrorType returns an optional attribute for the "error.type" semantic -// convention. It represents the describes a class of error the operation ended -// with. -func (SDKExporterLogExported) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { - return attribute.String("error.type", string(val)) -} - -// AttrComponentName returns an optional attribute for the "otel.component.name" -// semantic convention. It represents a name uniquely identifying the instance of -// the OpenTelemetry component within its containing SDK instance. -func (SDKExporterLogExported) AttrComponentName(val string) attribute.KeyValue { - return attribute.String("otel.component.name", val) -} - -// AttrComponentType returns an optional attribute for the "otel.component.type" -// semantic convention. It represents a name identifying the type of the -// OpenTelemetry component. -func (SDKExporterLogExported) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { - return attribute.String("otel.component.type", string(val)) -} - -// AttrServerAddress returns an optional attribute for the "server.address" -// semantic convention. It represents the server domain name if available without -// reverse DNS lookup; otherwise, IP address or Unix domain socket name. -func (SDKExporterLogExported) AttrServerAddress(val string) attribute.KeyValue { - return attribute.String("server.address", val) -} - -// AttrServerPort returns an optional attribute for the "server.port" semantic -// convention. It represents the server port number. -func (SDKExporterLogExported) AttrServerPort(val int) attribute.KeyValue { - return attribute.Int("server.port", val) -} - -// SDKExporterLogInflight is an instrument used to record metric values -// conforming to the "otel.sdk.exporter.log.inflight" semantic conventions. It -// represents the number of log records which were passed to the exporter, but -// that have not been exported yet (neither successful, nor failed). -type SDKExporterLogInflight struct { - metric.Int64UpDownCounter -} - -var newSDKExporterLogInflightOpts = []metric.Int64UpDownCounterOption{ - metric.WithDescription("The number of log records which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)."), - metric.WithUnit("{log_record}"), -} - -// NewSDKExporterLogInflight returns a new SDKExporterLogInflight instrument. -func NewSDKExporterLogInflight( - m metric.Meter, - opt ...metric.Int64UpDownCounterOption, -) (SDKExporterLogInflight, error) { - // Check if the meter is nil. - if m == nil { - return SDKExporterLogInflight{noop.Int64UpDownCounter{}}, nil - } - - if len(opt) == 0 { - opt = newSDKExporterLogInflightOpts - } else { - opt = append(opt, newSDKExporterLogInflightOpts...) - } - - i, err := m.Int64UpDownCounter( - "otel.sdk.exporter.log.inflight", - opt..., - ) - if err != nil { - return SDKExporterLogInflight{noop.Int64UpDownCounter{}}, err - } - return SDKExporterLogInflight{i}, nil -} - -// Inst returns the underlying metric instrument. -func (m SDKExporterLogInflight) Inst() metric.Int64UpDownCounter { - return m.Int64UpDownCounter -} - -// Name returns the semantic convention name of the instrument. -func (SDKExporterLogInflight) Name() string { - return "otel.sdk.exporter.log.inflight" -} - -// Unit returns the semantic convention unit of the instrument -func (SDKExporterLogInflight) Unit() string { - return "{log_record}" -} - -// Description returns the semantic convention description of the instrument -func (SDKExporterLogInflight) Description() string { - return "The number of log records which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)." -} - -// Add adds incr to the existing count for attrs. -// -// All additional attrs passed are included in the recorded value. -// -// For successful exports, `error.type` MUST NOT be set. For failed exports, -// `error.type` MUST contain the failure cause. -func (m SDKExporterLogInflight) Add( - ctx context.Context, - incr int64, - attrs ...attribute.KeyValue, -) { - if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) - return - } - - o := addOptPool.Get().(*[]metric.AddOption) - defer func() { - *o = (*o)[:0] - addOptPool.Put(o) - }() - - *o = append( - *o, - metric.WithAttributes( - attrs..., - ), - ) - - m.Int64UpDownCounter.Add(ctx, incr, *o...) -} - -// AddSet adds incr to the existing count for set. -// -// For successful exports, `error.type` MUST NOT be set. For failed exports, -// `error.type` MUST contain the failure cause. -func (m SDKExporterLogInflight) AddSet(ctx context.Context, incr int64, set attribute.Set) { - if set.Len() == 0 { - m.Int64UpDownCounter.Add(ctx, incr) - return - } - - o := addOptPool.Get().(*[]metric.AddOption) - defer func() { - *o = (*o)[:0] - addOptPool.Put(o) - }() - - *o = append(*o, metric.WithAttributeSet(set)) - m.Int64UpDownCounter.Add(ctx, incr, *o...) -} - -// AttrComponentName returns an optional attribute for the "otel.component.name" -// semantic convention. It represents a name uniquely identifying the instance of -// the OpenTelemetry component within its containing SDK instance. -func (SDKExporterLogInflight) AttrComponentName(val string) attribute.KeyValue { - return attribute.String("otel.component.name", val) -} - -// AttrComponentType returns an optional attribute for the "otel.component.type" -// semantic convention. It represents a name identifying the type of the -// OpenTelemetry component. -func (SDKExporterLogInflight) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { - return attribute.String("otel.component.type", string(val)) -} - -// AttrServerAddress returns an optional attribute for the "server.address" -// semantic convention. It represents the server domain name if available without -// reverse DNS lookup; otherwise, IP address or Unix domain socket name. -func (SDKExporterLogInflight) AttrServerAddress(val string) attribute.KeyValue { - return attribute.String("server.address", val) -} - -// AttrServerPort returns an optional attribute for the "server.port" semantic -// convention. It represents the server port number. -func (SDKExporterLogInflight) AttrServerPort(val int) attribute.KeyValue { - return attribute.Int("server.port", val) -} - -// SDKExporterMetricDataPointExported is an instrument used to record metric -// values conforming to the "otel.sdk.exporter.metric_data_point.exported" -// semantic conventions. It represents the number of metric data points for which -// the export has finished, either successful or failed. -type SDKExporterMetricDataPointExported struct { - metric.Int64Counter -} - -var newSDKExporterMetricDataPointExportedOpts = []metric.Int64CounterOption{ - metric.WithDescription("The number of metric data points for which the export has finished, either successful or failed."), - metric.WithUnit("{data_point}"), -} - -// NewSDKExporterMetricDataPointExported returns a new -// SDKExporterMetricDataPointExported instrument. -func NewSDKExporterMetricDataPointExported( - m metric.Meter, - opt ...metric.Int64CounterOption, -) (SDKExporterMetricDataPointExported, error) { - // Check if the meter is nil. - if m == nil { - return SDKExporterMetricDataPointExported{noop.Int64Counter{}}, nil - } - - if len(opt) == 0 { - opt = newSDKExporterMetricDataPointExportedOpts - } else { - opt = append(opt, newSDKExporterMetricDataPointExportedOpts...) - } - - i, err := m.Int64Counter( - "otel.sdk.exporter.metric_data_point.exported", - opt..., - ) - if err != nil { - return SDKExporterMetricDataPointExported{noop.Int64Counter{}}, err - } - return SDKExporterMetricDataPointExported{i}, nil -} - -// Inst returns the underlying metric instrument. -func (m SDKExporterMetricDataPointExported) Inst() metric.Int64Counter { - return m.Int64Counter -} - -// Name returns the semantic convention name of the instrument. -func (SDKExporterMetricDataPointExported) Name() string { - return "otel.sdk.exporter.metric_data_point.exported" -} - -// Unit returns the semantic convention unit of the instrument -func (SDKExporterMetricDataPointExported) Unit() string { - return "{data_point}" -} - -// Description returns the semantic convention description of the instrument -func (SDKExporterMetricDataPointExported) Description() string { - return "The number of metric data points for which the export has finished, either successful or failed." -} - -// Add adds incr to the existing count for attrs. -// -// All additional attrs passed are included in the recorded value. -// -// For successful exports, `error.type` MUST NOT be set. For failed exports, -// `error.type` MUST contain the failure cause. -// For exporters with partial success semantics (e.g. OTLP with -// `rejected_data_points`), rejected data points MUST count as failed and only -// non-rejected data points count as success. -// If no rejection reason is available, `rejected` SHOULD be used as value for -// `error.type`. -func (m SDKExporterMetricDataPointExported) Add( - ctx context.Context, - incr int64, - attrs ...attribute.KeyValue, -) { - if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) - return - } - - o := addOptPool.Get().(*[]metric.AddOption) - defer func() { - *o = (*o)[:0] - addOptPool.Put(o) - }() - - *o = append( - *o, - metric.WithAttributes( - attrs..., - ), - ) - - m.Int64Counter.Add(ctx, incr, *o...) -} - -// AddSet adds incr to the existing count for set. -// -// For successful exports, `error.type` MUST NOT be set. For failed exports, -// `error.type` MUST contain the failure cause. -// For exporters with partial success semantics (e.g. OTLP with -// `rejected_data_points`), rejected data points MUST count as failed and only -// non-rejected data points count as success. -// If no rejection reason is available, `rejected` SHOULD be used as value for -// `error.type`. -func (m SDKExporterMetricDataPointExported) AddSet(ctx context.Context, incr int64, set attribute.Set) { - if set.Len() == 0 { - m.Int64Counter.Add(ctx, incr) - return - } - - o := addOptPool.Get().(*[]metric.AddOption) - defer func() { - *o = (*o)[:0] - addOptPool.Put(o) - }() - - *o = append(*o, metric.WithAttributeSet(set)) - m.Int64Counter.Add(ctx, incr, *o...) -} - -// AttrErrorType returns an optional attribute for the "error.type" semantic -// convention. It represents the describes a class of error the operation ended -// with. -func (SDKExporterMetricDataPointExported) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { - return attribute.String("error.type", string(val)) -} - -// AttrComponentName returns an optional attribute for the "otel.component.name" -// semantic convention. It represents a name uniquely identifying the instance of -// the OpenTelemetry component within its containing SDK instance. -func (SDKExporterMetricDataPointExported) AttrComponentName(val string) attribute.KeyValue { - return attribute.String("otel.component.name", val) -} - -// AttrComponentType returns an optional attribute for the "otel.component.type" -// semantic convention. It represents a name identifying the type of the -// OpenTelemetry component. -func (SDKExporterMetricDataPointExported) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { - return attribute.String("otel.component.type", string(val)) -} - -// AttrServerAddress returns an optional attribute for the "server.address" -// semantic convention. It represents the server domain name if available without -// reverse DNS lookup; otherwise, IP address or Unix domain socket name. -func (SDKExporterMetricDataPointExported) AttrServerAddress(val string) attribute.KeyValue { - return attribute.String("server.address", val) -} - -// AttrServerPort returns an optional attribute for the "server.port" semantic -// convention. It represents the server port number. -func (SDKExporterMetricDataPointExported) AttrServerPort(val int) attribute.KeyValue { - return attribute.Int("server.port", val) -} - -// SDKExporterMetricDataPointInflight is an instrument used to record metric -// values conforming to the "otel.sdk.exporter.metric_data_point.inflight" -// semantic conventions. It represents the number of metric data points which -// were passed to the exporter, but that have not been exported yet (neither -// successful, nor failed). -type SDKExporterMetricDataPointInflight struct { - metric.Int64UpDownCounter -} - -var newSDKExporterMetricDataPointInflightOpts = []metric.Int64UpDownCounterOption{ - metric.WithDescription("The number of metric data points which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)."), - metric.WithUnit("{data_point}"), -} - -// NewSDKExporterMetricDataPointInflight returns a new -// SDKExporterMetricDataPointInflight instrument. -func NewSDKExporterMetricDataPointInflight( - m metric.Meter, - opt ...metric.Int64UpDownCounterOption, -) (SDKExporterMetricDataPointInflight, error) { - // Check if the meter is nil. - if m == nil { - return SDKExporterMetricDataPointInflight{noop.Int64UpDownCounter{}}, nil - } - - if len(opt) == 0 { - opt = newSDKExporterMetricDataPointInflightOpts - } else { - opt = append(opt, newSDKExporterMetricDataPointInflightOpts...) - } - - i, err := m.Int64UpDownCounter( - "otel.sdk.exporter.metric_data_point.inflight", - opt..., - ) - if err != nil { - return SDKExporterMetricDataPointInflight{noop.Int64UpDownCounter{}}, err - } - return SDKExporterMetricDataPointInflight{i}, nil -} - -// Inst returns the underlying metric instrument. -func (m SDKExporterMetricDataPointInflight) Inst() metric.Int64UpDownCounter { - return m.Int64UpDownCounter -} - -// Name returns the semantic convention name of the instrument. -func (SDKExporterMetricDataPointInflight) Name() string { - return "otel.sdk.exporter.metric_data_point.inflight" -} - -// Unit returns the semantic convention unit of the instrument -func (SDKExporterMetricDataPointInflight) Unit() string { - return "{data_point}" -} - -// Description returns the semantic convention description of the instrument -func (SDKExporterMetricDataPointInflight) Description() string { - return "The number of metric data points which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)." -} - -// Add adds incr to the existing count for attrs. -// -// All additional attrs passed are included in the recorded value. -// -// For successful exports, `error.type` MUST NOT be set. For failed exports, -// `error.type` MUST contain the failure cause. -func (m SDKExporterMetricDataPointInflight) Add( - ctx context.Context, - incr int64, - attrs ...attribute.KeyValue, -) { - if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) - return - } - - o := addOptPool.Get().(*[]metric.AddOption) - defer func() { - *o = (*o)[:0] - addOptPool.Put(o) - }() - - *o = append( - *o, - metric.WithAttributes( - attrs..., - ), - ) - - m.Int64UpDownCounter.Add(ctx, incr, *o...) -} - -// AddSet adds incr to the existing count for set. -// -// For successful exports, `error.type` MUST NOT be set. For failed exports, -// `error.type` MUST contain the failure cause. -func (m SDKExporterMetricDataPointInflight) AddSet(ctx context.Context, incr int64, set attribute.Set) { - if set.Len() == 0 { - m.Int64UpDownCounter.Add(ctx, incr) - return - } - - o := addOptPool.Get().(*[]metric.AddOption) - defer func() { - *o = (*o)[:0] - addOptPool.Put(o) - }() - - *o = append(*o, metric.WithAttributeSet(set)) - m.Int64UpDownCounter.Add(ctx, incr, *o...) -} - -// AttrComponentName returns an optional attribute for the "otel.component.name" -// semantic convention. It represents a name uniquely identifying the instance of -// the OpenTelemetry component within its containing SDK instance. -func (SDKExporterMetricDataPointInflight) AttrComponentName(val string) attribute.KeyValue { - return attribute.String("otel.component.name", val) -} - -// AttrComponentType returns an optional attribute for the "otel.component.type" -// semantic convention. It represents a name identifying the type of the -// OpenTelemetry component. -func (SDKExporterMetricDataPointInflight) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { - return attribute.String("otel.component.type", string(val)) -} - -// AttrServerAddress returns an optional attribute for the "server.address" -// semantic convention. It represents the server domain name if available without -// reverse DNS lookup; otherwise, IP address or Unix domain socket name. -func (SDKExporterMetricDataPointInflight) AttrServerAddress(val string) attribute.KeyValue { - return attribute.String("server.address", val) -} - -// AttrServerPort returns an optional attribute for the "server.port" semantic -// convention. It represents the server port number. -func (SDKExporterMetricDataPointInflight) AttrServerPort(val int) attribute.KeyValue { - return attribute.Int("server.port", val) -} - -// SDKExporterOperationDuration is an instrument used to record metric values -// conforming to the "otel.sdk.exporter.operation.duration" semantic conventions. -// It represents the duration of exporting a batch of telemetry records. -type SDKExporterOperationDuration struct { - metric.Float64Histogram -} - -var newSDKExporterOperationDurationOpts = []metric.Float64HistogramOption{ - metric.WithDescription("The duration of exporting a batch of telemetry records."), - metric.WithUnit("s"), -} - -// NewSDKExporterOperationDuration returns a new SDKExporterOperationDuration -// instrument. -func NewSDKExporterOperationDuration( - m metric.Meter, - opt ...metric.Float64HistogramOption, -) (SDKExporterOperationDuration, error) { - // Check if the meter is nil. - if m == nil { - return SDKExporterOperationDuration{noop.Float64Histogram{}}, nil - } - - if len(opt) == 0 { - opt = newSDKExporterOperationDurationOpts - } else { - opt = append(opt, newSDKExporterOperationDurationOpts...) - } - - i, err := m.Float64Histogram( - "otel.sdk.exporter.operation.duration", - opt..., - ) - if err != nil { - return SDKExporterOperationDuration{noop.Float64Histogram{}}, err - } - return SDKExporterOperationDuration{i}, nil -} - -// Inst returns the underlying metric instrument. -func (m SDKExporterOperationDuration) Inst() metric.Float64Histogram { - return m.Float64Histogram -} - -// Name returns the semantic convention name of the instrument. -func (SDKExporterOperationDuration) Name() string { - return "otel.sdk.exporter.operation.duration" -} - -// Unit returns the semantic convention unit of the instrument -func (SDKExporterOperationDuration) Unit() string { - return "s" -} - -// Description returns the semantic convention description of the instrument -func (SDKExporterOperationDuration) Description() string { - return "The duration of exporting a batch of telemetry records." -} - -// Record records val to the current distribution for attrs. -// -// All additional attrs passed are included in the recorded value. -// -// This metric defines successful operations using the full success definitions -// for [http] -// and [grpc]. Anything else is defined as an unsuccessful operation. For -// successful -// operations, `error.type` MUST NOT be set. For unsuccessful export operations, -// `error.type` MUST contain a relevant failure cause. -// -// [http]: https://github.com/open-telemetry/opentelemetry-proto/blob/v1.5.0/docs/specification.md#full-success-1 -// [grpc]: https://github.com/open-telemetry/opentelemetry-proto/blob/v1.5.0/docs/specification.md#full-success -func (m SDKExporterOperationDuration) Record( - ctx context.Context, - val float64, - attrs ...attribute.KeyValue, -) { - if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) - return - } - - o := recOptPool.Get().(*[]metric.RecordOption) - defer func() { - *o = (*o)[:0] - recOptPool.Put(o) - }() - - *o = append( - *o, - metric.WithAttributes( - attrs..., - ), - ) - - m.Float64Histogram.Record(ctx, val, *o...) -} - -// RecordSet records val to the current distribution for set. -// -// This metric defines successful operations using the full success definitions -// for [http] -// and [grpc]. Anything else is defined as an unsuccessful operation. For -// successful -// operations, `error.type` MUST NOT be set. For unsuccessful export operations, -// `error.type` MUST contain a relevant failure cause. -// -// [http]: https://github.com/open-telemetry/opentelemetry-proto/blob/v1.5.0/docs/specification.md#full-success-1 -// [grpc]: https://github.com/open-telemetry/opentelemetry-proto/blob/v1.5.0/docs/specification.md#full-success -func (m SDKExporterOperationDuration) RecordSet(ctx context.Context, val float64, set attribute.Set) { - if set.Len() == 0 { - m.Float64Histogram.Record(ctx, val) - return - } - - o := recOptPool.Get().(*[]metric.RecordOption) - defer func() { - *o = (*o)[:0] - recOptPool.Put(o) - }() - - *o = append(*o, metric.WithAttributeSet(set)) - m.Float64Histogram.Record(ctx, val, *o...) -} - -// AttrErrorType returns an optional attribute for the "error.type" semantic -// convention. It represents the describes a class of error the operation ended -// with. -func (SDKExporterOperationDuration) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { - return attribute.String("error.type", string(val)) -} - -// AttrHTTPResponseStatusCode returns an optional attribute for the -// "http.response.status_code" semantic convention. It represents the HTTP status -// code of the last HTTP request performed in scope of this export call. -func (SDKExporterOperationDuration) AttrHTTPResponseStatusCode(val int) attribute.KeyValue { - return attribute.Int("http.response.status_code", val) -} - -// AttrComponentName returns an optional attribute for the "otel.component.name" -// semantic convention. It represents a name uniquely identifying the instance of -// the OpenTelemetry component within its containing SDK instance. -func (SDKExporterOperationDuration) AttrComponentName(val string) attribute.KeyValue { - return attribute.String("otel.component.name", val) -} - -// AttrComponentType returns an optional attribute for the "otel.component.type" -// semantic convention. It represents a name identifying the type of the -// OpenTelemetry component. -func (SDKExporterOperationDuration) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { - return attribute.String("otel.component.type", string(val)) -} - -// AttrRPCResponseStatusCode returns an optional attribute for the -// "rpc.response.status_code" semantic convention. It represents the gRPC status -// code of the last gRPC request performed in scope of this export call. -func (SDKExporterOperationDuration) AttrRPCResponseStatusCode(val string) attribute.KeyValue { - return attribute.String("rpc.response.status_code", val) -} - -// AttrServerAddress returns an optional attribute for the "server.address" -// semantic convention. It represents the server domain name if available without -// reverse DNS lookup; otherwise, IP address or Unix domain socket name. -func (SDKExporterOperationDuration) AttrServerAddress(val string) attribute.KeyValue { - return attribute.String("server.address", val) -} - -// AttrServerPort returns an optional attribute for the "server.port" semantic -// convention. It represents the server port number. -func (SDKExporterOperationDuration) AttrServerPort(val int) attribute.KeyValue { - return attribute.Int("server.port", val) -} - -// SDKExporterSpanExported is an instrument used to record metric values -// conforming to the "otel.sdk.exporter.span.exported" semantic conventions. It -// represents the number of spans for which the export has finished, either -// successful or failed. -type SDKExporterSpanExported struct { - metric.Int64Counter -} - -var newSDKExporterSpanExportedOpts = []metric.Int64CounterOption{ - metric.WithDescription("The number of spans for which the export has finished, either successful or failed."), - metric.WithUnit("{span}"), -} - -// NewSDKExporterSpanExported returns a new SDKExporterSpanExported instrument. -func NewSDKExporterSpanExported( - m metric.Meter, - opt ...metric.Int64CounterOption, -) (SDKExporterSpanExported, error) { - // Check if the meter is nil. - if m == nil { - return SDKExporterSpanExported{noop.Int64Counter{}}, nil - } - - if len(opt) == 0 { - opt = newSDKExporterSpanExportedOpts - } else { - opt = append(opt, newSDKExporterSpanExportedOpts...) - } - - i, err := m.Int64Counter( - "otel.sdk.exporter.span.exported", - opt..., - ) - if err != nil { - return SDKExporterSpanExported{noop.Int64Counter{}}, err - } - return SDKExporterSpanExported{i}, nil -} - -// Inst returns the underlying metric instrument. -func (m SDKExporterSpanExported) Inst() metric.Int64Counter { - return m.Int64Counter -} - -// Name returns the semantic convention name of the instrument. -func (SDKExporterSpanExported) Name() string { - return "otel.sdk.exporter.span.exported" -} - -// Unit returns the semantic convention unit of the instrument -func (SDKExporterSpanExported) Unit() string { - return "{span}" -} - -// Description returns the semantic convention description of the instrument -func (SDKExporterSpanExported) Description() string { - return "The number of spans for which the export has finished, either successful or failed." -} - -// Add adds incr to the existing count for attrs. -// -// All additional attrs passed are included in the recorded value. -// -// For successful exports, `error.type` MUST NOT be set. For failed exports, -// `error.type` MUST contain the failure cause. -// For exporters with partial success semantics (e.g. OTLP with `rejected_spans` -// ), rejected spans MUST count as failed and only non-rejected spans count as -// success. -// If no rejection reason is available, `rejected` SHOULD be used as value for -// `error.type`. -func (m SDKExporterSpanExported) Add( - ctx context.Context, - incr int64, - attrs ...attribute.KeyValue, -) { - if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) - return - } - - o := addOptPool.Get().(*[]metric.AddOption) - defer func() { - *o = (*o)[:0] - addOptPool.Put(o) - }() - - *o = append( - *o, - metric.WithAttributes( - attrs..., - ), - ) - - m.Int64Counter.Add(ctx, incr, *o...) -} - -// AddSet adds incr to the existing count for set. -// -// For successful exports, `error.type` MUST NOT be set. For failed exports, -// `error.type` MUST contain the failure cause. -// For exporters with partial success semantics (e.g. OTLP with `rejected_spans` -// ), rejected spans MUST count as failed and only non-rejected spans count as -// success. -// If no rejection reason is available, `rejected` SHOULD be used as value for -// `error.type`. -func (m SDKExporterSpanExported) AddSet(ctx context.Context, incr int64, set attribute.Set) { - if set.Len() == 0 { - m.Int64Counter.Add(ctx, incr) - return - } - - o := addOptPool.Get().(*[]metric.AddOption) - defer func() { - *o = (*o)[:0] - addOptPool.Put(o) - }() - - *o = append(*o, metric.WithAttributeSet(set)) - m.Int64Counter.Add(ctx, incr, *o...) -} - -// AttrErrorType returns an optional attribute for the "error.type" semantic -// convention. It represents the describes a class of error the operation ended -// with. -func (SDKExporterSpanExported) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { - return attribute.String("error.type", string(val)) -} - -// AttrComponentName returns an optional attribute for the "otel.component.name" -// semantic convention. It represents a name uniquely identifying the instance of -// the OpenTelemetry component within its containing SDK instance. -func (SDKExporterSpanExported) AttrComponentName(val string) attribute.KeyValue { - return attribute.String("otel.component.name", val) -} - -// AttrComponentType returns an optional attribute for the "otel.component.type" -// semantic convention. It represents a name identifying the type of the -// OpenTelemetry component. -func (SDKExporterSpanExported) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { - return attribute.String("otel.component.type", string(val)) -} - -// AttrServerAddress returns an optional attribute for the "server.address" -// semantic convention. It represents the server domain name if available without -// reverse DNS lookup; otherwise, IP address or Unix domain socket name. -func (SDKExporterSpanExported) AttrServerAddress(val string) attribute.KeyValue { - return attribute.String("server.address", val) -} - -// AttrServerPort returns an optional attribute for the "server.port" semantic -// convention. It represents the server port number. -func (SDKExporterSpanExported) AttrServerPort(val int) attribute.KeyValue { - return attribute.Int("server.port", val) -} - -// SDKExporterSpanInflight is an instrument used to record metric values -// conforming to the "otel.sdk.exporter.span.inflight" semantic conventions. It -// represents the number of spans which were passed to the exporter, but that -// have not been exported yet (neither successful, nor failed). -type SDKExporterSpanInflight struct { - metric.Int64UpDownCounter -} - -var newSDKExporterSpanInflightOpts = []metric.Int64UpDownCounterOption{ - metric.WithDescription("The number of spans which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)."), - metric.WithUnit("{span}"), -} - -// NewSDKExporterSpanInflight returns a new SDKExporterSpanInflight instrument. -func NewSDKExporterSpanInflight( - m metric.Meter, - opt ...metric.Int64UpDownCounterOption, -) (SDKExporterSpanInflight, error) { - // Check if the meter is nil. - if m == nil { - return SDKExporterSpanInflight{noop.Int64UpDownCounter{}}, nil - } - - if len(opt) == 0 { - opt = newSDKExporterSpanInflightOpts - } else { - opt = append(opt, newSDKExporterSpanInflightOpts...) - } - - i, err := m.Int64UpDownCounter( - "otel.sdk.exporter.span.inflight", - opt..., - ) - if err != nil { - return SDKExporterSpanInflight{noop.Int64UpDownCounter{}}, err - } - return SDKExporterSpanInflight{i}, nil -} - -// Inst returns the underlying metric instrument. -func (m SDKExporterSpanInflight) Inst() metric.Int64UpDownCounter { - return m.Int64UpDownCounter -} - -// Name returns the semantic convention name of the instrument. -func (SDKExporterSpanInflight) Name() string { - return "otel.sdk.exporter.span.inflight" -} - -// Unit returns the semantic convention unit of the instrument -func (SDKExporterSpanInflight) Unit() string { - return "{span}" -} - -// Description returns the semantic convention description of the instrument -func (SDKExporterSpanInflight) Description() string { - return "The number of spans which were passed to the exporter, but that have not been exported yet (neither successful, nor failed)." -} - -// Add adds incr to the existing count for attrs. -// -// All additional attrs passed are included in the recorded value. -// -// For successful exports, `error.type` MUST NOT be set. For failed exports, -// `error.type` MUST contain the failure cause. -func (m SDKExporterSpanInflight) Add( - ctx context.Context, - incr int64, - attrs ...attribute.KeyValue, -) { - if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) - return - } - - o := addOptPool.Get().(*[]metric.AddOption) - defer func() { - *o = (*o)[:0] - addOptPool.Put(o) - }() - - *o = append( - *o, - metric.WithAttributes( - attrs..., - ), - ) - - m.Int64UpDownCounter.Add(ctx, incr, *o...) -} - -// AddSet adds incr to the existing count for set. -// -// For successful exports, `error.type` MUST NOT be set. For failed exports, -// `error.type` MUST contain the failure cause. -func (m SDKExporterSpanInflight) AddSet(ctx context.Context, incr int64, set attribute.Set) { - if set.Len() == 0 { - m.Int64UpDownCounter.Add(ctx, incr) - return - } - - o := addOptPool.Get().(*[]metric.AddOption) - defer func() { - *o = (*o)[:0] - addOptPool.Put(o) - }() - - *o = append(*o, metric.WithAttributeSet(set)) - m.Int64UpDownCounter.Add(ctx, incr, *o...) -} - -// AttrComponentName returns an optional attribute for the "otel.component.name" -// semantic convention. It represents a name uniquely identifying the instance of -// the OpenTelemetry component within its containing SDK instance. -func (SDKExporterSpanInflight) AttrComponentName(val string) attribute.KeyValue { - return attribute.String("otel.component.name", val) -} - -// AttrComponentType returns an optional attribute for the "otel.component.type" -// semantic convention. It represents a name identifying the type of the -// OpenTelemetry component. -func (SDKExporterSpanInflight) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { - return attribute.String("otel.component.type", string(val)) -} - -// AttrServerAddress returns an optional attribute for the "server.address" -// semantic convention. It represents the server domain name if available without -// reverse DNS lookup; otherwise, IP address or Unix domain socket name. -func (SDKExporterSpanInflight) AttrServerAddress(val string) attribute.KeyValue { - return attribute.String("server.address", val) -} - -// AttrServerPort returns an optional attribute for the "server.port" semantic -// convention. It represents the server port number. -func (SDKExporterSpanInflight) AttrServerPort(val int) attribute.KeyValue { - return attribute.Int("server.port", val) -} - -// SDKLogCreated is an instrument used to record metric values conforming to the -// "otel.sdk.log.created" semantic conventions. It represents the number of logs -// submitted to enabled SDK Loggers. -type SDKLogCreated struct { - metric.Int64Counter -} - -var newSDKLogCreatedOpts = []metric.Int64CounterOption{ - metric.WithDescription("The number of logs submitted to enabled SDK Loggers."), - metric.WithUnit("{log_record}"), -} - -// NewSDKLogCreated returns a new SDKLogCreated instrument. -func NewSDKLogCreated( - m metric.Meter, - opt ...metric.Int64CounterOption, -) (SDKLogCreated, error) { - // Check if the meter is nil. - if m == nil { - return SDKLogCreated{noop.Int64Counter{}}, nil - } - - if len(opt) == 0 { - opt = newSDKLogCreatedOpts - } else { - opt = append(opt, newSDKLogCreatedOpts...) - } - - i, err := m.Int64Counter( - "otel.sdk.log.created", - opt..., - ) - if err != nil { - return SDKLogCreated{noop.Int64Counter{}}, err - } - return SDKLogCreated{i}, nil -} - -// Inst returns the underlying metric instrument. -func (m SDKLogCreated) Inst() metric.Int64Counter { - return m.Int64Counter -} - -// Name returns the semantic convention name of the instrument. -func (SDKLogCreated) Name() string { - return "otel.sdk.log.created" -} - -// Unit returns the semantic convention unit of the instrument -func (SDKLogCreated) Unit() string { - return "{log_record}" -} - -// Description returns the semantic convention description of the instrument -func (SDKLogCreated) Description() string { - return "The number of logs submitted to enabled SDK Loggers." -} - -// Add adds incr to the existing count for attrs. -func (m SDKLogCreated) Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue) { - if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) - return - } - - o := addOptPool.Get().(*[]metric.AddOption) - defer func() { - *o = (*o)[:0] - addOptPool.Put(o) - }() - - *o = append(*o, metric.WithAttributes(attrs...)) - m.Int64Counter.Add(ctx, incr, *o...) -} - -// AddSet adds incr to the existing count for set. -func (m SDKLogCreated) AddSet(ctx context.Context, incr int64, set attribute.Set) { - if set.Len() == 0 { - m.Int64Counter.Add(ctx, incr) - return - } - - o := addOptPool.Get().(*[]metric.AddOption) - defer func() { - *o = (*o)[:0] - addOptPool.Put(o) - }() - - *o = append(*o, metric.WithAttributeSet(set)) - m.Int64Counter.Add(ctx, incr, *o...) -} - -// SDKMetricReaderCollectionDuration is an instrument used to record metric -// values conforming to the "otel.sdk.metric_reader.collection.duration" semantic -// conventions. It represents the duration of the collect operation of the metric -// reader. -type SDKMetricReaderCollectionDuration struct { - metric.Float64Histogram -} - -var newSDKMetricReaderCollectionDurationOpts = []metric.Float64HistogramOption{ - metric.WithDescription("The duration of the collect operation of the metric reader."), - metric.WithUnit("s"), -} - -// NewSDKMetricReaderCollectionDuration returns a new -// SDKMetricReaderCollectionDuration instrument. -func NewSDKMetricReaderCollectionDuration( - m metric.Meter, - opt ...metric.Float64HistogramOption, -) (SDKMetricReaderCollectionDuration, error) { - // Check if the meter is nil. - if m == nil { - return SDKMetricReaderCollectionDuration{noop.Float64Histogram{}}, nil - } - - if len(opt) == 0 { - opt = newSDKMetricReaderCollectionDurationOpts - } else { - opt = append(opt, newSDKMetricReaderCollectionDurationOpts...) - } - - i, err := m.Float64Histogram( - "otel.sdk.metric_reader.collection.duration", - opt..., - ) - if err != nil { - return SDKMetricReaderCollectionDuration{noop.Float64Histogram{}}, err - } - return SDKMetricReaderCollectionDuration{i}, nil -} - -// Inst returns the underlying metric instrument. -func (m SDKMetricReaderCollectionDuration) Inst() metric.Float64Histogram { - return m.Float64Histogram -} - -// Name returns the semantic convention name of the instrument. -func (SDKMetricReaderCollectionDuration) Name() string { - return "otel.sdk.metric_reader.collection.duration" -} - -// Unit returns the semantic convention unit of the instrument -func (SDKMetricReaderCollectionDuration) Unit() string { - return "s" -} - -// Description returns the semantic convention description of the instrument -func (SDKMetricReaderCollectionDuration) Description() string { - return "The duration of the collect operation of the metric reader." -} - -// Record records val to the current distribution for attrs. -// -// All additional attrs passed are included in the recorded value. -// -// For successful collections, `error.type` MUST NOT be set. For failed -// collections, `error.type` SHOULD contain the failure cause. -// It can happen that metrics collection is successful for some MetricProducers, -// while others fail. In that case `error.type` SHOULD be set to any of the -// failure causes. -func (m SDKMetricReaderCollectionDuration) Record( - ctx context.Context, - val float64, - attrs ...attribute.KeyValue, -) { - if len(attrs) == 0 { - m.Float64Histogram.Record(ctx, val) - return - } - - o := recOptPool.Get().(*[]metric.RecordOption) - defer func() { - *o = (*o)[:0] - recOptPool.Put(o) - }() - - *o = append( - *o, - metric.WithAttributes( - attrs..., - ), - ) - - m.Float64Histogram.Record(ctx, val, *o...) -} - -// RecordSet records val to the current distribution for set. -// -// For successful collections, `error.type` MUST NOT be set. For failed -// collections, `error.type` SHOULD contain the failure cause. -// It can happen that metrics collection is successful for some MetricProducers, -// while others fail. In that case `error.type` SHOULD be set to any of the -// failure causes. -func (m SDKMetricReaderCollectionDuration) RecordSet(ctx context.Context, val float64, set attribute.Set) { - if set.Len() == 0 { - m.Float64Histogram.Record(ctx, val) - return - } - - o := recOptPool.Get().(*[]metric.RecordOption) - defer func() { - *o = (*o)[:0] - recOptPool.Put(o) - }() - - *o = append(*o, metric.WithAttributeSet(set)) - m.Float64Histogram.Record(ctx, val, *o...) -} - -// AttrErrorType returns an optional attribute for the "error.type" semantic -// convention. It represents the describes a class of error the operation ended -// with. -func (SDKMetricReaderCollectionDuration) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { - return attribute.String("error.type", string(val)) -} - -// AttrComponentName returns an optional attribute for the "otel.component.name" -// semantic convention. It represents a name uniquely identifying the instance of -// the OpenTelemetry component within its containing SDK instance. -func (SDKMetricReaderCollectionDuration) AttrComponentName(val string) attribute.KeyValue { - return attribute.String("otel.component.name", val) -} - -// AttrComponentType returns an optional attribute for the "otel.component.type" -// semantic convention. It represents a name identifying the type of the -// OpenTelemetry component. -func (SDKMetricReaderCollectionDuration) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { - return attribute.String("otel.component.type", string(val)) -} - -// SDKProcessorLogProcessed is an instrument used to record metric values -// conforming to the "otel.sdk.processor.log.processed" semantic conventions. It -// represents the number of log records for which the processing has finished, -// either successful or failed. -type SDKProcessorLogProcessed struct { - metric.Int64Counter -} - -var newSDKProcessorLogProcessedOpts = []metric.Int64CounterOption{ - metric.WithDescription("The number of log records for which the processing has finished, either successful or failed."), - metric.WithUnit("{log_record}"), -} - -// NewSDKProcessorLogProcessed returns a new SDKProcessorLogProcessed instrument. -func NewSDKProcessorLogProcessed( - m metric.Meter, - opt ...metric.Int64CounterOption, -) (SDKProcessorLogProcessed, error) { - // Check if the meter is nil. - if m == nil { - return SDKProcessorLogProcessed{noop.Int64Counter{}}, nil - } - - if len(opt) == 0 { - opt = newSDKProcessorLogProcessedOpts - } else { - opt = append(opt, newSDKProcessorLogProcessedOpts...) - } - - i, err := m.Int64Counter( - "otel.sdk.processor.log.processed", - opt..., - ) - if err != nil { - return SDKProcessorLogProcessed{noop.Int64Counter{}}, err - } - return SDKProcessorLogProcessed{i}, nil -} - -// Inst returns the underlying metric instrument. -func (m SDKProcessorLogProcessed) Inst() metric.Int64Counter { - return m.Int64Counter -} - -// Name returns the semantic convention name of the instrument. -func (SDKProcessorLogProcessed) Name() string { - return "otel.sdk.processor.log.processed" -} - -// Unit returns the semantic convention unit of the instrument -func (SDKProcessorLogProcessed) Unit() string { - return "{log_record}" -} - -// Description returns the semantic convention description of the instrument -func (SDKProcessorLogProcessed) Description() string { - return "The number of log records for which the processing has finished, either successful or failed." -} - -// Add adds incr to the existing count for attrs. -// -// All additional attrs passed are included in the recorded value. -// -// For successful processing, `error.type` MUST NOT be set. For failed -// processing, `error.type` MUST contain the failure cause. -// For the SDK Simple and Batching Log Record Processor a log record is -// considered to be processed already when it has been submitted to the exporter, -// not when the corresponding export call has finished. -func (m SDKProcessorLogProcessed) Add( - ctx context.Context, - incr int64, - attrs ...attribute.KeyValue, -) { - if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) - return - } - - o := addOptPool.Get().(*[]metric.AddOption) - defer func() { - *o = (*o)[:0] - addOptPool.Put(o) - }() - - *o = append( - *o, - metric.WithAttributes( - attrs..., - ), - ) - - m.Int64Counter.Add(ctx, incr, *o...) -} - -// AddSet adds incr to the existing count for set. -// -// For successful processing, `error.type` MUST NOT be set. For failed -// processing, `error.type` MUST contain the failure cause. -// For the SDK Simple and Batching Log Record Processor a log record is -// considered to be processed already when it has been submitted to the exporter, -// not when the corresponding export call has finished. -func (m SDKProcessorLogProcessed) AddSet(ctx context.Context, incr int64, set attribute.Set) { - if set.Len() == 0 { - m.Int64Counter.Add(ctx, incr) - return - } - - o := addOptPool.Get().(*[]metric.AddOption) - defer func() { - *o = (*o)[:0] - addOptPool.Put(o) - }() - - *o = append(*o, metric.WithAttributeSet(set)) - m.Int64Counter.Add(ctx, incr, *o...) -} - -// AttrErrorType returns an optional attribute for the "error.type" semantic -// convention. It represents a low-cardinality description of the failure reason. -// SDK Batching Log Record Processors MUST use `queue_full` for log records -// dropped due to a full queue. -func (SDKProcessorLogProcessed) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { - return attribute.String("error.type", string(val)) -} - -// AttrComponentName returns an optional attribute for the "otel.component.name" -// semantic convention. It represents a name uniquely identifying the instance of -// the OpenTelemetry component within its containing SDK instance. -func (SDKProcessorLogProcessed) AttrComponentName(val string) attribute.KeyValue { - return attribute.String("otel.component.name", val) -} - -// AttrComponentType returns an optional attribute for the "otel.component.type" -// semantic convention. It represents a name identifying the type of the -// OpenTelemetry component. -func (SDKProcessorLogProcessed) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { - return attribute.String("otel.component.type", string(val)) -} - -// SDKProcessorLogQueueCapacity is an instrument used to record metric values -// conforming to the "otel.sdk.processor.log.queue.capacity" semantic -// conventions. It represents the maximum number of log records the queue of a -// given instance of an SDK Log Record processor can hold. -type SDKProcessorLogQueueCapacity struct { - metric.Int64ObservableUpDownCounter -} - -var newSDKProcessorLogQueueCapacityOpts = []metric.Int64ObservableUpDownCounterOption{ - metric.WithDescription("The maximum number of log records the queue of a given instance of an SDK Log Record processor can hold."), - metric.WithUnit("{log_record}"), -} - -// NewSDKProcessorLogQueueCapacity returns a new SDKProcessorLogQueueCapacity -// instrument. -func NewSDKProcessorLogQueueCapacity( - m metric.Meter, - opt ...metric.Int64ObservableUpDownCounterOption, -) (SDKProcessorLogQueueCapacity, error) { - // Check if the meter is nil. - if m == nil { - return SDKProcessorLogQueueCapacity{noop.Int64ObservableUpDownCounter{}}, nil - } - - if len(opt) == 0 { - opt = newSDKProcessorLogQueueCapacityOpts - } else { - opt = append(opt, newSDKProcessorLogQueueCapacityOpts...) - } - - i, err := m.Int64ObservableUpDownCounter( - "otel.sdk.processor.log.queue.capacity", - opt..., - ) - if err != nil { - return SDKProcessorLogQueueCapacity{noop.Int64ObservableUpDownCounter{}}, err - } - return SDKProcessorLogQueueCapacity{i}, nil -} - -// Inst returns the underlying metric instrument. -func (m SDKProcessorLogQueueCapacity) Inst() metric.Int64ObservableUpDownCounter { - return m.Int64ObservableUpDownCounter -} - -// Name returns the semantic convention name of the instrument. -func (SDKProcessorLogQueueCapacity) Name() string { - return "otel.sdk.processor.log.queue.capacity" -} - -// Unit returns the semantic convention unit of the instrument -func (SDKProcessorLogQueueCapacity) Unit() string { - return "{log_record}" -} - -// Description returns the semantic convention description of the instrument -func (SDKProcessorLogQueueCapacity) Description() string { - return "The maximum number of log records the queue of a given instance of an SDK Log Record processor can hold." -} - -// AttrComponentName returns an optional attribute for the "otel.component.name" -// semantic convention. It represents a name uniquely identifying the instance of -// the OpenTelemetry component within its containing SDK instance. -func (SDKProcessorLogQueueCapacity) AttrComponentName(val string) attribute.KeyValue { - return attribute.String("otel.component.name", val) -} - -// AttrComponentType returns an optional attribute for the "otel.component.type" -// semantic convention. It represents a name identifying the type of the -// OpenTelemetry component. -func (SDKProcessorLogQueueCapacity) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { - return attribute.String("otel.component.type", string(val)) -} - -// SDKProcessorLogQueueSize is an instrument used to record metric values -// conforming to the "otel.sdk.processor.log.queue.size" semantic conventions. It -// represents the number of log records in the queue of a given instance of an -// SDK log processor. -type SDKProcessorLogQueueSize struct { - metric.Int64ObservableUpDownCounter -} - -var newSDKProcessorLogQueueSizeOpts = []metric.Int64ObservableUpDownCounterOption{ - metric.WithDescription("The number of log records in the queue of a given instance of an SDK log processor."), - metric.WithUnit("{log_record}"), -} - -// NewSDKProcessorLogQueueSize returns a new SDKProcessorLogQueueSize instrument. -func NewSDKProcessorLogQueueSize( - m metric.Meter, - opt ...metric.Int64ObservableUpDownCounterOption, -) (SDKProcessorLogQueueSize, error) { - // Check if the meter is nil. - if m == nil { - return SDKProcessorLogQueueSize{noop.Int64ObservableUpDownCounter{}}, nil - } - - if len(opt) == 0 { - opt = newSDKProcessorLogQueueSizeOpts - } else { - opt = append(opt, newSDKProcessorLogQueueSizeOpts...) - } - - i, err := m.Int64ObservableUpDownCounter( - "otel.sdk.processor.log.queue.size", - opt..., - ) - if err != nil { - return SDKProcessorLogQueueSize{noop.Int64ObservableUpDownCounter{}}, err - } - return SDKProcessorLogQueueSize{i}, nil -} - -// Inst returns the underlying metric instrument. -func (m SDKProcessorLogQueueSize) Inst() metric.Int64ObservableUpDownCounter { - return m.Int64ObservableUpDownCounter -} - -// Name returns the semantic convention name of the instrument. -func (SDKProcessorLogQueueSize) Name() string { - return "otel.sdk.processor.log.queue.size" -} - -// Unit returns the semantic convention unit of the instrument -func (SDKProcessorLogQueueSize) Unit() string { - return "{log_record}" -} - -// Description returns the semantic convention description of the instrument -func (SDKProcessorLogQueueSize) Description() string { - return "The number of log records in the queue of a given instance of an SDK log processor." -} - -// AttrComponentName returns an optional attribute for the "otel.component.name" -// semantic convention. It represents a name uniquely identifying the instance of -// the OpenTelemetry component within its containing SDK instance. -func (SDKProcessorLogQueueSize) AttrComponentName(val string) attribute.KeyValue { - return attribute.String("otel.component.name", val) -} - -// AttrComponentType returns an optional attribute for the "otel.component.type" -// semantic convention. It represents a name identifying the type of the -// OpenTelemetry component. -func (SDKProcessorLogQueueSize) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { - return attribute.String("otel.component.type", string(val)) -} - -// SDKProcessorSpanProcessed is an instrument used to record metric values -// conforming to the "otel.sdk.processor.span.processed" semantic conventions. It -// represents the number of spans for which the processing has finished, either -// successful or failed. -type SDKProcessorSpanProcessed struct { - metric.Int64Counter -} - -var newSDKProcessorSpanProcessedOpts = []metric.Int64CounterOption{ - metric.WithDescription("The number of spans for which the processing has finished, either successful or failed."), - metric.WithUnit("{span}"), -} - -// NewSDKProcessorSpanProcessed returns a new SDKProcessorSpanProcessed -// instrument. -func NewSDKProcessorSpanProcessed( - m metric.Meter, - opt ...metric.Int64CounterOption, -) (SDKProcessorSpanProcessed, error) { - // Check if the meter is nil. - if m == nil { - return SDKProcessorSpanProcessed{noop.Int64Counter{}}, nil - } - - if len(opt) == 0 { - opt = newSDKProcessorSpanProcessedOpts - } else { - opt = append(opt, newSDKProcessorSpanProcessedOpts...) - } - - i, err := m.Int64Counter( - "otel.sdk.processor.span.processed", - opt..., - ) - if err != nil { - return SDKProcessorSpanProcessed{noop.Int64Counter{}}, err - } - return SDKProcessorSpanProcessed{i}, nil -} - -// Inst returns the underlying metric instrument. -func (m SDKProcessorSpanProcessed) Inst() metric.Int64Counter { - return m.Int64Counter -} - -// Name returns the semantic convention name of the instrument. -func (SDKProcessorSpanProcessed) Name() string { - return "otel.sdk.processor.span.processed" -} - -// Unit returns the semantic convention unit of the instrument -func (SDKProcessorSpanProcessed) Unit() string { - return "{span}" -} - -// Description returns the semantic convention description of the instrument -func (SDKProcessorSpanProcessed) Description() string { - return "The number of spans for which the processing has finished, either successful or failed." -} - -// Add adds incr to the existing count for attrs. -// -// All additional attrs passed are included in the recorded value. -// -// For successful processing, `error.type` MUST NOT be set. For failed -// processing, `error.type` MUST contain the failure cause. -// For the SDK Simple and Batching Span Processor a span is considered to be -// processed already when it has been submitted to the exporter, not when the -// corresponding export call has finished. -func (m SDKProcessorSpanProcessed) Add( - ctx context.Context, - incr int64, - attrs ...attribute.KeyValue, -) { - if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) - return - } - - o := addOptPool.Get().(*[]metric.AddOption) - defer func() { - *o = (*o)[:0] - addOptPool.Put(o) - }() - - *o = append( - *o, - metric.WithAttributes( - attrs..., - ), - ) - - m.Int64Counter.Add(ctx, incr, *o...) -} - -// AddSet adds incr to the existing count for set. -// -// For successful processing, `error.type` MUST NOT be set. For failed -// processing, `error.type` MUST contain the failure cause. -// For the SDK Simple and Batching Span Processor a span is considered to be -// processed already when it has been submitted to the exporter, not when the -// corresponding export call has finished. -func (m SDKProcessorSpanProcessed) AddSet(ctx context.Context, incr int64, set attribute.Set) { - if set.Len() == 0 { - m.Int64Counter.Add(ctx, incr) - return - } - - o := addOptPool.Get().(*[]metric.AddOption) - defer func() { - *o = (*o)[:0] - addOptPool.Put(o) - }() - - *o = append(*o, metric.WithAttributeSet(set)) - m.Int64Counter.Add(ctx, incr, *o...) -} - -// AttrErrorType returns an optional attribute for the "error.type" semantic -// convention. It represents a low-cardinality description of the failure reason. -// SDK Batching Span Processors MUST use `queue_full` for spans dropped due to a -// full queue. -func (SDKProcessorSpanProcessed) AttrErrorType(val ErrorTypeAttr) attribute.KeyValue { - return attribute.String("error.type", string(val)) -} - -// AttrComponentName returns an optional attribute for the "otel.component.name" -// semantic convention. It represents a name uniquely identifying the instance of -// the OpenTelemetry component within its containing SDK instance. -func (SDKProcessorSpanProcessed) AttrComponentName(val string) attribute.KeyValue { - return attribute.String("otel.component.name", val) -} - -// AttrComponentType returns an optional attribute for the "otel.component.type" -// semantic convention. It represents a name identifying the type of the -// OpenTelemetry component. -func (SDKProcessorSpanProcessed) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { - return attribute.String("otel.component.type", string(val)) -} - -// SDKProcessorSpanQueueCapacity is an instrument used to record metric values -// conforming to the "otel.sdk.processor.span.queue.capacity" semantic -// conventions. It represents the maximum number of spans the queue of a given -// instance of an SDK span processor can hold. -type SDKProcessorSpanQueueCapacity struct { - metric.Int64ObservableUpDownCounter -} - -var newSDKProcessorSpanQueueCapacityOpts = []metric.Int64ObservableUpDownCounterOption{ - metric.WithDescription("The maximum number of spans the queue of a given instance of an SDK span processor can hold."), - metric.WithUnit("{span}"), -} - -// NewSDKProcessorSpanQueueCapacity returns a new SDKProcessorSpanQueueCapacity -// instrument. -func NewSDKProcessorSpanQueueCapacity( - m metric.Meter, - opt ...metric.Int64ObservableUpDownCounterOption, -) (SDKProcessorSpanQueueCapacity, error) { - // Check if the meter is nil. - if m == nil { - return SDKProcessorSpanQueueCapacity{noop.Int64ObservableUpDownCounter{}}, nil - } - - if len(opt) == 0 { - opt = newSDKProcessorSpanQueueCapacityOpts - } else { - opt = append(opt, newSDKProcessorSpanQueueCapacityOpts...) - } - - i, err := m.Int64ObservableUpDownCounter( - "otel.sdk.processor.span.queue.capacity", - opt..., - ) - if err != nil { - return SDKProcessorSpanQueueCapacity{noop.Int64ObservableUpDownCounter{}}, err - } - return SDKProcessorSpanQueueCapacity{i}, nil -} - -// Inst returns the underlying metric instrument. -func (m SDKProcessorSpanQueueCapacity) Inst() metric.Int64ObservableUpDownCounter { - return m.Int64ObservableUpDownCounter -} - -// Name returns the semantic convention name of the instrument. -func (SDKProcessorSpanQueueCapacity) Name() string { - return "otel.sdk.processor.span.queue.capacity" -} - -// Unit returns the semantic convention unit of the instrument -func (SDKProcessorSpanQueueCapacity) Unit() string { - return "{span}" -} - -// Description returns the semantic convention description of the instrument -func (SDKProcessorSpanQueueCapacity) Description() string { - return "The maximum number of spans the queue of a given instance of an SDK span processor can hold." -} - -// AttrComponentName returns an optional attribute for the "otel.component.name" -// semantic convention. It represents a name uniquely identifying the instance of -// the OpenTelemetry component within its containing SDK instance. -func (SDKProcessorSpanQueueCapacity) AttrComponentName(val string) attribute.KeyValue { - return attribute.String("otel.component.name", val) -} - -// AttrComponentType returns an optional attribute for the "otel.component.type" -// semantic convention. It represents a name identifying the type of the -// OpenTelemetry component. -func (SDKProcessorSpanQueueCapacity) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { - return attribute.String("otel.component.type", string(val)) -} - -// SDKProcessorSpanQueueSize is an instrument used to record metric values -// conforming to the "otel.sdk.processor.span.queue.size" semantic conventions. -// It represents the number of spans in the queue of a given instance of an SDK -// span processor. -type SDKProcessorSpanQueueSize struct { - metric.Int64ObservableUpDownCounter -} - -var newSDKProcessorSpanQueueSizeOpts = []metric.Int64ObservableUpDownCounterOption{ - metric.WithDescription("The number of spans in the queue of a given instance of an SDK span processor."), - metric.WithUnit("{span}"), -} - -// NewSDKProcessorSpanQueueSize returns a new SDKProcessorSpanQueueSize -// instrument. -func NewSDKProcessorSpanQueueSize( - m metric.Meter, - opt ...metric.Int64ObservableUpDownCounterOption, -) (SDKProcessorSpanQueueSize, error) { - // Check if the meter is nil. - if m == nil { - return SDKProcessorSpanQueueSize{noop.Int64ObservableUpDownCounter{}}, nil - } - - if len(opt) == 0 { - opt = newSDKProcessorSpanQueueSizeOpts - } else { - opt = append(opt, newSDKProcessorSpanQueueSizeOpts...) - } - - i, err := m.Int64ObservableUpDownCounter( - "otel.sdk.processor.span.queue.size", - opt..., - ) - if err != nil { - return SDKProcessorSpanQueueSize{noop.Int64ObservableUpDownCounter{}}, err - } - return SDKProcessorSpanQueueSize{i}, nil -} - -// Inst returns the underlying metric instrument. -func (m SDKProcessorSpanQueueSize) Inst() metric.Int64ObservableUpDownCounter { - return m.Int64ObservableUpDownCounter -} - -// Name returns the semantic convention name of the instrument. -func (SDKProcessorSpanQueueSize) Name() string { - return "otel.sdk.processor.span.queue.size" -} - -// Unit returns the semantic convention unit of the instrument -func (SDKProcessorSpanQueueSize) Unit() string { - return "{span}" -} - -// Description returns the semantic convention description of the instrument -func (SDKProcessorSpanQueueSize) Description() string { - return "The number of spans in the queue of a given instance of an SDK span processor." -} - -// AttrComponentName returns an optional attribute for the "otel.component.name" -// semantic convention. It represents a name uniquely identifying the instance of -// the OpenTelemetry component within its containing SDK instance. -func (SDKProcessorSpanQueueSize) AttrComponentName(val string) attribute.KeyValue { - return attribute.String("otel.component.name", val) -} - -// AttrComponentType returns an optional attribute for the "otel.component.type" -// semantic convention. It represents a name identifying the type of the -// OpenTelemetry component. -func (SDKProcessorSpanQueueSize) AttrComponentType(val ComponentTypeAttr) attribute.KeyValue { - return attribute.String("otel.component.type", string(val)) -} - -// SDKSpanLive is an instrument used to record metric values conforming to the -// "otel.sdk.span.live" semantic conventions. It represents the number of created -// spans with `recording=true` for which the end operation has not been called -// yet. -type SDKSpanLive struct { - metric.Int64UpDownCounter -} - -var newSDKSpanLiveOpts = []metric.Int64UpDownCounterOption{ - metric.WithDescription("The number of created spans with `recording=true` for which the end operation has not been called yet."), - metric.WithUnit("{span}"), -} - -// NewSDKSpanLive returns a new SDKSpanLive instrument. -func NewSDKSpanLive( - m metric.Meter, - opt ...metric.Int64UpDownCounterOption, -) (SDKSpanLive, error) { - // Check if the meter is nil. - if m == nil { - return SDKSpanLive{noop.Int64UpDownCounter{}}, nil - } - - if len(opt) == 0 { - opt = newSDKSpanLiveOpts - } else { - opt = append(opt, newSDKSpanLiveOpts...) - } - - i, err := m.Int64UpDownCounter( - "otel.sdk.span.live", - opt..., - ) - if err != nil { - return SDKSpanLive{noop.Int64UpDownCounter{}}, err - } - return SDKSpanLive{i}, nil -} - -// Inst returns the underlying metric instrument. -func (m SDKSpanLive) Inst() metric.Int64UpDownCounter { - return m.Int64UpDownCounter -} - -// Name returns the semantic convention name of the instrument. -func (SDKSpanLive) Name() string { - return "otel.sdk.span.live" -} - -// Unit returns the semantic convention unit of the instrument -func (SDKSpanLive) Unit() string { - return "{span}" -} - -// Description returns the semantic convention description of the instrument -func (SDKSpanLive) Description() string { - return "The number of created spans with `recording=true` for which the end operation has not been called yet." -} - -// Add adds incr to the existing count for attrs. -// -// All additional attrs passed are included in the recorded value. -func (m SDKSpanLive) Add( - ctx context.Context, - incr int64, - attrs ...attribute.KeyValue, -) { - if len(attrs) == 0 { - m.Int64UpDownCounter.Add(ctx, incr) - return - } - - o := addOptPool.Get().(*[]metric.AddOption) - defer func() { - *o = (*o)[:0] - addOptPool.Put(o) - }() - - *o = append( - *o, - metric.WithAttributes( - attrs..., - ), - ) - - m.Int64UpDownCounter.Add(ctx, incr, *o...) -} - -// AddSet adds incr to the existing count for set. -func (m SDKSpanLive) AddSet(ctx context.Context, incr int64, set attribute.Set) { - if set.Len() == 0 { - m.Int64UpDownCounter.Add(ctx, incr) - return - } - - o := addOptPool.Get().(*[]metric.AddOption) - defer func() { - *o = (*o)[:0] - addOptPool.Put(o) - }() - - *o = append(*o, metric.WithAttributeSet(set)) - m.Int64UpDownCounter.Add(ctx, incr, *o...) -} - -// AttrSpanSamplingResult returns an optional attribute for the -// "otel.span.sampling_result" semantic convention. It represents the result -// value of the sampler for this span. -func (SDKSpanLive) AttrSpanSamplingResult(val SpanSamplingResultAttr) attribute.KeyValue { - return attribute.String("otel.span.sampling_result", string(val)) -} - -// SDKSpanStarted is an instrument used to record metric values conforming to the -// "otel.sdk.span.started" semantic conventions. It represents the number of -// created spans. -type SDKSpanStarted struct { - metric.Int64Counter -} - -var newSDKSpanStartedOpts = []metric.Int64CounterOption{ - metric.WithDescription("The number of created spans."), - metric.WithUnit("{span}"), -} - -// NewSDKSpanStarted returns a new SDKSpanStarted instrument. -func NewSDKSpanStarted( - m metric.Meter, - opt ...metric.Int64CounterOption, -) (SDKSpanStarted, error) { - // Check if the meter is nil. - if m == nil { - return SDKSpanStarted{noop.Int64Counter{}}, nil - } - - if len(opt) == 0 { - opt = newSDKSpanStartedOpts - } else { - opt = append(opt, newSDKSpanStartedOpts...) - } - - i, err := m.Int64Counter( - "otel.sdk.span.started", - opt..., - ) - if err != nil { - return SDKSpanStarted{noop.Int64Counter{}}, err - } - return SDKSpanStarted{i}, nil -} - -// Inst returns the underlying metric instrument. -func (m SDKSpanStarted) Inst() metric.Int64Counter { - return m.Int64Counter -} - -// Name returns the semantic convention name of the instrument. -func (SDKSpanStarted) Name() string { - return "otel.sdk.span.started" -} - -// Unit returns the semantic convention unit of the instrument -func (SDKSpanStarted) Unit() string { - return "{span}" -} - -// Description returns the semantic convention description of the instrument -func (SDKSpanStarted) Description() string { - return "The number of created spans." -} - -// Add adds incr to the existing count for attrs. -// -// All additional attrs passed are included in the recorded value. -// -// Implementations MUST record this metric for all spans, even for non-recording -// ones. -func (m SDKSpanStarted) Add( - ctx context.Context, - incr int64, - attrs ...attribute.KeyValue, -) { - if len(attrs) == 0 { - m.Int64Counter.Add(ctx, incr) - return - } - - o := addOptPool.Get().(*[]metric.AddOption) - defer func() { - *o = (*o)[:0] - addOptPool.Put(o) - }() - - *o = append( - *o, - metric.WithAttributes( - attrs..., - ), - ) - - m.Int64Counter.Add(ctx, incr, *o...) -} - -// AddSet adds incr to the existing count for set. -// -// Implementations MUST record this metric for all spans, even for non-recording -// ones. -func (m SDKSpanStarted) AddSet(ctx context.Context, incr int64, set attribute.Set) { - if set.Len() == 0 { - m.Int64Counter.Add(ctx, incr) - return - } - - o := addOptPool.Get().(*[]metric.AddOption) - defer func() { - *o = (*o)[:0] - addOptPool.Put(o) - }() - - *o = append(*o, metric.WithAttributeSet(set)) - m.Int64Counter.Add(ctx, incr, *o...) -} - -// AttrSpanParentOrigin returns an optional attribute for the -// "otel.span.parent.origin" semantic convention. It represents the determines -// whether the span has a parent span, and if so, [whether it is a remote parent] -// . -// -// [whether it is a remote parent]: https://opentelemetry.io/docs/specs/otel/trace/api/#isremote -func (SDKSpanStarted) AttrSpanParentOrigin(val SpanParentOriginAttr) attribute.KeyValue { - return attribute.String("otel.span.parent.origin", string(val)) -} - -// AttrSpanSamplingResult returns an optional attribute for the -// "otel.span.sampling_result" semantic convention. It represents the result -// value of the sampler for this span. -func (SDKSpanStarted) AttrSpanSamplingResult(val SpanSamplingResultAttr) attribute.KeyValue { - return attribute.String("otel.span.sampling_result", string(val)) -} diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.39.0/httpconv/metric.go b/vendor/go.opentelemetry.io/otel/semconv/v1.40.0/httpconv/metric.go similarity index 99% rename from vendor/go.opentelemetry.io/otel/semconv/v1.39.0/httpconv/metric.go rename to vendor/go.opentelemetry.io/otel/semconv/v1.40.0/httpconv/metric.go index d6ad8735a9..7264925ba9 100644 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.39.0/httpconv/metric.go +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.40.0/httpconv/metric.go @@ -177,7 +177,7 @@ func (m ClientActiveRequests) Add( *o, metric.WithAttributes( append( - attrs, + attrs[:len(attrs):len(attrs)], attribute.String("server.address", serverAddress), attribute.Int("server.port", serverPort), )..., @@ -320,7 +320,7 @@ func (m ClientConnectionDuration) Record( *o, metric.WithAttributes( append( - attrs, + attrs[:len(attrs):len(attrs)], attribute.String("server.address", serverAddress), attribute.Int("server.port", serverPort), )..., @@ -467,7 +467,7 @@ func (m ClientOpenConnections) Add( *o, metric.WithAttributes( append( - attrs, + attrs[:len(attrs):len(attrs)], attribute.String("http.connection.state", string(connectionState)), attribute.String("server.address", serverAddress), attribute.Int("server.port", serverPort), @@ -620,7 +620,7 @@ func (m ClientRequestBodySize) Record( *o, metric.WithAttributes( append( - attrs, + attrs[:len(attrs):len(attrs)], attribute.String("http.request.method", string(requestMethod)), attribute.String("server.address", serverAddress), attribute.Int("server.port", serverPort), @@ -800,7 +800,7 @@ func (m ClientRequestDuration) Record( *o, metric.WithAttributes( append( - attrs, + attrs[:len(attrs):len(attrs)], attribute.String("http.request.method", string(requestMethod)), attribute.String("server.address", serverAddress), attribute.Int("server.port", serverPort), @@ -980,7 +980,7 @@ func (m ClientResponseBodySize) Record( *o, metric.WithAttributes( append( - attrs, + attrs[:len(attrs):len(attrs)], attribute.String("http.request.method", string(requestMethod)), attribute.String("server.address", serverAddress), attribute.Int("server.port", serverPort), @@ -1157,7 +1157,7 @@ func (m ServerActiveRequests) Add( *o, metric.WithAttributes( append( - attrs, + attrs[:len(attrs):len(attrs)], attribute.String("http.request.method", string(requestMethod)), attribute.String("url.scheme", urlScheme), )..., @@ -1297,7 +1297,7 @@ func (m ServerRequestBodySize) Record( *o, metric.WithAttributes( append( - attrs, + attrs[:len(attrs):len(attrs)], attribute.String("http.request.method", string(requestMethod)), attribute.String("url.scheme", urlScheme), )..., @@ -1484,7 +1484,7 @@ func (m ServerRequestDuration) Record( *o, metric.WithAttributes( append( - attrs, + attrs[:len(attrs):len(attrs)], attribute.String("http.request.method", string(requestMethod)), attribute.String("url.scheme", urlScheme), )..., @@ -1671,7 +1671,7 @@ func (m ServerResponseBodySize) Record( *o, metric.WithAttributes( append( - attrs, + attrs[:len(attrs):len(attrs)], attribute.String("http.request.method", string(requestMethod)), attribute.String("url.scheme", urlScheme), )..., diff --git a/vendor/modules.txt b/vendor/modules.txt index 86ffca3166..c8d50c1ba9 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -70,7 +70,7 @@ github.com/cespare/xxhash/v2 # github.com/containerd/cgroups/v3 v3.1.2 ## explicit; go 1.22.0 github.com/containerd/cgroups/v3/cgroup1/stats -# github.com/containerd/containerd v1.7.30 +# github.com/containerd/containerd v1.7.31 ## explicit; go 1.24.0 github.com/containerd/containerd/archive github.com/containerd/containerd/archive/compression @@ -157,7 +157,7 @@ github.com/davecgh/go-spew/spew # github.com/distribution/reference v0.6.0 ## explicit; go 1.20 github.com/distribution/reference -# github.com/docker/cli v29.3.1+incompatible +# github.com/docker/cli v29.4.1+incompatible ## explicit github.com/docker/cli/cli/config github.com/docker/cli/cli/config/configfile @@ -349,7 +349,7 @@ github.com/gorilla/mux # github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 ## explicit github.com/grpc-ecosystem/go-grpc-prometheus -# github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.7 +# github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 ## explicit; go 1.24.0 github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options @@ -376,7 +376,7 @@ github.com/itchyny/timefmt-go # github.com/json-iterator/go v1.1.12 ## explicit; go 1.12 github.com/json-iterator/go -# github.com/klauspost/compress v1.18.3 +# github.com/klauspost/compress v1.18.4 ## explicit; go 1.23 github.com/klauspost/compress github.com/klauspost/compress/fse @@ -395,8 +395,8 @@ github.com/mattn/go-colorable # github.com/mattn/go-isatty v0.0.20 ## explicit; go 1.15 github.com/mattn/go-isatty -# github.com/mattn/go-sqlite3 v1.14.37 -## explicit; go 1.19 +# github.com/mattn/go-sqlite3 v1.14.42 +## explicit; go 1.21 github.com/mattn/go-sqlite3 # github.com/maxbrunsfeld/counterfeiter/v6 v6.12.2 ## explicit; go 1.25.0 @@ -538,7 +538,7 @@ github.com/operator-framework/api/pkg/validation github.com/operator-framework/api/pkg/validation/errors github.com/operator-framework/api/pkg/validation/interfaces github.com/operator-framework/api/pkg/validation/internal -# github.com/operator-framework/operator-registry v1.65.0 +# github.com/operator-framework/operator-registry v1.66.0 ## explicit; go 1.25.7 github.com/operator-framework/operator-registry/alpha/model github.com/operator-framework/operator-registry/alpha/property @@ -590,8 +590,8 @@ github.com/prometheus/client_model/go ## explicit; go 1.24.0 github.com/prometheus/common/expfmt github.com/prometheus/common/model -# github.com/prometheus/procfs v0.19.2 -## explicit; go 1.24.0 +# github.com/prometheus/procfs v0.20.1 +## explicit; go 1.25.0 github.com/prometheus/procfs github.com/prometheus/procfs/internal/fs github.com/prometheus/procfs/internal/util @@ -659,8 +659,8 @@ go.opentelemetry.io/auto/sdk/internal/telemetry ## explicit; go 1.24.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.65.0 -## explicit; go 1.24.0 +# go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.67.0 +## explicit; go 1.25.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv @@ -682,17 +682,16 @@ go.opentelemetry.io/otel/semconv/v1.17.0 go.opentelemetry.io/otel/semconv/v1.21.0 go.opentelemetry.io/otel/semconv/v1.37.0 go.opentelemetry.io/otel/semconv/v1.39.0 -go.opentelemetry.io/otel/semconv/v1.39.0/httpconv -go.opentelemetry.io/otel/semconv/v1.39.0/otelconv go.opentelemetry.io/otel/semconv/v1.39.0/rpcconv go.opentelemetry.io/otel/semconv/v1.40.0 +go.opentelemetry.io/otel/semconv/v1.40.0/httpconv go.opentelemetry.io/otel/semconv/v1.40.0/otelconv -# go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.40.0 -## explicit; go 1.24.0 +# go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.42.0 +## explicit; go 1.25.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform -# go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.40.0 -## explicit; go 1.24.0 +# go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.42.0 +## explicit; go 1.25.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/counter @@ -727,7 +726,7 @@ go.opentelemetry.io/proto/otlp/collector/trace/v1 go.opentelemetry.io/proto/otlp/common/v1 go.opentelemetry.io/proto/otlp/resource/v1 go.opentelemetry.io/proto/otlp/trace/v1 -# go.podman.io/common v0.67.0 +# go.podman.io/common v0.67.1 ## explicit; go 1.24.2 go.podman.io/common/pkg/auth go.podman.io/common/pkg/capabilities @@ -822,7 +821,7 @@ golang.org/x/crypto/salsa20/salsa ## explicit; go 1.24.0 golang.org/x/exp/maps golang.org/x/exp/slices -# golang.org/x/mod v0.34.0 +# golang.org/x/mod v0.35.0 ## explicit; go 1.25.0 golang.org/x/mod/internal/lazyregexp golang.org/x/mod/modfile @@ -846,7 +845,7 @@ golang.org/x/net/internal/timeseries golang.org/x/net/proxy golang.org/x/net/trace golang.org/x/net/websocket -# golang.org/x/oauth2 v0.34.0 +# golang.org/x/oauth2 v0.35.0 ## explicit; go 1.24.0 golang.org/x/oauth2 golang.org/x/oauth2/internal @@ -932,14 +931,14 @@ gomodules.xyz/jsonpatch/v2 # google.golang.org/genproto v0.0.0-20260203192932-546029d2fa20 ## explicit; go 1.24.0 google.golang.org/genproto/protobuf/field_mask -# google.golang.org/genproto/googleapis/api v0.0.0-20260203192932-546029d2fa20 -## explicit; go 1.24.0 +# google.golang.org/genproto/googleapis/api v0.0.0-20260226221140-a57be14db171 +## explicit; go 1.25.0 google.golang.org/genproto/googleapis/api google.golang.org/genproto/googleapis/api/annotations google.golang.org/genproto/googleapis/api/expr/v1alpha1 google.golang.org/genproto/googleapis/api/httpbody -# google.golang.org/genproto/googleapis/rpc v0.0.0-20260203192932-546029d2fa20 -## explicit; go 1.24.0 +# google.golang.org/genproto/googleapis/rpc v0.0.0-20260226221140-a57be14db171 +## explicit; go 1.25.0 google.golang.org/genproto/googleapis/rpc/errdetails google.golang.org/genproto/googleapis/rpc/status # google.golang.org/grpc v1.80.0