From 0a9d4ef47b8467bc69195c39d7745736d976b9c4 Mon Sep 17 00:00:00 2001 From: Srdjan Petrovic Date: Mon, 24 Jul 2023 15:34:22 -0700 Subject: [PATCH] Update weaver-gke to the base weaver version 0.18.0. Changes required for the upgrade: * Use the new versioning libraries. * Local copy of the version command, since the corresponding command in weaver has been moved to its internal/. * Change the protocol to use `protos.TraceSpans`. * Trace dashboard changes. --- cmd/weaver-gke-local/dashboard.go | 124 ++++++++++++++++++--- cmd/weaver-gke-local/main.go | 2 +- cmd/weaver-gke-local/templates/traces.html | 122 ++++++++++++++++++++ cmd/weaver-gke-local/version.go | 36 ++++++ cmd/weaver-gke/main.go | 2 +- cmd/weaver-gke/version.go | 36 ++++++ go.mod | 50 +++++---- go.sum | 106 +++++++++--------- internal/babysitter/babysitter.go | 7 +- internal/gke/babysitter.go | 13 ++- internal/local/babysitter.go | 8 +- internal/local/data.go | 2 +- internal/tool/deploy.go | 37 ++++-- internal/tool/testprogram/weaver_gen.go | 32 +++++- internal/version/version.go | 22 ++++ 15 files changed, 483 insertions(+), 116 deletions(-) create mode 100644 cmd/weaver-gke-local/templates/traces.html create mode 100644 cmd/weaver-gke-local/version.go create mode 100644 cmd/weaver-gke/version.go create mode 100644 internal/version/version.go diff --git a/cmd/weaver-gke-local/dashboard.go b/cmd/weaver-gke-local/dashboard.go index abcd09b..2d3300f 100644 --- a/cmd/weaver-gke-local/dashboard.go +++ b/cmd/weaver-gke-local/dashboard.go @@ -16,17 +16,30 @@ package main import ( "context" + _ "embed" "flag" "fmt" + "html/template" "net/http" "net/url" - "os" + "time" "github.com/ServiceWeaver/weaver-gke/internal/local" "github.com/ServiceWeaver/weaver-gke/internal/local/metricdb" "github.com/ServiceWeaver/weaver-gke/internal/tool" "github.com/ServiceWeaver/weaver/runtime/logging" "github.com/ServiceWeaver/weaver/runtime/perfetto" + "github.com/ServiceWeaver/weaver/runtime/traces" +) + +var ( + //go:embed templates/traces.html + tracesHTML string + tracesTemplate = template.Must(template.New("traces").Funcs(template.FuncMap{ + "sub": func(endTime, startTime time.Time) string { + return endTime.Sub(startTime).String() + }, + }).Parse(tracesHTML)) ) var dashboardSpec = tool.DashboardSpec{ @@ -43,26 +56,25 @@ var dashboardSpec = tool.DashboardSpec{ } mux.Handle("/metrics", local.NewPrometheusHandler(metricDB, logger)) - // Start a separate Perfetto server, which has to run on - // a specific port. - db, err := perfetto.Open(ctx, "gke-local") + // Add the trace handlers. + traceDB, err := traces.OpenDB(ctx, local.TracesFile) if err != nil { return err } - go func() { - defer db.Close() - if db.Serve(ctx); err != nil { - fmt.Fprintln(os.Stderr, "Error serving local traces", err) - } - }() + mux.HandleFunc("/traces", func(w http.ResponseWriter, r *http.Request) { + handleTraces(w, r, traceDB) + }) + mux.HandleFunc("/tracefetch", func(w http.ResponseWriter, r *http.Request) { + handleTraceFetch(w, r, traceDB) + }) + return nil }, AppLinks: func(ctx context.Context, app string) (tool.Links, error) { v := url.Values{} v.Set("app", app) - tracerURL := url.QueryEscape("http://127.0.0.1:9001?" + v.Encode()) return tool.Links{ - Traces: "https://ui.perfetto.dev/#!/?url=" + tracerURL, + Traces: "/traces?" + v.Encode(), Metrics: "/metrics?" + v.Encode(), }, nil }, @@ -71,9 +83,8 @@ var dashboardSpec = tool.DashboardSpec{ v := url.Values{} v.Set("app", app) v.Set("version", version) - tracerURL := url.QueryEscape("http://127.0.0.1:9001?" + v.Encode()) return tool.Links{ - Traces: "https://ui.perfetto.dev/#!/?url=" + tracerURL, + Traces: "/traces?" + v.Encode(), Metrics: "/metrics?" + v.Encode(), }, nil }, @@ -94,3 +105,88 @@ var dashboardSpec = tool.DashboardSpec{ } }, } + +// handleTraces handles requests to /traces?app=&version= +func handleTraces(w http.ResponseWriter, r *http.Request, db *traces.DB) { + app := r.URL.Query().Get("app") + version := r.URL.Query().Get("version") + if app == "" && version == "" { + http.Error(w, "neither application name or version id provided", http.StatusBadRequest) + } + parseDuration := func(arg string) (time.Duration, bool) { + str := r.URL.Query().Get(arg) + if str == "" { + return 0, true + } + dur, err := time.ParseDuration(str) + if err != nil { + http.Error(w, fmt.Sprintf("invalid duration %q", str), http.StatusBadRequest) + return 0, false + } + return dur, true + } + latencyLower, ok := parseDuration("lat_low") + if !ok { + return + } + latencyUpper, ok := parseDuration("lat_hi") + if !ok { + return + } + onlyErrors := r.URL.Query().Get("errs") != "" + + // Weavelets export traces every 5 seconds. In order to (semi-)guarantee + // that the database contains all spans for the selected traces, we only + // fetch traces that ended more than 5+ seconds ago (all spans for such + // traces should have been exported to the database by now). + const exportInterval = 5 * time.Second + const gracePeriod = time.Second + endTime := time.Now().Add(-1 * (exportInterval + gracePeriod)) + + const maxNumTraces = 100 + ts, err := db.QueryTraces(r.Context(), app, version, time.Time{} /*startTime*/, endTime, latencyLower, latencyUpper, onlyErrors, maxNumTraces) + if err != nil { + http.Error(w, fmt.Sprintf("cannot query trace database: %v", err), http.StatusInternalServerError) + return + } + + content := struct { + Tool string + App string + Version string + Traces []traces.TraceSummary + }{ + Tool: "gke-local", + App: app, + Version: version, + Traces: ts, + } + if err := tracesTemplate.Execute(w, content); err != nil { + http.Error(w, fmt.Sprintf("cannot display traces: %v", err), http.StatusInternalServerError) + return + } +} + +// handleTraceFetch handles requests to /tracefetch?trace_id=. +func handleTraceFetch(w http.ResponseWriter, r *http.Request, db *traces.DB) { + traceID := r.URL.Query().Get("trace_id") + if traceID == "" { + http.Error(w, fmt.Sprintf("invalid trace id %q", traceID), http.StatusBadRequest) + return + } + spans, err := db.FetchSpans(r.Context(), traceID) + if err != nil { + http.Error(w, fmt.Sprintf("cannot fetch spans: %v", err), http.StatusInternalServerError) + return + } + if len(spans) == 0 { + http.Error(w, "no matching spans", http.StatusNotFound) + return + } + data, err := perfetto.EncodeSpans(spans) + if err != nil { + http.Error(w, fmt.Sprintf("cannot encode spans: %v", err), http.StatusInternalServerError) + return + } + w.Write(data) //nolint:errcheck // response write error +} diff --git a/cmd/weaver-gke-local/main.go b/cmd/weaver-gke-local/main.go index 4123c08..5c7e05e 100644 --- a/cmd/weaver-gke-local/main.go +++ b/cmd/weaver-gke-local/main.go @@ -27,7 +27,7 @@ func main() { "kill": gketool.KillCmd(&killSpec), "profile": gketool.ProfileCmd(&profileSpec), "dashboard": gketool.DashboardCmd(&dashboardSpec), - "version": tool.VersionCmd("weaver gke-local"), + "version": &versionCmd, "purge": tool.PurgeCmd(&purgeSpec), // Hidden commands. diff --git a/cmd/weaver-gke-local/templates/traces.html b/cmd/weaver-gke-local/templates/traces.html new file mode 100644 index 0000000..9aee735 --- /dev/null +++ b/cmd/weaver-gke-local/templates/traces.html @@ -0,0 +1,122 @@ + + + + + + + + {{.Tool}} Dashboard + + + + + + + + + +
+
+
Traces
+
+ + + + + + + + + + + + +
0-1ms1-10ms10-100ms100ms-1s1-10sallerrors
+
+ + + + + + + + + + + {{range .Traces}} + + + + + + + {{end}} + +
Trace URLStart TimeLatencyStatus
link{{.StartTime}}{{sub .EndTime .StartTime}}{{.Status}}
+
+
+ + diff --git a/cmd/weaver-gke-local/version.go b/cmd/weaver-gke-local/version.go new file mode 100644 index 0000000..05e9fa0 --- /dev/null +++ b/cmd/weaver-gke-local/version.go @@ -0,0 +1,36 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package main + +import ( + "context" + "flag" + "fmt" + "runtime" + + "github.com/ServiceWeaver/weaver-gke/internal/version" + "github.com/ServiceWeaver/weaver/runtime/tool" +) + +var versionCmd = tool.Command{ + Name: "version", + Flags: flag.NewFlagSet("version", flag.ContinueOnError), + Description: "Show weaver gke-local version", + Help: "Usage:\n weaver gke-local version", + Fn: func(context.Context, []string) error { + fmt.Printf("weaver gke-local v%d.%d.%d %s/%s\n", version.Major, version.Minor, version.Patch, runtime.GOOS, runtime.GOARCH) + return nil + }, +} diff --git a/cmd/weaver-gke/main.go b/cmd/weaver-gke/main.go index da9791f..b8e16f6 100644 --- a/cmd/weaver-gke/main.go +++ b/cmd/weaver-gke/main.go @@ -28,7 +28,7 @@ func main() { "kill": gketool.KillCmd(&killSpec), "store": gketool.StoreCmd(&storeSpec), "profile": gketool.ProfileCmd(&profileSpec), - "version": tool.VersionCmd("weaver gke"), + "version": &versionCmd, "purge": &purgeCmd, // Hidden commands. diff --git a/cmd/weaver-gke/version.go b/cmd/weaver-gke/version.go new file mode 100644 index 0000000..5446b9c --- /dev/null +++ b/cmd/weaver-gke/version.go @@ -0,0 +1,36 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package main + +import ( + "context" + "flag" + "fmt" + "runtime" + + "github.com/ServiceWeaver/weaver-gke/internal/version" + "github.com/ServiceWeaver/weaver/runtime/tool" +) + +var versionCmd = tool.Command{ + Name: "version", + Flags: flag.NewFlagSet("version", flag.ContinueOnError), + Description: "Show weaver gke version", + Help: "Usage:\n weaver gke version", + Fn: func(context.Context, []string) error { + fmt.Printf("weaver gke v%d.%d.%d %s/%s\n", version.Major, version.Minor, version.Patch, runtime.GOOS, runtime.GOARCH) + return nil + }, +} diff --git a/go.mod b/go.mod index fcbd1cd..27e3265 100644 --- a/go.mod +++ b/go.mod @@ -12,32 +12,32 @@ require ( cloud.google.com/go/monitoring v1.12.0 cloud.google.com/go/security v1.10.0 github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v1.11.0 - github.com/ServiceWeaver/weaver v0.16.0 + github.com/ServiceWeaver/weaver v0.17.1-0.20230724182416-3cb82f53ee95 github.com/golang/protobuf v1.5.2 - github.com/google/cel-go v0.13.0 + github.com/google/cel-go v0.17.1 github.com/google/go-cmp v0.5.9 - github.com/google/pprof v0.0.0-20230131232505-5a9e8f65f08f + github.com/google/pprof v0.0.0-20230705174524-200ffdc848b8 github.com/google/uuid v1.3.0 github.com/googleapis/gax-go/v2 v2.7.0 github.com/mattn/go-sqlite3 v1.14.16 github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 github.com/prometheus/client_golang v1.14.0 - go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.12.0 - go.opentelemetry.io/otel/sdk v1.12.0 - go.opentelemetry.io/otel/trace v1.13.0 - golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea + go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.16.0 + go.opentelemetry.io/otel/sdk v1.16.0 + go.opentelemetry.io/otel/trace v1.16.0 + golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 golang.org/x/oauth2 v0.4.0 google.golang.org/api v0.109.0 google.golang.org/genproto v0.0.0-20230202175211-008b39050e57 google.golang.org/grpc v1.53.0 - google.golang.org/protobuf v1.28.1 + google.golang.org/protobuf v1.31.0 k8s.io/api v0.25.0 k8s.io/apiextensions-apiserver v0.25.0 k8s.io/apimachinery v0.25.0 k8s.io/autoscaler/vertical-pod-autoscaler v0.13.0 k8s.io/client-go v0.25.0 k8s.io/ingress-gce v1.20.2 - modernc.org/sqlite v1.21.0 + modernc.org/sqlite v1.24.0 sigs.k8s.io/gateway-api v0.5.1 ) @@ -45,17 +45,18 @@ require ( cloud.google.com/go v0.107.0 // indirect cloud.google.com/go/longrunning v0.3.0 // indirect cloud.google.com/go/trace v1.8.0 // indirect - github.com/BurntSushi/toml v1.2.0 // indirect - github.com/DataDog/hyperloglog v0.0.0-20220214164406-974598347557 // indirect + github.com/BurntSushi/toml v1.3.2 // indirect + github.com/DataDog/hyperloglog v0.0.0-20220804205443-1806d9b66146 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.35.0 // indirect - github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 // indirect + github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/dustin/go-humanize v1.0.0 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect github.com/emicklei/go-restful/v3 v3.9.0 // indirect + github.com/felixge/httpsnoop v1.0.3 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/go-logr/logr v1.2.3 // indirect + github.com/go-logr/logr v1.2.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-openapi/jsonreference v0.20.0 // indirect @@ -65,7 +66,6 @@ require ( github.com/google/gnostic v0.5.7-v3refs // indirect github.com/google/gofuzz v1.1.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.1 // indirect - github.com/hashicorp/golang-lru/v2 v2.0.1 // indirect github.com/imdario/mergo v0.3.12 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -84,17 +84,19 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/stoewer/go-strcase v1.2.0 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/otel v1.13.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.42.0 // indirect + go.opentelemetry.io/otel v1.16.0 // indirect + go.opentelemetry.io/otel/metric v1.16.0 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect - golang.org/x/mod v0.6.0 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/term v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + golang.org/x/mod v0.12.0 // indirect + golang.org/x/net v0.12.0 // indirect + golang.org/x/sync v0.3.0 // indirect + golang.org/x/sys v0.10.0 // indirect + golang.org/x/term v0.10.0 // indirect + golang.org/x/text v0.11.0 // indirect golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect - golang.org/x/tools v0.2.0 // indirect + golang.org/x/tools v0.11.0 // indirect google.golang.org/appengine v1.6.7 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect @@ -105,7 +107,7 @@ require ( lukechampine.com/uint128 v1.2.0 // indirect modernc.org/cc/v3 v3.40.0 // indirect modernc.org/ccgo/v3 v3.16.13 // indirect - modernc.org/libc v1.22.3 // indirect + modernc.org/libc v1.22.5 // indirect modernc.org/mathutil v1.5.0 // indirect modernc.org/memory v1.5.0 // indirect modernc.org/opt v0.1.3 // indirect diff --git a/go.sum b/go.sum index cdc2bde..d7fef69 100644 --- a/go.sum +++ b/go.sum @@ -55,26 +55,26 @@ cloud.google.com/go/trace v1.8.0 h1:GFPLxbp5/FzdgTzor3nlNYNxMd6hLmzkE7sA9F0qQcA= cloud.google.com/go/trace v1.8.0/go.mod h1:zH7vcsbAhklH8hWFig58HvxcxyQbaIqMarMg9hn5ECA= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.2.0 h1:Rt8g24XnyGTyglgET/PRUNlrUeu9F5L+7FilkXfZgs0= -github.com/BurntSushi/toml v1.2.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= +github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/DataDog/hyperloglog v0.0.0-20220214164406-974598347557 h1:t+/ZxFkPEVJYvbKbk4suUhKFuCy3C8rg3tuP6Oj/Zyk= -github.com/DataDog/hyperloglog v0.0.0-20220214164406-974598347557/go.mod h1:hFPkswc42pKhRbeKDKXy05mRi7J1kJ2vMNbvd9erH0M= +github.com/DataDog/hyperloglog v0.0.0-20220804205443-1806d9b66146 h1:S5WsRc58vIeuhvbz0V0FKs19nTbh5z23DCutLIXJkFA= +github.com/DataDog/hyperloglog v0.0.0-20220804205443-1806d9b66146/go.mod h1:hFPkswc42pKhRbeKDKXy05mRi7J1kJ2vMNbvd9erH0M= github.com/DataDog/mmh3 v0.0.0-20210722141835-012dc69a9e49 h1:EbzDX8HPk5uE2FsJYxD74QmMw0/3CqSKhEr6teh0ncQ= github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v1.11.0 h1:H+n5i7aVENiTGEr4fqfw4akY5nwAAVvvo6HZU7aYtjM= github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v1.11.0/go.mod h1:qTIu7f/AlQOQ8OANsKLnrc0mLsld6RY7hq5/kR3wUxM= github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.35.0 h1:6KWug9hBDdc7s9a0BxnxtTXPwFcLpVx7IUKO1SLIaDE= github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.35.0 h1:vjtrvX7B3S+uqTIOvOUfqsMCa3eEtEOOQWm7ERI1pxg= github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.35.0/go.mod h1:H785fvlgotVZqht+1rHhXSs8EJ8uPVmpBYkTYO3ccpc= -github.com/ServiceWeaver/weaver v0.16.0 h1:CP8n1E3mFI3zmKgQpkY6Qcm5YDdi5pWUMmw0iJ3gdRw= -github.com/ServiceWeaver/weaver v0.16.0/go.mod h1:zvziH3h+Blab1yppwDsmaZks2Zd5C3/YmSNs6LCODSY= +github.com/ServiceWeaver/weaver v0.17.1-0.20230724182416-3cb82f53ee95 h1:dwK+J80gtDjZo8fAceRyETJ+zQY+PE+j4YeMkEXBD/A= +github.com/ServiceWeaver/weaver v0.17.1-0.20230724182416-3cb82f53ee95/go.mod h1:/tJzitb+h8nLeHa4Mk7iIGU5ZV4OGB4C9IvIfD8n/1I= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 h1:yL7+Jz0jTC6yykIK/Wh74gnTJnrGr5AyrNMXuA0gves= -github.com/antlr/antlr4/runtime/Go/antlr v1.4.10/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= +github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df h1:7RFfzj4SSt6nnvCPbCqijJi1nWCd+TqAT3bYCStRC18= +github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -94,8 +94,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/dustin/randbo v0.0.0-20140428231429-7f1b564ca724 h1:1/c0u68+2LRI+XSpduQpV9BnKx1k1P6GTb3MVxCE3w4= github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= @@ -103,6 +103,8 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= +github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -118,8 +120,8 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= @@ -166,8 +168,8 @@ github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/cel-go v0.13.0 h1:z+8OBOcmh7IeKyqwT/6IlnMvy621fYUqnTVPEdegGlU= -github.com/google/cel-go v0.13.0/go.mod h1:K2hpQgEjDp18J76a2DKFRlPBPpgRZgi6EbnpDgIhJ8s= +github.com/google/cel-go v0.17.1 h1:s2151PDGy/eqpCI80/8dl4VL3xTkqI/YubXLXCFw0mw= +github.com/google/cel-go v0.17.1/go.mod h1:HXZKzB0LXqer5lHHgfWAnlYwJaQBDKMjxjulNQzhwhY= github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -194,8 +196,8 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20230131232505-5a9e8f65f08f h1:gl1DCiSk+mrXXBGPm6CEeS2MkJuMVzAOrXg34oVj1QI= -github.com/google/pprof v0.0.0-20230131232505-5a9e8f65f08f/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= +github.com/google/pprof v0.0.0-20230705174524-200ffdc848b8 h1:n6vlPhxsA+BW/XsS5+uqi7GyzaLa5MH7qlSLBZtRdiA= +github.com/google/pprof v0.0.0-20230705174524-200ffdc848b8/go.mod h1:Jh3hGz2jkYak8qXPD19ryItVnUgpgeqzdkY/D0EaeuA= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= @@ -208,8 +210,6 @@ github.com/googleapis/gax-go/v2 v2.7.0 h1:IcsPKeInNvYi7eqSaDjiZqDDKu5rsmunY0Y1Yu github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru/v2 v2.0.1 h1:5pv5N1lT1fjLg2VQ5KWc7kmucp2x/kvFOnxuVTqZ6x4= -github.com/hashicorp/golang-lru/v2 v2.0.1/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= @@ -322,8 +322,8 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -335,14 +335,18 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/otel v1.13.0 h1:1ZAKnNQKwBBxFtww/GwxNUyTf0AxkZzrukO8MeXqe4Y= -go.opentelemetry.io/otel v1.13.0/go.mod h1:FH3RtdZCzRkJYFTCsAKDy9l/XYjMdNv6QrkFFB8DvVg= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.12.0 h1:FXwvCIXsrMas/reQkSUTPZVCqud1yDy441acn4Fdu6w= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.12.0/go.mod h1:TTDkohPFSX4LMcbmNMYDh0hMXV8YigEjw5WwD+nDn6U= -go.opentelemetry.io/otel/sdk v1.12.0 h1:8npliVYV7qc0t1FKdpU08eMnOjgPFMnriPhn0HH4q3o= -go.opentelemetry.io/otel/sdk v1.12.0/go.mod h1:WYcvtgquYvgODEvxOry5owO2y9MyciW7JqMz6cpXShE= -go.opentelemetry.io/otel/trace v1.13.0 h1:CBgRZ6ntv+Amuj1jDsMhZtlAPT6gbyIRdaIzFhfBSdY= -go.opentelemetry.io/otel/trace v1.13.0/go.mod h1:muCvmmO9KKpvuXSf3KKAXXB2ygNYHQ+ZfI5X08d3tds= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.42.0 h1:pginetY7+onl4qN1vl0xW/V/v6OBZ0vVdH+esuJgvmM= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.42.0/go.mod h1:XiYsayHc36K3EByOO6nbAXnAWbrUxdjUROCEeeROOH8= +go.opentelemetry.io/otel v1.16.0 h1:Z7GVAX/UkAXPKsy94IU+i6thsQS4nb7LviLpnaNeW8s= +go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeHrT/bx4= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.16.0 h1:+XWJd3jf75RXJq29mxbuXhCXFDG3S3R4vBUeSI2P7tE= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.16.0/go.mod h1:hqgzBPTf4yONMFgdZvL/bK42R/iinTyVQtiWihs3SZc= +go.opentelemetry.io/otel/metric v1.16.0 h1:RbrpwVG1Hfv85LgnZ7+txXioPDoh6EdbZHo26Q3hqOo= +go.opentelemetry.io/otel/metric v1.16.0/go.mod h1:QE47cpOmkwipPiefDwo2wDzwJrlfxxNYodqc4xnGCo4= +go.opentelemetry.io/otel/sdk v1.16.0 h1:Z1Ok1YsijYL0CSJpHt4cS3wDDh7p572grzNrBMiMWgE= +go.opentelemetry.io/otel/sdk v1.16.0/go.mod h1:tMsIuKXuuIWPBAOrH+eHtvhTL+SntFtXF9QD68aP6p4= +go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZEu5MQs= +go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= @@ -364,8 +368,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea h1:vLCWI/yYrdEHyN2JzIzPO3aaQJHQdp89IZBA/+azVC4= -golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 h1:MGwJjxBy0HJshjDNfLsYO8xppfqWlA5ZT9OhtUUhTNw= +golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -386,8 +390,8 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 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.6.0 h1:b9gGHsz9/HhJ3HF5DHQytPpuwocVTChQJK3AvoLRD5I= -golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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= @@ -421,8 +425,8 @@ golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= +golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= 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-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -442,8 +446,8 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= 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= @@ -486,12 +490,12 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/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.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= +golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 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.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c= +golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= 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= @@ -499,8 +503,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 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.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= 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= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -548,8 +552,8 @@ golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE= -golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= +golang.org/x/tools v0.11.0 h1:EMCa6U9S2LtZXLAMoWiR/R8dAQFRqbAitmbJ2UKhoi8= +golang.org/x/tools v0.11.0/go.mod h1:anzJrxPjNtfgiYQYirP2CPGzGLxrH2u2QBhn6Bf3qY8= 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= @@ -640,8 +644,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -697,22 +701,22 @@ modernc.org/ccgo/v3 v3.16.13 h1:Mkgdzl46i5F/CNR/Kj80Ri59hC8TKAhZrYSaqvkwzUw= modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY= modernc.org/ccorpus v1.11.6 h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk= modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM= -modernc.org/libc v1.22.3 h1:D/g6O5ftAfavceqlLOFwaZuA5KYafKwmr30A6iSqoyY= -modernc.org/libc v1.22.3/go.mod h1:MQrloYP209xa2zHome2a8HLiLm6k0UT8CoHpV74tOFw= +modernc.org/libc v1.22.5 h1:91BNch/e5B0uPbJFgqbxXuOnxBQjlS//icfQEGmvyjE= +modernc.org/libc v1.22.5/go.mod h1:jj+Z7dTNX8fBScMVNRAYZ/jF91K8fdT2hYMThc3YjBY= modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ= modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/memory v1.5.0 h1:N+/8c5rE6EqugZwHii4IFsaJ7MUhoWX07J5tC/iI5Ds= modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/sqlite v1.21.0 h1:4aP4MdUf15i3R3M2mx6Q90WHKz3nZLoz96zlB6tNdow= -modernc.org/sqlite v1.21.0/go.mod h1:XwQ0wZPIh1iKb5mkvCJ3szzbhk+tykC8ZWqTRTgYRwI= +modernc.org/sqlite v1.24.0 h1:EsClRIWHGhLTCX44p+Ri/JLD+vFGo0QGjasg2/F9TlI= +modernc.org/sqlite v1.24.0/go.mod h1:OrDj17Mggn6MhE+iPbBNf7RGKODDE9NFT0f3EwDzJqk= modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY= modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= -modernc.org/tcl v1.15.1 h1:mOQwiEK4p7HruMZcwKTZPw/aqtGM4aY00uzWhlKKYws= +modernc.org/tcl v1.15.2 h1:C4ybAYCGJw968e+Me18oW55kD/FexcHbqH2xak1ROSY= modernc.org/token v1.0.1 h1:A3qvTqOwexpfZZeyI0FeGPDlSWX5pjZu9hF4lU+EKWg= modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= -modernc.org/z v1.7.0 h1:xkDw/KepgEjeizO2sNco+hqYkU12taxQFqPEmgm1GWE= +modernc.org/z v1.7.3 h1:zDJf6iHjrnB+WRD88stbXokugjyc0/pB91ri1gO6LZY= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/internal/babysitter/babysitter.go b/internal/babysitter/babysitter.go index 070e98e..2103bdb 100644 --- a/internal/babysitter/babysitter.go +++ b/internal/babysitter/babysitter.go @@ -34,7 +34,6 @@ import ( "github.com/ServiceWeaver/weaver/runtime/protomsg" "github.com/ServiceWeaver/weaver/runtime/protos" "github.com/ServiceWeaver/weaver/runtime/retry" - "go.opentelemetry.io/otel/sdk/trace" "golang.org/x/exp/slog" ) @@ -59,7 +58,7 @@ type Babysitter struct { selfCertGetter func() ([]byte, []byte, error) logger *slog.Logger logSaver func(*protos.LogEntry) - traceSaver func(spans []trace.ReadOnlySpan) error + traceSaver func(spans *protos.TraceSpans) error metricExporter func(metrics []*metrics.MetricSnapshot) error mu sync.Mutex @@ -82,7 +81,7 @@ func Start( caCert *x509.Certificate, selfCertGetter func() ([]byte, []byte, error), logSaver func(*protos.LogEntry), - traceSaver func(spans []trace.ReadOnlySpan) error, + traceSaver func(spans *protos.TraceSpans) error, metricExporter func(metrics []*metrics.MetricSnapshot) error, ) (*Babysitter, error) { logger := slog.New(&logging.LogHandler{ @@ -407,7 +406,7 @@ func (b *Babysitter) HandleLogEntry(_ context.Context, entry *protos.LogEntry) e } // HandleTraceSpans implements the envelope.EnvelopeHandler interface. -func (b *Babysitter) HandleTraceSpans(_ context.Context, traces []trace.ReadOnlySpan) error { +func (b *Babysitter) HandleTraceSpans(_ context.Context, traces *protos.TraceSpans) error { if b.traceSaver == nil { return nil } diff --git a/internal/gke/babysitter.go b/internal/gke/babysitter.go index 0dcc3ed..8339541 100644 --- a/internal/gke/babysitter.go +++ b/internal/gke/babysitter.go @@ -28,6 +28,8 @@ import ( "github.com/ServiceWeaver/weaver-gke/internal/nanny/manager" "github.com/ServiceWeaver/weaver-gke/internal/proto" "github.com/ServiceWeaver/weaver/runtime/metrics" + "github.com/ServiceWeaver/weaver/runtime/protos" + "github.com/ServiceWeaver/weaver/runtime/traces" "go.opentelemetry.io/otel/sdk/trace" ) @@ -109,8 +111,15 @@ func RunBabysitter(ctx context.Context) error { defer traceExporter.Shutdown(ctx) logSaver := logClient.Log - traceSaver := func(spans []trace.ReadOnlySpan) error { - return traceExporter.ExportSpans(ctx, spans) + traceSaver := func(spans *protos.TraceSpans) error { + if len(spans.Span) == 0 { + return nil + } + s := make([]trace.ReadOnlySpan, len(spans.Span)) + for i, span := range spans.Span { + s[i] = &traces.ReadSpan{Span: span} + } + return traceExporter.ExportSpans(ctx, s) } metricSaver := func(metrics []*metrics.MetricSnapshot) error { return metricsExporter.Export(ctx, metrics) diff --git a/internal/local/babysitter.go b/internal/local/babysitter.go index 77ccda7..25cdeb4 100644 --- a/internal/local/babysitter.go +++ b/internal/local/babysitter.go @@ -31,9 +31,9 @@ import ( "github.com/ServiceWeaver/weaver-gke/internal/nanny/manager" "github.com/ServiceWeaver/weaver/runtime/logging" "github.com/ServiceWeaver/weaver/runtime/metrics" - "github.com/ServiceWeaver/weaver/runtime/perfetto" + protos "github.com/ServiceWeaver/weaver/runtime/protos" + "github.com/ServiceWeaver/weaver/runtime/traces" "github.com/google/uuid" - sdktrace "go.opentelemetry.io/otel/sdk/trace" ) // startBabysitter creates and starts a babysitter in a gke-local deployment. @@ -47,11 +47,11 @@ func startBabysitter(ctx context.Context, cfg *config.GKEConfig, replicaSet stri logSaver := ls.Add // Setup trace recording. - traceDB, err := perfetto.Open(ctx, perfettoFile) + traceDB, err := traces.OpenDB(ctx, TracesFile) if err != nil { return nil, fmt.Errorf("cannot open Perfetto database: %w", err) } - traceSaver := func(spans []sdktrace.ReadOnlySpan) error { + traceSaver := func(spans *protos.TraceSpans) error { return traceDB.Store(ctx, cfg.Deployment.App.Name, cfg.Deployment.Id, spans) } diff --git a/internal/local/data.go b/internal/local/data.go index eb303d9..53a57ec 100644 --- a/internal/local/data.go +++ b/internal/local/data.go @@ -25,7 +25,7 @@ var ( LogDir = filepath.Join(runtime.LogsDir(), "gke-local") DataDir = filepath.Join(must(runtime.DataDir()), "gke-local") MetricsFile = filepath.Join(DataDir, "metrics.db") - perfettoFile = filepath.Join(DataDir, "perfetto.db") + TracesFile = filepath.Join(DataDir, "traces.db") caCertFile = filepath.Join(DataDir, "ca_cert.pem") caKeyFile = filepath.Join(DataDir, "ca_key.pem") toolCertFile = filepath.Join(DataDir, "tool_cert.pem") diff --git a/internal/tool/deploy.go b/internal/tool/deploy.go index 9dc49fe..c1a9c2c 100644 --- a/internal/tool/deploy.go +++ b/internal/tool/deploy.go @@ -23,6 +23,7 @@ import ( "net/http" "os" "os/signal" + "path/filepath" "syscall" "time" @@ -184,17 +185,37 @@ func (d *DeploySpec) doDeploy(ctx context.Context, cfg *config.GKEConfig) error if info.IsDir() { return fmt.Errorf("want binary, found directory at path %q", app.Binary) } - major, minor, patch, err := version.ReadVersion(app.Binary) + // Check version compatibility. + versions, err := bin.ReadVersions(app.Binary) if err != nil { - return fmt.Errorf("read binary version: %w", err) + return fmt.Errorf("read versions: %w", err) } - if major != version.Major || minor != version.Minor || patch != version.Patch { - return fmt.Errorf( - "version mismatch: deployer version %d.%d.%d is incompatible with app version %d.%d.%d", - version.Major, version.Minor, version.Patch, - major, minor, patch, - ) + if versions.DeployerVersion != version.DeployerVersion { + // Try to relativize the binary, defaulting to the absolute path if + // there are any errors.. + binary := app.Binary + if cwd, err := os.Getwd(); err == nil { + if rel, err := filepath.Rel(cwd, app.Binary); err == nil { + binary = rel + } + } + return fmt.Errorf(` +ERROR: The binary you're trying to deploy (%q) was built with +github.com/ServiceWeaver/weaver module version %s. However, the 'weaver-gke' +binary you're using was built with weaver module version %s. These versions are +incompatible. + +We recommend updating both the weaver module your application is built with and +updating the 'weaver-gke' command by running the following. + + go get github.com/ServiceWeaver/weaver@latest + go install github.com/ServiceWeaver/weaver-gke/cmd/weaver-gke@latest + +Then, re-build your code and re-run 'weaver-gke deploy'. If the problem +persists, please file an issue at https://github.com/ServiceWeaver/weaver/issues.`, + binary, versions.ModuleVersion, version.ModuleVersion) } + // TODO(mwhittaker): Check that the controller is running the same version // as the tool? Have the controller check the binary version as well? diff --git a/internal/tool/testprogram/weaver_gen.go b/internal/tool/testprogram/weaver_gen.go index 1894f4d..59ff836 100644 --- a/internal/tool/testprogram/weaver_gen.go +++ b/internal/tool/testprogram/weaver_gen.go @@ -1,8 +1,8 @@ +// Code generated by "weaver generate". DO NOT EDIT. //go:build !ignoreWeaverGen package main -// Code generated by "weaver generate". DO NOT EDIT. import ( "context" "github.com/ServiceWeaver/weaver" @@ -10,14 +10,34 @@ import ( "go.opentelemetry.io/otel/trace" "reflect" ) -var _ codegen.LatestVersion = codegen.Version[[0][11]struct{}]("You used 'weaver generate' codegen version 0.11.0, but you built your code with an incompatible weaver module version. Try upgrading 'weaver generate' and re-running it.") + +var _ codegen.LatestVersion = codegen.Version[[0][17]struct{}](` + +ERROR: You generated this file with 'weaver generate' v0.17.0 (codegen +version v0.17.0). The generated code is incompatible with the version of the +github.com/ServiceWeaver/weaver module that you're using. The weaver module +version can be found in your go.mod file or by running the following command. + + go list -m github.com/ServiceWeaver/weaver + +We recommend updating the weaver module and the 'weaver generate' command by +running the following. + + go get github.com/ServiceWeaver/weaver@latest + go install github.com/ServiceWeaver/weaver/cmd/weaver@latest + +Then, re-run 'weaver generate' and re-build your code. If the problem persists, +please file an issue at https://github.com/ServiceWeaver/weaver/issues. + +`) func init() { codegen.Register(codegen.Registration{ - Name: "github.com/ServiceWeaver/weaver/Main", - Iface: reflect.TypeOf((*weaver.Main)(nil)).Elem(), - Impl: reflect.TypeOf(app{}), - LocalStubFn: func(impl any, tracer trace.Tracer) any { + Name: "github.com/ServiceWeaver/weaver/Main", + Iface: reflect.TypeOf((*weaver.Main)(nil)).Elem(), + Impl: reflect.TypeOf(app{}), + Listeners: []string{"a", "b"}, + LocalStubFn: func(impl any, caller string, tracer trace.Tracer) any { return main_local_stub{impl: impl.(weaver.Main), tracer: tracer} }, ClientStubFn: func(stub codegen.Stub, caller string) any { return main_client_stub{stub: stub} }, diff --git a/internal/version/version.go b/internal/version/version.go new file mode 100644 index 0000000..4e0a92a --- /dev/null +++ b/internal/version/version.go @@ -0,0 +1,22 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package version + +const ( + // weaver-gke module version (Major.Minor.Patch). + Major = 0 + Minor = 18 + Patch = 0 +)