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
This commit is contained in:
Jeff Wendling 2019-11-08 13:40:39 -07:00
parent 17580fdf57
commit 7999d24f81
96 changed files with 328 additions and 166 deletions

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -8,7 +8,7 @@ import (
"sync"
"time"
"github.com/zeebo/admission/admproto"
"github.com/zeebo/admission/v2/admproto"
"storj.io/common/memory"
)

156
cmd/statreceiver/influx.go Normal file
View File

@ -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)
}
}
}

View File

@ -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),

View File

@ -8,7 +8,7 @@ import (
"sync"
"time"
"github.com/zeebo/admission/admproto"
"github.com/zeebo/admission/v2/admproto"
"storj.io/common/memory"
)

View File

@ -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"

19
go.mod
View File

@ -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
)

43
go.sum
View File

@ -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=

View File

@ -4,8 +4,8 @@
package uplink
import (
"github.com/spacemonkeygo/monkit/v3"
"github.com/zeebo/errs"
monkit "gopkg.in/spacemonkeygo/monkit.v2"
)
var (

View File

@ -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"

View File

@ -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() {

View File

@ -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)
})
}

View File

@ -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"

View File

@ -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"
)

View File

@ -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"

View File

@ -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
}

View File

@ -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"

View File

@ -4,8 +4,8 @@
package server
import (
"github.com/spacemonkeygo/monkit/v3"
"github.com/zeebo/errs"
monkit "gopkg.in/spacemonkeygo/monkit.v2"
)
var (

View File

@ -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 (

View File

@ -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) {

View File

@ -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"
)

View File

@ -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 (

View File

@ -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
}

View File

@ -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

View File

@ -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"

View File

@ -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)
}))
}

View File

@ -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"

View File

@ -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"
)

View File

@ -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"
)

View File

@ -14,8 +14,8 @@ import (
"sync"
"time"
"github.com/spacemonkeygo/monkit/v3"
"github.com/zeebo/errs"
monkit "gopkg.in/spacemonkeygo/monkit.v2"
)
var (

View File

@ -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

View File

@ -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"
)

View File

@ -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))
}

View File

@ -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"
)

View File

@ -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"
)

View File

@ -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"

View File

@ -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.

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"
)

View File

@ -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"

View File

@ -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"

View File

@ -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.

View File

@ -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"

View File

@ -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"

View File

@ -6,7 +6,7 @@ package downtime
import (
"time"
"gopkg.in/spacemonkeygo/monkit.v2"
"github.com/spacemonkeygo/monkit/v3"
)
var (

View File

@ -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"

View File

@ -6,8 +6,8 @@ package gracefulexit
import (
"time"
"github.com/spacemonkeygo/monkit/v3"
"github.com/zeebo/errs"
"gopkg.in/spacemonkeygo/monkit.v2"
)
var (

View File

@ -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"

View File

@ -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"
)

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -6,8 +6,8 @@ package overlay
import (
"time"
"github.com/spacemonkeygo/monkit/v3"
"github.com/zeebo/errs"
monkit "gopkg.in/spacemonkeygo/monkit.v2"
)
var (

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -6,7 +6,7 @@ package irreparable
import (
"context"
monkit "gopkg.in/spacemonkeygo/monkit.v2"
"github.com/spacemonkeygo/monkit/v3"
"storj.io/common/pb"
)

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"
)

View File

@ -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"

View File

@ -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()

View File

@ -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"
)

View File

@ -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"

View File

@ -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"
)

View File

@ -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"
)

View File

@ -10,7 +10,7 @@ import (
"sort"
"sync"
monkit "gopkg.in/spacemonkeygo/monkit.v2"
"github.com/spacemonkeygo/monkit/v3"
"storj.io/storj/storage"
)

View File

@ -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"
)

View File

@ -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"

View File

@ -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"
)

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"
)

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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 (

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -4,7 +4,7 @@
package preflight
import (
"gopkg.in/spacemonkeygo/monkit.v2"
"github.com/spacemonkeygo/monkit/v3"
)
var mon = monkit.Package()

View File

@ -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"

View File

@ -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"

View File

@ -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"