From 4e7601d390ed15e204c5bbb253d75c12d6de69f6 Mon Sep 17 00:00:00 2001 From: Steven L Date: Thu, 24 Jul 2025 14:45:15 -0500 Subject: [PATCH 1/9] got an initial set of histogram buckets, still figuring out a reasonable api --- Makefile | 29 +- cmd/server/cadence/fx.go | 6 +- cmd/server/cadence/server.go | 6 +- cmd/server/cadence/server_test.go | 11 +- cmd/server/go.mod | 14 +- cmd/server/go.sum | 30 +- common/archiver/gcloud/go.mod | 16 +- common/archiver/gcloud/go.sum | 30 +- common/metrics/defs.go | 21 +- common/metrics/defs_test.go | 33 ++ common/metrics/metricsfx/metricsfx.go | 5 +- common/metrics/structured/base.go | 146 +++++++++ common/metrics/structured/doc.go | 2 + common/metrics/structured/histograms.go | 187 ++++++++++++ common/metrics/structured/histograms_test.go | 132 ++++++++ common/metrics/structured/operation.go | 12 + common/resource/params.go | 2 + common/resource/resource_impl.go | 8 + common/resource/resource_mock.go | 15 + common/resource/resource_test_utils.go | 8 + common/resource/types.go | 2 + go.mod | 17 +- go.sum | 30 +- go.work.sum | 24 +- internal/tools/go.mod | 20 +- internal/tools/go.sum | 36 ++- internal/tools/go.work | 2 +- internal/tools/go.work.sum | 31 +- internal/tools/metricslint/analyzer.go | 283 ++++++++++++++++++ internal/tools/metricslint/analyzer_test.go | 12 + internal/tools/metricslint/cmd/main.go | 111 +++++++ internal/tools/metricslint/testdata/go.mod | 4 + .../tools/metricslint/testdata/metrics.go | 67 +++++ .../tools/metricslint/testdata/metrics_gen.go | 20 ++ .../metricslint/testdata/metrics_test.go | 20 ++ revive.toml | 4 +- .../engine/engineimpl/history_engine.go | 1 + service/history/replication/task_processor.go | 40 ++- .../replication/task_processor_test.go | 3 + service/history/resource/resource_mock.go | 15 + service/history/shard/context.go | 2 + service/history/shard/context_mock.go | 15 + 42 files changed, 1323 insertions(+), 149 deletions(-) create mode 100644 common/metrics/structured/base.go create mode 100644 common/metrics/structured/doc.go create mode 100644 common/metrics/structured/histograms.go create mode 100644 common/metrics/structured/histograms_test.go create mode 100644 common/metrics/structured/operation.go create mode 100644 internal/tools/metricslint/analyzer.go create mode 100644 internal/tools/metricslint/analyzer_test.go create mode 100644 internal/tools/metricslint/cmd/main.go create mode 100644 internal/tools/metricslint/testdata/go.mod create mode 100644 internal/tools/metricslint/testdata/metrics.go create mode 100644 internal/tools/metricslint/testdata/metrics_gen.go create mode 100644 internal/tools/metricslint/testdata/metrics_test.go diff --git a/Makefile b/Makefile index 51bd35f16a6..3d41543de5e 100644 --- a/Makefile +++ b/Makefile @@ -64,7 +64,7 @@ $(BUILD)/goversion-lint: $(BUILD)/fmt: $(BUILD)/codegen # formatting must occur only after all other go-file-modifications are done # $(BUILD)/copyright # $(BUILD)/copyright: $(BUILD)/codegen # must add copyright to generated code, sometimes needs re-formatting -$(BUILD)/codegen: $(BUILD)/thrift $(BUILD)/protoc +$(BUILD)/codegen: $(BUILD)/thrift $(BUILD)/protoc $(BUILD)/metrics $(BUILD)/thrift: $(BUILD)/go_mod_check $(BUILD)/protoc: $(BUILD)/go_mod_check $(BUILD)/go_mod_check: @@ -211,6 +211,12 @@ $(BIN)/protoc-gen-gogofast: go.mod go.work | $(BIN) $(BIN)/protoc-gen-yarpc-go: go.mod go.work | $(BIN) $(call go_mod_build_tool,go.uber.org/yarpc/encoding/protobuf/protoc-gen-yarpc-go) +$(BIN)/metricsgen: internal/tools/go.mod go.work $(wildcard internal/tools/metricsgen/*) | $(BIN) + $(call go_build_tool,./metricsgen) + +$(BIN)/metricslint: internal/tools/go.mod go.work $(wildcard internal/tools/metricslint/* internal/tools/metricslint/cmd/*) | $(BIN) + $(call go_build_tool,./metricslint/cmd,metricslint) + $(BUILD)/go_mod_check: go.mod internal/tools/go.mod go.work $Q # generated == used is occasionally important for gomock / mock libs in general. this is not a definite problem if violated though. $Q ./scripts/check-gomod-version.sh github.com/golang/mock/gomock $(if $(verbose),-v) @@ -352,6 +358,10 @@ $(BUILD)/protoc: $(PROTO_FILES) $(STABLE_BIN)/$(PROTOC_VERSION_BIN) $(BIN)/proto fi $Q touch $@ +$(BUILD)/metrics: $(ALL_SRC) $(BIN)/metricsgen + $Q $(BIN_PATH) go generate -run=metricsgen ./... + $Q touch $@ + # ==================================== # Rule-breaking targets intended ONLY for special cases with no good alternatives. # ==================================== @@ -404,6 +414,11 @@ $(BUILD)/code-lint: $(LINT_SRC) $(BIN)/revive | $(BUILD) fi $Q touch $@ +$(BUILD)/metrics-lint: $(ALL_SRC) $(BIN)/metricslint | $(BUILD) + $Q echo "linting metrics definitions..." + $Q $(BIN_PATH) $(BIN)/metricslint -skip cadence_requests_per_tl,2 -skip cache_hit,2 -skip cache_full,2 -skip cache_miss,2 -skip cross_cluster_fetch_errors,2 ./... + $Q touch $@ + $(BUILD)/goversion-lint: go.work Dockerfile docker/github_actions/Dockerfile${DOCKERFILE_SUFFIX} $Q echo "checking go version..." $Q # intentionally using go.work toolchain, as GOTOOLCHAIN is user-overridable @@ -458,7 +473,7 @@ endef # useful to actually re-run to get output again. # reuse the intermediates for simplicity and consistency. lint: ## (Re)run the linter - $(call remake,proto-lint gomod-lint code-lint goversion-lint) + $(call remake,proto-lint gomod-lint code-lint goversion-lint metrics-lint) # intentionally not re-making, it's a bit slow and it's clear when it's unnecessary fmt: $(BUILD)/fmt ## Run `gofmt` / organize imports / etc @@ -544,14 +559,20 @@ bins: $(BINS) ## Build all binaries, and any fast codegen needed (does not refre tools: $(TOOLS) -go-generate: $(BIN)/mockgen $(BIN)/enumer $(BIN)/mockery $(BIN)/gowrap ## Run `go generate` to regen mocks, enums, etc +go-generate: $(BIN)/mockgen $(BIN)/enumer $(BIN)/mockery $(BIN)/gowrap $(BIN)/metricsgen ## Run `go generate` to regen mocks, enums, etc $Q echo "running go generate ./..., this takes a minute or more..." $Q # add our bins to PATH so `go generate` can find them $Q $(BIN_PATH) go generate $(if $(verbose),-v) ./... + $Q touch $(BUILD)/metrics # whole-service go-generate also regenerates metrics $Q $(MAKE) --no-print-directory fmt # $Q echo "updating copyright headers" # $Q $(MAKE) --no-print-directory copyright +metrics: $(BIN)/metricsgen ## metrics-only code regen, much faster than go-generate + $Q echo "re-generating metrics structs..." + $Q $(MAKE) $(BUILD)/metrics + $Q $(MAKE) fmt # clean up imports + release: ## Re-generate generated code and run tests $(MAKE) --no-print-directory go-generate $(MAKE) --no-print-directory test @@ -577,7 +598,7 @@ tidy: ## `go mod tidy` all packages clean: ## Clean build products and SQLite database rm -f $(BINS) rm -Rf $(BUILD) - rm *.db + rm -f *.db $(if \ $(wildcard $(STABLE_BIN)/*), \ $(warning usually-stable build tools still exist, delete the $(STABLE_BIN) folder to rebuild them),) diff --git a/cmd/server/cadence/fx.go b/cmd/server/cadence/fx.go index 147dba12e01..719a2d48afa 100644 --- a/cmd/server/cadence/fx.go +++ b/cmd/server/cadence/fx.go @@ -40,6 +40,7 @@ import ( "github.com/uber/cadence/common/log/tag" "github.com/uber/cadence/common/metrics" "github.com/uber/cadence/common/metrics/metricsfx" + "github.com/uber/cadence/common/metrics/structured" "github.com/uber/cadence/common/persistence/nosql/nosqlplugin/cassandra/gocql" "github.com/uber/cadence/common/rpc/rpcfx" "github.com/uber/cadence/common/service" @@ -101,6 +102,7 @@ type AppParams struct { DynamicConfig dynamicconfig.Client Scope tally.Scope MetricsClient metrics.Client + Emitter structured.Emitter } // NewApp created a new Application from pre initalized config and logger. @@ -112,6 +114,7 @@ func NewApp(params AppParams) *App { dynamicConfig: params.DynamicConfig, scope: params.Scope, metricsClient: params.MetricsClient, + emitter: params.Emitter, } params.LifeCycle.Append(fx.StartHook(app.verifySchema)) @@ -128,13 +131,14 @@ type App struct { dynamicConfig dynamicconfig.Client scope tally.Scope metricsClient metrics.Client + emitter structured.Emitter daemon common.Daemon service string } func (a *App) Start(_ context.Context) error { - a.daemon = newServer(a.service, a.cfg, a.logger, a.dynamicConfig, a.scope, a.metricsClient) + a.daemon = newServer(a.service, a.cfg, a.logger, a.dynamicConfig, a.scope, a.metricsClient, a.emitter) a.daemon.Start() return nil } diff --git a/cmd/server/cadence/server.go b/cmd/server/cadence/server.go index 873ce35a4aa..01b8f5715c5 100644 --- a/cmd/server/cadence/server.go +++ b/cmd/server/cadence/server.go @@ -54,6 +54,7 @@ import ( "github.com/uber/cadence/common/membership" "github.com/uber/cadence/common/messaging/kafka" "github.com/uber/cadence/common/metrics" + "github.com/uber/cadence/common/metrics/structured" "github.com/uber/cadence/common/peerprovider/ringpopprovider" pnt "github.com/uber/cadence/common/pinot" "github.com/uber/cadence/common/resource" @@ -79,12 +80,13 @@ type ( dynamicCfgClient dynamicconfig.Client scope tally.Scope metricsClient metrics.Client + emitter structured.Emitter } ) // newServer returns a new instance of a daemon // that represents a cadence service -func newServer(service string, cfg config.Config, logger log.Logger, dynamicCfgClient dynamicconfig.Client, scope tally.Scope, metricsClient metrics.Client) common.Daemon { +func newServer(service string, cfg config.Config, logger log.Logger, dynamicCfgClient dynamicconfig.Client, scope tally.Scope, metricsClient metrics.Client, emitter structured.Emitter) common.Daemon { return &server{ cfg: cfg, name: service, @@ -93,6 +95,7 @@ func newServer(service string, cfg config.Config, logger log.Logger, dynamicCfgC dynamicCfgClient: dynamicCfgClient, scope: scope, metricsClient: metricsClient, + emitter: emitter, } } @@ -142,6 +145,7 @@ func (s *server) startService() common.Daemon { params.MetricScope = s.scope params.MetricsClient = s.metricsClient + params.Emitter = s.emitter rpcParams, err := rpc.NewParams(params.Name, &s.cfg, dc, params.Logger, params.MetricsClient) if err != nil { diff --git a/cmd/server/cadence/server_test.go b/cmd/server/cadence/server_test.go index 902f5fd5eef..ea6bb16be66 100644 --- a/cmd/server/cadence/server_test.go +++ b/cmd/server/cadence/server_test.go @@ -44,6 +44,7 @@ import ( "github.com/uber/cadence/common/log/tag" "github.com/uber/cadence/common/log/testlogger" "github.com/uber/cadence/common/metrics" + "github.com/uber/cadence/common/metrics/structured" pt "github.com/uber/cadence/common/persistence/persistence-tests" "github.com/uber/cadence/common/persistence/sql/sqlplugin/sqlite" "github.com/uber/cadence/common/resource" @@ -110,7 +111,15 @@ func (s *ServerSuite) TestServerStartup() { }) for _, svc := range services { - server := newServer(svc, cfg, logger, dynamicconfig.NewNopClient(), tally.NoopScope, metrics.NewNoopMetricsClient()) + server := newServer( + svc, + cfg, + logger, + dynamicconfig.NewNopClient(), + tally.NoopScope, + metrics.NewNoopMetricsClient(), + structured.NewTestEmitter(s.T(), nil), + ) daemons = append(daemons, server) server.Start() } diff --git a/cmd/server/go.mod b/cmd/server/go.mod index 3a82de2a202..fccf3721cad 100644 --- a/cmd/server/go.mod +++ b/cmd/server/go.mod @@ -57,10 +57,10 @@ require ( go.uber.org/thriftrw v1.29.2 // indirect go.uber.org/yarpc v1.70.3 // indirect go.uber.org/zap v1.26.0 - golang.org/x/net v0.38.0 // indirect - golang.org/x/sync v0.12.0 // indirect + golang.org/x/net v0.43.0 // indirect + golang.org/x/sync v0.16.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.22.0 // indirect + golang.org/x/tools v0.36.0 // indirect gonum.org/v1/gonum v0.7.0 // indirect google.golang.org/grpc v1.59.0 // indirect gopkg.in/validator.v2 v2.0.0-20180514200540-135c24b11c19 // indirect @@ -159,14 +159,14 @@ require ( go.opencensus.io v0.24.0 // indirect go.uber.org/dig v1.18.0 // indirect go.uber.org/net/metrics v1.3.0 // indirect - golang.org/x/crypto v0.36.0 // indirect + golang.org/x/crypto v0.41.0 // indirect golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e // indirect golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect - golang.org/x/mod v0.18.0 // indirect + golang.org/x/mod v0.27.0 // indirect golang.org/x/oauth2 v0.11.0 // indirect - golang.org/x/sys v0.31.0 // indirect - golang.org/x/text v0.23.0 // indirect + golang.org/x/sys v0.35.0 // indirect + golang.org/x/text v0.28.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/api v0.128.0 // indirect google.golang.org/appengine v1.6.7 // indirect diff --git a/cmd/server/go.sum b/cmd/server/go.sum index c35e47e3a25..d338b2bcedd 100644 --- a/cmd/server/go.sum +++ b/cmd/server/go.sum @@ -525,8 +525,8 @@ golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= -golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= +golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4= +golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -550,8 +550,8 @@ 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.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= -golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= +golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= 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-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -575,8 +575,8 @@ golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= -golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= +golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= +golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -592,8 +592,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= -golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= +golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -627,8 +627,8 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= -golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= +golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -639,8 +639,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= -golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= +golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= +golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= golang.org/x/time v0.0.0-20170927054726-6dc17368e09b/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= @@ -673,8 +673,10 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.11-0.20220513221640-090b14e8501f/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg= +golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s= +golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM= +golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/common/archiver/gcloud/go.mod b/common/archiver/gcloud/go.mod index 3735a01878b..2e559d1c41a 100644 --- a/common/archiver/gcloud/go.mod +++ b/common/archiver/gcloud/go.mod @@ -1,6 +1,6 @@ module github.com/uber/cadence/common/archiver/gcloud -go 1.23 +go 1.23.0 toolchain go1.23.4 @@ -40,10 +40,10 @@ require ( go.uber.org/thriftrw v1.29.2 // indirect go.uber.org/yarpc v1.70.3 // indirect go.uber.org/zap v1.26.0 // indirect - golang.org/x/net v0.26.0 // indirect - golang.org/x/sync v0.10.0 // indirect + golang.org/x/net v0.43.0 // indirect + golang.org/x/sync v0.16.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.22.0 // indirect + golang.org/x/tools v0.36.0 // indirect google.golang.org/grpc v1.59.0 // indirect gopkg.in/validator.v2 v2.0.0-20180514200540-135c24b11c19 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect @@ -98,12 +98,12 @@ require ( go.uber.org/dig v1.18.0 // indirect go.uber.org/fx v1.23.0 // indirect go.uber.org/net/metrics v1.3.0 // indirect - golang.org/x/crypto v0.32.0 // indirect + golang.org/x/crypto v0.41.0 // indirect golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e // indirect golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect - golang.org/x/mod v0.18.0 // indirect - golang.org/x/sys v0.29.0 // indirect - golang.org/x/text v0.21.0 // indirect + golang.org/x/mod v0.27.0 // indirect + golang.org/x/sys v0.35.0 // indirect + golang.org/x/text v0.28.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b // indirect diff --git a/common/archiver/gcloud/go.sum b/common/archiver/gcloud/go.sum index 49007734a2e..64354222668 100644 --- a/common/archiver/gcloud/go.sum +++ b/common/archiver/gcloud/go.sum @@ -353,8 +353,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= -golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= +golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4= +golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= @@ -374,8 +374,8 @@ 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.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= -golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= +golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= 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-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -397,8 +397,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= +golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -414,8 +414,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= -golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= +golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -442,8 +442,8 @@ golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= -golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= +golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -453,8 +453,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= -golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= +golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= golang.org/x/time v0.0.0-20170927054726-6dc17368e09b/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= @@ -484,8 +484,10 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.11-0.20220513221640-090b14e8501f/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg= +golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s= +golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM= +golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/common/metrics/defs.go b/common/metrics/defs.go index 00214a52649..a1d546ede05 100644 --- a/common/metrics/defs.go +++ b/common/metrics/defs.go @@ -53,6 +53,10 @@ type ( ServiceIdx int ) +func (s scopeDefinition) GetOperationString() string { + return s.operation +} + // MetricTypes which are supported const ( Counter MetricType = iota @@ -1068,7 +1072,7 @@ const ( // -- Operation scopes for History service -- const ( // HistoryStartWorkflowExecutionScope tracks StartWorkflowExecution API calls received by service - HistoryStartWorkflowExecutionScope = iota + NumCommonScopes + HistoryStartWorkflowExecutionScope = iota + NumFrontendScopes // HistoryRecordActivityTaskHeartbeatScope tracks RecordActivityTaskHeartbeat API calls received by service HistoryRecordActivityTaskHeartbeatScope // HistoryRespondDecisionTaskCompletedScope tracks RespondDecisionTaskCompleted API calls received by service @@ -1356,7 +1360,7 @@ const ( // -- Operation scopes for Matching service -- const ( // PollForDecisionTaskScope tracks PollForDecisionTask API calls received by service - MatchingPollForDecisionTaskScope = iota + NumCommonScopes + MatchingPollForDecisionTaskScope = iota + NumHistoryScopes // PollForActivityTaskScope tracks PollForActivityTask API calls received by service MatchingPollForActivityTaskScope // MatchingAddActivityTaskScope tracks AddActivityTask API calls received by service @@ -1392,7 +1396,7 @@ const ( // -- Operation scopes for Worker service -- const ( // ReplicationScope is the scope used by all metric emitted by replicator - ReplicatorScope = iota + NumCommonScopes + ReplicatorScope = iota + NumMatchingScopes // DomainReplicationTaskScope is the scope used by domain task replication processing DomainReplicationTaskScope // ESProcessorScope is scope used by all metric emitted by esProcessor @@ -1440,7 +1444,7 @@ const ( // -- Operation scopes for ShardDistributor service -- const ( // ShardDistributorGetShardOwnerScope tracks GetShardOwner API calls received by service - ShardDistributorGetShardOwnerScope = iota + NumCommonScopes + ShardDistributorGetShardOwnerScope = iota + NumWorkerScopes ShardDistributorHeartbeatScope ShardDistributorAssignLoopScope @@ -2700,12 +2704,13 @@ const ( VirtualQueueCountGauge VirtualQueuePausedGauge VirtualQueueRunningGauge + NumHistoryMetrics ) // Matching metrics enum const ( - PollSuccessPerTaskListCounter = iota + NumCommonMetrics + PollSuccessPerTaskListCounter = iota + NumHistoryMetrics PollTimeoutPerTaskListCounter PollSuccessWithSyncPerTaskListCounter LeaseRequestPerTaskListCounter @@ -2783,12 +2788,13 @@ const ( IsolationGroupUpscale IsolationGroupDownscale PartitionDrained + NumMatchingMetrics ) // Worker metrics enum const ( - ReplicatorMessages = iota + NumCommonMetrics + ReplicatorMessages = iota + NumMatchingMetrics ReplicatorFailures ReplicatorMessagesDropped ReplicatorLatency @@ -2872,12 +2878,13 @@ const ( DiagnosticsWorkflowStartedCount DiagnosticsWorkflowSuccess DiagnosticsWorkflowExecutionLatency + NumWorkerMetrics ) // ShardDistributor metrics enum const ( - ShardDistributorRequests = iota + NumCommonMetrics + ShardDistributorRequests = iota + NumWorkerMetrics ShardDistributorFailures ShardDistributorLatency ShardDistributorErrContextTimeoutCounter diff --git a/common/metrics/defs_test.go b/common/metrics/defs_test.go index 122aa359645..db6c15a96a3 100644 --- a/common/metrics/defs_test.go +++ b/common/metrics/defs_test.go @@ -129,6 +129,39 @@ func TestMetricDefs(t *testing.T) { } } +// "index -> operation" must be unique for structured.DynamicOperationTags' int lookup to work consistently. +// Duplicate indexes with the same operation name are technically fine, but there doesn't seem to be any benefit in allowing it, +// and it trivially ensures that all indexes have only one operation name. +func TestOperationIndexesAreUnique(t *testing.T) { + seen := make(map[int]bool) + for serviceIdx, serviceOps := range ScopeDefs { + for idx := range serviceOps { + if seen[idx] { + t.Error("duplicate operation index:", idx, "with name:", serviceOps[idx].operation, "in service:", serviceIdx) + } + seen[idx] = true + } + } +} + +func TestMetricsAreUnique(t *testing.T) { + // Duplicate indexes is arguably fine, but there doesn't seem to be any benefit in allowing it. + // + // Duplicate names are also linted, but they're done via an analyzer (metricslint) instead, to + // allow checking across multiple formats. + t.Run("indexes", func(t *testing.T) { + seen := make(map[int]bool) + for _, serviceMetrics := range MetricDefs { + for idx := range serviceMetrics { + if seen[idx] { + t.Error("duplicate metric index:", idx, "with name:", serviceMetrics[idx].metricName) + } + seen[idx] = true + } + } + }) +} + func TestExponentialDurationBuckets(t *testing.T) { factor := math.Pow(2, 0.25) assert.Equal(t, 80, len(ExponentialDurationBuckets)) diff --git a/common/metrics/metricsfx/metricsfx.go b/common/metrics/metricsfx/metricsfx.go index 56702a26107..790880aee67 100644 --- a/common/metrics/metricsfx/metricsfx.go +++ b/common/metrics/metricsfx/metricsfx.go @@ -29,12 +29,15 @@ import ( "github.com/uber/cadence/common/config" "github.com/uber/cadence/common/log" "github.com/uber/cadence/common/metrics" + "github.com/uber/cadence/common/metrics/structured" "github.com/uber/cadence/common/service" ) // Module provides metrics client for fx application. var Module = fx.Module("metricsfx", - fx.Provide(buildClient)) + fx.Provide(buildClient), + structured.Module, +) // ModuleForExternalScope provides metrics client for fx application when tally.Scope is created outside. var ModuleForExternalScope = fx.Module("metricsfx", diff --git a/common/metrics/structured/base.go b/common/metrics/structured/base.go new file mode 100644 index 00000000000..edef3714df9 --- /dev/null +++ b/common/metrics/structured/base.go @@ -0,0 +1,146 @@ +package structured + +import ( + "maps" + "strconv" + "strings" + "testing" + "time" + + "github.com/uber-go/tally" + "go.uber.org/fx" +) + +var Module = fx.Options( + fx.Provide(func(s tally.Scope) Emitter { + return Emitter{scope: s} + }), +) + +// Tags is simply a map of metric tags, to help differentiate from other maps. +type Tags map[string]string + +func (o Tags) With(key, value string, more ...string) Tags { + if len(more)%2 != 0 { + // pretty easy to catch at dev time, seems reasonably unlikely to ever happen in prod. + panic("Tags.With requires an even number of 'more' arguments") + } + + dup := make(Tags, len(o)+1+len(more)/2) + maps.Copy(dup, o) + dup[key] = value + for i := 0; i < len(more)-1; i += 2 { + dup[more[i]] = more[i+1] + } + return dup +} + +// Emitter is the base helper for emitting metrics, and it contains only low-level +// metrics-emitting funcs to keep it as simple as possible. +// +// Calls to metrics methods on this type are checked by internal/tools/metricslint +// to ensure that all metrics are uniquely named, to reduce our risk of collisions +// that break queries / Prometheus / etc. +// +// Tags must be passed in each time to help make it clear what tags are used, +// and you MUST NOT vary the tags per metric name - this breaks Prometheus. +type Emitter struct { + // intentionally NOT no-op by default. + // + // use a test emitter in tests, it should be quite easy to construct, + // and this way it will panic if forgotten for some reason, rather than + // causing a misleading lack-of-metrics. + // + // currently, because this is constructed by common/config/metrics.go, + // this scope already contains the `cadence_service:cadence-{whatever}` tag, + // but essentially no others (aside from platform-level stuff). + // you can get the instance from go.uber.org/fx, as just `tally.Scope`. + scope tally.Scope +} + +// Histogram records a duration-based histogram with the provided data. +// +// Metric names MUST have an "_ns" suffix to avoid confusion with timers, +// and to make it clear they are duration-based histograms. +func (b Emitter) Histogram(name string, buckets SubsettableHistogram, dur time.Duration, meta Tags) { + tags := make(Tags, len(meta)+3) + maps.Copy(tags, meta) + writeHistogramRangeTags(buckets.tallyBuckets, buckets.scale, tags) + + if !strings.HasSuffix(name, "_ns") { + // duration-based histograms are always in nanoseconds, + // and the name MUST be different from timers while we migrate, + // so this ensures we always have a unique _ns suffix. + // + // hopefully this is never used, but it'll at least make it clear if it is. + name = name + "_error_missing_suffix_ns" + } + b.scope.Tagged(tags).Histogram(name, buckets.tallyBuckets).RecordDuration(dur) +} + +// IntHistogram records a count-based histogram with the provided data. +// It adds a "histogram_scale" tag, so histograms can be accurately subset in queries or via middleware. +func (b Emitter) IntHistogram(name string, buckets IntSubsettableHistogram, num int, meta Tags) { + tags := make(Tags, len(meta)+3) + maps.Copy(tags, meta) + writeHistogramRangeTags(buckets.tallyBuckets, buckets.scale, tags) + + if !strings.HasSuffix(name, "_counts") { + // int-based histograms are always in "_counts" (currently anyway), + // and the name MUST be different from timers while we migrate. + // so this ensures we always have a unique _counts suffix. + // + // hopefully this is never used, but it'll at least make it clear if it is. + name = name + "_error_missing_suffix_counts" + } + b.scope.Tagged(tags).Histogram(name, buckets.tallyBuckets).RecordDuration(time.Duration(num)) +} + +func writeHistogramRangeTags(buckets []time.Duration, scale int, into Tags) { + // all subsettable histograms need to emit scale values so scale changes + // can be correctly merged at query time. + if _, ok := into["histogram_start"]; ok { + into["error_rename_this_tag_histogram_start"] = into["histogram_start"] + } + if _, ok := into["histogram_end"]; ok { + into["error_rename_this_tag_histogram_end"] = into["histogram_end"] + } + if _, ok := into["histogram_scale"]; ok { + into["error_rename_this_tag_histogram_scale"] = into["histogram_scale"] + } + // record the full range and scale of the histogram so it can be recreated from any individual metric. + into["histogram_start"] = strconv.Itoa(int(buckets[1])) // first non-zero bucket + into["histogram_end"] = strconv.Itoa(int(buckets[len(buckets)-1])) // note this will change if scale changes + // include the scale, so we know how far away from the requested scale it is, when re-subsetting. + into["histogram_scale"] = strconv.Itoa(scale) +} + +// TODO: make a MinMaxHistogram helper which maintains a precise, rolling +// min/max gauge, over a window larger than the metrics granularity (e.g. ~20s) +// to work around gauges' last-data-only behavior. +// +// This will likely require some additional state though, and might benefit from +// keeping that state further up the Tags-stack to keep contention and +// series-deduplication-costs low. +// +// Maybe OTEL / Prometheus will natively support this one day. It'd be simple. + +// Count records a counter with the provided data. +func (b Emitter) Count(name string, num int, meta Tags) { + b.scope.Tagged(meta).Counter(name).Inc(int64(num)) +} + +// Gauge emits a gauge with the provided data. +func (b Emitter) Gauge(name string, val float64, meta Tags) { + b.scope.Tagged(meta).Gauge(name).Update(val) +} + +// NewTestEmitter creates an emitter for tests, optionally using the provided scope. +// If scope is nil, a no-op scope will be used. +func NewTestEmitter(t *testing.T, scope tally.Scope) Emitter { + t.Name() // require non-nil + if scope == nil { + scope = tally.NoopScope + } + return Emitter{scope} +} diff --git a/common/metrics/structured/doc.go b/common/metrics/structured/doc.go new file mode 100644 index 00000000000..fc57fc0bb99 --- /dev/null +++ b/common/metrics/structured/doc.go @@ -0,0 +1,2 @@ +// TODO: document the simplified structure, and explain the motivation behind the new histograms +package structured diff --git a/common/metrics/structured/histograms.go b/common/metrics/structured/histograms.go new file mode 100644 index 00000000000..cc020362187 --- /dev/null +++ b/common/metrics/structured/histograms.go @@ -0,0 +1,187 @@ +package structured + +import ( + "fmt" + "math" + "slices" + "time" + + "github.com/uber-go/tally" +) + +// Nearly all histograms should use pre-defined buckets here, to encourage consistency. +// Name them more by their intent than their exact ranges - if you need something outside the intent, +// make a new bucket. +// +// Extreme, rare cases should still create a new bucket here, not declare one in-line elsewhere. +// +// Partly this helps us document our ranges, and partly it ensures that any customized emitter +// can easily detect buckets with an `==` comparison, and can choose to use a different one +// if needed (e.g. to reduce scale if it is too costly to support). +var ( + // Default1ms10m is our "default" set of buckets, targeting 1ms through 100s, + // and is "rounded up" slightly to reach 80 buckets == 16 minutes (100s needs 68 buckets), + // plus multi-minute exceptions are common enough to support for the small additional cost. + // + // If you need sub-millisecond precision, or substantially longer durations than about 1 minute, + // consider using a different histogram. + Default1ms10m = makeSubsettableHistogram(time.Millisecond, 2, func(last time.Duration, length int) bool { + return last >= 10*time.Minute && length == 80 + }) + + // High1ms24h covers things like activity latency, where "longer than 1 day" is not + // particularly worth being precise about. + // + // This uses a lot of buckets, so it must be used with relatively-low cardinality elsewhere, + // and/or consider dual emitting (Mid1ms24h or lower) so overviews can be queried efficiently. + High1ms24h = makeSubsettableHistogram(time.Millisecond, 2, func(last time.Duration, length int) bool { + // 24h leads to 108 buckets, raise to 112 for cleaner subsetting + return last >= 24*time.Hour && length == 112 + }) + + // Mid1ms24h is a one-scale-lower version of High1ms24h, + // for use when we know it's too detailed to be worth emitting. + // + // This uses 57 buckets, half of High1ms24h's 113 + Mid1ms24h = High1ms24h.subsetTo(1) + + // Low1ms10s is for things that are usually very fast, like most individual database calls, + // and is MUCH lower cardinality than Default1ms10m so it's more suitable for things like per-shard metrics. + Low1ms10s = makeSubsettableHistogram(time.Millisecond, 1, func(last time.Duration, length int) bool { + // 10s needs 26 buckets, raise to 32 for cleaner subsetting + return last >= 10*time.Second && length == 32 + }) + + // Mid1To32k is a histogram for small counters, like "how many replication tasks did we receive". + // This targets 1 to 32k + Mid1To32k = IntSubsettableHistogram(makeSubsettableHistogram(1, 2, func(last time.Duration, length int) bool { + // 10k needs 56 buckets, raise to 64 for cleaner subsetting + return last >= 10000 && length == 64 + })) +) + +// SubsettableHistogram is a duration-based histogram that can be subset to a lower scale +// in a standardized, predictable way. It is intentionally compatible with Prometheus and OTEL's +// "exponential histograms": https://opentelemetry.io/docs/specs/otel/metrics/data-model/#exponentialhistogram +// +// These histograms MUST always have a "_ns" suffix in their name to avoid confusion with timers. +type SubsettableHistogram struct { + tallyBuckets tally.DurationBuckets + + scale int +} + +// IntSubsettableHistogram is a non-duration-based integer-distribution histogram, otherwise identical +// to SubsettableHistogram. +// +// These histograms MUST always have a "_counts" suffix in their name to avoid confusion with timers, +// or modify the Emitter to allow different suffixes if something else reads better. +type IntSubsettableHistogram SubsettableHistogram + +// currently we have no apparent need for float-histograms, +// as all our value ranges go from >=1 to many thousands, where +// decimal precision is pointless and mostly just looks bad. +// +// if we ever need 0..1 precision in histograms, we can add them then. +// type FloatSubsettableHistogram struct { +// tally.ValueBuckets +// scale int +// } + +func (s SubsettableHistogram) subsetTo(newScale int) SubsettableHistogram { + if newScale >= s.scale { + panic(fmt.Sprintf("scale %v is not less than the current scale %v", newScale, s.scale)) + } + if newScale < 0 { + panic(fmt.Sprintf("negative scales (%v == greater than *2 per step) are possible, but do not have tests yet", newScale)) + } + dup := SubsettableHistogram{ + tallyBuckets: slices.Clone(s.tallyBuckets), + scale: s.scale, + } + // remove every other bucket per -1 scale + for dup.scale > newScale { + if (len(dup.tallyBuckets)-1)%2 != 0 { + panic(fmt.Sprintf("cannot subset from scale %v to %v, %v-buckets is not divisible by 2", dup.scale, dup.scale-1, len(dup.tallyBuckets)-1)) + } + half := make(tally.DurationBuckets, 0, ((len(dup.tallyBuckets)-1)/2)+1) + half = append(half, dup.tallyBuckets[0]) // keep the zero value + for i := 1; i < len(dup.tallyBuckets); i += 2 { + half = append(half, dup.tallyBuckets[i]) // add first, third, etc + } + dup.tallyBuckets = half + dup.scale-- + } + return dup +} + +func (i IntSubsettableHistogram) subsetTo(newScale int) IntSubsettableHistogram { + return IntSubsettableHistogram(SubsettableHistogram(i).subsetTo(newScale)) +} + +// makeSubsettableHistogram is a replacement for tally.MustMakeExponentialDurationBuckets, +// tailored to make "construct a range" or "ensure N buckets" simpler for OTEL-compatible exponential histograms +// (i.e. https://opentelemetry.io/docs/specs/otel/metrics/data-model/#exponentialhistogram), +// ensures values are as precise as possible (preventing display-space-wasteful numbers like 3.99996ms), +// and that all histograms start with a 0 value (else erroneous negative values are impossible to notice). +// +// Start time must be positive, scale must be 0..3 (inclusive), and the loop MUST stop within 320 or fewer steps, +// to prevent extremely-costly histograms. +// Even 320 is far too many tbh, target 160 for very-high-value data, and generally around 80 or less (ideally a value +// that is divisible by 2 many times). +// +// The stop callback will be given the current largest value and the number of values generated so far. +// This excludes the zero value (you should ignore it anyway), so you can stop at your target value, +// or == a highly-divisible-by-2 number (do not go over). +// The buckets produced may be padded further to reach a "full" power-of-2 row, as this simplifies math elsewhere +// and costs very little compared to the rest of the histogram. +// +// For all values produced, please add a test to print the concrete values, and record the length and maximum value +// so they can be quickly checked when reading. +func makeSubsettableHistogram(start time.Duration, scale int, stop func(last time.Duration, length int) bool) SubsettableHistogram { + if start <= 0 { + panic(fmt.Sprintf("start must be greater than 0 or it will not grow exponentially, got %v", start)) + } + if scale < 0 || scale > 3 { + // anything outside this range is currently not expected and probably a mistake + panic(fmt.Sprintf("scale must be between 0 (grows by *2) and 3 (grows by *2^1/8), got scale: %v", scale)) + } + buckets := tally.DurationBuckets{ + time.Duration(0), // else "too low" and "negative" are impossible to tell apart. + // ^ note this must be excluded from calculations below, hence -1 everywhere. + } + for { + if len(buckets) > 320 { + panic(fmt.Sprintf("over 320 buckets is too many, choose a smaller range or smaller scale. "+ + "started at: %v, scale: %v, last value: %v", + start, scale, buckets[len(buckets)-1])) + } + buckets = append(buckets, nextBucket(start, len(buckets)-1, scale)) + + // stop when requested. + if stop(buckets[len(buckets)-1], len(buckets)-1) { + break + } + } + + // fill in as many buckets as are necessary to make a full "row", i.e. just + // before the next power of 2 from the original value. + // this ensures subsetting keeps "round" numbers as long as possible. + powerOfTwoWidth := int(math.Pow(2, float64(scale))) // num of buckets needed to double a value + for (len(buckets)-1)%powerOfTwoWidth != 0 { + buckets = append(buckets, nextBucket(start, len(buckets)-1, scale)) + } + return SubsettableHistogram{ + tallyBuckets: buckets, + scale: scale, + } +} + +func nextBucket(start time.Duration, num int, scale int) time.Duration { + // calculating it from `start` each time reduces floating point error, ensuring "clean" multiples + // at every power of 2 (and possibly others), instead of e.g. "1ms ... 1.9999994ms" which occurs + // if you try to build from the previous value each time. + return time.Duration( + float64(start) * + math.Pow(2, float64(num)/math.Pow(2, float64(scale)))) +} diff --git a/common/metrics/structured/histograms_test.go b/common/metrics/structured/histograms_test.go new file mode 100644 index 00000000000..bdb271e7b48 --- /dev/null +++ b/common/metrics/structured/histograms_test.go @@ -0,0 +1,132 @@ +package structured + +import ( + "fmt" + "math" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/uber-go/tally" +) + +func TestHistogramValues(t *testing.T) { + t.Run("default_1ms_to_10m", func(t *testing.T) { + checkHistogram(t, Default1ms10m) + assert.Equal(t, 81, Default1ms10m.len(), "wrong number of buckets") + assertBetween(t, 10*time.Minute, Default1ms10m.max(), 15*time.Minute) // roughly 14m 42s + }) + t.Run("high_1ms_to_24h", func(t *testing.T) { + checkHistogram(t, High1ms24h) + assert.Equal(t, 113, High1ms24h.len(), "wrong number of buckets") + assertBetween(t, 24*time.Hour, High1ms24h.max(), 64*time.Hour) // roughly 63h + }) + t.Run("mid_1ms_24h", func(t *testing.T) { + checkHistogram(t, Mid1ms24h) + assert.Equal(t, 57, Mid1ms24h.len(), "wrong number of buckets") + assertBetween(t, 12*time.Hour, Mid1ms24h.max(), 64*time.Hour) // roughly 53h + }) + t.Run("mid_to_32k_ints", func(t *testing.T) { + // note: this histogram has some duplicates: + // [0] + // [1 1 1 1] + // [2 2 2 3] + // [4 4 5 6] + // [8 9 11 13] + // ... + // + // this wastes a bit of memory, but Tally will choose the same index each + // time for a specific value, so it does not cause extra non-zero series + // to be stored or emitted. + // + // if this turns out to be expensive in Prometheus / etc, it's easy + // enough to start the histogram at 8, and dual-emit a non-exponential + // histogram for lower values. + checkHistogram(t, Mid1To32k) + assert.Equal(t, 65, Mid1To32k.len(), "wrong number of buckets") + assertBetween(t, 32_000, int(Mid1To32k.max()), 64_000) // 55108 + }) + t.Run("low_cardinality_1ms_10s", func(t *testing.T) { + checkHistogram(t, Low1ms10s) + assert.Equal(t, 33, Low1ms10s.len(), "wrong number of buckets") + assertBetween(t, 10*time.Second, Low1ms10s.max(), time.Minute) // roughly 46s + }) +} + +// test helpers, but could be moved elsewhere if they prove useful +func (s SubsettableHistogram) width() int { return int(math.Pow(2, float64(s.scale))) } +func (s SubsettableHistogram) len() int { return len(s.tallyBuckets) } +func (s SubsettableHistogram) max() time.Duration { return s.tallyBuckets[len(s.tallyBuckets)-1] } +func (s SubsettableHistogram) buckets() tally.DurationBuckets { return s.tallyBuckets } + +func (i IntSubsettableHistogram) width() int { return int(math.Pow(2, float64(i.scale))) } +func (i IntSubsettableHistogram) len() int { return len(i.tallyBuckets) } +func (i IntSubsettableHistogram) max() time.Duration { + return i.tallyBuckets[len(i.tallyBuckets)-1] +} +func (i IntSubsettableHistogram) buckets() tally.DurationBuckets { return i.tallyBuckets } + +type histogrammy interface { + SubsettableHistogram | IntSubsettableHistogram + + width() int + len() int + max() time.Duration + buckets() tally.DurationBuckets +} + +type numeric interface { + ~int | ~int64 +} + +func assertBetween[T numeric](t *testing.T, min, actual, max T, msgAndArgs ...interface{}) { + if actual < min || actual > max { + assert.Fail(t, fmt.Sprintf("value %v not between %v and %v", actual, min, max), msgAndArgs...) + } +} + +// most histograms should pass this check, but fuzzy comparison is fine if needed for extreme cases. +func checkHistogram[T histogrammy](t *testing.T, h T) { + printHistogram(t, h) + buckets := h.buckets() + assert.EqualValues(t, 0, buckets[0], "first bucket should always be zero") + for i := 1; i < len(buckets); i += h.width() { + if i > 1 { + // ensure good float math. + // + // this is *intentionally* doing exact comparisons, as floating point math with + // human-friendly integers have precise power-of-2 multiples for a very long time. + // + // note that the equivalent tally buckets, e.g.: + // tally.MustMakeExponentialDurationBuckets(time.Millisecond, math.Pow(2, 1.0/4.0)) + // fails this test, and the logs produced show ugly e.g. 31.999942ms values. + // it also produces incorrect results if you start at e.g. 1, as it never exceeds 1. + assert.Equalf(t, buckets[i-h.width()]*2, buckets[i], + "current row's value (%v) is not a power of 2 greater than previous (%v), skewed / bad math?", + buckets[i-h.width()], buckets[i]) + } + } +} + +func printHistogram[T histogrammy](t *testing.T, histogram T) { + switch h := (any)(histogram).(type) { + case SubsettableHistogram: + t.Log(h.buckets()[:1]) + for i := 1; i < len(h.buckets()); i += h.width() { + t.Log(h.buckets()[i : i+h.width()]) // display row by row for easier reading. + // ^ this will panic if the histograms are not an even multiple of `width`, + // that's also a sign that it's constructed incorrectly. + } + case IntSubsettableHistogram: + hi := make([]int, len(h.buckets())) // convert to int + for i, v := range h.buckets() { + hi[i] = int(v) + } + t.Log(hi[:1]) + for i := 1; i < len(hi); i += h.width() { + t.Log(hi[i : i+h.width()]) + } + default: + panic("unreachable") + } +} diff --git a/common/metrics/structured/operation.go b/common/metrics/structured/operation.go new file mode 100644 index 00000000000..7a9b63761b3 --- /dev/null +++ b/common/metrics/structured/operation.go @@ -0,0 +1,12 @@ +package structured + +import "github.com/uber/cadence/common/metrics" + +func GetOperationString(op int) string { + for _, serviceOps := range metrics.ScopeDefs { + if serviceOp, ok := serviceOps[op]; ok { + return serviceOp.GetOperationString() // unit test ensures this is unique + } + } + return "unknown_operation_int" // should never happen +} diff --git a/common/resource/params.go b/common/resource/params.go index 7e48a56d220..aaed4ff26c5 100644 --- a/common/resource/params.go +++ b/common/resource/params.go @@ -42,6 +42,7 @@ import ( "github.com/uber/cadence/common/membership" "github.com/uber/cadence/common/messaging" "github.com/uber/cadence/common/metrics" + "github.com/uber/cadence/common/metrics/structured" persistenceClient "github.com/uber/cadence/common/persistence/client" "github.com/uber/cadence/common/pinot" "github.com/uber/cadence/common/rpc" @@ -68,6 +69,7 @@ type ( ClusterMetadata cluster.Metadata ReplicatorConfig config.Replicator MetricsClient metrics.Client + Emitter structured.Emitter MessagingClient messaging.Client BlobstoreClient blobstore.Client ESClient es.GenericClient diff --git a/common/resource/resource_impl.go b/common/resource/resource_impl.go index 48a9be7bd66..bd50919328d 100644 --- a/common/resource/resource_impl.go +++ b/common/resource/resource_impl.go @@ -57,6 +57,7 @@ import ( "github.com/uber/cadence/common/membership" "github.com/uber/cadence/common/messaging" "github.com/uber/cadence/common/metrics" + "github.com/uber/cadence/common/metrics/structured" "github.com/uber/cadence/common/persistence" persistenceClient "github.com/uber/cadence/common/persistence/client" qrpc "github.com/uber/cadence/common/quotas/global/rpc" @@ -98,6 +99,7 @@ type Impl struct { timeSource clock.TimeSource payloadSerializer persistence.PayloadSerializer metricsClient metrics.Client + emitter structured.Emitter messagingClient messaging.Client blobstoreClient blobstore.Client archivalMetadata archiver.ArchivalMetadata @@ -360,6 +362,7 @@ func New( timeSource: clock.NewRealTimeSource(), payloadSerializer: persistence.NewPayloadSerializer(), metricsClient: params.MetricsClient, + emitter: params.Emitter, messagingClient: params.MessagingClient, blobstoreClient: params.BlobstoreClient, archivalMetadata: params.ArchivalMetadata, @@ -534,6 +537,11 @@ func (h *Impl) GetMetricsClient() metrics.Client { return h.metricsClient } +// GetMetricsEmitter returns a base structured metrics emitter +func (h *Impl) GetMetricsEmitter() structured.Emitter { + return h.emitter +} + // GetMessagingClient return messaging client func (h *Impl) GetMessagingClient() messaging.Client { return h.messagingClient diff --git a/common/resource/resource_mock.go b/common/resource/resource_mock.go index 58127259301..1fbf82491cd 100644 --- a/common/resource/resource_mock.go +++ b/common/resource/resource_mock.go @@ -36,6 +36,7 @@ import ( membership "github.com/uber/cadence/common/membership" messaging "github.com/uber/cadence/common/messaging" metrics "github.com/uber/cadence/common/metrics" + structured "github.com/uber/cadence/common/metrics/structured" persistence "github.com/uber/cadence/common/persistence" client0 "github.com/uber/cadence/common/persistence/client" rpc "github.com/uber/cadence/common/quotas/global/rpc" @@ -498,6 +499,20 @@ func (mr *MockResourceMockRecorder) GetMetricsClient() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMetricsClient", reflect.TypeOf((*MockResource)(nil).GetMetricsClient)) } +// GetMetricsEmitter mocks base method. +func (m *MockResource) GetMetricsEmitter() structured.Emitter { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetMetricsEmitter") + ret0, _ := ret[0].(structured.Emitter) + return ret0 +} + +// GetMetricsEmitter indicates an expected call of GetMetricsEmitter. +func (mr *MockResourceMockRecorder) GetMetricsEmitter() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMetricsEmitter", reflect.TypeOf((*MockResource)(nil).GetMetricsEmitter)) +} + // GetPayloadSerializer mocks base method. func (m *MockResource) GetPayloadSerializer() persistence.PayloadSerializer { m.ctrl.T.Helper() diff --git a/common/resource/resource_test_utils.go b/common/resource/resource_test_utils.go index 18249940c32..b40e89640fe 100644 --- a/common/resource/resource_test_utils.go +++ b/common/resource/resource_test_utils.go @@ -52,6 +52,7 @@ import ( "github.com/uber/cadence/common/membership" "github.com/uber/cadence/common/messaging" "github.com/uber/cadence/common/metrics" + "github.com/uber/cadence/common/metrics/structured" "github.com/uber/cadence/common/mocks" "github.com/uber/cadence/common/persistence" persistenceClient "github.com/uber/cadence/common/persistence/client" @@ -74,6 +75,7 @@ type ( TimeSource clock.TimeSource PayloadSerializer persistence.PayloadSerializer MetricsClient metrics.Client + Emitter structured.Emitter ArchivalMetadata *archiver.MockArchivalMetadata ArchiverProvider *provider.MockArchiverProvider BlobstoreClient *blobstore.MockClient @@ -188,6 +190,7 @@ func NewTest( TimeSource: clock.NewRealTimeSource(), PayloadSerializer: persistence.NewPayloadSerializer(), MetricsClient: metrics.NewClient(scope, serviceMetricsIndex), + Emitter: structured.NewTestEmitter(t, scope), ArchivalMetadata: &archiver.MockArchivalMetadata{}, ArchiverProvider: &provider.MockArchiverProvider{}, BlobstoreClient: &blobstore.MockClient{}, @@ -295,6 +298,11 @@ func (s *Test) GetMetricsClient() metrics.Client { return s.MetricsClient } +// GetMetricsEmitter for testing +func (s *Test) GetMetricsEmitter() structured.Emitter { + return s.Emitter +} + // GetMessagingClient for testing func (s *Test) GetMessagingClient() messaging.Client { panic("user should implement this method for test") diff --git a/common/resource/types.go b/common/resource/types.go index fdc3701ece7..11920e32339 100644 --- a/common/resource/types.go +++ b/common/resource/types.go @@ -47,6 +47,7 @@ import ( "github.com/uber/cadence/common/membership" "github.com/uber/cadence/common/messaging" "github.com/uber/cadence/common/metrics" + "github.com/uber/cadence/common/metrics/structured" "github.com/uber/cadence/common/persistence" persistenceClient "github.com/uber/cadence/common/persistence/client" qrpc "github.com/uber/cadence/common/quotas/global/rpc" @@ -79,6 +80,7 @@ type Resource interface { GetTimeSource() clock.TimeSource GetPayloadSerializer() persistence.PayloadSerializer GetMetricsClient() metrics.Client + GetMetricsEmitter() structured.Emitter GetArchiverProvider() provider.ArchiverProvider GetMessagingClient() messaging.Client GetBlobstoreClient() blobstore.Client diff --git a/go.mod b/go.mod index 6ce106d3d0b..229e76e051a 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/uber/cadence -go 1.23 +go 1.23.0 toolchain go1.23.4 @@ -57,10 +57,10 @@ require ( go.uber.org/yarpc v1.70.3 go.uber.org/zap v1.26.0 golang.org/x/exp v0.0.0-20231226003508-02704c960a9b - golang.org/x/net v0.26.0 - golang.org/x/sync v0.10.0 + golang.org/x/net v0.43.0 + golang.org/x/sync v0.16.0 golang.org/x/time v0.5.0 - golang.org/x/tools v0.22.0 + golang.org/x/tools v0.36.0 gonum.org/v1/gonum v0.7.0 google.golang.org/grpc v1.59.0 gopkg.in/validator.v2 v2.0.0-20180514200540-135c24b11c19 @@ -84,6 +84,7 @@ require ( github.com/tetratelabs/wazero v1.8.2 // indirect github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect github.com/yosida95/uritemplate/v3 v3.0.2 // indirect + golang.org/x/tools/go/expect v0.1.1-deprecated // indirect ) require ( @@ -148,12 +149,12 @@ require ( go.uber.org/dig v1.18.0 // indirect go.uber.org/goleak v1.2.0 go.uber.org/net/metrics v1.3.0 // indirect - golang.org/x/crypto v0.32.0 // indirect + golang.org/x/crypto v0.41.0 // indirect golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e // indirect golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect - golang.org/x/mod v0.18.0 - golang.org/x/sys v0.29.0 // indirect - golang.org/x/text v0.21.0 // indirect + golang.org/x/mod v0.27.0 + golang.org/x/sys v0.35.0 // indirect + golang.org/x/text v0.28.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect diff --git a/go.sum b/go.sum index 931aad5f0d0..8dfbafa5bbd 100644 --- a/go.sum +++ b/go.sum @@ -549,8 +549,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= -golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= +golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4= +golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -574,8 +574,8 @@ 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.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= -golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= +golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= 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-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -596,8 +596,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= +golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -611,8 +611,8 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= -golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= +golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180903190138-2b024373dcd9/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -647,8 +647,8 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= -golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= +golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -658,8 +658,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= -golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= +golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= golang.org/x/time v0.0.0-20170927054726-6dc17368e09b/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= @@ -695,8 +695,10 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.11-0.20220513221640-090b14e8501f/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg= +golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s= +golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM= +golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/go.work.sum b/go.work.sum index 9926d9a5247..bd7e2c1207e 100644 --- a/go.work.sum +++ b/go.work.sum @@ -562,8 +562,6 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 h1:lDH9UUVJtmYCjyT0CI4q8xvlXPxeZ0gYCVvWbmPlp88= -github.com/opensearch-project/opensearch-go/v4 v4.1.0 h1:YXNaMpMU0PC7suGyP13EuczkDT3K54QajgDnLKCZAz8= -github.com/opensearch-project/opensearch-go/v4 v4.1.0/go.mod h1:aSTMFGSLEoiG19US6Oo5udvWCjHap3mRcWBNV8rAFak= github.com/otiai10/curr v1.0.0 h1:TJIWdbX0B+kpNagQrjgq8bCMrbhiuX73M2XwgtDMoOI= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= @@ -622,12 +620,6 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/taylanisikdemir/cadence-idl v0.0.0-20250604205405-c829a7dc2e0c h1:EtJglCmzRnUbKX67v9svqAnYlrgPwCE+PUnG1kB2ooY= github.com/taylanisikdemir/cadence-idl v0.0.0-20250604205405-c829a7dc2e0c/go.mod h1:oyUK7GCNCRHCCyWyzifSzXpVrRYVBbAMHAzF5dXiKws= -github.com/tidwall/gjson v1.17.1 h1:wlYEnwqAHgzmhNUFfw7Xalt2JzQvsMx2Se4PcoFCT/U= -github.com/tidwall/gjson v1.17.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= -github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= -github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= -github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= -github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= github.com/timl3136/cadence-idl v0.0.0-20240716221550-3529a2618736 h1:UoaE2FX56QyLA0VGMJ16cll3haA5aZaFnfw5ZFDBzVU= github.com/timl3136/cadence-idl v0.0.0-20240716221550-3529a2618736/go.mod h1:oyUK7GCNCRHCCyWyzifSzXpVrRYVBbAMHAzF5dXiKws= github.com/timl3136/cadence-idl v0.0.0-20240716224349-f9e143d54910 h1:cxtZkrE5AumMJDXFKVOUG+Q0GSHHM05t90/NKFdt+6E= @@ -658,8 +650,6 @@ github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyC github.com/valyala/quicktemplate v1.7.0 h1:LUPTJmlVcb46OOUY3IeD9DojFpAVbsG+5WFTcjMJzCM= github.com/valyala/quicktemplate v1.7.0/go.mod h1:sqKJnoaOF88V07vkO+9FL8fb9uZg/VPSJnLYn+LmLk8= github.com/viki-org/dnscache v0.0.0-20130720023526-c70c1f23c5d8 h1:EVObHAr8DqpoJCVv6KYTle8FEImKhtkfcZetNqxDoJQ= -github.com/wI2L/jsondiff v0.6.0 h1:zrsH3FbfVa3JO9llxrcDy/XLkYPLgoMX6Mz3T2PP2AI= -github.com/wI2L/jsondiff v0.6.0/go.mod h1:D6aQ5gKgPF9g17j+E9N7aasmU1O+XvfmWm1y8UMmNpw= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77 h1:ESFSdwYZvkeru3RtdrYueztKhOBCSAAzS4Gf+k0tEow= @@ -698,22 +688,29 @@ golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45 golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= +golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81 h1:00VmoueYNlNz/aHIilyyQz/MHSqGoWJzpFv/HW8xpzI= golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= golang.org/x/mobile v0.0.0-20200801112145-973feb4309de h1:OVJ6QQUBAesB8CZijKDSsXX7xYVtUhrkY0gwMfbi4p4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.26.0/go.mod h1:/j6NAhSk8iQ723BGAUyoAcn7SlD7s15Dp9Nd/SfeaFQ= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= +golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8= golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -721,8 +718,11 @@ golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457 h1:zf5N6UOrA487eEFacMePxjXAJctxKmyjKUsjA11Uzuk= golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457/go.mod h1:pRgIJT+bRLFKnoM1ldnzKoxTIn14Yxz928LQRYYgIN0= +golang.org/x/telemetry v0.0.0-20250807160809-1a19826ec488 h1:3doPGa+Gg4snce233aCWnbZVFsyFMo/dR40KK/6skyE= +golang.org/x/telemetry v0.0.0-20250807160809-1a19826ec488/go.mod h1:fGb/2+tgXXjhjHsTNdVEEMZNWA0quBnfrO+AfoDSAKw= golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= @@ -731,14 +731,18 @@ golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y= golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g= +golang.org/x/term v0.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4= +golang.org/x/term v0.34.0/go.mod h1:5jC53AEywhIVebHgPVeg0mj8OD3VO9OzclacVrqpaAw= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.35.0/go.mod h1:NKdj5HkL/73byiZSJjqJgKn3ep7KjFkBOkR/Hps3VPw= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b h1:Qh4dB5D/WpoUUp3lSod7qgoyEHbDGPUWjIbnqdqqe1k= google.golang.org/api v0.139.0 h1:A1TrCPgMmOiYu0AiNkvQIpIx+D8blHTDcJ5EogkP7LI= diff --git a/internal/tools/go.mod b/internal/tools/go.mod index 06016e100d8..303083bcede 100644 --- a/internal/tools/go.mod +++ b/internal/tools/go.mod @@ -1,6 +1,6 @@ module github.com/uber/cadence/internal/tools -go 1.22 +go 1.23.0 toolchain go1.23.4 @@ -14,7 +14,7 @@ require ( go.uber.org/mock v0.5.0 go.uber.org/thriftrw v1.29.2 go.uber.org/yarpc v1.70.3 - golang.org/x/tools v0.22.0 + golang.org/x/tools v0.36.0 ) require ( @@ -249,16 +249,18 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.24.0 // indirect gocloud.dev v0.23.0 // indirect - golang.org/x/crypto v0.24.0 // indirect + golang.org/x/crypto v0.41.0 // indirect golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e // indirect - golang.org/x/mod v0.18.0 // indirect - golang.org/x/net v0.26.0 // indirect + golang.org/x/mod v0.27.0 // indirect + golang.org/x/net v0.43.0 // indirect golang.org/x/oauth2 v0.7.0 // indirect - golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/term v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/sync v0.16.0 // indirect + golang.org/x/sys v0.35.0 // indirect + golang.org/x/term v0.34.0 // indirect + golang.org/x/text v0.28.0 // indirect golang.org/x/time v0.1.0 // indirect + golang.org/x/tools/go/expect v0.1.1-deprecated // indirect + golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/api v0.114.0 // indirect google.golang.org/appengine v1.6.7 // indirect diff --git a/internal/tools/go.sum b/internal/tools/go.sum index a95619a6621..5544ff0339d 100644 --- a/internal/tools/go.sum +++ b/internal/tools/go.sum @@ -1336,8 +1336,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220313003712-b769efc7c000/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4= +golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1383,8 +1383,8 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= -golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= +golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= 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-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1446,8 +1446,8 @@ golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= +golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1485,8 +1485,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= +golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1595,13 +1595,13 @@ golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= +golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4= +golang.org/x/term v0.34.0/go.mod h1:5jC53AEywhIVebHgPVeg0mj8OD3VO9OzclacVrqpaAw= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1611,8 +1611,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= +golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1727,8 +1727,12 @@ golang.org/x/tools v0.1.9-0.20211228192929-ee1ca4ffc4da/go.mod h1:nABZi5QlRsZVlz golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.11-0.20220513221640-090b14e8501f/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg= +golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s= +golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM= +golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= +golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated h1:1h2MnaIAIXISqTFKdENegdpAgUXz6NrPEsbIeWaBRvM= +golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated/go.mod h1:RVAQXBGNv1ib0J382/DPCRS/BPnsGebyM1Gj5VSDpG8= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/internal/tools/go.work b/internal/tools/go.work index faccf112027..68c84632dae 100644 --- a/internal/tools/go.work +++ b/internal/tools/go.work @@ -1,4 +1,4 @@ -go 1.22 +go 1.23.0 toolchain go1.23.4 diff --git a/internal/tools/go.work.sum b/internal/tools/go.work.sum index a65cfb62d41..9a08f6a6cce 100644 --- a/internal/tools/go.work.sum +++ b/internal/tools/go.work.sum @@ -124,7 +124,6 @@ cloud.google.com/go/lifesciences v0.8.0 h1:uWrMjWTsGjLZpCTWEAzYvyXj+7fhiZST45u9A cloud.google.com/go/lifesciences v0.8.0/go.mod h1:lFxiEOMqII6XggGbOnKiyZ7IBwoIqA84ClvoezaA/bo= cloud.google.com/go/logging v1.7.0 h1:CJYxlNNNNAMkHp9em/YEXcfJg+rPDg7YfwoRpMU+t5I= cloud.google.com/go/logging v1.7.0/go.mod h1:3xjP2CjkM3ZkO73aj4ASA5wRPGGCRrPIAeNqVNkzY8M= -cloud.google.com/go/longrunning v0.4.1/go.mod h1:4iWDqhBZ70CvZ6BfETbvam3T8FMvLK+eFj0E6AaRQTo= cloud.google.com/go/managedidentities v1.5.0 h1:ZRQ4k21/jAhrHBVKl/AY7SjgzeJwG1iZa+mJ82P+VNg= cloud.google.com/go/managedidentities v1.5.0/go.mod h1:+dWcZ0JlUmpuxpIDfyP5pP5y0bLdRwOS4Lp7gMni/LA= cloud.google.com/go/maps v0.7.0 h1:mv9YaczD4oZBZkM5XJl6fXQ984IkJNHPwkc8MUsdkBo= @@ -242,10 +241,8 @@ github.com/Azure/azure-service-bus-go v0.10.11 h1:GBg2mcLQA3af+w+ZuYhiAv58OWSVmQ github.com/Azure/go-amqp v0.13.7 h1:ukcCtx138ZmOfHbdALuh9yoJhGtOY3+yaKApfzNvhSk= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc= github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= -github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/GoogleCloudPlatform/cloudsql-proxy v1.22.0 h1:aTDBS16pX1X4ZR/GFsC2NcOCYJ1hDJwJm3WmKRA905Q= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= -github.com/ProtonMail/gopenpgp/v2 v2.2.2/go.mod h1:ajUlBGvxMH1UBZnaYO3d1FSVzjiC6kK9XlZYGiDCvpM= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E= github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= @@ -260,11 +257,9 @@ github.com/armon/go-metrics v0.4.0 h1:yCQqn7dwca4ITXb+CbubHmedzaQYHhNhrEXLYUeEe8 github.com/armon/go-metrics v0.4.0/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59 h1:WWB576BN5zNSZc/M9d/10pqEx5VHNhaQ/yOVAkmj5Yo= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c h1:+0HFd5KSZ/mm3JmhmrDukiId5iR6w4+BdFtfSy4yWIc= github.com/bmizerany/perks v0.0.0-20141205001514-d9a9656a3a4b h1:AP/Y7sqYicnjGDfD5VcY4CIfh1hRXBUavxrvELjTiOE= -github.com/caarlos0/go-rpmutils v0.2.1-0.20211112020245-2cd62ff89b11/go.mod h1:je2KZ+LxaCNvCoKg32jtOIULcFogJKcL1ZWUaIBjKj0= github.com/cactus/go-statsd-client/statsd v0.0.0-20191106001114-12b4e2b38748 h1:bXxS5/Z3/dfc8iFniQfgogNBomo0u+1//9eP+jl8GVo= github.com/cavaliercoder/go-cpio v0.0.0-20180626203310-925f9528c45e h1:hHg27A0RSSp2Om9lubZpiMgVbvn39bsUmW9U5h0twqc= github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g= @@ -304,7 +299,6 @@ github.com/envoyproxy/go-control-plane v0.11.1-0.20230524094728-9239064ad72f/go. github.com/envoyproxy/protoc-gen-validate v0.10.1 h1:c0g45+xCJhdgFGw7a5QAfdS4byAbud7miNWJ1WwEVf8= github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= -github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fullstorydev/grpcurl v1.6.0 h1:p8BB6VZF8O7w6MxGr3KJ9E6EVKaswCevSALK6FBtMzA= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= @@ -337,9 +331,7 @@ github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/certificate-transparency-go v1.1.1 h1:6JHXZhXEvilMcTjR4MGZn5KV0IRkcFl4CJx5iHVhjFE= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= -github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/renameio v0.1.0 h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA= github.com/google/rpmpack v0.0.0-20210410105602-e20c988a6f5a h1:XC048Fc/OB2rUl/BxruopEl2u/EP6cJNFveVxI1cvdk= @@ -350,7 +342,6 @@ github.com/gookit/color v1.5.0 h1:1Opow3+BWDwqor78DcJkJCIwnkviFi+rrOANki9BUFw= github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75 h1:f0n1xnMSmBLzVfsMMvriDyA75NB/oBgILX2GcHXIQzY= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= -github.com/gostaticanalysis/testutil v0.4.0/go.mod h1:bLIoPefWXrRi/ssLFWX1dx7Repi5x3CuviD3dgAZaBU= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 h1:FlFbCRLd5Jr4iYXZufAvgWN6Ao0JrI5chLINnUXDDr0= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= @@ -390,7 +381,6 @@ github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 h1:uC1QfSlInpQ github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= @@ -466,15 +456,11 @@ github.com/shirou/gopsutil/v3 v3.22.4/go.mod h1:D01hZJ4pVHPpCTZ3m3T2+wDF2YAGfd+H github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e h1:MZM7FHLqUHYI0Y/mQAt3d2aYa0SiNms/hFqC9qJYolM= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041 h1:llrF3Fs4018ePo4+G/HV/uQUqEI1HMDjCeOf2V6puPc= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= -github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9 h1:hp2CYQUINdZMHdvTdXtPOY2ainKl4IoMcpAXEf2xj3Q= -github.com/smartystreets/goconvey v1.7.2/go.mod h1:Vw0tHAZW6lzCRk3xgdin6fKYcG+G3Pg9vgXWeJpQFMM= github.com/smartystreets/gunit v1.0.0 h1:RyPDUFcJbvtXlhJPk7v+wnxZRY2EUokhEYl2EJOPToI= github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= github.com/streadway/quantile v0.0.0-20150917103942-b0c588724d25 h1:7z3LSn867ex6VSaahyKadf4WtSsJIgne6A1WLOAGM8A= -github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/tj/go-buffer v1.1.0 h1:Lo2OsPHlIxXF24zApe15AbK3bJLAOvkkxEA6Ux4c47M= github.com/tj/go-elastic v0.0.0-20171221160941-36157cbbebc2 h1:eGaGNxrtoZf/mBURsnNQKDR7u50Klgcf2eFDQEnc8Bc= github.com/tj/go-kinesis v0.0.0-20171128231115-08b17f58cb1b h1:m74UWYy+HBs+jMFR9mdZU6shPewugMyH5+GV6LNgW8w= @@ -525,36 +511,37 @@ go.opentelemetry.io/otel v1.0.1/go.mod h1:OPEOD4jIT2SlZPMmwT6FqZz2C0ZNdQqiWcoK6M go.opentelemetry.io/otel/trace v1.0.1 h1:StTeIH6Q3G4r0Fiw34LTokUFESZgIDUr0qIJ7mKmAfw= go.opentelemetry.io/otel/trace v1.0.1/go.mod h1:5g4i4fKLaX2BQpSBsxw8YYcgKpMMSW3x7ZTuYBr3sUk= go.opentelemetry.io/proto/otlp v0.7.0 h1:rwOQPCuKAKmwGKq2aVNnYIibI6wnV7EvzgfTCzcdGg8= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= +golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5 h1:FR+oGxGfbQu1d+jglI3rCkjAjUnhRSZcUxr+DqlDLNo= golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= golang.org/x/mobile v0.0.0-20200801112145-973feb4309de h1:OVJ6QQUBAesB8CZijKDSsXX7xYVtUhrkY0gwMfbi4p4= golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= +golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2 h1:IRJeR9r1pYWsHKTRe/IInb7lYvbBVIqOgsX/u0mbOWY= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457 h1:zf5N6UOrA487eEFacMePxjXAJctxKmyjKUsjA11Uzuk= golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457/go.mod h1:pRgIJT+bRLFKnoM1ldnzKoxTIn14Yxz928LQRYYgIN0= +golang.org/x/telemetry v0.0.0-20250807160809-1a19826ec488 h1:3doPGa+Gg4snce233aCWnbZVFsyFMo/dR40KK/6skyE= +golang.org/x/telemetry v0.0.0-20250807160809-1a19826ec488/go.mod h1:fGb/2+tgXXjhjHsTNdVEEMZNWA0quBnfrO+AfoDSAKw= golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/term v0.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4= +golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 h1:M1YKkFIboKNieVO5DLUEVzQfGwJD30Nv2jfUgzb5UcE= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/cheggaaa/pb.v1 v1.0.28 h1:n1tBJnnK2r7g9OW2btFH91V92STTUevLXYFb8gy9EMk= diff --git a/internal/tools/metricslint/analyzer.go b/internal/tools/metricslint/analyzer.go new file mode 100644 index 00000000000..9704caf1ce4 --- /dev/null +++ b/internal/tools/metricslint/analyzer.go @@ -0,0 +1,283 @@ +package metricslint + +import ( + "fmt" + "go/ast" + "go/token" + "go/types" + "maps" + "slices" + "strings" + + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/analysis/passes/inspect" + "golang.org/x/tools/go/ast/inspector" +) + +const ( + emitterPkg = "github.com/uber/cadence/common/metrics/structured" + emitterTypeName = emitterPkg + ".Emitter" +) + +// Analyzer reports all (inline string) metric names passed to Emitter methods or defined in metrics/defs.go. +// +// This is NOT intended to be used directly, it's just using the analysis framework to simplify type checking. +// The output needs to be checked for duplicates or error messages by a separate process (see cmd/main.go). +var Analyzer = &analysis.Analyzer{ + Name: "metricnames", + Doc: "finds calls to metrics-emitting methods on Emitter, and metricDefinition names, and reports them for further analysis", + Requires: []*analysis.Analyzer{inspect.Analyzer}, + Run: run, +} + +// method names on the emitter that we care about, and the suffixes that are required (if any). +// method names are checked against the actual methods on the emitter type, +// but we need the list ahead of time or passes might be racing with initializing it. +var emitterMethods = map[string]map[string]bool{ + "Histogram": {"_ns": true}, // all our durations are in nanoseconds + "IntHistogram": {"_counts": true}, // differentiates from durations, will likely have multiple suffixes + "Count": nil, + "Gauge": nil, +} + +func run(pass *analysis.Pass) (interface{}, error) { + i := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) + + if pass.Pkg.Path() == "github.com/uber/cadence/common/metrics" { + // report all hard-coded metricDefinition names, so we can make sure + // there are no duplicates between the integers and the const strings + // passed to the emitter. + // + // if you want a duplicate: no, you really don't. + // use a different name, and once verified just swap to the old name and + // delete the integer def. otherwise you risk double-counting events if + // both are emitted, and can't tell if your tags are wrong. + // + // if you're swapping calls in one step, also delete the old definition. + // + // if you really do have an exception, modify this linter to allow it. + reportMetricDefinitionNames(pass, i) + // and DO NOT return, in case there are emitter calls in this package too, + // though currently that would imply an import loop. + } else if pass.Pkg.Path() == emitterPkg { + // read the methods on the emitter and the target methods, and make sure they're in sync. + checkTargetNamesMap(pass) + } + + // print calls to metrics-emitting methods on Emitter, regardless of location + reportMetricEmitterCalls(pass, i) + + return nil, nil +} + +func reportMetricDefinitionNames(pass *analysis.Pass, i *inspector.Inspector) { + nodeFilter := []ast.Node{ + (*ast.CompositeLit)(nil), + } + i.Preorder(nodeFilter, func(n ast.Node) { + decl := n.(*ast.CompositeLit) + var metricNameField *ast.KeyValueExpr + for _, el := range decl.Elts { + kv, ok := el.(*ast.KeyValueExpr) + if !ok { + return // not a struct initializer + } + ident, ok := kv.Key.(*ast.Ident) + if !ok { + return // dynamic key in a dict or something, ignore + } + if ident.Name == "metricName" { + metricNameField = kv // currently this is exclusively used by metricDefinition + } + break + } + if metricNameField == nil { + return + } + str, ok := getConstantString(metricNameField.Value) + if !ok { + pass.Reportf(metricNameField.Pos(), "metricDefinition{metricName: ...} value must be an inline string literal") + return + } + pass.Reportf(metricNameField.Pos(), "success: %v", str) + }) +} + +func checkTargetNamesMap(pass *analysis.Pass) { + named, ok := pass.Pkg.Scope().Lookup("Emitter").Type().(*types.Named) + if !ok { + pass.Reportf(token.NoPos, "could not find Emitter type in %v", emitterPkg) + return + } + ms := types.NewMethodSet(named) + foundTargets := make(map[string]map[string]bool, len(emitterMethods)) + maps.Copy(foundTargets, emitterMethods) + for i := 0; i < ms.Len(); i++ { + m := ms.At(i) + _, ok := emitterMethods[m.Obj().Name()] + if !ok { + foundTargets[m.Obj().Name()] = nil // add any missing keys to the map + } else { + delete(foundTargets, m.Obj().Name()) // remove any found ones from the map + } + } + if len(foundTargets) != 0 { + pass.Reportf(named.Obj().Pos(), "target methods do not match Emitter methods, diff: %v", foundTargets) + } +} + +func reportMetricEmitterCalls(pass *analysis.Pass, i *inspector.Inspector) { + nodeFilter := []ast.Node{ + (*ast.File)(nil), // to skip test files + (*ast.FuncDecl)(nil), // to skip test helper funcs + (*ast.CallExpr)(nil), + } + i.Nodes(nodeFilter, func(n ast.Node, push bool) (proceed bool) { + // always descend by default, in case the call contains a closure that emits metrics. + // this covers the sync.Once case in the testdata, for example. + proceed = true + if !push { + return // do nothing when ascending the ast tree + } + + // check for test files, ignore their content if found + file, ok := n.(*ast.File) + if ok { + filename := pass.Fset.Position(file.Pos()).Filename + if strings.HasSuffix(filename, "_test.go") { + return false // don't inspect test files + } + return + } + + // check for test helper funcs anywhere, ignore their content if found. + // these are identified by a *testing.T as their first arg. + if fn, ok := n.(*ast.FuncDecl); ok { + if len(fn.Type.Params.List) > 0 { + firstArgType := pass.TypesInfo.TypeOf(fn.Type.Params.List[0].Type) + asStr := types.TypeString(firstArgType, nil) // "full/path/to.Type" + if asStr == "*testing.T" { + return false // don't inspect test helpers + } + } + return + } + + call := n.(*ast.CallExpr) // only other possibility due to nodeFilter + + // check if this is a method call (receiver.Method() == X.Sel) + // for one of the names we care about (as an early / efficient check) + sel, ok := call.Fun.(*ast.SelectorExpr) + if !ok { + return + } + methodName := sel.Sel.Name + requiredSuffixes, ok := emitterMethods[methodName] + if !ok { + return + } + + // check if the receiver type is one we care about + receiver := pass.TypesInfo.TypeOf(sel.X) + // pointer receivers are not allowed, complain if found. + // if we just ignore them here, we might miss a metric call with a duplicate name. + isPointerReceiver := false + ptr, ok := receiver.(*types.Pointer) + for ; ok; ptr, ok = receiver.(*types.Pointer) { + isPointerReceiver = true + receiver = ptr.Elem() + } + named, ok := receiver.(*types.Named) + if !ok { + // allowed by the type system, but should be impossible in a CallExpr + pass.Reportf(sel.Pos(), "anonymous receiver of a method call should be impossible?") + return + } + fullName := getPkgAndName(named) + if fullName != emitterTypeName { + return // apparently not the emitter, it just has similarly-named methods (e.g. Tally). ignore it. + } + + // at this point we know that it's "a metrics method", make sure it's valid. + + if isPointerReceiver { + // could be allowed with a bit more .Elem() dereferencing in this analyzer, + // but currently blocked to intentionally force value types. + pass.Reportf(sel.Pos(), "pointer receivers are not allowed on metrics emission calls: %v", types.ExprString(sel)) + return + } + if len(call.Args) < 2 { + // 0 or 1 arg == not currently in use + pass.Reportf(call.Pos(), "method call %v looks like a metrics method, but has too few args", call) + return + } + + // pull out the first arg, and make sure it's a constant inline string. + nameArg := call.Args[0] + metricName, isConstant := getConstantString(nameArg) + if !isConstant { + pass.Reportf(nameArg.Pos(), "metric names must be in-line strings, not consts or vars: %v", nameArg) + return + } + if len(requiredSuffixes) > 0 { + matched := false + for suffix := range requiredSuffixes { + if strings.HasSuffix(metricName, suffix) { + matched = true + break + } + } + if !matched { + suffixes := make([]string, 0, len(requiredSuffixes)) + for s := range requiredSuffixes { + suffixes = append(suffixes, fmt.Sprintf("%q", s)) + } + slices.Sort(suffixes) + pass.Reportf( + nameArg.Pos(), + "metric name %q is not valid for method %v, it must have one of the following suffixes: %v", + metricName, methodName, strings.Join(suffixes, ", "), + ) + return + } + } + + // valid call! + // + // "report" the data we've found so it can be checked with a separate process (see cmd/main.go). + // that will error if any non-"success" lines were found, else check that the list is unique. + // + // tests may lead to the same package being processed more than once, but + // the reported lines for "path/to/file:line success: {name}" are still unique + // and that won't count as a duplicate. + pass.Reportf(call.Pos(), "success: %s", metricName) + return + }) +} + +func getPkgAndName(named *types.Named) (fullName string) { + obj := named.Obj() + if obj == nil { + // afaik not possible, this would be "a named type without a type" + return "" + } + pkg := obj.Pkg() + if pkg == nil { + // given where this is used, I believe this would currently imply + // "a builtin type with a method", which does not exist. + // but it's fine to return partial values, in case it's used in more places. + return obj.Name() + } + return pkg.Path() + "." + obj.Name() +} + +func getConstantString(expr ast.Expr) (str string, ok bool) { + lit, ok := expr.(*ast.BasicLit) + if !ok { + return "", false + } + if lit.Kind != token.STRING { + return "", false + } + return strings.Trim(lit.Value, `"`), true +} diff --git a/internal/tools/metricslint/analyzer_test.go b/internal/tools/metricslint/analyzer_test.go new file mode 100644 index 00000000000..55e262e7186 --- /dev/null +++ b/internal/tools/metricslint/analyzer_test.go @@ -0,0 +1,12 @@ +package metricslint + +import ( + "testing" + + "golang.org/x/tools/go/analysis/analysistest" +) + +func TestAnalyzer(t *testing.T) { + testdata := analysistest.TestData() + analysistest.Run(t, testdata, Analyzer, "github.com/uber/cadence/common/metrics/structured") +} diff --git a/internal/tools/metricslint/cmd/main.go b/internal/tools/metricslint/cmd/main.go new file mode 100644 index 00000000000..6fff6b1306e --- /dev/null +++ b/internal/tools/metricslint/cmd/main.go @@ -0,0 +1,111 @@ +package main + +import ( + "flag" + "fmt" + "os" + "os/exec" + "slices" + "strconv" + "strings" + + "golang.org/x/tools/go/analysis/singlechecker" + + "github.com/uber/cadence/internal/tools/metricslint" +) + +func main() { + var analyze bool + flag.BoolVar(&analyze, "analyze", false, "if true, run the analyzer normally (e.g. for debugging). if false, run the analyzer internally and interpret the results as a linter") + skip := map[string]int{} + flag.Func("skip", "metric name to ignore, comma, followed by the number of times it is duplicated. repeat to skip more things.", func(s string) error { + parts := strings.SplitN(s, ",", 2) + if len(parts) != 2 { + return fmt.Errorf("skip argument %q is not in the form `name,count`", s) + } + count, err := strconv.Atoi(parts[1]) + if err != nil || count < 2 { + return fmt.Errorf("skip argument %q has invalid count %q: %v", s, parts[1], err) + } + skip[parts[0]] = count + return nil + }) + flag.Parse() + + if analyze { + singlechecker.Main(metricslint.Analyzer) + } else { + os.Exit(checkAnalyzerOutput(skip)) + } +} + +func checkAnalyzerOutput(skip map[string]int) (exitCode int) { + cmd := exec.Command(os.Args[0], append([]string{"-analyze"}, os.Args[1:]...)...) + out, _ := cmd.CombinedOutput() + + defer func() { + // in case of crashes, print the output we got so far as it likely narrows down the cause. + if r := recover(); r != nil { + _, _ = fmt.Fprint(os.Stderr, "\n\n"+string(out)) + panic(r) + } + }() + + lines := strings.Split(string(out), "\n") + // map of metric name to set of lines using it (to deduplicate) + names := make(map[string]map[string]struct{}, len(lines)) + var failures []string + for _, line := range lines { + if line == "" { + continue // empty lines are fine + } + words := strings.Fields(line) + if len(words) == 3 && words[1] == "success:" { + prev, ok := names[words[2]] + if !ok { + prev = make(map[string]struct{}) + } + prev[line] = struct{}{} + names[words[2]] = prev + } else { + failures = append(failures, line) + } + } + + if len(failures) > 0 { + _, _ = fmt.Fprintln(os.Stderr, strings.Join(failures, "\n")+"\n") + return 1 + } + + exitCode = 0 + for name, usages := range names { + var complain bool + expected, ok := skip[name] + if ok { + complain = len(usages) != expected // expectation mismatch + } else { + complain = len(usages) > 1 // must not have duplicates + } + if complain { + if expected > 0 { + _, _ = fmt.Fprintf(os.Stderr, "Metric name %q used in an unexpected number of places:\n", name) + } else { + _, _ = fmt.Fprintf(os.Stderr, "Metric name %q used in multiple places:\n", name) + } + // frustratingly: this can't use `maps.Keys` because it + // returns an iterator, not a slice, so it can't be sorted or `...`-spread. + // bleh. + sorted := make([]string, 0, len(usages)) + for usage := range usages { + sorted = append(sorted, usage) + } + slices.Sort(sorted) + for usage := range usages { + _, _ = fmt.Fprintf(os.Stderr, "\t%s\n", usage) + } + exitCode = 1 + } + } + + return exitCode +} diff --git a/internal/tools/metricslint/testdata/go.mod b/internal/tools/metricslint/testdata/go.mod new file mode 100644 index 00000000000..42d6cbc8c14 --- /dev/null +++ b/internal/tools/metricslint/testdata/go.mod @@ -0,0 +1,4 @@ +module github.com/uber/cadence/common/metrics/structured +// ^ must be the same package as the emitter's definition for the hardcoded path to work right + +go 1.24 \ No newline at end of file diff --git a/internal/tools/metricslint/testdata/metrics.go b/internal/tools/metricslint/testdata/metrics.go new file mode 100644 index 00000000000..b6078034f00 --- /dev/null +++ b/internal/tools/metricslint/testdata/metrics.go @@ -0,0 +1,67 @@ +package structured + +import ( + "sync" + "testing" + "time" +) + +const disallowedConst = "dynamic-name" + +type Emitter struct{} +type Tags map[string]string + +func (e Emitter) Count(name string, value int, meta Tags) {} +func (e Emitter) Histogram(name string, buckets []time.Duration, dur time.Duration, meta Tags) {} +func (e Emitter) Gauge(name string, value float64, meta Tags) {} +func (e Emitter) IntHistogram(name string, buckets []time.Duration, num int, meta Tags) {} + +type UnrelatedThing struct{ metricName string } + +var _ = UnrelatedThing{metricName: disallowedConst} + +func (n UnrelatedThing) Gauge(name string) {} +func (n UnrelatedThing) Count(name string, value int, meta Tags) {} + +// test helper funcs can violate the rules, ignore them. +// they must have *testing.T as the first arg +func TestHelper(t *testing.T, name string) { + var emitter Emitter + emitter.Count(name, 5, nil) +} + +func someMetricsCalls() { + var emitter Emitter + tags := Tags{"key": "value"} + + // valid calls on the emitter + emitter.Count("test-count", 5, tags) // want `success: test-count` + emitter.Histogram("test-histogram_ns", nil, time.Second, tags) // want `success: test-histogram_ns` + + // duplicates are not blocked at this stage, it's run separately because of how the analysis framework works + emitter.Count("duplicate-metric", 1, tags) // want `success: duplicate-metric` + emitter.Count("duplicate-metric", 2, tags) // want `success: duplicate-metric` + + // wrong suffix + emitter.Histogram("test-histogram", nil, time.Second, tags) // want `metric name "test-histogram" is not valid for method Histogram, it must have one of the following suffixes: "_ns"` + + // string vars are not good + dynamicName := "dynamic-name" + emitter.Count(dynamicName, 1, tags) // want `metric names must be in-line strings, not consts or vars: dynamicName` + + // named consts are also not good + // (this is fairly easy to allow though, if strongly desired) + emitter.Count(disallowedConst, 1, tags) // want `metric names must be in-line strings, not consts or vars: disallowedConst` + + var unrelated UnrelatedThing + name := "asdf" + unrelated.Gauge(name) // ignored, not on Emitter + unrelated.Count(name, 42, tags) // ignored, not on Emitter + + // contents of closures must be checked too (ensures we recurse into calls) + var once sync.Once + once.Do(func() { + emitter.Gauge(disallowedConst, 9001, tags) // want `metric names must be in-line strings, not consts or vars: disallowedConst` + emitter.IntHistogram("hist_counts", nil, 42, tags) // want `success: hist_counts` + }) +} diff --git a/internal/tools/metricslint/testdata/metrics_gen.go b/internal/tools/metricslint/testdata/metrics_gen.go new file mode 100644 index 00000000000..02669e19d57 --- /dev/null +++ b/internal/tools/metricslint/testdata/metrics_gen.go @@ -0,0 +1,20 @@ +package structured + +// Code generated by test_shenanigans; DO NOT EDIT + +import "time" + +func GeneratedFunction() { + var emitter Emitter + tags := Tags{} + + // allowed, generated code needs to follow the same rules + emitter.Count("base_count", 1, tags) // want `success: base_count` + emitter.Gauge("gauge", 12, tags) // want `success: gauge` + emitter.Histogram("hist_ns", nil, time.Second, tags) // want `success: hist_ns` + + // disallowed, generated code needs to follow the same rules + const sneakyConst = "bad_metric" + emitter.IntHistogram(sneakyConst, nil, 3, tags) // want `metric names must be in-line strings, not consts or vars: sneakyConst` + emitter.Count(sneakyConst, 1, tags) // want `metric names must be in-line strings, not consts or vars: sneakyConst` +} diff --git a/internal/tools/metricslint/testdata/metrics_test.go b/internal/tools/metricslint/testdata/metrics_test.go new file mode 100644 index 00000000000..0067efd8e67 --- /dev/null +++ b/internal/tools/metricslint/testdata/metrics_test.go @@ -0,0 +1,20 @@ +package structured + +import ( + "time" +) + +func ignoredInTestFiles() { + var emitter Emitter + tags := Tags{} + + // test code is allowed to break the rules because it does not run in production + + emitter.Count("base_count", 1, tags) + emitter.Gauge("gauge", 12, tags) + emitter.Histogram("hist_ns", nil, time.Second, tags) + + const sneakyConst = "bad_metric" + emitter.IntHistogram(sneakyConst, nil, 3, tags) + emitter.Count(sneakyConst, 1, tags) +} diff --git a/revive.toml b/revive.toml index 2238d4dd4c9..d1b939df7af 100644 --- a/revive.toml +++ b/revive.toml @@ -20,7 +20,7 @@ warningCode = 0 [rule.errorf] # [rule.exported] # disabled due to lack of value / encouraging bad habits [rule.if-return] -[rule.increment-decrement] +# [rule.increment-decrement] # noisy on generated code, otherwise seems fine - if there's a way to fix that, probably re-enable [rule.indent-error-flow] # Disabled because we have 158 packages that need package comments; we could instead add ignore # directives for existing packages and require it for new packages. @@ -62,7 +62,7 @@ arguments=[["loop","method-call","recover","return", "immediate-recover"]] [rule.range-val-address] # beneficial [rule.range-val-in-closure] # beneficial [rule.unconditional-recursion] # probably a good idea -[rule.unreachable-code] # code simplifier +# [rule.unreachable-code] # reasonable code simplifier, but does not match compiler behavior (e.g. log.Fatal still needs panic or return) [rule.waitgroup-by-value] # correct use of sync code, important #### unused utilities diff --git a/service/history/engine/engineimpl/history_engine.go b/service/history/engine/engineimpl/history_engine.go index 576b2998707..573ac483846 100644 --- a/service/history/engine/engineimpl/history_engine.go +++ b/service/history/engine/engineimpl/history_engine.go @@ -279,6 +279,7 @@ func NewEngineWithShardContext( historyEngImpl, config, shard.GetMetricsClient(), + shard.GetMetricsEmitter(), replicationTaskFetcher, replicationTaskExecutor, shard.GetTimeSource(), diff --git a/service/history/replication/task_processor.go b/service/history/replication/task_processor.go index 2e0c9416950..abadab298d0 100644 --- a/service/history/replication/task_processor.go +++ b/service/history/replication/task_processor.go @@ -41,6 +41,7 @@ import ( "github.com/uber/cadence/common/log" "github.com/uber/cadence/common/log/tag" "github.com/uber/cadence/common/metrics" + "github.com/uber/cadence/common/metrics/structured" "github.com/uber/cadence/common/persistence" "github.com/uber/cadence/common/quotas" "github.com/uber/cadence/common/reconciliation" @@ -81,6 +82,8 @@ type ( historySerializer persistence.PayloadSerializer config *config.Config metricsClient metrics.Client + metrics structured.Emitter + metricTags structured.Tags logger log.Logger taskExecutor TaskExecutor hostRateLimiter quotas.Limiter @@ -113,6 +116,7 @@ func NewTaskProcessor( historyEngine engine.Engine, config *config.Config, metricsClient metrics.Client, + emitter structured.Emitter, taskFetcher TaskFetcher, taskExecutor TaskExecutor, clock clock.TimeSource, @@ -142,6 +146,8 @@ func NewTaskProcessor( historySerializer: persistence.NewPayloadSerializer(), config: config, metricsClient: metricsClient, + metrics: emitter, + metricTags: structured.Tags{"target_cluster": sourceCluster}, // looks backwards, but matches historical behavior logger: shard.GetLogger().WithTags(tag.SourceCluster(sourceCluster), tag.ShardID(shardID)), taskExecutor: taskExecutor, hostRateLimiter: taskFetcher.GetRateLimiter(), @@ -467,28 +473,44 @@ func (p *taskProcessorImpl) processTaskOnce(replicationTask *types.ReplicationTa if err != nil { p.updateFailureMetric(scope, err, p.shard.GetShardID()) } else { - now := ts.Now() mScope := p.metricsClient.Scope(scope, metrics.TargetClusterTag(p.sourceCluster)) domainID := replicationTask.HistoryTaskV2Attributes.GetDomainID() + var domainName string if domainID != "" { - domainName, errorDomainName := p.shard.GetDomainCache().GetDomainName(domainID) + name, errorDomainName := p.shard.GetDomainCache().GetDomainName(domainID) if errorDomainName != nil { return errorDomainName } + domainName = name mScope = mScope.Tagged(metrics.DomainTag(domainName)) } + tags := p.metricTags.With( + "operation", structured.GetOperationString(scope), + "domain", domainName, + ) + + now := ts.Now() + processingLatency := now.Sub(startTime) + replicationLatency := now.Sub(time.Unix(0, replicationTask.GetCreationTime())) + + p.metrics.Histogram("task_processing_latency_ns", structured.Low1ms10s, processingLatency, tags) + // latency from task generated to task received + p.metrics.Histogram("task_replication_latency_ns", structured.Mid1ms24h, replicationLatency, tags) + // number of replication tasks + // this is an exact match for the legacy scope, so it would cause duplicates if emitted. + // because this is the first use of this new system, we'll verify the tags with the histograms first. + // p.Count("replication_tasks_applied_per_domain", 1, tags) + // emit single task processing latency - mScope.RecordTimer(metrics.TaskProcessingLatency, now.Sub(startTime)) + mScope.RecordTimer(metrics.TaskProcessingLatency, processingLatency) // emit latency from task generated to task received - mScope.RecordTimer( - metrics.ReplicationTaskLatency, - now.Sub(time.Unix(0, replicationTask.GetCreationTime())), - ) - // emit the number of replication tasks + mScope.RecordTimer(metrics.ReplicationTaskLatency, replicationLatency) + // emit the number of replication tasks. + // when removing, be sure to un-comment the p.Count above mScope.IncCounter(metrics.ReplicationTasksAppliedPerDomain) + shardScope := p.metricsClient.Scope(scope, metrics.TargetClusterTag(p.sourceCluster), metrics.InstanceTag(strconv.Itoa(p.shard.GetShardID()))) shardScope.IncCounter(metrics.ReplicationTasksApplied) - } return err diff --git a/service/history/replication/task_processor_test.go b/service/history/replication/task_processor_test.go index d7b54163ff6..0c320a14aa3 100644 --- a/service/history/replication/task_processor_test.go +++ b/service/history/replication/task_processor_test.go @@ -49,6 +49,7 @@ import ( "github.com/uber/cadence/common/constants" "github.com/uber/cadence/common/dynamicconfig/dynamicproperties" "github.com/uber/cadence/common/metrics" + "github.com/uber/cadence/common/metrics/structured" "github.com/uber/cadence/common/mocks" "github.com/uber/cadence/common/persistence" "github.com/uber/cadence/common/quotas" @@ -154,6 +155,7 @@ func (s *taskProcessorSuite) SetupTest() { s.mockEngine, s.config, metricsClient, + structured.NewTestEmitter(s.T(), nil), s.taskFetcher, s.taskExecutor, s.clock, @@ -646,6 +648,7 @@ func TestProcessorLoop_TaskExecuteFailed_ShardChangeErr(t *testing.T) { mockEngine, config, metricsClient, + structured.NewTestEmitter(t, nil), taskFetcher, taskExecutor, clock.NewMockedTimeSource(), diff --git a/service/history/resource/resource_mock.go b/service/history/resource/resource_mock.go index 184fa60e971..a97aefb5ade 100644 --- a/service/history/resource/resource_mock.go +++ b/service/history/resource/resource_mock.go @@ -36,6 +36,7 @@ import ( membership "github.com/uber/cadence/common/membership" messaging "github.com/uber/cadence/common/messaging" metrics "github.com/uber/cadence/common/metrics" + structured "github.com/uber/cadence/common/metrics/structured" persistence "github.com/uber/cadence/common/persistence" client0 "github.com/uber/cadence/common/persistence/client" algorithm "github.com/uber/cadence/common/quotas/global/algorithm" @@ -489,6 +490,20 @@ func (mr *MockResourceMockRecorder) GetMetricsClient() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMetricsClient", reflect.TypeOf((*MockResource)(nil).GetMetricsClient)) } +// GetMetricsEmitter mocks base method. +func (m *MockResource) GetMetricsEmitter() structured.Emitter { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetMetricsEmitter") + ret0, _ := ret[0].(structured.Emitter) + return ret0 +} + +// GetMetricsEmitter indicates an expected call of GetMetricsEmitter. +func (mr *MockResourceMockRecorder) GetMetricsEmitter() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMetricsEmitter", reflect.TypeOf((*MockResource)(nil).GetMetricsEmitter)) +} + // GetPayloadSerializer mocks base method. func (m *MockResource) GetPayloadSerializer() persistence.PayloadSerializer { m.ctrl.T.Helper() diff --git a/service/history/shard/context.go b/service/history/shard/context.go index 9d0d2355d59..cecd64a40a0 100644 --- a/service/history/shard/context.go +++ b/service/history/shard/context.go @@ -41,6 +41,7 @@ import ( "github.com/uber/cadence/common/log" "github.com/uber/cadence/common/log/tag" "github.com/uber/cadence/common/metrics" + "github.com/uber/cadence/common/metrics/structured" "github.com/uber/cadence/common/persistence" "github.com/uber/cadence/common/types" "github.com/uber/cadence/service/history/config" @@ -65,6 +66,7 @@ type ( GetLogger() log.Logger GetThrottledLogger() log.Logger GetMetricsClient() metrics.Client + GetMetricsEmitter() structured.Emitter GetTimeSource() clock.TimeSource PreviousShardOwnerWasDifferent() bool diff --git a/service/history/shard/context_mock.go b/service/history/shard/context_mock.go index dc774b2a714..027da55949b 100644 --- a/service/history/shard/context_mock.go +++ b/service/history/shard/context_mock.go @@ -22,6 +22,7 @@ import ( cluster "github.com/uber/cadence/common/cluster" log "github.com/uber/cadence/common/log" metrics "github.com/uber/cadence/common/metrics" + structured "github.com/uber/cadence/common/metrics/structured" persistence "github.com/uber/cadence/common/persistence" types "github.com/uber/cadence/common/types" config "github.com/uber/cadence/service/history/config" @@ -353,6 +354,20 @@ func (mr *MockContextMockRecorder) GetMetricsClient() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMetricsClient", reflect.TypeOf((*MockContext)(nil).GetMetricsClient)) } +// GetMetricsEmitter mocks base method. +func (m *MockContext) GetMetricsEmitter() structured.Emitter { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetMetricsEmitter") + ret0, _ := ret[0].(structured.Emitter) + return ret0 +} + +// GetMetricsEmitter indicates an expected call of GetMetricsEmitter. +func (mr *MockContextMockRecorder) GetMetricsEmitter() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMetricsEmitter", reflect.TypeOf((*MockContext)(nil).GetMetricsEmitter)) +} + // GetQueueAckLevel mocks base method. func (m *MockContext) GetQueueAckLevel(category persistence.HistoryTaskCategory) persistence.HistoryTaskKey { m.ctrl.T.Helper() From b4274fe9d6bdafbdf6358b26b87c4d18ed482100 Mon Sep 17 00:00:00 2001 From: Steven L Date: Wed, 27 Aug 2025 16:55:49 -0500 Subject: [PATCH 2/9] reduce diff size --- cmd/server/go.mod | 14 +++++++------- cmd/server/go.sum | 30 ++++++++++++++--------------- common/archiver/gcloud/go.mod | 16 ++++++++-------- common/archiver/gcloud/go.sum | 30 ++++++++++++++--------------- go.mod | 17 ++++++++--------- go.sum | 30 ++++++++++++++--------------- go.work.sum | 24 ++++++++++------------- internal/tools/go.mod | 20 +++++++++---------- internal/tools/go.sum | 36 ++++++++++++++++------------------- internal/tools/go.work | 2 +- internal/tools/go.work.sum | 31 +++++++++++++++++++++--------- 11 files changed, 123 insertions(+), 127 deletions(-) diff --git a/cmd/server/go.mod b/cmd/server/go.mod index fccf3721cad..3a82de2a202 100644 --- a/cmd/server/go.mod +++ b/cmd/server/go.mod @@ -57,10 +57,10 @@ require ( go.uber.org/thriftrw v1.29.2 // indirect go.uber.org/yarpc v1.70.3 // indirect go.uber.org/zap v1.26.0 - golang.org/x/net v0.43.0 // indirect - golang.org/x/sync v0.16.0 // indirect + golang.org/x/net v0.38.0 // indirect + golang.org/x/sync v0.12.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.36.0 // indirect + golang.org/x/tools v0.22.0 // indirect gonum.org/v1/gonum v0.7.0 // indirect google.golang.org/grpc v1.59.0 // indirect gopkg.in/validator.v2 v2.0.0-20180514200540-135c24b11c19 // indirect @@ -159,14 +159,14 @@ require ( go.opencensus.io v0.24.0 // indirect go.uber.org/dig v1.18.0 // indirect go.uber.org/net/metrics v1.3.0 // indirect - golang.org/x/crypto v0.41.0 // indirect + golang.org/x/crypto v0.36.0 // indirect golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e // indirect golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect - golang.org/x/mod v0.27.0 // indirect + golang.org/x/mod v0.18.0 // indirect golang.org/x/oauth2 v0.11.0 // indirect - golang.org/x/sys v0.35.0 // indirect - golang.org/x/text v0.28.0 // indirect + golang.org/x/sys v0.31.0 // indirect + golang.org/x/text v0.23.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/api v0.128.0 // indirect google.golang.org/appengine v1.6.7 // indirect diff --git a/cmd/server/go.sum b/cmd/server/go.sum index d338b2bcedd..c35e47e3a25 100644 --- a/cmd/server/go.sum +++ b/cmd/server/go.sum @@ -525,8 +525,8 @@ golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4= -golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc= +golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= +golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -550,8 +550,8 @@ 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.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= -golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= +golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= +golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -575,8 +575,8 @@ golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= -golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= +golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= +golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -592,8 +592,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= -golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= +golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -627,8 +627,8 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= -golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= +golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -639,8 +639,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= -golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= +golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= +golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= golang.org/x/time v0.0.0-20170927054726-6dc17368e09b/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= @@ -673,10 +673,8 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.11-0.20220513221640-090b14e8501f/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg= -golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s= -golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM= -golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= +golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= +golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/common/archiver/gcloud/go.mod b/common/archiver/gcloud/go.mod index 2e559d1c41a..3735a01878b 100644 --- a/common/archiver/gcloud/go.mod +++ b/common/archiver/gcloud/go.mod @@ -1,6 +1,6 @@ module github.com/uber/cadence/common/archiver/gcloud -go 1.23.0 +go 1.23 toolchain go1.23.4 @@ -40,10 +40,10 @@ require ( go.uber.org/thriftrw v1.29.2 // indirect go.uber.org/yarpc v1.70.3 // indirect go.uber.org/zap v1.26.0 // indirect - golang.org/x/net v0.43.0 // indirect - golang.org/x/sync v0.16.0 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sync v0.10.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.36.0 // indirect + golang.org/x/tools v0.22.0 // indirect google.golang.org/grpc v1.59.0 // indirect gopkg.in/validator.v2 v2.0.0-20180514200540-135c24b11c19 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect @@ -98,12 +98,12 @@ require ( go.uber.org/dig v1.18.0 // indirect go.uber.org/fx v1.23.0 // indirect go.uber.org/net/metrics v1.3.0 // indirect - golang.org/x/crypto v0.41.0 // indirect + golang.org/x/crypto v0.32.0 // indirect golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e // indirect golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect - golang.org/x/mod v0.27.0 // indirect - golang.org/x/sys v0.35.0 // indirect - golang.org/x/text v0.28.0 // indirect + golang.org/x/mod v0.18.0 // indirect + golang.org/x/sys v0.29.0 // indirect + golang.org/x/text v0.21.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b // indirect diff --git a/common/archiver/gcloud/go.sum b/common/archiver/gcloud/go.sum index 64354222668..49007734a2e 100644 --- a/common/archiver/gcloud/go.sum +++ b/common/archiver/gcloud/go.sum @@ -353,8 +353,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4= -golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= @@ -374,8 +374,8 @@ 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.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= -golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= +golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= +golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -397,8 +397,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= -golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -414,8 +414,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= -golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -442,8 +442,8 @@ golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= -golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -453,8 +453,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= -golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20170927054726-6dc17368e09b/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= @@ -484,10 +484,8 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.11-0.20220513221640-090b14e8501f/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg= -golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s= -golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM= -golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= +golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= +golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/go.mod b/go.mod index 229e76e051a..6ce106d3d0b 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/uber/cadence -go 1.23.0 +go 1.23 toolchain go1.23.4 @@ -57,10 +57,10 @@ require ( go.uber.org/yarpc v1.70.3 go.uber.org/zap v1.26.0 golang.org/x/exp v0.0.0-20231226003508-02704c960a9b - golang.org/x/net v0.43.0 - golang.org/x/sync v0.16.0 + golang.org/x/net v0.26.0 + golang.org/x/sync v0.10.0 golang.org/x/time v0.5.0 - golang.org/x/tools v0.36.0 + golang.org/x/tools v0.22.0 gonum.org/v1/gonum v0.7.0 google.golang.org/grpc v1.59.0 gopkg.in/validator.v2 v2.0.0-20180514200540-135c24b11c19 @@ -84,7 +84,6 @@ require ( github.com/tetratelabs/wazero v1.8.2 // indirect github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect github.com/yosida95/uritemplate/v3 v3.0.2 // indirect - golang.org/x/tools/go/expect v0.1.1-deprecated // indirect ) require ( @@ -149,12 +148,12 @@ require ( go.uber.org/dig v1.18.0 // indirect go.uber.org/goleak v1.2.0 go.uber.org/net/metrics v1.3.0 // indirect - golang.org/x/crypto v0.41.0 // indirect + golang.org/x/crypto v0.32.0 // indirect golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e // indirect golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect - golang.org/x/mod v0.27.0 - golang.org/x/sys v0.35.0 // indirect - golang.org/x/text v0.28.0 // indirect + golang.org/x/mod v0.18.0 + golang.org/x/sys v0.29.0 // indirect + golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect diff --git a/go.sum b/go.sum index 8dfbafa5bbd..931aad5f0d0 100644 --- a/go.sum +++ b/go.sum @@ -549,8 +549,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4= -golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -574,8 +574,8 @@ 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.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= -golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= +golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= +golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -596,8 +596,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= -golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -611,8 +611,8 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= -golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180903190138-2b024373dcd9/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -647,8 +647,8 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= -golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -658,8 +658,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= -golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20170927054726-6dc17368e09b/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= @@ -695,10 +695,8 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.11-0.20220513221640-090b14e8501f/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= -golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg= -golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s= -golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM= -golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= +golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= +golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/go.work.sum b/go.work.sum index bd7e2c1207e..9926d9a5247 100644 --- a/go.work.sum +++ b/go.work.sum @@ -562,6 +562,8 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 h1:lDH9UUVJtmYCjyT0CI4q8xvlXPxeZ0gYCVvWbmPlp88= +github.com/opensearch-project/opensearch-go/v4 v4.1.0 h1:YXNaMpMU0PC7suGyP13EuczkDT3K54QajgDnLKCZAz8= +github.com/opensearch-project/opensearch-go/v4 v4.1.0/go.mod h1:aSTMFGSLEoiG19US6Oo5udvWCjHap3mRcWBNV8rAFak= github.com/otiai10/curr v1.0.0 h1:TJIWdbX0B+kpNagQrjgq8bCMrbhiuX73M2XwgtDMoOI= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= @@ -620,6 +622,12 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/taylanisikdemir/cadence-idl v0.0.0-20250604205405-c829a7dc2e0c h1:EtJglCmzRnUbKX67v9svqAnYlrgPwCE+PUnG1kB2ooY= github.com/taylanisikdemir/cadence-idl v0.0.0-20250604205405-c829a7dc2e0c/go.mod h1:oyUK7GCNCRHCCyWyzifSzXpVrRYVBbAMHAzF5dXiKws= +github.com/tidwall/gjson v1.17.1 h1:wlYEnwqAHgzmhNUFfw7Xalt2JzQvsMx2Se4PcoFCT/U= +github.com/tidwall/gjson v1.17.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= +github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= +github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= +github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= github.com/timl3136/cadence-idl v0.0.0-20240716221550-3529a2618736 h1:UoaE2FX56QyLA0VGMJ16cll3haA5aZaFnfw5ZFDBzVU= github.com/timl3136/cadence-idl v0.0.0-20240716221550-3529a2618736/go.mod h1:oyUK7GCNCRHCCyWyzifSzXpVrRYVBbAMHAzF5dXiKws= github.com/timl3136/cadence-idl v0.0.0-20240716224349-f9e143d54910 h1:cxtZkrE5AumMJDXFKVOUG+Q0GSHHM05t90/NKFdt+6E= @@ -650,6 +658,8 @@ github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyC github.com/valyala/quicktemplate v1.7.0 h1:LUPTJmlVcb46OOUY3IeD9DojFpAVbsG+5WFTcjMJzCM= github.com/valyala/quicktemplate v1.7.0/go.mod h1:sqKJnoaOF88V07vkO+9FL8fb9uZg/VPSJnLYn+LmLk8= github.com/viki-org/dnscache v0.0.0-20130720023526-c70c1f23c5d8 h1:EVObHAr8DqpoJCVv6KYTle8FEImKhtkfcZetNqxDoJQ= +github.com/wI2L/jsondiff v0.6.0 h1:zrsH3FbfVa3JO9llxrcDy/XLkYPLgoMX6Mz3T2PP2AI= +github.com/wI2L/jsondiff v0.6.0/go.mod h1:D6aQ5gKgPF9g17j+E9N7aasmU1O+XvfmWm1y8UMmNpw= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77 h1:ESFSdwYZvkeru3RtdrYueztKhOBCSAAzS4Gf+k0tEow= @@ -688,29 +698,22 @@ golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45 golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= -golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= -golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81 h1:00VmoueYNlNz/aHIilyyQz/MHSqGoWJzpFv/HW8xpzI= golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= golang.org/x/mobile v0.0.0-20200801112145-973feb4309de h1:OVJ6QQUBAesB8CZijKDSsXX7xYVtUhrkY0gwMfbi4p4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.26.0/go.mod h1:/j6NAhSk8iQ723BGAUyoAcn7SlD7s15Dp9Nd/SfeaFQ= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= -golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= -golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8= golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -718,11 +721,8 @@ golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457 h1:zf5N6UOrA487eEFacMePxjXAJctxKmyjKUsjA11Uzuk= golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457/go.mod h1:pRgIJT+bRLFKnoM1ldnzKoxTIn14Yxz928LQRYYgIN0= -golang.org/x/telemetry v0.0.0-20250807160809-1a19826ec488 h1:3doPGa+Gg4snce233aCWnbZVFsyFMo/dR40KK/6skyE= -golang.org/x/telemetry v0.0.0-20250807160809-1a19826ec488/go.mod h1:fGb/2+tgXXjhjHsTNdVEEMZNWA0quBnfrO+AfoDSAKw= golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= @@ -731,18 +731,14 @@ golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y= golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g= -golang.org/x/term v0.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4= -golang.org/x/term v0.34.0/go.mod h1:5jC53AEywhIVebHgPVeg0mj8OD3VO9OzclacVrqpaAw= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= -golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= -golang.org/x/tools v0.35.0/go.mod h1:NKdj5HkL/73byiZSJjqJgKn3ep7KjFkBOkR/Hps3VPw= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b h1:Qh4dB5D/WpoUUp3lSod7qgoyEHbDGPUWjIbnqdqqe1k= google.golang.org/api v0.139.0 h1:A1TrCPgMmOiYu0AiNkvQIpIx+D8blHTDcJ5EogkP7LI= diff --git a/internal/tools/go.mod b/internal/tools/go.mod index 303083bcede..06016e100d8 100644 --- a/internal/tools/go.mod +++ b/internal/tools/go.mod @@ -1,6 +1,6 @@ module github.com/uber/cadence/internal/tools -go 1.23.0 +go 1.22 toolchain go1.23.4 @@ -14,7 +14,7 @@ require ( go.uber.org/mock v0.5.0 go.uber.org/thriftrw v1.29.2 go.uber.org/yarpc v1.70.3 - golang.org/x/tools v0.36.0 + golang.org/x/tools v0.22.0 ) require ( @@ -249,18 +249,16 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.24.0 // indirect gocloud.dev v0.23.0 // indirect - golang.org/x/crypto v0.41.0 // indirect + golang.org/x/crypto v0.24.0 // indirect golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e // indirect - golang.org/x/mod v0.27.0 // indirect - golang.org/x/net v0.43.0 // indirect + golang.org/x/mod v0.18.0 // indirect + golang.org/x/net v0.26.0 // indirect golang.org/x/oauth2 v0.7.0 // indirect - golang.org/x/sync v0.16.0 // indirect - golang.org/x/sys v0.35.0 // indirect - golang.org/x/term v0.34.0 // indirect - golang.org/x/text v0.28.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/term v0.21.0 // indirect + golang.org/x/text v0.16.0 // indirect golang.org/x/time v0.1.0 // indirect - golang.org/x/tools/go/expect v0.1.1-deprecated // indirect - golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/api v0.114.0 // indirect google.golang.org/appengine v1.6.7 // indirect diff --git a/internal/tools/go.sum b/internal/tools/go.sum index 5544ff0339d..a95619a6621 100644 --- a/internal/tools/go.sum +++ b/internal/tools/go.sum @@ -1336,8 +1336,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220313003712-b769efc7c000/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4= -golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc= +golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= +golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1383,8 +1383,8 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= -golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= +golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= +golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1446,8 +1446,8 @@ golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= -golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1485,8 +1485,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= -golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1595,13 +1595,13 @@ golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= -golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4= -golang.org/x/term v0.34.0/go.mod h1:5jC53AEywhIVebHgPVeg0mj8OD3VO9OzclacVrqpaAw= +golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= +golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1611,8 +1611,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= -golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1727,12 +1727,8 @@ golang.org/x/tools v0.1.9-0.20211228192929-ee1ca4ffc4da/go.mod h1:nABZi5QlRsZVlz golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.11-0.20220513221640-090b14e8501f/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= -golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg= -golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s= -golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM= -golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= -golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated h1:1h2MnaIAIXISqTFKdENegdpAgUXz6NrPEsbIeWaBRvM= -golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated/go.mod h1:RVAQXBGNv1ib0J382/DPCRS/BPnsGebyM1Gj5VSDpG8= +golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= +golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/internal/tools/go.work b/internal/tools/go.work index 68c84632dae..faccf112027 100644 --- a/internal/tools/go.work +++ b/internal/tools/go.work @@ -1,4 +1,4 @@ -go 1.23.0 +go 1.22 toolchain go1.23.4 diff --git a/internal/tools/go.work.sum b/internal/tools/go.work.sum index 9a08f6a6cce..a65cfb62d41 100644 --- a/internal/tools/go.work.sum +++ b/internal/tools/go.work.sum @@ -124,6 +124,7 @@ cloud.google.com/go/lifesciences v0.8.0 h1:uWrMjWTsGjLZpCTWEAzYvyXj+7fhiZST45u9A cloud.google.com/go/lifesciences v0.8.0/go.mod h1:lFxiEOMqII6XggGbOnKiyZ7IBwoIqA84ClvoezaA/bo= cloud.google.com/go/logging v1.7.0 h1:CJYxlNNNNAMkHp9em/YEXcfJg+rPDg7YfwoRpMU+t5I= cloud.google.com/go/logging v1.7.0/go.mod h1:3xjP2CjkM3ZkO73aj4ASA5wRPGGCRrPIAeNqVNkzY8M= +cloud.google.com/go/longrunning v0.4.1/go.mod h1:4iWDqhBZ70CvZ6BfETbvam3T8FMvLK+eFj0E6AaRQTo= cloud.google.com/go/managedidentities v1.5.0 h1:ZRQ4k21/jAhrHBVKl/AY7SjgzeJwG1iZa+mJ82P+VNg= cloud.google.com/go/managedidentities v1.5.0/go.mod h1:+dWcZ0JlUmpuxpIDfyP5pP5y0bLdRwOS4Lp7gMni/LA= cloud.google.com/go/maps v0.7.0 h1:mv9YaczD4oZBZkM5XJl6fXQ984IkJNHPwkc8MUsdkBo= @@ -241,8 +242,10 @@ github.com/Azure/azure-service-bus-go v0.10.11 h1:GBg2mcLQA3af+w+ZuYhiAv58OWSVmQ github.com/Azure/go-amqp v0.13.7 h1:ukcCtx138ZmOfHbdALuh9yoJhGtOY3+yaKApfzNvhSk= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc= github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= +github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/GoogleCloudPlatform/cloudsql-proxy v1.22.0 h1:aTDBS16pX1X4ZR/GFsC2NcOCYJ1hDJwJm3WmKRA905Q= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= +github.com/ProtonMail/gopenpgp/v2 v2.2.2/go.mod h1:ajUlBGvxMH1UBZnaYO3d1FSVzjiC6kK9XlZYGiDCvpM= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E= github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= @@ -257,9 +260,11 @@ github.com/armon/go-metrics v0.4.0 h1:yCQqn7dwca4ITXb+CbubHmedzaQYHhNhrEXLYUeEe8 github.com/armon/go-metrics v0.4.0/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59 h1:WWB576BN5zNSZc/M9d/10pqEx5VHNhaQ/yOVAkmj5Yo= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c h1:+0HFd5KSZ/mm3JmhmrDukiId5iR6w4+BdFtfSy4yWIc= github.com/bmizerany/perks v0.0.0-20141205001514-d9a9656a3a4b h1:AP/Y7sqYicnjGDfD5VcY4CIfh1hRXBUavxrvELjTiOE= +github.com/caarlos0/go-rpmutils v0.2.1-0.20211112020245-2cd62ff89b11/go.mod h1:je2KZ+LxaCNvCoKg32jtOIULcFogJKcL1ZWUaIBjKj0= github.com/cactus/go-statsd-client/statsd v0.0.0-20191106001114-12b4e2b38748 h1:bXxS5/Z3/dfc8iFniQfgogNBomo0u+1//9eP+jl8GVo= github.com/cavaliercoder/go-cpio v0.0.0-20180626203310-925f9528c45e h1:hHg27A0RSSp2Om9lubZpiMgVbvn39bsUmW9U5h0twqc= github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g= @@ -299,6 +304,7 @@ github.com/envoyproxy/go-control-plane v0.11.1-0.20230524094728-9239064ad72f/go. github.com/envoyproxy/protoc-gen-validate v0.10.1 h1:c0g45+xCJhdgFGw7a5QAfdS4byAbud7miNWJ1WwEVf8= github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fullstorydev/grpcurl v1.6.0 h1:p8BB6VZF8O7w6MxGr3KJ9E6EVKaswCevSALK6FBtMzA= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= @@ -331,7 +337,9 @@ github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/certificate-transparency-go v1.1.1 h1:6JHXZhXEvilMcTjR4MGZn5KV0IRkcFl4CJx5iHVhjFE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= +github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/renameio v0.1.0 h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA= github.com/google/rpmpack v0.0.0-20210410105602-e20c988a6f5a h1:XC048Fc/OB2rUl/BxruopEl2u/EP6cJNFveVxI1cvdk= @@ -342,6 +350,7 @@ github.com/gookit/color v1.5.0 h1:1Opow3+BWDwqor78DcJkJCIwnkviFi+rrOANki9BUFw= github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75 h1:f0n1xnMSmBLzVfsMMvriDyA75NB/oBgILX2GcHXIQzY= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= +github.com/gostaticanalysis/testutil v0.4.0/go.mod h1:bLIoPefWXrRi/ssLFWX1dx7Repi5x3CuviD3dgAZaBU= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 h1:FlFbCRLd5Jr4iYXZufAvgWN6Ao0JrI5chLINnUXDDr0= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= @@ -381,6 +390,7 @@ github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 h1:uC1QfSlInpQ github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= @@ -456,11 +466,15 @@ github.com/shirou/gopsutil/v3 v3.22.4/go.mod h1:D01hZJ4pVHPpCTZ3m3T2+wDF2YAGfd+H github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e h1:MZM7FHLqUHYI0Y/mQAt3d2aYa0SiNms/hFqC9qJYolM= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041 h1:llrF3Fs4018ePo4+G/HV/uQUqEI1HMDjCeOf2V6puPc= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= +github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9 h1:hp2CYQUINdZMHdvTdXtPOY2ainKl4IoMcpAXEf2xj3Q= +github.com/smartystreets/goconvey v1.7.2/go.mod h1:Vw0tHAZW6lzCRk3xgdin6fKYcG+G3Pg9vgXWeJpQFMM= github.com/smartystreets/gunit v1.0.0 h1:RyPDUFcJbvtXlhJPk7v+wnxZRY2EUokhEYl2EJOPToI= github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= github.com/streadway/quantile v0.0.0-20150917103942-b0c588724d25 h1:7z3LSn867ex6VSaahyKadf4WtSsJIgne6A1WLOAGM8A= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/tj/go-buffer v1.1.0 h1:Lo2OsPHlIxXF24zApe15AbK3bJLAOvkkxEA6Ux4c47M= github.com/tj/go-elastic v0.0.0-20171221160941-36157cbbebc2 h1:eGaGNxrtoZf/mBURsnNQKDR7u50Klgcf2eFDQEnc8Bc= github.com/tj/go-kinesis v0.0.0-20171128231115-08b17f58cb1b h1:m74UWYy+HBs+jMFR9mdZU6shPewugMyH5+GV6LNgW8w= @@ -511,37 +525,36 @@ go.opentelemetry.io/otel v1.0.1/go.mod h1:OPEOD4jIT2SlZPMmwT6FqZz2C0ZNdQqiWcoK6M go.opentelemetry.io/otel/trace v1.0.1 h1:StTeIH6Q3G4r0Fiw34LTokUFESZgIDUr0qIJ7mKmAfw= go.opentelemetry.io/otel/trace v1.0.1/go.mod h1:5g4i4fKLaX2BQpSBsxw8YYcgKpMMSW3x7ZTuYBr3sUk= go.opentelemetry.io/proto/otlp v0.7.0 h1:rwOQPCuKAKmwGKq2aVNnYIibI6wnV7EvzgfTCzcdGg8= +go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4= +golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5 h1:FR+oGxGfbQu1d+jglI3rCkjAjUnhRSZcUxr+DqlDLNo= golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= golang.org/x/mobile v0.0.0-20200801112145-973feb4309de h1:OVJ6QQUBAesB8CZijKDSsXX7xYVtUhrkY0gwMfbi4p4= golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= +golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2 h1:IRJeR9r1pYWsHKTRe/IInb7lYvbBVIqOgsX/u0mbOWY= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457 h1:zf5N6UOrA487eEFacMePxjXAJctxKmyjKUsjA11Uzuk= golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457/go.mod h1:pRgIJT+bRLFKnoM1ldnzKoxTIn14Yxz928LQRYYgIN0= -golang.org/x/telemetry v0.0.0-20250807160809-1a19826ec488 h1:3doPGa+Gg4snce233aCWnbZVFsyFMo/dR40KK/6skyE= -golang.org/x/telemetry v0.0.0-20250807160809-1a19826ec488/go.mod h1:fGb/2+tgXXjhjHsTNdVEEMZNWA0quBnfrO+AfoDSAKw= golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= -golang.org/x/term v0.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4= -golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= +golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= +golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 h1:M1YKkFIboKNieVO5DLUEVzQfGwJD30Nv2jfUgzb5UcE= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/cheggaaa/pb.v1 v1.0.28 h1:n1tBJnnK2r7g9OW2btFH91V92STTUevLXYFb8gy9EMk= From b1247c3299830d21f551d821b82f38e2c72b48eb Mon Sep 17 00:00:00 2001 From: Steven L Date: Wed, 27 Aug 2025 18:17:05 -0500 Subject: [PATCH 3/9] improved tags-handling, printing, tests --- common/metrics/structured/base.go | 94 ++++---- common/metrics/structured/doc.go | 2 - common/metrics/structured/histograms.go | 89 +++++++- common/metrics/structured/histograms_test.go | 221 ++++++++++++------- 4 files changed, 268 insertions(+), 138 deletions(-) delete mode 100644 common/metrics/structured/doc.go diff --git a/common/metrics/structured/base.go b/common/metrics/structured/base.go index edef3714df9..db3a3995f51 100644 --- a/common/metrics/structured/base.go +++ b/common/metrics/structured/base.go @@ -2,7 +2,6 @@ package structured import ( "maps" - "strconv" "strings" "testing" "time" @@ -17,26 +16,31 @@ var Module = fx.Options( }), ) -// Tags is simply a map of metric tags, to help differentiate from other maps. -type Tags map[string]string +// Tags is an immutable map of strings, to prevent accidentally mutating shared vars. +type Tags struct{ m map[string]string } +func TagsFromMap(m map[string]string) Tags { + return Tags{m} +} + +// With makes a copy with the added key/value pair(s), overriding any conflicting keys. func (o Tags) With(key, value string, more ...string) Tags { if len(more)%2 != 0 { // pretty easy to catch at dev time, seems reasonably unlikely to ever happen in prod. panic("Tags.With requires an even number of 'more' arguments") } - dup := make(Tags, len(o)+1+len(more)/2) - maps.Copy(dup, o) - dup[key] = value + dup := Tags{make(map[string]string, len(o.m)+1+len(more)/2)} + maps.Copy(dup.m, o.m) + dup.m[key] = value for i := 0; i < len(more)-1; i += 2 { - dup[more[i]] = more[i+1] + dup.m[more[i]] = more[i+1] } return dup } -// Emitter is the base helper for emitting metrics, and it contains only low-level -// metrics-emitting funcs to keep it as simple as possible. +// Emitter is essentially our new metrics.Client, but with a much smaller API surface +// to make it easier to reason about, lint, and fully disconnect from Tally details later. // // Calls to metrics methods on this type are checked by internal/tools/metricslint // to ensure that all metrics are uniquely named, to reduce our risk of collisions @@ -45,11 +49,7 @@ func (o Tags) With(key, value string, more ...string) Tags { // Tags must be passed in each time to help make it clear what tags are used, // and you MUST NOT vary the tags per metric name - this breaks Prometheus. type Emitter struct { - // intentionally NOT no-op by default. - // - // use a test emitter in tests, it should be quite easy to construct, - // and this way it will panic if forgotten for some reason, rather than - // causing a misleading lack-of-metrics. + // intentionally NOT no-op by default. use a test emitter in tests. // // currently, because this is constructed by common/config/metrics.go, // this scope already contains the `cadence_service:cadence-{whatever}` tag, @@ -62,60 +62,48 @@ type Emitter struct { // // Metric names MUST have an "_ns" suffix to avoid confusion with timers, // and to make it clear they are duration-based histograms. -func (b Emitter) Histogram(name string, buckets SubsettableHistogram, dur time.Duration, meta Tags) { - tags := make(Tags, len(meta)+3) - maps.Copy(tags, meta) - writeHistogramRangeTags(buckets.tallyBuckets, buckets.scale, tags) +func (b Emitter) Histogram(name string, buckets SubsettableHistogram, dur time.Duration, tags Tags) { + histogramTags := make(map[string]string, len(tags.m)+3) + maps.Copy(histogramTags, tags.m) + buckets.writeTags(name, histogramTags, b) if !strings.HasSuffix(name, "_ns") { // duration-based histograms are always in nanoseconds, // and the name MUST be different from timers while we migrate, // so this ensures we always have a unique _ns suffix. // - // hopefully this is never used, but it'll at least make it clear if it is. - name = name + "_error_missing_suffix_ns" + // this suffix is also checked in the linter, to change the allowed + // suffix(es) just make sure you update both. + b.scope.Tagged(map[string]string{"bad_metric_name": name}).Counter("incorrect_histogram_metric_name").Inc(1) + name = name + "_ns" } - b.scope.Tagged(tags).Histogram(name, buckets.tallyBuckets).RecordDuration(dur) + b.scope.Tagged(histogramTags).Histogram(name, buckets.tallyBuckets).RecordDuration(dur) } // IntHistogram records a count-based histogram with the provided data. // It adds a "histogram_scale" tag, so histograms can be accurately subset in queries or via middleware. -func (b Emitter) IntHistogram(name string, buckets IntSubsettableHistogram, num int, meta Tags) { - tags := make(Tags, len(meta)+3) - maps.Copy(tags, meta) - writeHistogramRangeTags(buckets.tallyBuckets, buckets.scale, tags) +func (b Emitter) IntHistogram(name string, buckets IntSubsettableHistogram, num int, tags Tags) { + histogramTags := make(map[string]string, len(tags.m)+3) + maps.Copy(histogramTags, tags.m) + buckets.writeTags(name, histogramTags, b) if !strings.HasSuffix(name, "_counts") { - // int-based histograms are always in "_counts" (currently anyway), - // and the name MUST be different from timers while we migrate. - // so this ensures we always have a unique _counts suffix. - // - // hopefully this is never used, but it'll at least make it clear if it is. - name = name + "_error_missing_suffix_counts" + // same as duration suffix. + // this suffix is also checked in the linter, to change the allowed + // suffix(es) just make sure you update both. + b.scope.Tagged(map[string]string{"bad_metric_name": name}).Counter("incorrect_int_histogram_metric_name").Inc(1) + name = name + "_counts" } - b.scope.Tagged(tags).Histogram(name, buckets.tallyBuckets).RecordDuration(time.Duration(num)) + b.scope.Tagged(histogramTags).Histogram(name, buckets.tallyBuckets).RecordDuration(time.Duration(num)) } -func writeHistogramRangeTags(buckets []time.Duration, scale int, into Tags) { - // all subsettable histograms need to emit scale values so scale changes - // can be correctly merged at query time. - if _, ok := into["histogram_start"]; ok { - into["error_rename_this_tag_histogram_start"] = into["histogram_start"] - } - if _, ok := into["histogram_end"]; ok { - into["error_rename_this_tag_histogram_end"] = into["histogram_end"] - } - if _, ok := into["histogram_scale"]; ok { - into["error_rename_this_tag_histogram_scale"] = into["histogram_scale"] +func (b Emitter) assertNoTag(key string, errorName string, in map[string]string) { + if _, ok := in[key]; ok { + b.scope.Tagged(map[string]string{"bad_key": key}).Counter(errorName).Inc(1) } - // record the full range and scale of the histogram so it can be recreated from any individual metric. - into["histogram_start"] = strconv.Itoa(int(buckets[1])) // first non-zero bucket - into["histogram_end"] = strconv.Itoa(int(buckets[len(buckets)-1])) // note this will change if scale changes - // include the scale, so we know how far away from the requested scale it is, when re-subsetting. - into["histogram_scale"] = strconv.Itoa(scale) } -// TODO: make a MinMaxHistogram helper which maintains a precise, rolling +// TODO: make a MinMaxGauge helper which maintains a precise, rolling // min/max gauge, over a window larger than the metrics granularity (e.g. ~20s) // to work around gauges' last-data-only behavior. // @@ -126,13 +114,13 @@ func writeHistogramRangeTags(buckets []time.Duration, scale int, into Tags) { // Maybe OTEL / Prometheus will natively support this one day. It'd be simple. // Count records a counter with the provided data. -func (b Emitter) Count(name string, num int, meta Tags) { - b.scope.Tagged(meta).Counter(name).Inc(int64(num)) +func (b Emitter) Count(name string, num int, tags Tags) { + b.scope.Tagged(tags.m).Counter(name).Inc(int64(num)) } // Gauge emits a gauge with the provided data. -func (b Emitter) Gauge(name string, val float64, meta Tags) { - b.scope.Tagged(meta).Gauge(name).Update(val) +func (b Emitter) Gauge(name string, val float64, tags Tags) { + b.scope.Tagged(tags.m).Gauge(name).Update(val) } // NewTestEmitter creates an emitter for tests, optionally using the provided scope. diff --git a/common/metrics/structured/doc.go b/common/metrics/structured/doc.go deleted file mode 100644 index fc57fc0bb99..00000000000 --- a/common/metrics/structured/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// TODO: document the simplified structure, and explain the motivation behind the new histograms -package structured diff --git a/common/metrics/structured/histograms.go b/common/metrics/structured/histograms.go index cc020362187..a059869e306 100644 --- a/common/metrics/structured/histograms.go +++ b/common/metrics/structured/histograms.go @@ -4,6 +4,7 @@ import ( "fmt" "math" "slices" + "strconv" "time" "github.com/uber-go/tally" @@ -72,7 +73,7 @@ type SubsettableHistogram struct { } // IntSubsettableHistogram is a non-duration-based integer-distribution histogram, otherwise identical -// to SubsettableHistogram. +// to SubsettableHistogram but built as a separate type so you cannot pass the wrong one. // // These histograms MUST always have a "_counts" suffix in their name to avoid confusion with timers, // or modify the Emitter to allow different suffixes if something else reads better. @@ -185,3 +186,89 @@ func nextBucket(start time.Duration, num int, scale int) time.Duration { float64(start) * math.Pow(2, float64(num)/math.Pow(2, float64(scale)))) } + +func (s SubsettableHistogram) histScale() int { return s.scale } +func (s SubsettableHistogram) width() int { return int(math.Pow(2, float64(s.scale))) } +func (s SubsettableHistogram) len() int { return len(s.tallyBuckets) } +func (s SubsettableHistogram) start() time.Duration { return s.tallyBuckets[1] } +func (s SubsettableHistogram) end() time.Duration { return s.tallyBuckets[len(s.tallyBuckets)-1] } +func (s SubsettableHistogram) buckets() tally.DurationBuckets { return s.tallyBuckets } +func (s SubsettableHistogram) writeTags(metricName string, into map[string]string, tagCollisionComplaints Emitter) { + writeHistogramTags(s, into, func(key string) { + tagCollisionComplaints.Count( + "error_histogram_tag_collision", + 1, + TagsFromMap(into).With( // carry along existing tags in case it narrows down the cause + "bad_key", key, + "metric_name", metricName, + )) + }) +} +func (s SubsettableHistogram) print(to func(string, ...any)) { + to("%v\n", s.tallyBuckets[0:1]) // zero value on its own row + for rowStart := 1; rowStart < s.len(); rowStart += s.width() { + to("%v\n", s.tallyBuckets[rowStart:rowStart+s.width()]) + } +} + +func (i IntSubsettableHistogram) histScale() int { return i.scale } +func (i IntSubsettableHistogram) width() int { return int(math.Pow(2, float64(i.scale))) } +func (i IntSubsettableHistogram) len() int { return len(i.tallyBuckets) } +func (i IntSubsettableHistogram) start() time.Duration { return i.tallyBuckets[1] } +func (i IntSubsettableHistogram) end() time.Duration { + return i.tallyBuckets[len(i.tallyBuckets)-1] +} +func (i IntSubsettableHistogram) buckets() tally.DurationBuckets { return i.tallyBuckets } +func (i IntSubsettableHistogram) writeTags(metricName string, into map[string]string, tagCollisionComplaints Emitter) { + writeHistogramTags(i, into, func(key string) { + tagCollisionComplaints.Count( + "error_int_histogram_tag_collision", + 1, + TagsFromMap(into).With( // carry along existing tags in case it narrows down the cause + "bad_key", key, + "metric_name", metricName, + )) + }) +} +func (i IntSubsettableHistogram) print(to func(string, ...any)) { + // fairly unreadable as duration-strings, so convert to int by hand + to("[%d]\n", int(i.tallyBuckets[0])) // zero value on its own row + for rowStart := 1; rowStart < i.len(); rowStart += i.width() { + ints := make([]int, 0, i.width()) + for _, d := range i.tallyBuckets[rowStart : rowStart+i.width()] { + ints = append(ints, int(d)) + } + to("%v\n", ints) + } +} + +func writeHistogramTags[T any](h histogrammy[T], into map[string]string, tagCollision func(key string)) { + if _, ok := into["histogram_start"]; ok { + tagCollision("histogram_start") + } + if _, ok := into["histogram_end"]; ok { + tagCollision("histogram_end") + } + if _, ok := into["histogram_scale"]; ok { + tagCollision("histogram_scale") + } + // record the full range and scale of the histogram so it can be recreated from any individual metric. + into["histogram_start"] = strconv.Itoa(int(h.start())) + into["histogram_end"] = strconv.Itoa(int(h.end())) + // include the scale, so we know how far away from the requested scale it is, when re-subsetting. + into["histogram_scale"] = strconv.Itoa(h.histScale()) +} + +// internal utility/test methods, but could be exposed if there's a use for it +type histogrammy[T any] interface { + histScale() int // exponential scale value. 0..3 inclusive. + width() int // number of values per power of 2 == how wide to print each row. 1, 2, 4, or 8. + len() int // number of buckets + start() time.Duration // first non-zero bucket + end() time.Duration // last bucket + buckets() tally.DurationBuckets // access to all buckets + subsetTo(newScale int) T // generic so specific types can be returned + writeTags(metricName string, into map[string]string, tagCollisionComplaints Emitter) + + print(to func(string, ...any)) // test-oriented printer +} diff --git a/common/metrics/structured/histograms_test.go b/common/metrics/structured/histograms_test.go index bdb271e7b48..485d803d719 100644 --- a/common/metrics/structured/histograms_test.go +++ b/common/metrics/structured/histograms_test.go @@ -2,38 +2,108 @@ package structured import ( "fmt" - "math" + "strings" "testing" - "time" "github.com/stretchr/testify/assert" - "github.com/uber-go/tally" ) func TestHistogramValues(t *testing.T) { t.Run("default_1ms_to_10m", func(t *testing.T) { - checkHistogram(t, Default1ms10m) - assert.Equal(t, 81, Default1ms10m.len(), "wrong number of buckets") - assertBetween(t, 10*time.Minute, Default1ms10m.max(), 15*time.Minute) // roughly 14m 42s + checkHistogram(t, Default1ms10m, + ` +[0s] +[1ms 1.189207ms 1.414213ms 1.681792ms] +[2ms 2.378414ms 2.828427ms 3.363585ms] +[4ms 4.756828ms 5.656854ms 6.727171ms] +[8ms 9.513656ms 11.313708ms 13.454342ms] +[16ms 19.027313ms 22.627416ms 26.908685ms] +[32ms 38.054627ms 45.254833ms 53.81737ms] +[64ms 76.109255ms 90.509667ms 107.634741ms] +[128ms 152.21851ms 181.019335ms 215.269482ms] +[256ms 304.437021ms 362.038671ms 430.538964ms] +[512ms 608.874042ms 724.077343ms 861.077929ms] +[1.024s 1.217748085s 1.448154687s 1.722155858s] +[2.048s 2.435496171s 2.896309375s 3.444311716s] +[4.096s 4.870992343s 5.792618751s 6.888623433s] +[8.192s 9.741984686s 11.585237502s 13.777246867s] +[16.384s 19.483969372s 23.170475005s 27.554493735s] +[32.768s 38.967938744s 46.340950011s 55.10898747s] +[1m5.536s 1m17.935877488s 1m32.681900023s 1m50.21797494s] +[2m11.072s 2m35.871754977s 3m5.363800047s 3m40.43594988s] +[4m22.144s 5m11.743509955s 6m10.727600094s 7m20.87189976s] +[8m44.288s 10m23.48701991s 12m21.455200189s 14m41.743799521s] +`) }) t.Run("high_1ms_to_24h", func(t *testing.T) { - checkHistogram(t, High1ms24h) - assert.Equal(t, 113, High1ms24h.len(), "wrong number of buckets") - assertBetween(t, 24*time.Hour, High1ms24h.max(), 64*time.Hour) // roughly 63h + checkHistogram(t, High1ms24h, + ` +[0s] +[1ms 1.189207ms 1.414213ms 1.681792ms] +[2ms 2.378414ms 2.828427ms 3.363585ms] +[4ms 4.756828ms 5.656854ms 6.727171ms] +[8ms 9.513656ms 11.313708ms 13.454342ms] +[16ms 19.027313ms 22.627416ms 26.908685ms] +[32ms 38.054627ms 45.254833ms 53.81737ms] +[64ms 76.109255ms 90.509667ms 107.634741ms] +[128ms 152.21851ms 181.019335ms 215.269482ms] +[256ms 304.437021ms 362.038671ms 430.538964ms] +[512ms 608.874042ms 724.077343ms 861.077929ms] +[1.024s 1.217748085s 1.448154687s 1.722155858s] +[2.048s 2.435496171s 2.896309375s 3.444311716s] +[4.096s 4.870992343s 5.792618751s 6.888623433s] +[8.192s 9.741984686s 11.585237502s 13.777246867s] +[16.384s 19.483969372s 23.170475005s 27.554493735s] +[32.768s 38.967938744s 46.340950011s 55.10898747s] +[1m5.536s 1m17.935877488s 1m32.681900023s 1m50.21797494s] +[2m11.072s 2m35.871754977s 3m5.363800047s 3m40.43594988s] +[4m22.144s 5m11.743509955s 6m10.727600094s 7m20.87189976s] +[8m44.288s 10m23.48701991s 12m21.455200189s 14m41.743799521s] +[17m28.576s 20m46.974039821s 24m42.910400378s 29m23.487599042s] +[34m57.152s 41m33.948079642s 49m25.820800757s 58m46.975198084s] +[1h9m54.304s 1h23m7.896159284s 1h38m51.641601515s 1h57m33.950396168s] +[2h19m48.608s 2h46m15.792318568s 3h17m43.283203031s 3h55m7.900792337s] +[4h39m37.216s 5h32m31.584637137s 6h35m26.566406062s 7h50m15.801584674s] +[9h19m14.432s 11h5m3.169274274s 13h10m53.132812125s 15h40m31.603169349s] +[18h38m28.864s 22h10m6.338548549s 26h21m46.265624251s 31h21m3.206338698s] +[37h16m57.728s 44h20m12.677097099s 52h43m32.531248503s 62h42m6.412677396s] +`) }) t.Run("mid_1ms_24h", func(t *testing.T) { - checkHistogram(t, Mid1ms24h) - assert.Equal(t, 57, Mid1ms24h.len(), "wrong number of buckets") - assertBetween(t, 12*time.Hour, Mid1ms24h.max(), 64*time.Hour) // roughly 53h + checkHistogram(t, Mid1ms24h, ` +[0s] +[1ms 1.414213ms] +[2ms 2.828427ms] +[4ms 5.656854ms] +[8ms 11.313708ms] +[16ms 22.627416ms] +[32ms 45.254833ms] +[64ms 90.509667ms] +[128ms 181.019335ms] +[256ms 362.038671ms] +[512ms 724.077343ms] +[1.024s 1.448154687s] +[2.048s 2.896309375s] +[4.096s 5.792618751s] +[8.192s 11.585237502s] +[16.384s 23.170475005s] +[32.768s 46.340950011s] +[1m5.536s 1m32.681900023s] +[2m11.072s 3m5.363800047s] +[4m22.144s 6m10.727600094s] +[8m44.288s 12m21.455200189s] +[17m28.576s 24m42.910400378s] +[34m57.152s 49m25.820800757s] +[1h9m54.304s 1h38m51.641601515s] +[2h19m48.608s 3h17m43.283203031s] +[4h39m37.216s 6h35m26.566406062s] +[9h19m14.432s 13h10m53.132812125s] +[18h38m28.864s 26h21m46.265624251s] +[37h16m57.728s 52h43m32.531248503s] +`) }) t.Run("mid_to_32k_ints", func(t *testing.T) { - // note: this histogram has some duplicates: - // [0] - // [1 1 1 1] - // [2 2 2 3] - // [4 4 5 6] - // [8 9 11 13] - // ... + // note: this histogram has some duplicates. // // this wastes a bit of memory, but Tally will choose the same index each // time for a specific value, so it does not cause extra non-zero series @@ -42,52 +112,61 @@ func TestHistogramValues(t *testing.T) { // if this turns out to be expensive in Prometheus / etc, it's easy // enough to start the histogram at 8, and dual-emit a non-exponential // histogram for lower values. - checkHistogram(t, Mid1To32k) - assert.Equal(t, 65, Mid1To32k.len(), "wrong number of buckets") - assertBetween(t, 32_000, int(Mid1To32k.max()), 64_000) // 55108 + checkHistogram(t, Mid1To32k, ` +[0] +[1 1 1 1] +[2 2 2 3] +[4 4 5 6] +[8 9 11 13] +[16 19 22 26] +[32 38 45 53] +[64 76 90 107] +[128 152 181 215] +[256 304 362 430] +[512 608 724 861] +[1024 1217 1448 1722] +[2048 2435 2896 3444] +[4096 4870 5792 6888] +[8192 9741 11585 13777] +[16384 19483 23170 27554] +[32768 38967 46340 55108] +`) }) t.Run("low_cardinality_1ms_10s", func(t *testing.T) { - checkHistogram(t, Low1ms10s) - assert.Equal(t, 33, Low1ms10s.len(), "wrong number of buckets") - assertBetween(t, 10*time.Second, Low1ms10s.max(), time.Minute) // roughly 46s + checkHistogram(t, Low1ms10s, ` +[0s] +[1ms 1.414213ms] +[2ms 2.828427ms] +[4ms 5.656854ms] +[8ms 11.313708ms] +[16ms 22.627416ms] +[32ms 45.254833ms] +[64ms 90.509667ms] +[128ms 181.019335ms] +[256ms 362.038671ms] +[512ms 724.077343ms] +[1.024s 1.448154687s] +[2.048s 2.896309375s] +[4.096s 5.792618751s] +[8.192s 11.585237502s] +[16.384s 23.170475005s] +[32.768s 46.340950011s] +`) }) } -// test helpers, but could be moved elsewhere if they prove useful -func (s SubsettableHistogram) width() int { return int(math.Pow(2, float64(s.scale))) } -func (s SubsettableHistogram) len() int { return len(s.tallyBuckets) } -func (s SubsettableHistogram) max() time.Duration { return s.tallyBuckets[len(s.tallyBuckets)-1] } -func (s SubsettableHistogram) buckets() tally.DurationBuckets { return s.tallyBuckets } - -func (i IntSubsettableHistogram) width() int { return int(math.Pow(2, float64(i.scale))) } -func (i IntSubsettableHistogram) len() int { return len(i.tallyBuckets) } -func (i IntSubsettableHistogram) max() time.Duration { - return i.tallyBuckets[len(i.tallyBuckets)-1] -} -func (i IntSubsettableHistogram) buckets() tally.DurationBuckets { return i.tallyBuckets } - -type histogrammy interface { - SubsettableHistogram | IntSubsettableHistogram - - width() int - len() int - max() time.Duration - buckets() tally.DurationBuckets -} - -type numeric interface { - ~int | ~int64 -} - -func assertBetween[T numeric](t *testing.T, min, actual, max T, msgAndArgs ...interface{}) { - if actual < min || actual > max { - assert.Fail(t, fmt.Sprintf("value %v not between %v and %v", actual, min, max), msgAndArgs...) +// most histograms should pass this check, but fuzzy comparison is fine if needed for extreme cases. +func checkHistogram[T any](t *testing.T, h histogrammy[T], expected string) { + var buf strings.Builder + h.print(func(s string, a ...any) { + str := fmt.Sprintf(s, a...) + t.Logf(str) + buf.WriteString(str) + }) + if strings.TrimSpace(expected) != strings.TrimSpace(buf.String()) { + t.Error("histogram definition changed, update the test if this is intended") } -} -// most histograms should pass this check, but fuzzy comparison is fine if needed for extreme cases. -func checkHistogram[T histogrammy](t *testing.T, h T) { - printHistogram(t, h) buckets := h.buckets() assert.EqualValues(t, 0, buckets[0], "first bucket should always be zero") for i := 1; i < len(buckets); i += h.width() { @@ -100,33 +179,11 @@ func checkHistogram[T histogrammy](t *testing.T, h T) { // note that the equivalent tally buckets, e.g.: // tally.MustMakeExponentialDurationBuckets(time.Millisecond, math.Pow(2, 1.0/4.0)) // fails this test, and the logs produced show ugly e.g. 31.999942ms values. - // it also produces incorrect results if you start at e.g. 1, as it never exceeds 1. + // tally also produces incorrect results if you start at e.g. 1, + // as it just produces endless `1` values. assert.Equalf(t, buckets[i-h.width()]*2, buckets[i], "current row's value (%v) is not a power of 2 greater than previous (%v), skewed / bad math?", buckets[i-h.width()], buckets[i]) } } } - -func printHistogram[T histogrammy](t *testing.T, histogram T) { - switch h := (any)(histogram).(type) { - case SubsettableHistogram: - t.Log(h.buckets()[:1]) - for i := 1; i < len(h.buckets()); i += h.width() { - t.Log(h.buckets()[i : i+h.width()]) // display row by row for easier reading. - // ^ this will panic if the histograms are not an even multiple of `width`, - // that's also a sign that it's constructed incorrectly. - } - case IntSubsettableHistogram: - hi := make([]int, len(h.buckets())) // convert to int - for i, v := range h.buckets() { - hi[i] = int(v) - } - t.Log(hi[:1]) - for i := 1; i < len(hi); i += h.width() { - t.Log(hi[i : i+h.width()]) - } - default: - panic("unreachable") - } -} From 7e2d9d70bd041b7c973381e0f0e895bfdb3e32af Mon Sep 17 00:00:00 2001 From: Steven L Date: Wed, 27 Aug 2025 18:26:58 -0500 Subject: [PATCH 4/9] fix --- common/metrics/structured/base.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/common/metrics/structured/base.go b/common/metrics/structured/base.go index db3a3995f51..11cb05d535f 100644 --- a/common/metrics/structured/base.go +++ b/common/metrics/structured/base.go @@ -97,12 +97,6 @@ func (b Emitter) IntHistogram(name string, buckets IntSubsettableHistogram, num b.scope.Tagged(histogramTags).Histogram(name, buckets.tallyBuckets).RecordDuration(time.Duration(num)) } -func (b Emitter) assertNoTag(key string, errorName string, in map[string]string) { - if _, ok := in[key]; ok { - b.scope.Tagged(map[string]string{"bad_key": key}).Counter(errorName).Inc(1) - } -} - // TODO: make a MinMaxGauge helper which maintains a precise, rolling // min/max gauge, over a window larger than the metrics granularity (e.g. ~20s) // to work around gauges' last-data-only behavior. From d750a3f30c69f485379ed32d812fad6209233c3f Mon Sep 17 00:00:00 2001 From: Steven L Date: Wed, 27 Aug 2025 18:28:07 -0500 Subject: [PATCH 5/9] fix --- service/history/replication/task_processor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/history/replication/task_processor.go b/service/history/replication/task_processor.go index abadab298d0..702aa5a74ec 100644 --- a/service/history/replication/task_processor.go +++ b/service/history/replication/task_processor.go @@ -147,7 +147,7 @@ func NewTaskProcessor( config: config, metricsClient: metricsClient, metrics: emitter, - metricTags: structured.Tags{"target_cluster": sourceCluster}, // looks backwards, but matches historical behavior + metricTags: structured.TagsFromMap(map[string]string{"target_cluster": sourceCluster}), // looks backwards, but matches historical behavior logger: shard.GetLogger().WithTags(tag.SourceCluster(sourceCluster), tag.ShardID(shardID)), taskExecutor: taskExecutor, hostRateLimiter: taskFetcher.GetRateLimiter(), From 16b66404f0145c7dcf3290a8007596fe414bc06e Mon Sep 17 00:00:00 2001 From: Steven L Date: Wed, 27 Aug 2025 18:40:14 -0500 Subject: [PATCH 6/9] fix --- service/history/replication/task_processor.go | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/service/history/replication/task_processor.go b/service/history/replication/task_processor.go index 702aa5a74ec..ff8ca9209c0 100644 --- a/service/history/replication/task_processor.go +++ b/service/history/replication/task_processor.go @@ -138,16 +138,18 @@ func NewTaskProcessor( noTaskBackoffPolicy.SetExpirationInterval(backoff.NoInterval) noTaskRetrier := backoff.NewRetrier(noTaskBackoffPolicy, clock) return &taskProcessorImpl{ - currentCluster: shard.GetClusterMetadata().GetCurrentClusterName(), - sourceCluster: sourceCluster, - status: common.DaemonStatusInitialized, - shard: shard, - historyEngine: historyEngine, - historySerializer: persistence.NewPayloadSerializer(), - config: config, - metricsClient: metricsClient, - metrics: emitter, - metricTags: structured.TagsFromMap(map[string]string{"target_cluster": sourceCluster}), // looks backwards, but matches historical behavior + currentCluster: shard.GetClusterMetadata().GetCurrentClusterName(), + sourceCluster: sourceCluster, + status: common.DaemonStatusInitialized, + shard: shard, + historyEngine: historyEngine, + historySerializer: persistence.NewPayloadSerializer(), + config: config, + metricsClient: metricsClient, + metrics: emitter, + metricTags: structured.TagsFromMap(map[string]string{ + "target_cluster": sourceCluster, // looks backwards, but matches historical behavior + }), logger: shard.GetLogger().WithTags(tag.SourceCluster(sourceCluster), tag.ShardID(shardID)), taskExecutor: taskExecutor, hostRateLimiter: taskFetcher.GetRateLimiter(), From 004ff07164f04af04a5e0f7f3bc93ca769643cad Mon Sep 17 00:00:00 2001 From: Steven L Date: Wed, 27 Aug 2025 19:31:19 -0500 Subject: [PATCH 7/9] fix --- service/history/replication/task_processor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/history/replication/task_processor.go b/service/history/replication/task_processor.go index ff8ca9209c0..a25a85bbe59 100644 --- a/service/history/replication/task_processor.go +++ b/service/history/replication/task_processor.go @@ -501,7 +501,7 @@ func (p *taskProcessorImpl) processTaskOnce(replicationTask *types.ReplicationTa // number of replication tasks // this is an exact match for the legacy scope, so it would cause duplicates if emitted. // because this is the first use of this new system, we'll verify the tags with the histograms first. - // p.Count("replication_tasks_applied_per_domain", 1, tags) + // p.Emitter.Count("replication_tasks_applied_per_domain", 1, tags) // emit single task processing latency mScope.RecordTimer(metrics.TaskProcessingLatency, processingLatency) From fca356fbf95b7ba7e31d621f21254e449a2a303b Mon Sep 17 00:00:00 2001 From: Steven L Date: Wed, 27 Aug 2025 19:34:08 -0500 Subject: [PATCH 8/9] fix --- service/history/replication/task_processor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/history/replication/task_processor.go b/service/history/replication/task_processor.go index a25a85bbe59..e9cd3191fdc 100644 --- a/service/history/replication/task_processor.go +++ b/service/history/replication/task_processor.go @@ -501,7 +501,7 @@ func (p *taskProcessorImpl) processTaskOnce(replicationTask *types.ReplicationTa // number of replication tasks // this is an exact match for the legacy scope, so it would cause duplicates if emitted. // because this is the first use of this new system, we'll verify the tags with the histograms first. - // p.Emitter.Count("replication_tasks_applied_per_domain", 1, tags) + // p.metrics.Count("replication_tasks_applied_per_domain", 1, tags) // emit single task processing latency mScope.RecordTimer(metrics.TaskProcessingLatency, processingLatency) From 75d6f562624457c1afe983fb9f55ec8c20262ecd Mon Sep 17 00:00:00 2001 From: Steven L Date: Thu, 28 Aug 2025 14:26:05 -0500 Subject: [PATCH 9/9] add len to tests, it's too hard to estimate at a glance --- common/metrics/structured/histograms_test.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/common/metrics/structured/histograms_test.go b/common/metrics/structured/histograms_test.go index 485d803d719..ba2a18a9cfd 100644 --- a/common/metrics/structured/histograms_test.go +++ b/common/metrics/structured/histograms_test.go @@ -10,7 +10,7 @@ import ( func TestHistogramValues(t *testing.T) { t.Run("default_1ms_to_10m", func(t *testing.T) { - checkHistogram(t, Default1ms10m, + checkHistogram(t, Default1ms10m, 81, ` [0s] [1ms 1.189207ms 1.414213ms 1.681792ms] @@ -36,7 +36,7 @@ func TestHistogramValues(t *testing.T) { `) }) t.Run("high_1ms_to_24h", func(t *testing.T) { - checkHistogram(t, High1ms24h, + checkHistogram(t, High1ms24h, 113, ` [0s] [1ms 1.189207ms 1.414213ms 1.681792ms] @@ -70,7 +70,7 @@ func TestHistogramValues(t *testing.T) { `) }) t.Run("mid_1ms_24h", func(t *testing.T) { - checkHistogram(t, Mid1ms24h, ` + checkHistogram(t, Mid1ms24h, 57, ` [0s] [1ms 1.414213ms] [2ms 2.828427ms] @@ -112,7 +112,7 @@ func TestHistogramValues(t *testing.T) { // if this turns out to be expensive in Prometheus / etc, it's easy // enough to start the histogram at 8, and dual-emit a non-exponential // histogram for lower values. - checkHistogram(t, Mid1To32k, ` + checkHistogram(t, Mid1To32k, 65, ` [0] [1 1 1 1] [2 2 2 3] @@ -133,7 +133,7 @@ func TestHistogramValues(t *testing.T) { `) }) t.Run("low_cardinality_1ms_10s", func(t *testing.T) { - checkHistogram(t, Low1ms10s, ` + checkHistogram(t, Low1ms10s, 33, ` [0s] [1ms 1.414213ms] [2ms 2.828427ms] @@ -156,7 +156,7 @@ func TestHistogramValues(t *testing.T) { } // most histograms should pass this check, but fuzzy comparison is fine if needed for extreme cases. -func checkHistogram[T any](t *testing.T, h histogrammy[T], expected string) { +func checkHistogram[T any](t *testing.T, h histogrammy[T], length int, expected string) { var buf strings.Builder h.print(func(s string, a ...any) { str := fmt.Sprintf(s, a...) @@ -167,6 +167,8 @@ func checkHistogram[T any](t *testing.T, h histogrammy[T], expected string) { t.Error("histogram definition changed, update the test if this is intended") } + assert.Equal(t, length, h.len(), "wrong number of buckets") + buckets := h.buckets() assert.EqualValues(t, 0, buckets[0], "first bucket should always be zero") for i := 1; i < len(buckets); i += h.width() {