From 7999d24f81f534b61b192bfe1ccdb64821b6f98c Mon Sep 17 00:00:00 2001 From: Jeff Wendling Date: Fri, 8 Nov 2019 13:40:39 -0700 Subject: [PATCH] all: use monkit v3 this commit updates our monkit dependency to the v3 version where it outputs in an influx style. this makes discovery much easier as many tools are built to look at it this way. graphite and rothko will suffer some due to no longer being a tree based on dots. hopefully time will exist to update rothko to index based on the new metric format. it adds an influx output for the statreceiver so that we can write to influxdb v1 or v2 directly. Change-Id: Iae9f9494a6d29cfbd1f932a5e71a891b490415ff --- certificate/authorization/authorizations.go | 2 +- certificate/certificateclient/client.go | 2 +- certificate/peer.go | 2 +- cmd/statreceiver/filter.go | 2 +- cmd/statreceiver/influx.go | 156 ++++++++++++++++++ cmd/statreceiver/main.go | 1 + cmd/statreceiver/parser.go | 2 +- cmd/uplink/cmd/config.go | 2 +- go.mod | 19 +-- go.sum | 43 +++-- lib/uplink/common.go | 2 +- linksharing/handler.go | 2 +- pkg/debug/error.go | 2 +- pkg/debug/server.go | 22 ++- pkg/miniogw/gateway.go | 2 +- pkg/process/debug.go | 2 +- pkg/process/exec_conf.go | 6 +- pkg/process/metrics.go | 22 +-- pkg/revocation/db.go | 2 +- pkg/server/common.go | 2 +- pkg/telemetry/client.go | 6 +- pkg/telemetry/client_test.go | 4 +- pkg/telemetry/example_test.go | 4 +- pkg/telemetry/server.go | 6 +- pkg/telemetry/tm_test.go | 4 +- pkg/traces/traces.go | 6 +- private/dbutil/cockroachutil/db.go | 2 +- private/dbutil/defaults.go | 8 +- private/dbutil/pgutil/db.go | 2 +- private/dbutil/txutil/transactions.go | 2 +- private/lifecycle/group.go | 2 +- private/post/oauth2/auth.go | 2 +- private/post/sender.go | 2 +- private/version/checker/client.go | 2 +- private/version/stats.go | 25 +-- satellite/accounting/live/cache.go | 2 +- satellite/accounting/projectusage.go | 2 +- satellite/accounting/reportedrollup/chore.go | 2 +- satellite/accounting/rollup/common.go | 2 +- satellite/accounting/tally/tally.go | 2 +- satellite/api.go | 2 +- satellite/audit/verifier.go | 2 +- .../console/consoleweb/consoleapi/payments.go | 2 +- satellite/console/consoleweb/server.go | 2 +- satellite/console/service.go | 2 +- satellite/contact/common.go | 2 +- satellite/core.go | 2 +- satellite/dbcleanup/chore.go | 2 +- satellite/downtime/common.go | 2 +- satellite/gc/service.go | 2 +- satellite/gracefulexit/common.go | 2 +- satellite/inspector/inspector.go | 2 +- satellite/mailservice/service.go | 2 +- satellite/mailservice/simulate/linkclicker.go | 2 +- satellite/metainfo/metainfo.go | 2 +- satellite/metrics/chore.go | 2 +- satellite/nodestats/endpoint.go | 2 +- satellite/orders/endpoint.go | 2 +- satellite/overlay/config.go | 2 +- .../payments/mockpayments/mockpayments.go | 2 +- .../payments/stripecoinpayments/service.go | 2 +- satellite/peer.go | 2 +- satellite/referrals/service.go | 2 +- satellite/repair/checker/checker.go | 2 +- satellite/repair/irreparable/inspector.go | 2 +- satellite/repair/repairer/repairer.go | 2 +- satellite/repairer.go | 2 +- satellite/satellitedb/dbx/gen.go | 2 +- satellite/satellitedb/overlaycache.go | 2 +- storage/boltdb/client.go | 2 +- storage/cockroachkv/client.go | 2 +- storage/common.go | 2 +- storage/filestore/store.go | 2 +- storage/postgreskv/client.go | 2 +- storage/redis/client.go | 2 +- storage/storelogger/logger.go | 2 +- storage/teststore/store.go | 2 +- storagenode/bandwidth/service.go | 2 +- storagenode/collector/service.go | 2 +- .../consolenotifications/notificationsapi.go | 2 +- storagenode/console/consoleserver/server.go | 2 +- storagenode/console/service.go | 2 +- storagenode/contact/service.go | 2 +- storagenode/gracefulexit/common.go | 2 +- storagenode/inspector/inspector.go | 2 +- storagenode/monitor/monitor.go | 2 +- storagenode/nodestats/service.go | 2 +- storagenode/notifications/service.go | 2 +- storagenode/orders/service.go | 2 +- storagenode/peer.go | 2 +- storagenode/pieces/store.go | 2 +- storagenode/piecestore/endpoint.go | 2 +- storagenode/preflight/common.go | 2 +- storagenode/retain/retain.go | 2 +- storagenode/storagenodedb/database.go | 2 +- storagenode/trust/service.go | 2 +- 96 files changed, 328 insertions(+), 166 deletions(-) create mode 100644 cmd/statreceiver/influx.go diff --git a/certificate/authorization/authorizations.go b/certificate/authorization/authorizations.go index a7b841fda..2697f4b69 100644 --- a/certificate/authorization/authorizations.go +++ b/certificate/authorization/authorizations.go @@ -16,8 +16,8 @@ import ( "time" "github.com/btcsuite/btcutil/base58" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/identity" "storj.io/common/pb" diff --git a/certificate/certificateclient/client.go b/certificate/certificateclient/client.go index ea1a2d271..e8463a82c 100644 --- a/certificate/certificateclient/client.go +++ b/certificate/certificateclient/client.go @@ -7,8 +7,8 @@ import ( "context" "time" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/identity" "storj.io/common/pb" diff --git a/certificate/peer.go b/certificate/peer.go index e10a7c51f..8027a2178 100644 --- a/certificate/peer.go +++ b/certificate/peer.go @@ -7,10 +7,10 @@ import ( "context" "net" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" "golang.org/x/sync/errgroup" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/errs2" "storj.io/common/identity" diff --git a/cmd/statreceiver/filter.go b/cmd/statreceiver/filter.go index 1c0a87181..c8cea9b75 100644 --- a/cmd/statreceiver/filter.go +++ b/cmd/statreceiver/filter.go @@ -8,7 +8,7 @@ import ( "sync" "time" - "github.com/zeebo/admission/admproto" + "github.com/zeebo/admission/v2/admproto" "storj.io/common/memory" ) diff --git a/cmd/statreceiver/influx.go b/cmd/statreceiver/influx.go new file mode 100644 index 000000000..86de62def --- /dev/null +++ b/cmd/statreceiver/influx.go @@ -0,0 +1,156 @@ +// Copyright (C) 2019 Storj Labs, Inc. +// See LICENSE for copying information. + +package main + +import ( + "bytes" + "fmt" + "log" + "net/http" + "net/url" + "strings" + "sync" + "time" + + "github.com/zeebo/errs" +) + +// InfluxDest is a MetricDest that sends data with the Influx TCP wire +// protocol. +type InfluxDest struct { + url string + token string + + mu sync.Mutex + buf bytes.Buffer + stopped bool +} + +// NewInfluxDest creates a InfluxDest with stats URL url. Because +// this function is called in a Lua pipeline domain-specific language, the DSL +// wants a Influx destination to be flushing every few seconds, so this +// constructor will start that process. Use Close to stop it. +func NewInfluxDest(writeURL string) *InfluxDest { + parsed, err := url.Parse(writeURL) + if err != nil { + panic(err) + } + token := parsed.Query().Get("authorization") + parsed.Query().Del("authorization") + + rv := &InfluxDest{ + url: parsed.String(), + token: token, + } + go rv.flush() + return rv +} + +// Metric implements MetricDest +func (d *InfluxDest) Metric(application, instance string, key []byte, val float64, ts time.Time) error { + d.mu.Lock() + defer d.mu.Unlock() + + // TODO(jeff): actual parsing of the key is very tricky in the presence of influx's busted + // escapes. If we could do that, we could more easily put the application tag in sorted order + // but since it begins with a, we'll do the easy thing and insert it first. + added := false +keyRange: + for i, val := range key { + switch { + case val != ' ' && val != ',': + continue + case i == 0: + break keyRange + case key[i-1] == '\\': + continue + } + + var newKey []byte + newKey = append(newKey, key[:i]...) + newKey = append(newKey, ",application="...) + newKey = appendTag(newKey, application) + newKey = append(newKey, key[i:]...) + key = newKey + + added = true + break + } + if !added { + log.Printf("metric dropped: %q", key) + return nil + } + + _, err := fmt.Fprintf(&d.buf, "%s=%v %d\n", key, val, ts.Truncate(time.Second).UnixNano()) + return err +} + +// appendTag writes a tag key, value, or field key to the buffer. +func appendTag(buf []byte, tag string) []byte { + if !strings.ContainsAny(tag, ",= ") { + return append(buf, tag...) + } + + for i := 0; i < len(tag); i++ { + if tag[i] == ',' || + tag[i] == '=' || + tag[i] == ' ' { + buf = append(buf, '\\') + } + buf = append(buf, tag[i]) + } + + return buf +} + +// Close stops the flushing goroutine. +func (d *InfluxDest) Close() error { + d.mu.Lock() + d.stopped = true + d.mu.Unlock() + return nil +} + +func (d *InfluxDest) flush() { + for { + time.Sleep(5 * time.Second) + + d.mu.Lock() + if d.stopped { + d.mu.Unlock() + return + } + data := append([]byte{}, d.buf.Bytes()...) + d.buf.Reset() + d.mu.Unlock() + + if len(data) == 0 { + continue + } + + err := func() (err error) { + req, err := http.NewRequest("POST", d.url, bytes.NewReader(data)) + if err != nil { + return err + } + if d.token != "" { + req.Header.Set("Authorization", "Token "+d.token) + } + + resp, err := http.DefaultClient.Do(req) + if err != nil { + return err + } + defer func() { err = errs.Combine(err, resp.Body.Close()) }() + + if resp.StatusCode != http.StatusNoContent { + return errs.New("invalid status code: %d", resp.StatusCode) + } + return nil + }() + if err != nil { + log.Printf("failed flushing: %v", err) + } + } +} diff --git a/cmd/statreceiver/main.go b/cmd/statreceiver/main.go index bb3007906..f45a8a3f7 100644 --- a/cmd/statreceiver/main.go +++ b/cmd/statreceiver/main.go @@ -79,6 +79,7 @@ func Main(cmd *cobra.Command, args []string) error { scope.RegisterVal("keyfilter", NewKeyFilter), scope.RegisterVal("sanitize", NewSanitizer), scope.RegisterVal("graphite", NewGraphiteDest), + scope.RegisterVal("influx", NewInfluxDest), scope.RegisterVal("db", NewDBDest), scope.RegisterVal("pbufprep", NewPacketBufPrep), scope.RegisterVal("mbufprep", NewMetricBufPrep), diff --git a/cmd/statreceiver/parser.go b/cmd/statreceiver/parser.go index b42dc2508..0b565829d 100644 --- a/cmd/statreceiver/parser.go +++ b/cmd/statreceiver/parser.go @@ -8,7 +8,7 @@ import ( "sync" "time" - "github.com/zeebo/admission/admproto" + "github.com/zeebo/admission/v2/admproto" "storj.io/common/memory" ) diff --git a/cmd/uplink/cmd/config.go b/cmd/uplink/cmd/config.go index 0fe234b9c..d82e03dab 100644 --- a/cmd/uplink/cmd/config.go +++ b/cmd/uplink/cmd/config.go @@ -8,8 +8,8 @@ import ( "strings" "time" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/memory" "storj.io/common/peertls/tlsopts" diff --git a/go.mod b/go.mod index 1e08d7473..6c5a57c8f 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,6 @@ require ( github.com/btcsuite/btcutil v0.0.0-20180706230648-ab6388e0c60a github.com/garyburd/redigo v1.0.1-0.20170216214944-0d253a66e6e1 // indirect github.com/graphql-go/graphql v0.7.9-0.20190403165646-199d20bbfed7 - github.com/minio/minio v0.0.0-20180508161510-54cd29b51c38 github.com/segmentio/go-prompt v1.2.1-0.20161017233205-f0d19b6901ad ) @@ -52,8 +51,8 @@ require ( github.com/jackc/pgx v3.2.0+incompatible github.com/jtolds/gls v4.2.1+incompatible // indirect github.com/jtolds/go-luar v0.0.0-20170419063437-0786921db8c0 - github.com/jtolds/monkit-hw v0.0.0-20190108155550-0f753668cf20 - github.com/jtolds/tracetagger v0.0.0-20200112222712-32e72f1f7180 + github.com/jtolds/monkit-hw/v2 v2.0.0-20191108235325-141a0da276b3 + github.com/jtolds/tracetagger/v2 v2.0.0-rc0 github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e // indirect github.com/klauspost/reedsolomon v0.0.0-20180704173009-925cb01d6510 // indirect github.com/lib/pq v1.3.0 @@ -84,21 +83,20 @@ require ( github.com/skyrings/skyring-common v0.0.0-20160929130248-d1c0bb1cbd5e github.com/smartystreets/assertions v0.0.0-20180820201707-7c9eb446e3cf // indirect github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a // indirect + github.com/spacemonkeygo/monkit/v3 v3.0.1 github.com/spf13/cast v1.3.0 github.com/spf13/cobra v0.0.5 github.com/spf13/pflag v1.0.3 github.com/spf13/viper v1.4.0 github.com/streadway/amqp v0.0.0-20180806233856-70e15c650864 // indirect - github.com/stretchr/testify v1.3.0 + github.com/stretchr/testify v1.4.0 github.com/stripe/stripe-go v63.1.1+incompatible github.com/tidwall/gjson v1.1.3 // indirect github.com/tidwall/match v0.0.0-20171002075945-1731857f09b1 // indirect github.com/vivint/infectious v0.0.0-20190108171102-2455b059135b github.com/yuin/gopher-lua v0.0.0-20180918061612-799fa34954fb // indirect - github.com/zeebo/admission v0.0.0-20180821192747-f24f2a94a40c + github.com/zeebo/admission/v2 v2.0.0-20191108235419-c7982d45d29a github.com/zeebo/errs v1.2.2 - github.com/zeebo/float16 v0.1.0 // indirect - github.com/zeebo/incenc v0.0.0-20180505221441-0d92902eec54 // indirect github.com/zeebo/structs v1.0.2 go.uber.org/zap v1.10.0 golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876 @@ -111,9 +109,8 @@ require ( gopkg.in/cheggaaa/pb.v1 v1.0.25 // indirect gopkg.in/ini.v1 v1.38.2 // indirect gopkg.in/olivere/elastic.v5 v5.0.76 // indirect - gopkg.in/spacemonkeygo/monkit.v2 v2.0.0-20190623001553-09813957f0a8 - gopkg.in/yaml.v2 v2.2.2 + gopkg.in/yaml.v2 v2.2.4 storj.io/common v0.0.0-20200130005211-04afbf4cd6a5 - storj.io/drpc v0.0.7 - storj.io/uplink v0.0.0-20200127130338-7a4b7876e16b + storj.io/drpc v0.0.8 + storj.io/uplink v0.0.0-20200131143957-f3b6350b4add ) diff --git a/go.sum b/go.sum index 48027ed61..b96e7b5e2 100644 --- a/go.sum +++ b/go.sum @@ -226,10 +226,10 @@ github.com/jtolds/gls v4.2.1+incompatible h1:fSuqC+Gmlu6l/ZYAoZzx2pyucC8Xza35fpR github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/jtolds/go-luar v0.0.0-20170419063437-0786921db8c0 h1:UyVaeqfY1fLPMt1iUTaWsxUNxYAzZVyK+7G+a3sRfhk= github.com/jtolds/go-luar v0.0.0-20170419063437-0786921db8c0/go.mod h1:OtVLEpPHGJkn8jgGrHlYELCA3uXLU0YSfNN0faeDM2M= -github.com/jtolds/monkit-hw v0.0.0-20190108155550-0f753668cf20 h1:XK96humQhnPbQ24uKtSHKbdShDgrKYqlWBNKJTcIKbg= -github.com/jtolds/monkit-hw v0.0.0-20190108155550-0f753668cf20/go.mod h1:1liUiYZzx8ZoPTfZrBE2q8DFRDPafts0GGjslOtcZcw= -github.com/jtolds/tracetagger v0.0.0-20200112222712-32e72f1f7180 h1:bQhCPoH0j+N8Zdy3kUXZOgulMR9Ws+RNTOMdRsIhiwY= -github.com/jtolds/tracetagger v0.0.0-20200112222712-32e72f1f7180/go.mod h1:TuzhgRc1KtjV8osCjF1FTs0GzjFy7Cne1lY4NxLSqpk= +github.com/jtolds/monkit-hw/v2 v2.0.0-20191108235325-141a0da276b3 h1:dITCBge70U9RDyZUL/Thn/yAT/ct4Rz40mNUX51dFCk= +github.com/jtolds/monkit-hw/v2 v2.0.0-20191108235325-141a0da276b3/go.mod h1:eo5po8nCwRcvZIIR8eGi7PKthzXuunpXzUmXzxCBfBc= +github.com/jtolds/tracetagger/v2 v2.0.0-rc0 h1:ND7ncC1SZyJ97ALL2QsKN5whzvRGOeXv0cu8PaCYttA= +github.com/jtolds/tracetagger/v2 v2.0.0-rc0/go.mod h1:EeqZ0b80feEwRK+FutrQ/GJxruNqamJBKOezZVfzSxA= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= @@ -323,8 +323,12 @@ github.com/onsi/ginkgo v1.6.0 h1:Ix8l273rp3QzYgXSR+c8d1fTG7UPgYkOSELPhiY/YGw= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.3 h1:OoxbjfXVZyod1fmWYhI7SEyaD8B00ynP3T+D5GiyHOY= +github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.1 h1:K0jcRCwNQM3vFGh1ppMtDh/+7ApJrjldlX8fA0jDTLQ= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= @@ -390,6 +394,7 @@ github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:X github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spacemonkeygo/errors v0.0.0-20171212215202-9064522e9fd1 h1:xHQewZjohU9/wUsyC99navCjQDNHtTgUOM/J1jAbzfw= github.com/spacemonkeygo/errors v0.0.0-20171212215202-9064522e9fd1/go.mod h1:7NL9UAYQnRM5iKHUCld3tf02fKb5Dft+41+VckASUy0= +github.com/spacemonkeygo/monkit/v3 v3.0.0-20191108235033-eacca33b3037/go.mod h1:JcK1pCbReQsOsMKF/POFSZCq7drXFybgGmbc27tuwes= github.com/spacemonkeygo/monkit/v3 v3.0.1 h1:mSZQU+LOFuN5KSUvE1EiU1lxlFcOz/r0N5Tz8z+TwN0= github.com/spacemonkeygo/monkit/v3 v3.0.1/go.mod h1:JcK1pCbReQsOsMKF/POFSZCq7drXFybgGmbc27tuwes= github.com/spacemonkeygo/monotime v0.0.0-20180824235756-e3f48a95f98a h1:8+cCjxhToanKmxLIbuyBNe2EnpgwhiivsIaRJstDRFA= @@ -421,6 +426,8 @@ github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1 github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stripe/stripe-go v63.1.1+incompatible h1:OpGp55VzHcnu5O/MtVVU42xS2xeAWosx3xELvuoMMMw= github.com/stripe/stripe-go v63.1.1+incompatible/go.mod h1:A1dQZmO/QypXmsL0T8axYZkSN/uA/T/A64pfKdBAMiY= github.com/tidwall/gjson v1.1.3 h1:u4mspaByxY+Qk4U1QYYVzGFI8qxN/3jtEV0ZDb2vRic= @@ -440,8 +447,8 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/gopher-lua v0.0.0-20180918061612-799fa34954fb h1:Jmfk7z2f/+gxVFAgPsJMuczO1uEIxZy6wytTdeZ49lg= github.com/yuin/gopher-lua v0.0.0-20180918061612-799fa34954fb/go.mod h1:aEV29XrmTYFr3CiRxZeGHpkvbwq+prZduBqMaascyCU= -github.com/zeebo/admission v0.0.0-20180821192747-f24f2a94a40c h1:WoYvMZp+keiJz+ZogLAhwsUZvWe81W+mCnpfdgEUOl4= -github.com/zeebo/admission v0.0.0-20180821192747-f24f2a94a40c/go.mod h1:Aq7yiXoKLFIDzh4eR6EG4owIO9alpttZ0XJ5c/z/QrE= +github.com/zeebo/admission/v2 v2.0.0-20191108235419-c7982d45d29a h1:ycSw8pJ2MFGraixL9hFv5bknnIH7wQZ76S7h/4sLGcI= +github.com/zeebo/admission/v2 v2.0.0-20191108235419-c7982d45d29a/go.mod h1:gSeHGelDHW7Vq6UyJo2boeSt/6Dsnqpisv0i4YZSOyM= github.com/zeebo/assert v0.0.0-20181109011804-10f827ce2ed6 h1:bs7mSHVrLRQHxqWcm0hyez0sA23YuXb8Pwnq5NhyZ8A= github.com/zeebo/assert v0.0.0-20181109011804-10f827ce2ed6/go.mod h1:yssERNPivllc1yU3BvpjYI5BUW+zglcz6QWqeVRL5t0= github.com/zeebo/assert v1.0.0 h1:qw3LXzO7lbptWIQ6DsemJIUOoaqyKbgY3M8b8yvlaaY= @@ -475,8 +482,6 @@ golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7 h1:0hQKqeLdqlt5iIwVOBErRisrHJAN57yOiPRQItI20fU= -golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876 h1:sKJQZMuxjOAR/Uo2LBfU90onWEf1dF4C+0hPJCc9Mpc= golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -495,8 +500,6 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190424112056-4829fb13d2c6/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190916140828-c8589233b77d h1:mCMDWKhNO37A7GAhOpHPbIw1cjd0V86kX1/WA9c7FZ8= -golang.org/x/net v0.0.0-20190916140828-c8589233b77d/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478 h1:l5EDrHhldLYb3ZRHDUhXF7Om7MvYXnkV9/iQNo1lX6g= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= @@ -513,8 +516,6 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEha golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180824143301-4910a1d54f87 h1:GqwDwfvIpC33dK9bA1fD+JiDUNsuAiQiEkpHqUKze4o= -golang.org/x/sys v0.0.0-20180824143301-4910a1d54f87/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-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -582,12 +583,6 @@ gopkg.in/ini.v1 v1.38.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/olivere/elastic.v5 v5.0.76 h1:A6W7X4yLPQDINHiYAqIwqev+rD5hIQ4G0e1d5H//VXk= gopkg.in/olivere/elastic.v5 v5.0.76/go.mod h1:uhHoB4o3bvX5sorxBU29rPcmBQdV2Qfg0FBrx5D6pV0= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/spacemonkeygo/monkit.v2 v2.0.0-20180827161543-6ebf5a752f9b h1:zkhw+LuPvld5/ZwIlpYzd4DX/r0KxTvhEpo+2lcrp9k= -gopkg.in/spacemonkeygo/monkit.v2 v2.0.0-20180827161543-6ebf5a752f9b/go.mod h1:6UQdi0rNB4YDNwVYP8fJNmjLNaU8MA84WCdXStx3Spo= -gopkg.in/spacemonkeygo/monkit.v2 v2.0.0-20190612171030-cf5a9e6f8fd2 h1:Hzf9SARsnWv8oWl9TWmQ3vo3lSqOMByumL6aJ7ehw7g= -gopkg.in/spacemonkeygo/monkit.v2 v2.0.0-20190612171030-cf5a9e6f8fd2/go.mod h1:6UQdi0rNB4YDNwVYP8fJNmjLNaU8MA84WCdXStx3Spo= -gopkg.in/spacemonkeygo/monkit.v2 v2.0.0-20190623001553-09813957f0a8 h1:nyw4hxw2zz4S0EHqr5nQfA3zGbMFJDRJlQPM4PCb7O4= -gopkg.in/spacemonkeygo/monkit.v2 v2.0.0-20190623001553-09813957f0a8/go.mod h1:6UQdi0rNB4YDNwVYP8fJNmjLNaU8MA84WCdXStx3Spo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= @@ -595,17 +590,17 @@ gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -storj.io/common v0.0.0-20200108114547-1c62e5708bce/go.mod h1:mDnchZF+e7g7u630Wwgu/X/zCmqpU0lvy5kQ3jQgs5k= storj.io/common v0.0.0-20200130005211-04afbf4cd6a5 h1:BqnkK/pId17R1a70qWcCm2fBgR3kQ5fLBKZ69W+8ecU= storj.io/common v0.0.0-20200130005211-04afbf4cd6a5/go.mod h1:n4sxosrQlw5iDBlbTdBtae/8ZqnXUG3nA5XZdIHJibY= -storj.io/drpc v0.0.7-0.20191115031725-2171c57838d2 h1:8SgLYEhe99R8QlAD1EAOBPRyIR+cn2hqkXtWlAUPf/c= storj.io/drpc v0.0.7-0.20191115031725-2171c57838d2/go.mod h1:/ascUDbzNAv0A3Jj7wUIKFBH2JdJ2uJIBO/b9+2yHgQ= -storj.io/drpc v0.0.7 h1:hWb9tdmUGgH3RUf46Kx82/o8mIVQjb8va6cWw37wcMI= -storj.io/drpc v0.0.7/go.mod h1:jRZKM/4rS6jgmsxoNP/zGhW+3CUeXOeK+nY4n6OjK60= -storj.io/uplink v0.0.0-20200127130338-7a4b7876e16b h1:1ZAsoOdQPC2O4IjK6Mrj3NhjWygDWHTCa4JLrgnxvc0= -storj.io/uplink v0.0.0-20200127130338-7a4b7876e16b/go.mod h1:uUACeUcun4vec5KGdNMPUp9ujIQAhRR+HHWSJpxhDaw= +storj.io/drpc v0.0.8 h1:wu68cMmtoT0vSWIAZz29RpJkWdi4o0S8BIrLslpH5FQ= +storj.io/drpc v0.0.8/go.mod h1:v39uWro/EbXXk+gNnrM9FQuVVS2zUBWBfeduydgeXUA= +storj.io/uplink v0.0.0-20200131143957-f3b6350b4add h1:/G2nFSq00KxD/9tQIpNJA2vRGkaSHdZvi1ZsX4qAgbQ= +storj.io/uplink v0.0.0-20200131143957-f3b6350b4add/go.mod h1:sqhw1H30vF8pD6coKYkx0nLAkw9M0ISwjLi+3R5b3A8= diff --git a/lib/uplink/common.go b/lib/uplink/common.go index e8ac743f8..d90eed932 100644 --- a/lib/uplink/common.go +++ b/lib/uplink/common.go @@ -4,8 +4,8 @@ package uplink import ( + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" - monkit "gopkg.in/spacemonkeygo/monkit.v2" ) var ( diff --git a/linksharing/handler.go b/linksharing/handler.go index 0795dfee4..c38d59295 100644 --- a/linksharing/handler.go +++ b/linksharing/handler.go @@ -12,9 +12,9 @@ import ( "path" "strings" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/ranger" "storj.io/common/storj" diff --git a/pkg/debug/error.go b/pkg/debug/error.go index c684f88fc..7320bb386 100644 --- a/pkg/debug/error.go +++ b/pkg/debug/error.go @@ -4,8 +4,8 @@ package debug import ( + "github.com/spacemonkeygo/monkit/v3" "google.golang.org/grpc/status" - monkit "gopkg.in/spacemonkeygo/monkit.v2" ) func init() { diff --git a/pkg/debug/server.go b/pkg/debug/server.go index d919a6961..497e229b0 100644 --- a/pkg/debug/server.go +++ b/pkg/debug/server.go @@ -13,10 +13,10 @@ import ( "strings" "time" + "github.com/spacemonkeygo/monkit/v3" + "github.com/spacemonkeygo/monkit/v3/present" "go.uber.org/zap" "golang.org/x/sync/errgroup" - "gopkg.in/spacemonkeygo/monkit.v2" - "gopkg.in/spacemonkeygo/monkit.v2/present" "storj.io/storj/pkg/traces" "storj.io/storj/private/version/checker" @@ -108,12 +108,20 @@ func (server *Server) Close() error { // metrics writes https://prometheus.io/docs/instrumenting/exposition_formats/ func (server *Server) metrics(w http.ResponseWriter, r *http.Request) { - // TODO(jt): deeper monkit integration so we can expose prometheus types + // writes https://prometheus.io/docs/instrumenting/exposition_formats/ // (https://prometheus.io/docs/concepts/metric_types/) - server.registry.Stats(func(name string, val float64) { - metric := sanitize(name) - _, _ = fmt.Fprintf(w, "# TYPE %s gauge\n%s %g\n", - metric, metric, val) + server.registry.Stats(func(key monkit.SeriesKey, field string, val float64) { + measurement := sanitize(key.Measurement) + var metrics []string + for tag, tagVal := range key.Tags.All() { + metric := sanitize(tag) + "=\"" + sanitize(tagVal) + "\"" + metrics = append(metrics, metric) + } + fieldMetric := "field=\"" + sanitize(field) + "\"" + metrics = append(metrics, fieldMetric) + + _, _ = fmt.Fprintf(w, "# TYPE %s gauge\n%s{"+ + strings.Join(metrics, ",")+"} %g\n", measurement, measurement, val) }) } diff --git a/pkg/miniogw/gateway.go b/pkg/miniogw/gateway.go index 035e1bbc5..95bcf5bae 100644 --- a/pkg/miniogw/gateway.go +++ b/pkg/miniogw/gateway.go @@ -12,8 +12,8 @@ import ( minio "github.com/minio/minio/cmd" "github.com/minio/minio/pkg/auth" "github.com/minio/minio/pkg/hash" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" - monkit "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/memory" "storj.io/common/storj" diff --git a/pkg/process/debug.go b/pkg/process/debug.go index 3dc2f871f..2e31bfdfb 100644 --- a/pkg/process/debug.go +++ b/pkg/process/debug.go @@ -9,8 +9,8 @@ import ( "fmt" "net" + "github.com/spacemonkeygo/monkit/v3" "go.uber.org/zap" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/storj/pkg/debug" ) diff --git a/pkg/process/exec_conf.go b/pkg/process/exec_conf.go index 15da573f9..37618cb1b 100644 --- a/pkg/process/exec_conf.go +++ b/pkg/process/exec_conf.go @@ -17,15 +17,15 @@ import ( "syscall" "time" + "github.com/spacemonkeygo/monkit/v3" + "github.com/spacemonkeygo/monkit/v3/collect" + "github.com/spacemonkeygo/monkit/v3/present" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" "github.com/zeebo/errs" "github.com/zeebo/structs" "go.uber.org/zap" - monkit "gopkg.in/spacemonkeygo/monkit.v2" - "gopkg.in/spacemonkeygo/monkit.v2/collect" - "gopkg.in/spacemonkeygo/monkit.v2/present" "storj.io/storj/pkg/cfgstruct" "storj.io/storj/private/version" diff --git a/pkg/process/metrics.go b/pkg/process/metrics.go index d9263e5d6..dbfc45218 100644 --- a/pkg/process/metrics.go +++ b/pkg/process/metrics.go @@ -9,11 +9,11 @@ import ( "os" "path/filepath" - hw "github.com/jtolds/monkit-hw" - "github.com/zeebo/admission/admproto" + hw "github.com/jtolds/monkit-hw/v2" + "github.com/spacemonkeygo/monkit/v3" + "github.com/spacemonkeygo/monkit/v3/environment" + "github.com/zeebo/admission/v2/admproto" "go.uber.org/zap" - monkit "gopkg.in/spacemonkeygo/monkit.v2" - "gopkg.in/spacemonkeygo/monkit.v2/environment" "storj.io/common/identity" "storj.io/storj/pkg/cfgstruct" @@ -43,14 +43,19 @@ func flagDefault(dev, release string) string { // InitMetrics initializes telemetry reporting. Makes a telemetry.Client and calls // its Run() method in a goroutine. func InitMetrics(ctx context.Context, log *zap.Logger, r *monkit.Registry, instanceID string) (err error) { + if r == nil { + r = monkit.Default + } + environment.Register(r) + hw.Register(r) + r.ScopeNamed("env").Chain(monkit.StatSourceFunc(version.Build.Stats)) + log = log.Named("telemetry") if *metricCollector == "" || *metricInterval == 0 { log.Info("disabled") return nil } - if r == nil { - r = monkit.Default - } + if instanceID == "" { instanceID = telemetry.DefaultInstanceID() } @@ -68,9 +73,6 @@ func InitMetrics(ctx context.Context, log *zap.Logger, r *monkit.Registry, insta if err != nil { return err } - environment.Register(r) - hw.Register(r) - r.ScopeNamed("env").Chain("version", monkit.StatSourceFunc(version.Build.Stats)) go c.Run(ctx) return nil } diff --git a/pkg/revocation/db.go b/pkg/revocation/db.go index ce21cacd1..57ccf0270 100644 --- a/pkg/revocation/db.go +++ b/pkg/revocation/db.go @@ -8,8 +8,8 @@ import ( "crypto/x509" "crypto/x509/pkix" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/identity" "storj.io/common/peertls" diff --git a/pkg/server/common.go b/pkg/server/common.go index a9874d996..4ba12c92d 100644 --- a/pkg/server/common.go +++ b/pkg/server/common.go @@ -4,8 +4,8 @@ package server import ( + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" - monkit "gopkg.in/spacemonkeygo/monkit.v2" ) var ( diff --git a/pkg/telemetry/client.go b/pkg/telemetry/client.go index 9a7921751..a4b5ea73c 100644 --- a/pkg/telemetry/client.go +++ b/pkg/telemetry/client.go @@ -8,10 +8,10 @@ import ( "os" "time" - "github.com/zeebo/admission/admmonkit" - "github.com/zeebo/admission/admproto" + "github.com/spacemonkeygo/monkit/v3" + "github.com/zeebo/admission/v2/admmonkit" + "github.com/zeebo/admission/v2/admproto" "go.uber.org/zap" - monkit "gopkg.in/spacemonkeygo/monkit.v2" ) const ( diff --git a/pkg/telemetry/client_test.go b/pkg/telemetry/client_test.go index 26ba22986..7d89c6720 100644 --- a/pkg/telemetry/client_test.go +++ b/pkg/telemetry/client_test.go @@ -8,10 +8,10 @@ import ( "testing" "time" + "github.com/spacemonkeygo/monkit/v3" "github.com/stretchr/testify/assert" - "github.com/zeebo/admission/admmonkit" + "github.com/zeebo/admission/v2/admmonkit" "go.uber.org/zap/zaptest" - monkit "gopkg.in/spacemonkeygo/monkit.v2" ) func TestNewClient_IntervalIsZero(t *testing.T) { diff --git a/pkg/telemetry/example_test.go b/pkg/telemetry/example_test.go index e2ca91031..bd1438cdd 100644 --- a/pkg/telemetry/example_test.go +++ b/pkg/telemetry/example_test.go @@ -9,11 +9,11 @@ import ( "log" "time" - "github.com/zeebo/admission/admproto" + "github.com/spacemonkeygo/monkit/v3" + "github.com/zeebo/admission/v2/admproto" "github.com/zeebo/errs" "go.uber.org/zap" "golang.org/x/sync/errgroup" - monkit "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/storj/pkg/telemetry" ) diff --git a/pkg/telemetry/server.go b/pkg/telemetry/server.go index f0e2f7eda..e5a691ced 100644 --- a/pkg/telemetry/server.go +++ b/pkg/telemetry/server.go @@ -9,9 +9,9 @@ import ( "net" "syscall" - "github.com/zeebo/admission" - "github.com/zeebo/admission/admproto" - monkit "gopkg.in/spacemonkeygo/monkit.v2" + "github.com/spacemonkeygo/monkit/v3" + "github.com/zeebo/admission/v2" + "github.com/zeebo/admission/v2/admproto" ) var ( diff --git a/pkg/telemetry/tm_test.go b/pkg/telemetry/tm_test.go index 45ee8bcf7..12f2501d1 100644 --- a/pkg/telemetry/tm_test.go +++ b/pkg/telemetry/tm_test.go @@ -8,9 +8,9 @@ import ( "runtime" "testing" + "github.com/spacemonkeygo/monkit/v3" "github.com/stretchr/testify/assert" "go.uber.org/zap/zaptest" - monkit "gopkg.in/spacemonkeygo/monkit.v2" ) var ( @@ -44,7 +44,7 @@ func TestMetrics(t *testing.T) { func(application, instance string, key []byte, val float64) { assert.Equal(t, application, "testapp") assert.Equal(t, instance, "testinst") - if string(key) == "testpkg.testint.recent" { + if string(key) == "testint,scope=testpkg recent" { assert.Equal(t, val, float64(3)) errs <- nil } diff --git a/pkg/traces/traces.go b/pkg/traces/traces.go index 3a72f4871..7dc686650 100644 --- a/pkg/traces/traces.go +++ b/pkg/traces/traces.go @@ -10,9 +10,9 @@ import ( "os" "path/filepath" - "github.com/jtolds/tracetagger" - monkit "gopkg.in/spacemonkeygo/monkit.v2" - "gopkg.in/spacemonkeygo/monkit.v2/collect" + "github.com/jtolds/tracetagger/v2" + "github.com/spacemonkeygo/monkit/v3" + "github.com/spacemonkeygo/monkit/v3/collect" ) // TraceTag is a type to keep track of different types of tags for traces diff --git a/private/dbutil/cockroachutil/db.go b/private/dbutil/cockroachutil/db.go index 164602a8c..b44d6098f 100644 --- a/private/dbutil/cockroachutil/db.go +++ b/private/dbutil/cockroachutil/db.go @@ -11,8 +11,8 @@ import ( "strings" "github.com/lib/pq" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/storj/private/dbutil" "storj.io/storj/private/tagsql" diff --git a/private/dbutil/defaults.go b/private/dbutil/defaults.go index 982500a5e..f6913c72c 100644 --- a/private/dbutil/defaults.go +++ b/private/dbutil/defaults.go @@ -8,7 +8,7 @@ import ( "flag" "time" - monkit "gopkg.in/spacemonkeygo/monkit.v2" + "github.com/spacemonkeygo/monkit/v3" ) var ( @@ -36,8 +36,8 @@ func Configure(db ConfigurableDB, mon *monkit.Scope) { if *connMaxLifetime >= 0 { db.SetConnMaxLifetime(*connMaxLifetime) } - mon.Chain("db_stats", monkit.StatSourceFunc( - func(cb func(name string, val float64)) { - monkit.StatSourceFromStruct(db.Stats()).Stats(cb) + mon.Chain(monkit.StatSourceFunc( + func(cb func(key monkit.SeriesKey, field string, val float64)) { + monkit.StatSourceFromStruct(monkit.NewSeriesKey("db_stats"), db.Stats()).Stats(cb) })) } diff --git a/private/dbutil/pgutil/db.go b/private/dbutil/pgutil/db.go index 44471b153..98bf2380f 100644 --- a/private/dbutil/pgutil/db.go +++ b/private/dbutil/pgutil/db.go @@ -8,8 +8,8 @@ import ( "strings" "github.com/lib/pq" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" - monkit "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/storj/private/dbutil" "storj.io/storj/private/dbutil/dbschema" diff --git a/private/dbutil/txutil/transactions.go b/private/dbutil/txutil/transactions.go index 3c054bf7d..989c95822 100644 --- a/private/dbutil/txutil/transactions.go +++ b/private/dbutil/txutil/transactions.go @@ -12,8 +12,8 @@ import ( "time" "github.com/lib/pq" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/storj/private/tagsql" ) diff --git a/private/lifecycle/group.go b/private/lifecycle/group.go index 5f81fed66..70bb9d2c2 100644 --- a/private/lifecycle/group.go +++ b/private/lifecycle/group.go @@ -7,10 +7,10 @@ package lifecycle import ( "context" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" "golang.org/x/sync/errgroup" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/errs2" ) diff --git a/private/post/oauth2/auth.go b/private/post/oauth2/auth.go index fc931bd4e..de0eeb723 100644 --- a/private/post/oauth2/auth.go +++ b/private/post/oauth2/auth.go @@ -14,8 +14,8 @@ import ( "sync" "time" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" - monkit "gopkg.in/spacemonkeygo/monkit.v2" ) var ( diff --git a/private/post/sender.go b/private/post/sender.go index f1adb6a4b..6b88229fa 100644 --- a/private/post/sender.go +++ b/private/post/sender.go @@ -11,8 +11,8 @@ import ( "net/mail" "net/smtp" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" - monkit "gopkg.in/spacemonkeygo/monkit.v2" ) // Address is alias of net/mail.Address diff --git a/private/version/checker/client.go b/private/version/checker/client.go index 19b0d76e5..3520b3c4b 100644 --- a/private/version/checker/client.go +++ b/private/version/checker/client.go @@ -13,8 +13,8 @@ import ( "strings" "time" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/storj/private/version" ) diff --git a/private/version/stats.go b/private/version/stats.go index 5b1422338..1089d93c2 100644 --- a/private/version/stats.go +++ b/private/version/stats.go @@ -6,19 +6,23 @@ package version import ( "hash/crc32" "sync/atomic" + + "github.com/spacemonkeygo/monkit/v3" ) // Stats implements the monkit.StatSource interface -func (info *Info) Stats(reportValue func(name string, val float64)) { +func (info *Info) Stats(cb func(key monkit.SeriesKey, field string, val float64)) { + key := monkit.NewSeriesKey("version_info") + if info.Release { - reportValue("release", 1) + cb(key, "release", 1) } else { - reportValue("release", 0) + cb(key, "release", 0) + } + if !info.Timestamp.IsZero() { + cb(key, "timestamp", float64(info.Timestamp.Unix())) } - reportValue("timestamp", float64(info.Timestamp.Unix())) - crc := atomic.LoadUint32(&info.commitHashCRC) - if crc == 0 { c := crc32.NewIEEE() _, err := c.Write([]byte(buildCommitHash)) @@ -27,9 +31,8 @@ func (info *Info) Stats(reportValue func(name string, val float64)) { } atomic.StoreUint32(&info.commitHashCRC, c.Sum32()) } - - reportValue("commit", float64(crc)) - reportValue("major", float64(info.Version.Major)) - reportValue("minor", float64(info.Version.Minor)) - reportValue("patch", float64(info.Version.Patch)) + cb(key, "commit", float64(crc)) + cb(key, "major", float64(info.Version.Major)) + cb(key, "minor", float64(info.Version.Minor)) + cb(key, "patch", float64(info.Version.Patch)) } diff --git a/satellite/accounting/live/cache.go b/satellite/accounting/live/cache.go index c92b766b5..045d91b55 100644 --- a/satellite/accounting/live/cache.go +++ b/satellite/accounting/live/cache.go @@ -6,9 +6,9 @@ package live import ( "strings" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/storj/satellite/accounting" ) diff --git a/satellite/accounting/projectusage.go b/satellite/accounting/projectusage.go index 4a9fc6d6a..4284c73b0 100644 --- a/satellite/accounting/projectusage.go +++ b/satellite/accounting/projectusage.go @@ -8,9 +8,9 @@ import ( "time" "github.com/skyrings/skyring-common/tools/uuid" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "golang.org/x/sync/errgroup" - monkit "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/memory" ) diff --git a/satellite/accounting/reportedrollup/chore.go b/satellite/accounting/reportedrollup/chore.go index cca3fe15e..c62f45ce3 100644 --- a/satellite/accounting/reportedrollup/chore.go +++ b/satellite/accounting/reportedrollup/chore.go @@ -7,9 +7,9 @@ import ( "context" "time" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/sync2" "storj.io/storj/satellite/orders" diff --git a/satellite/accounting/rollup/common.go b/satellite/accounting/rollup/common.go index efc0bc453..99fb6b952 100644 --- a/satellite/accounting/rollup/common.go +++ b/satellite/accounting/rollup/common.go @@ -4,8 +4,8 @@ package rollup import ( + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" - monkit "gopkg.in/spacemonkeygo/monkit.v2" ) // Error is a standard error class for this package. diff --git a/satellite/accounting/tally/tally.go b/satellite/accounting/tally/tally.go index 0974a7b96..ef7023a35 100644 --- a/satellite/accounting/tally/tally.go +++ b/satellite/accounting/tally/tally.go @@ -8,9 +8,9 @@ import ( "time" "github.com/skyrings/skyring-common/tools/uuid" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/pb" "storj.io/common/storj" diff --git a/satellite/api.go b/satellite/api.go index 307c1e1df..a48faf0cf 100644 --- a/satellite/api.go +++ b/satellite/api.go @@ -10,10 +10,10 @@ import ( "net/mail" "net/smtp" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" "golang.org/x/sync/errgroup" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/identity" "storj.io/common/pb" diff --git a/satellite/audit/verifier.go b/satellite/audit/verifier.go index f095f6b3e..a6b31f6f2 100644 --- a/satellite/audit/verifier.go +++ b/satellite/audit/verifier.go @@ -11,10 +11,10 @@ import ( "sync" "time" + "github.com/spacemonkeygo/monkit/v3" "github.com/vivint/infectious" "github.com/zeebo/errs" "go.uber.org/zap" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/errs2" "storj.io/common/identity" diff --git a/satellite/console/consoleweb/consoleapi/payments.go b/satellite/console/consoleweb/consoleapi/payments.go index 44266015e..6c597fff4 100644 --- a/satellite/console/consoleweb/consoleapi/payments.go +++ b/satellite/console/consoleweb/consoleapi/payments.go @@ -10,9 +10,9 @@ import ( "time" "github.com/gorilla/mux" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" - monkit "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/storj/satellite/console" ) diff --git a/satellite/console/consoleweb/server.go b/satellite/console/consoleweb/server.go index 2a5a1ec47..0f9468a7a 100644 --- a/satellite/console/consoleweb/server.go +++ b/satellite/console/consoleweb/server.go @@ -23,10 +23,10 @@ import ( "github.com/graphql-go/graphql" "github.com/graphql-go/graphql/gqlerrors" "github.com/skyrings/skyring-common/tools/uuid" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" "golang.org/x/sync/errgroup" - monkit "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/storj/pkg/auth" "storj.io/storj/satellite/console" diff --git a/satellite/console/service.go b/satellite/console/service.go index 661d2ed85..e93044ac0 100644 --- a/satellite/console/service.go +++ b/satellite/console/service.go @@ -11,10 +11,10 @@ import ( "time" "github.com/skyrings/skyring-common/tools/uuid" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" "golang.org/x/crypto/bcrypt" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/macaroon" "storj.io/common/memory" diff --git a/satellite/contact/common.go b/satellite/contact/common.go index d392ac4d8..8440dabe0 100644 --- a/satellite/contact/common.go +++ b/satellite/contact/common.go @@ -4,8 +4,8 @@ package contact import ( + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" - "gopkg.in/spacemonkeygo/monkit.v2" ) // Error is the default error class for contact package. diff --git a/satellite/core.go b/satellite/core.go index ca81e5bbd..5b10d3129 100644 --- a/satellite/core.go +++ b/satellite/core.go @@ -8,10 +8,10 @@ import ( "errors" "net" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" "golang.org/x/sync/errgroup" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/identity" "storj.io/common/pb" diff --git a/satellite/dbcleanup/chore.go b/satellite/dbcleanup/chore.go index 1de6ccd17..3a5dfcf5a 100644 --- a/satellite/dbcleanup/chore.go +++ b/satellite/dbcleanup/chore.go @@ -7,9 +7,9 @@ import ( "context" "time" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/sync2" "storj.io/storj/satellite/orders" diff --git a/satellite/downtime/common.go b/satellite/downtime/common.go index a7d171702..1764df272 100644 --- a/satellite/downtime/common.go +++ b/satellite/downtime/common.go @@ -6,7 +6,7 @@ package downtime import ( "time" - "gopkg.in/spacemonkeygo/monkit.v2" + "github.com/spacemonkeygo/monkit/v3" ) var ( diff --git a/satellite/gc/service.go b/satellite/gc/service.go index 60a5ecf0d..1e828aef6 100644 --- a/satellite/gc/service.go +++ b/satellite/gc/service.go @@ -7,9 +7,9 @@ import ( "context" "time" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" - monkit "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/bloomfilter" "storj.io/common/pb" diff --git a/satellite/gracefulexit/common.go b/satellite/gracefulexit/common.go index 6340bc25c..5770f46d7 100644 --- a/satellite/gracefulexit/common.go +++ b/satellite/gracefulexit/common.go @@ -6,8 +6,8 @@ package gracefulexit import ( "time" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" - "gopkg.in/spacemonkeygo/monkit.v2" ) var ( diff --git a/satellite/inspector/inspector.go b/satellite/inspector/inspector.go index 73c3a1106..10dd3039f 100644 --- a/satellite/inspector/inspector.go +++ b/satellite/inspector/inspector.go @@ -8,9 +8,9 @@ import ( "strconv" "github.com/skyrings/skyring-common/tools/uuid" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" - monkit "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/pb" "storj.io/common/storj" diff --git a/satellite/mailservice/service.go b/satellite/mailservice/service.go index f99a2b66b..e0e6cd042 100644 --- a/satellite/mailservice/service.go +++ b/satellite/mailservice/service.go @@ -10,8 +10,8 @@ import ( "path/filepath" "sync" + "github.com/spacemonkeygo/monkit/v3" "go.uber.org/zap" - monkit "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/storj/private/post" ) diff --git a/satellite/mailservice/simulate/linkclicker.go b/satellite/mailservice/simulate/linkclicker.go index 1f03f16c9..bb1c8a90d 100644 --- a/satellite/mailservice/simulate/linkclicker.go +++ b/satellite/mailservice/simulate/linkclicker.go @@ -9,8 +9,8 @@ import ( "regexp" "strings" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" - monkit "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/storj/private/post" "storj.io/storj/satellite/mailservice" diff --git a/satellite/metainfo/metainfo.go b/satellite/metainfo/metainfo.go index 1160948bf..1725e955d 100644 --- a/satellite/metainfo/metainfo.go +++ b/satellite/metainfo/metainfo.go @@ -13,9 +13,9 @@ import ( "github.com/gogo/protobuf/proto" "github.com/skyrings/skyring-common/tools/uuid" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" - monkit "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/errs2" "storj.io/common/identity" diff --git a/satellite/metrics/chore.go b/satellite/metrics/chore.go index df80c16ae..18ff1cd16 100644 --- a/satellite/metrics/chore.go +++ b/satellite/metrics/chore.go @@ -7,9 +7,9 @@ import ( "context" "time" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/sync2" "storj.io/storj/satellite/metainfo" diff --git a/satellite/nodestats/endpoint.go b/satellite/nodestats/endpoint.go index 55dcfb6fa..703cd6fac 100644 --- a/satellite/nodestats/endpoint.go +++ b/satellite/nodestats/endpoint.go @@ -6,8 +6,8 @@ package nodestats import ( "context" + "github.com/spacemonkeygo/monkit/v3" "go.uber.org/zap" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/identity" "storj.io/common/pb" diff --git a/satellite/orders/endpoint.go b/satellite/orders/endpoint.go index ac2e29e91..4e034f816 100644 --- a/satellite/orders/endpoint.go +++ b/satellite/orders/endpoint.go @@ -11,9 +11,9 @@ import ( "time" "github.com/skyrings/skyring-common/tools/uuid" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/identity" "storj.io/common/pb" diff --git a/satellite/overlay/config.go b/satellite/overlay/config.go index d8d843dae..3c847fb6d 100644 --- a/satellite/overlay/config.go +++ b/satellite/overlay/config.go @@ -6,8 +6,8 @@ package overlay import ( "time" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" - monkit "gopkg.in/spacemonkeygo/monkit.v2" ) var ( diff --git a/satellite/payments/mockpayments/mockpayments.go b/satellite/payments/mockpayments/mockpayments.go index 9a22610eb..3f67f5c8a 100644 --- a/satellite/payments/mockpayments/mockpayments.go +++ b/satellite/payments/mockpayments/mockpayments.go @@ -7,8 +7,8 @@ import ( "context" "github.com/skyrings/skyring-common/tools/uuid" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" - monkit "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/memory" "storj.io/storj/satellite/payments" diff --git a/satellite/payments/stripecoinpayments/service.go b/satellite/payments/stripecoinpayments/service.go index 80a9caf6c..a71251b21 100644 --- a/satellite/payments/stripecoinpayments/service.go +++ b/satellite/payments/stripecoinpayments/service.go @@ -11,11 +11,11 @@ import ( "time" "github.com/shopspring/decimal" + "github.com/spacemonkeygo/monkit/v3" "github.com/stripe/stripe-go" "github.com/stripe/stripe-go/client" "github.com/zeebo/errs" "go.uber.org/zap" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/memory" "storj.io/storj/satellite/accounting" diff --git a/satellite/peer.go b/satellite/peer.go index 5d9ebfc22..95880e536 100644 --- a/satellite/peer.go +++ b/satellite/peer.go @@ -6,7 +6,7 @@ package satellite import ( "context" - "gopkg.in/spacemonkeygo/monkit.v2" + "github.com/spacemonkeygo/monkit/v3" "storj.io/common/identity" "storj.io/storj/pkg/debug" diff --git a/satellite/referrals/service.go b/satellite/referrals/service.go index eab6a5328..c62ccc01b 100644 --- a/satellite/referrals/service.go +++ b/satellite/referrals/service.go @@ -7,10 +7,10 @@ import ( "context" "github.com/skyrings/skyring-common/tools/uuid" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" "golang.org/x/crypto/bcrypt" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/pb" "storj.io/common/rpc" diff --git a/satellite/repair/checker/checker.go b/satellite/repair/checker/checker.go index ae2282fd0..4b67c7c5d 100644 --- a/satellite/repair/checker/checker.go +++ b/satellite/repair/checker/checker.go @@ -7,10 +7,10 @@ import ( "context" "time" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" "golang.org/x/sync/errgroup" - monkit "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/errs2" "storj.io/common/pb" diff --git a/satellite/repair/irreparable/inspector.go b/satellite/repair/irreparable/inspector.go index 4a9ab3d6d..461da4860 100644 --- a/satellite/repair/irreparable/inspector.go +++ b/satellite/repair/irreparable/inspector.go @@ -6,7 +6,7 @@ package irreparable import ( "context" - monkit "gopkg.in/spacemonkeygo/monkit.v2" + "github.com/spacemonkeygo/monkit/v3" "storj.io/common/pb" ) diff --git a/satellite/repair/repairer/repairer.go b/satellite/repair/repairer/repairer.go index f43cd5ecb..098e69679 100644 --- a/satellite/repair/repairer/repairer.go +++ b/satellite/repair/repairer/repairer.go @@ -7,9 +7,9 @@ import ( "context" "time" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/memory" "storj.io/common/pb" diff --git a/satellite/repairer.go b/satellite/repairer.go index 211f9f5ca..e4237f7eb 100644 --- a/satellite/repairer.go +++ b/satellite/repairer.go @@ -8,10 +8,10 @@ import ( "errors" "net" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" "golang.org/x/sync/errgroup" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/identity" "storj.io/common/pb" diff --git a/satellite/satellitedb/dbx/gen.go b/satellite/satellitedb/dbx/gen.go index 78648f3b5..a1ac81674 100644 --- a/satellite/satellitedb/dbx/gen.go +++ b/satellite/satellitedb/dbx/gen.go @@ -7,8 +7,8 @@ import ( "context" "fmt" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" - "gopkg.in/spacemonkeygo/monkit.v2" // load our cockroach sql driver for anywhere that uses this dbx.Open _ "storj.io/storj/private/dbutil/cockroachutil" diff --git a/satellite/satellitedb/overlaycache.go b/satellite/satellitedb/overlaycache.go index e206f53ae..a9b58febe 100644 --- a/satellite/satellitedb/overlaycache.go +++ b/satellite/satellitedb/overlaycache.go @@ -13,8 +13,8 @@ import ( "time" "github.com/lib/pq" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" - monkit "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/pb" "storj.io/common/storj" diff --git a/storage/boltdb/client.go b/storage/boltdb/client.go index 9264b10ea..caa7897c4 100644 --- a/storage/boltdb/client.go +++ b/storage/boltdb/client.go @@ -10,8 +10,8 @@ import ( "time" "github.com/boltdb/bolt" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/storj/storage" ) diff --git a/storage/cockroachkv/client.go b/storage/cockroachkv/client.go index 539c13ef2..fc0d0541f 100644 --- a/storage/cockroachkv/client.go +++ b/storage/cockroachkv/client.go @@ -9,8 +9,8 @@ import ( "database/sql" "github.com/lib/pq" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/storj/private/dbutil" "storj.io/storj/private/dbutil/pgutil" diff --git a/storage/common.go b/storage/common.go index f86b22b5e..32ea68c86 100644 --- a/storage/common.go +++ b/storage/common.go @@ -8,8 +8,8 @@ import ( "context" "errors" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" - monkit "gopkg.in/spacemonkeygo/monkit.v2" ) var mon = monkit.Package() diff --git a/storage/filestore/store.go b/storage/filestore/store.go index 8e0d8bc55..865b4db01 100644 --- a/storage/filestore/store.go +++ b/storage/filestore/store.go @@ -9,9 +9,9 @@ import ( "path/filepath" "time" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/storj/storage" ) diff --git a/storage/postgreskv/client.go b/storage/postgreskv/client.go index ee7c0e782..c772dc2f5 100644 --- a/storage/postgreskv/client.go +++ b/storage/postgreskv/client.go @@ -8,8 +8,8 @@ import ( "database/sql" "github.com/lib/pq" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/storj/private/dbutil" "storj.io/storj/private/dbutil/pgutil" diff --git a/storage/redis/client.go b/storage/redis/client.go index a0c26e8bc..a23e497ee 100644 --- a/storage/redis/client.go +++ b/storage/redis/client.go @@ -12,8 +12,8 @@ import ( "time" "github.com/go-redis/redis" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" - monkit "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/storj/storage" ) diff --git a/storage/storelogger/logger.go b/storage/storelogger/logger.go index 9fa63528d..88791dedc 100644 --- a/storage/storelogger/logger.go +++ b/storage/storelogger/logger.go @@ -8,8 +8,8 @@ import ( "strconv" "sync/atomic" + "github.com/spacemonkeygo/monkit/v3" "go.uber.org/zap" - monkit "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/storj/storage" ) diff --git a/storage/teststore/store.go b/storage/teststore/store.go index f5e68d931..1d75c6af1 100644 --- a/storage/teststore/store.go +++ b/storage/teststore/store.go @@ -10,7 +10,7 @@ import ( "sort" "sync" - monkit "gopkg.in/spacemonkeygo/monkit.v2" + "github.com/spacemonkeygo/monkit/v3" "storj.io/storj/storage" ) diff --git a/storagenode/bandwidth/service.go b/storagenode/bandwidth/service.go index 4f3084f68..e3d8468f5 100644 --- a/storagenode/bandwidth/service.go +++ b/storagenode/bandwidth/service.go @@ -8,8 +8,8 @@ import ( "context" "time" + "github.com/spacemonkeygo/monkit/v3" "go.uber.org/zap" - monkit "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/sync2" ) diff --git a/storagenode/collector/service.go b/storagenode/collector/service.go index 610e8ea8d..0ea4ea08b 100644 --- a/storagenode/collector/service.go +++ b/storagenode/collector/service.go @@ -8,8 +8,8 @@ import ( "context" "time" + "github.com/spacemonkeygo/monkit/v3" "go.uber.org/zap" - monkit "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/sync2" "storj.io/storj/storagenode/pieces" diff --git a/storagenode/console/consolenotifications/notificationsapi.go b/storagenode/console/consolenotifications/notificationsapi.go index e1d024510..1ef796a0d 100644 --- a/storagenode/console/consolenotifications/notificationsapi.go +++ b/storagenode/console/consolenotifications/notificationsapi.go @@ -10,9 +10,9 @@ import ( "github.com/gorilla/mux" "github.com/skyrings/skyring-common/tools/uuid" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/storj/storagenode/notifications" ) diff --git a/storagenode/console/consoleserver/server.go b/storagenode/console/consoleserver/server.go index 3b749cda1..54ca37797 100644 --- a/storagenode/console/consoleserver/server.go +++ b/storagenode/console/consoleserver/server.go @@ -11,10 +11,10 @@ import ( "path/filepath" "github.com/gorilla/mux" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" "golang.org/x/sync/errgroup" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/storj" "storj.io/storj/storagenode/console" diff --git a/storagenode/console/service.go b/storagenode/console/service.go index bfb3415a7..cb3e8f00a 100644 --- a/storagenode/console/service.go +++ b/storagenode/console/service.go @@ -7,9 +7,9 @@ import ( "context" "time" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/memory" "storj.io/common/storj" diff --git a/storagenode/contact/service.go b/storagenode/contact/service.go index 1605ef110..6d12d848c 100644 --- a/storagenode/contact/service.go +++ b/storagenode/contact/service.go @@ -7,9 +7,9 @@ import ( "sync" "time" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/pb" "storj.io/common/sync2" diff --git a/storagenode/gracefulexit/common.go b/storagenode/gracefulexit/common.go index 346975241..5e673ec9e 100644 --- a/storagenode/gracefulexit/common.go +++ b/storagenode/gracefulexit/common.go @@ -6,8 +6,8 @@ package gracefulexit import ( "time" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/memory" ) diff --git a/storagenode/inspector/inspector.go b/storagenode/inspector/inspector.go index 3ec986c3f..7c74c3384 100644 --- a/storagenode/inspector/inspector.go +++ b/storagenode/inspector/inspector.go @@ -9,9 +9,9 @@ import ( "time" "github.com/golang/protobuf/ptypes" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/pb" "storj.io/common/rpc/rpcstatus" diff --git a/storagenode/monitor/monitor.go b/storagenode/monitor/monitor.go index c01a7634d..d0d214cb5 100644 --- a/storagenode/monitor/monitor.go +++ b/storagenode/monitor/monitor.go @@ -7,9 +7,9 @@ import ( "context" "time" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" - monkit "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/memory" "storj.io/common/pb" diff --git a/storagenode/nodestats/service.go b/storagenode/nodestats/service.go index 17f92d135..c950e7f5b 100644 --- a/storagenode/nodestats/service.go +++ b/storagenode/nodestats/service.go @@ -7,9 +7,9 @@ import ( "context" "time" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/pb" "storj.io/common/rpc" diff --git a/storagenode/notifications/service.go b/storagenode/notifications/service.go index 6ed89054a..10cf4d10b 100644 --- a/storagenode/notifications/service.go +++ b/storagenode/notifications/service.go @@ -7,8 +7,8 @@ import ( "context" "github.com/skyrings/skyring-common/tools/uuid" + "github.com/spacemonkeygo/monkit/v3" "go.uber.org/zap" - "gopkg.in/spacemonkeygo/monkit.v2" ) var ( diff --git a/storagenode/orders/service.go b/storagenode/orders/service.go index fbd751e21..2dfbec489 100644 --- a/storagenode/orders/service.go +++ b/storagenode/orders/service.go @@ -9,10 +9,10 @@ import ( "math/rand" "time" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" "golang.org/x/sync/errgroup" - monkit "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/pb" "storj.io/common/rpc" diff --git a/storagenode/peer.go b/storagenode/peer.go index 757457f23..10419437a 100644 --- a/storagenode/peer.go +++ b/storagenode/peer.go @@ -10,10 +10,10 @@ import ( "net/http" "time" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" "golang.org/x/sync/errgroup" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/identity" "storj.io/common/pb" diff --git a/storagenode/pieces/store.go b/storagenode/pieces/store.go index 82642f234..8b0682e99 100644 --- a/storagenode/pieces/store.go +++ b/storagenode/pieces/store.go @@ -9,9 +9,9 @@ import ( "os" "time" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/memory" "storj.io/common/pb" diff --git a/storagenode/piecestore/endpoint.go b/storagenode/piecestore/endpoint.go index 199301549..98a37009c 100644 --- a/storagenode/piecestore/endpoint.go +++ b/storagenode/piecestore/endpoint.go @@ -11,10 +11,10 @@ import ( "sync/atomic" "time" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" "golang.org/x/sync/errgroup" - monkit "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/bloomfilter" "storj.io/common/errs2" diff --git a/storagenode/preflight/common.go b/storagenode/preflight/common.go index 5332b3de2..697781134 100644 --- a/storagenode/preflight/common.go +++ b/storagenode/preflight/common.go @@ -4,7 +4,7 @@ package preflight import ( - "gopkg.in/spacemonkeygo/monkit.v2" + "github.com/spacemonkeygo/monkit/v3" ) var mon = monkit.Package() diff --git a/storagenode/retain/retain.go b/storagenode/retain/retain.go index 721b703ac..cc83a4efa 100644 --- a/storagenode/retain/retain.go +++ b/storagenode/retain/retain.go @@ -9,10 +9,10 @@ import ( "sync" "time" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" "golang.org/x/sync/errgroup" - monkit "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/bloomfilter" "storj.io/common/storj" diff --git a/storagenode/storagenodedb/database.go b/storagenode/storagenodedb/database.go index 130943a8d..e4d2c6283 100644 --- a/storagenode/storagenodedb/database.go +++ b/storagenode/storagenodedb/database.go @@ -12,9 +12,9 @@ import ( "github.com/google/go-cmp/cmp" _ "github.com/mattn/go-sqlite3" // used indirectly. + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" - "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/storj/private/dbutil" "storj.io/storj/private/dbutil/sqliteutil" diff --git a/storagenode/trust/service.go b/storagenode/trust/service.go index a5b23f6fd..adfb3e148 100644 --- a/storagenode/trust/service.go +++ b/storagenode/trust/service.go @@ -10,9 +10,9 @@ import ( "sync" "time" + "github.com/spacemonkeygo/monkit/v3" "github.com/zeebo/errs" "go.uber.org/zap" - monkit "gopkg.in/spacemonkeygo/monkit.v2" "storj.io/common/identity" "storj.io/common/rpc"