From 167cbf31b1d7ee23bd60f70b5fdb7686fb6c70d4 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Sun, 20 Mar 2022 23:32:28 +0200 Subject: [PATCH 01/63] Pmm-5680 store logs --- agents/process/process.go | 7 ++++-- agents/process/process_child.go | 3 ++- main.go | 7 ++++-- storelogs/main.go | 38 +++++++++++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 storelogs/main.go diff --git a/agents/process/process.go b/agents/process/process.go index f25cc2636..f3d2aa390 100644 --- a/agents/process/process.go +++ b/agents/process/process.go @@ -17,6 +17,7 @@ package process import ( + "container/ring" "context" "fmt" "os/exec" @@ -60,7 +61,7 @@ type Process struct { changes chan inventorypb.AgentStatus backoff *backoff.Backoff ctxDone chan struct{} - + savelog *ring.Ring // recreated on each restart cmd *exec.Cmd cmdDone chan struct{} @@ -87,7 +88,7 @@ func (p *Params) String() string { } // New creates new process. -func New(params *Params, redactWords []string, l *logrus.Entry) *Process { +func New(params *Params, redactWords []string, l *logrus.Entry, rl *ring.Ring) *Process { return &Process{ params: params, l: l, @@ -95,6 +96,7 @@ func New(params *Params, redactWords []string, l *logrus.Entry) *Process { changes: make(chan inventorypb.AgentStatus, 10), backoff: backoff.New(backoffMinDelay, backoffMaxDelay), ctxDone: make(chan struct{}), + savelog: rl, } } @@ -209,6 +211,7 @@ func (p *Process) toStopping() { // nothing case <-t.C: p.l.Warnf("Process: still alive after %s, sending SIGKILL...", killT) + if err := p.cmd.Process.Signal(unix.SIGKILL); err != nil { p.l.Errorf("Process: failed to send SIGKILL: %s.", err) } diff --git a/agents/process/process_child.go b/agents/process/process_child.go index ca060e86a..734be28e0 100644 --- a/agents/process/process_child.go +++ b/agents/process/process_child.go @@ -39,8 +39,9 @@ func main() { logger := logrus.New() logger.SetOutput(ioutil.Discard) l := logrus.NewEntry(logger) + ringLogs := ring.New(30) - p := process.New(&process.Params{Path: "sleep", Args: []string{"100500"}}, nil, l) + p := process.New(&process.Params{Path: "sleep", Args: []string{"100500"}}, nil, l, ringLogs) go p.Run(context.Background()) // Wait until the process is running. diff --git a/main.go b/main.go index 9d6193045..f0f54db98 100644 --- a/main.go +++ b/main.go @@ -16,9 +16,12 @@ package main import ( + "container/ring" "fmt" + "github.com/percona/pmm-agent/storelogs" "path/filepath" "runtime" + "time" "github.com/percona/pmm/version" "github.com/sirupsen/logrus" @@ -33,7 +36,7 @@ func main() { if version.Version == "" { panic("pmm-agent version is not set during build.") } - + time.Sleep(time.Second * 30) // we don't have configuration options for formatter, so set it once there logrus.SetFormatter(&logrus.TextFormatter{ // Enable multiline-friendly formatter in both development (with terminal) and production (without terminal): @@ -63,7 +66,7 @@ func main() { kingpin.HelpFlag = app.HelpFlag kingpin.HelpCommand = app.HelpCommand cmd := kingpin.Parse() - + storelogs.Logs.MapLogs = make(map[string]*ring.Ring) switch cmd { case "run": // delay logger configuration until we read configuration file diff --git a/storelogs/main.go b/storelogs/main.go new file mode 100644 index 000000000..b988c3a1a --- /dev/null +++ b/storelogs/main.go @@ -0,0 +1,38 @@ +package storelogs + +import ( + "container/ring" + "fmt" +) + +type LogsStore struct { + MapLogs map[string]*ring.Ring +} + +func (l *LogsStore) SetUp(exporter string, countLogs int) { + l.MapLogs[exporter] = ring.New(countLogs) +} + +func (l *LogsStore) LenLogs(exporter string) int { + r, ok := l.MapLogs[exporter] + if !ok { + return 0 + } + return r.Len() +} + +func (l *LogsStore) SaveLog(exporter string, log string) { + l.MapLogs[exporter].Value = log + l.MapLogs[exporter] = l.MapLogs[exporter].Next() +} + +func (l *LogsStore) GetLogs(exporter string) []string { + var logs []string + l.MapLogs[exporter].Do(func(p interface{}) { + log := fmt.Sprint(p) + logs = append(logs, log) + }) + return logs +} + +var Logs = new(LogsStore) From 29764ccdde4a0a2e8762f499aa0e2a550a0060e5 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Wed, 23 Mar 2022 23:59:37 +0200 Subject: [PATCH 02/63] Pmm-5680 store logs --- agents/process/process.go | 24 ++++++++++++--- agents/supervisor/supervisor.go | 6 ++-- main.go | 3 -- storelogs/main.go | 53 +++++++++++++++++++-------------- 4 files changed, 54 insertions(+), 32 deletions(-) diff --git a/agents/process/process.go b/agents/process/process.go index f3d2aa390..6fb52cfd6 100644 --- a/agents/process/process.go +++ b/agents/process/process.go @@ -17,9 +17,9 @@ package process import ( - "container/ring" "context" "fmt" + "github.com/percona/pmm-agent/storelogs" "os/exec" "strings" "time" @@ -61,7 +61,7 @@ type Process struct { changes chan inventorypb.AgentStatus backoff *backoff.Backoff ctxDone chan struct{} - savelog *ring.Ring + savelog *storelogs.LogsStore // recreated on each restart cmd *exec.Cmd cmdDone chan struct{} @@ -88,7 +88,8 @@ func (p *Params) String() string { } // New creates new process. -func New(params *Params, redactWords []string, l *logrus.Entry, rl *ring.Ring) *Process { +//func New(params *Params, redactWords []string, l *logrus.Entry) *Process { +func New(params *Params, redactWords []string, l *logrus.Entry, rl *storelogs.LogsStore) *Process { return &Process{ params: params, l: l, @@ -106,6 +107,9 @@ func (p *Process) Run(ctx context.Context) { <-ctx.Done() p.l.Infof("Process: context canceled.") + p.savelog.SaveLog("Process: context canceled.") + //p.l.Data + close(p.ctxDone) } @@ -113,6 +117,7 @@ func (p *Process) Run(ctx context.Context) { // STARTING -> WAITING func (p *Process) toStarting() { p.l.Tracef("Process: starting.") + p.savelog.SaveLog("Process: starting.") p.changes <- inventorypb.AgentStatus_STARTING p.cmd = exec.Command(p.params.Path, p.params.Args...) //nolint:gosec @@ -131,6 +136,7 @@ func (p *Process) toStarting() { if err := p.cmd.Start(); err != nil { p.l.Warnf("Process: failed to start: %s.", err) + p.savelog.SaveLog(fmt.Sprintf("Process: failed to start: %s.", err)) go p.toWaiting() return } @@ -148,6 +154,7 @@ func (p *Process) toStarting() { go p.toRunning() case <-p.cmdDone: p.l.Warnf("Process: exited early: %s.", p.cmd.ProcessState) + p.savelog.SaveLog(fmt.Sprintf("Process: exited early: %s.", p.cmd.ProcessState)) go p.toWaiting() } } @@ -156,6 +163,7 @@ func (p *Process) toStarting() { // RUNNING -> WAITING func (p *Process) toRunning() { p.l.Tracef("Process: running.") + p.savelog.SaveLog("Process: running.") p.changes <- inventorypb.AgentStatus_RUNNING p.backoff.Reset() @@ -165,6 +173,7 @@ func (p *Process) toRunning() { go p.toStopping() case <-p.cmdDone: p.l.Warnf("Process: exited: %s.", p.cmd.ProcessState) + p.savelog.SaveLog(fmt.Sprintf("Process: exited: %s.", p.cmd.ProcessState)) go p.toWaiting() } } @@ -175,6 +184,8 @@ func (p *Process) toWaiting() { delay := p.backoff.Delay() p.l.Infof("Process: waiting %s.", delay) + p.savelog.SaveLog(fmt.Sprintf("Process: waiting %s.", delay)) + p.changes <- inventorypb.AgentStatus_WAITING t := time.NewTimer(delay) @@ -186,6 +197,7 @@ func (p *Process) toWaiting() { _, err := p.params.TemplateRenderer.RenderFiles(p.params.TemplateParams) if err != nil { p.l.Warnf("Process: failed to regenerate config in %s.", p.params.TemplateRenderer.TempDir) + p.savelog.SaveLog(fmt.Sprintf("Process: failed to regenerate config in %s.", p.params.TemplateRenderer.TempDir)) } } @@ -198,10 +210,12 @@ func (p *Process) toWaiting() { // STOPPING -> DONE func (p *Process) toStopping() { p.l.Tracef("Process: stopping (sending SIGTERM)...") + p.savelog.SaveLog("Process: stopping (sending SIGTERM)...") p.changes <- inventorypb.AgentStatus_STOPPING if err := p.cmd.Process.Signal(unix.SIGTERM); err != nil { p.l.Errorf("Process: failed to send SIGTERM: %s.", err) + p.savelog.SaveLog(fmt.Sprintf("Process: failed to send SIGTERM: %s.", err)) } t := time.NewTimer(killT) @@ -211,14 +225,16 @@ func (p *Process) toStopping() { // nothing case <-t.C: p.l.Warnf("Process: still alive after %s, sending SIGKILL...", killT) - + p.savelog.SaveLog(fmt.Sprintf("Process: still alive after %s, sending SIGKILL...", killT)) if err := p.cmd.Process.Signal(unix.SIGKILL); err != nil { p.l.Errorf("Process: failed to send SIGKILL: %s.", err) + p.savelog.SaveLog(fmt.Sprintf("Process: failed to send SIGKILL: %s.", err)) } <-p.cmdDone } p.l.Infof("Process: exited: %s.", p.cmd.ProcessState) + p.savelog.SaveLog(fmt.Sprintf("Process: exited: %s.", p.cmd.ProcessState)) go p.toDone() } diff --git a/agents/supervisor/supervisor.go b/agents/supervisor/supervisor.go index 8b67c84cb..ef8a5b5e8 100644 --- a/agents/supervisor/supervisor.go +++ b/agents/supervisor/supervisor.go @@ -19,6 +19,7 @@ package supervisor import ( "context" "fmt" + "github.com/percona/pmm-agent/storelogs" "path/filepath" "regexp" "runtime/pprof" @@ -345,8 +346,9 @@ func (s *Supervisor) startProcess(agentID string, agentProcess *agentpb.SetState "type": agentType, }) l.Debugf("Starting: %s.", processParams) - - process := process.New(processParams, agentProcess.RedactWords, l) + ringLog := new(storelogs.LogsStore) + ringLog.SetUp(100, l) + process := process.New(processParams, agentProcess.RedactWords, l, ringLog) go pprof.Do(ctx, pprof.Labels("agentID", agentID, "type", agentType), process.Run) done := make(chan struct{}) diff --git a/main.go b/main.go index f0f54db98..343b573a7 100644 --- a/main.go +++ b/main.go @@ -16,9 +16,7 @@ package main import ( - "container/ring" "fmt" - "github.com/percona/pmm-agent/storelogs" "path/filepath" "runtime" "time" @@ -66,7 +64,6 @@ func main() { kingpin.HelpFlag = app.HelpFlag kingpin.HelpCommand = app.HelpCommand cmd := kingpin.Parse() - storelogs.Logs.MapLogs = make(map[string]*ring.Ring) switch cmd { case "run": // delay logger configuration until we read configuration file diff --git a/storelogs/main.go b/storelogs/main.go index b988c3a1a..35e9908f4 100644 --- a/storelogs/main.go +++ b/storelogs/main.go @@ -3,36 +3,43 @@ package storelogs import ( "container/ring" "fmt" + "github.com/sirupsen/logrus" ) type LogsStore struct { - MapLogs map[string]*ring.Ring + log *ring.Ring + entry *logrus.Entry } -func (l *LogsStore) SetUp(exporter string, countLogs int) { - l.MapLogs[exporter] = ring.New(countLogs) +func (l *LogsStore) SetUp(countLogs int, entry *logrus.Entry) { + l.log = ring.New(countLogs) + l.entry = entry } -func (l *LogsStore) LenLogs(exporter string) int { - r, ok := l.MapLogs[exporter] - if !ok { - return 0 - } - return r.Len() -} +//func (l *LogsStore) LenLogs(exporter string) int { +// r, ok := l.MapLogs[exporter] +// if !ok { +// return 0 +// } +// return r.Len() +//} -func (l *LogsStore) SaveLog(exporter string, log string) { - l.MapLogs[exporter].Value = log - l.MapLogs[exporter] = l.MapLogs[exporter].Next() -} - -func (l *LogsStore) GetLogs(exporter string) []string { - var logs []string - l.MapLogs[exporter].Do(func(p interface{}) { - log := fmt.Sprint(p) - logs = append(logs, log) - }) - return logs +func (l *LogsStore) SaveLog(log string) { + log = l.entry.Level.String() + ": " + log + for _, v := range l.entry.Data { + log = log + fmt.Sprintf(" %v", v) + } + l.log.Value = log + l.log = l.log.Next() + //l.MapLogs[exporter].Value = log + //l.MapLogs[exporter] = l.MapLogs[exporter].Next() } -var Logs = new(LogsStore) +//func (l *LogsStore) GetLogs(exporter string) []string { +// var logs []string +// l.MapLogs[exporter].Do(func(p interface{}) { +// log := fmt.Sprint(p) +// logs = append(logs, log) +// }) +// return logs +//} From b673eaaa19d9a6763fc77121801372d64192f6e2 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Sun, 27 Mar 2022 20:21:22 +0300 Subject: [PATCH 03/63] Pmm-5680 store logs --- agents/supervisor/supervisor.go | 3 +++ storelogs/main.go | 16 ++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/agents/supervisor/supervisor.go b/agents/supervisor/supervisor.go index ef8a5b5e8..a0894f4b2 100644 --- a/agents/supervisor/supervisor.go +++ b/agents/supervisor/supervisor.go @@ -71,6 +71,7 @@ type agentProcessInfo struct { done <-chan struct{} // closes when Process.Changes() channel closes requestedState *agentpb.SetStateRequest_AgentProcess listenPort uint16 + logs *storelogs.LogsStore //store logs } // builtinAgentInfo describes built-in Agent. @@ -120,6 +121,7 @@ func (s *Supervisor) AgentsList() []*agentlocalpb.AgentInfo { res := make([]*agentlocalpb.AgentInfo, 0, len(s.agentProcesses)+len(s.builtinAgents)) for id, agent := range s.agentProcesses { + fmt.Printf("%+v", agent.logs.GetLogs()) info := &agentlocalpb.AgentInfo{ AgentId: id, AgentType: agent.requestedState.Type, @@ -370,6 +372,7 @@ func (s *Supervisor) startProcess(agentID string, agentProcess *agentpb.SetState done: done, requestedState: proto.Clone(agentProcess).(*agentpb.SetStateRequest_AgentProcess), listenPort: port, + logs: ringLog, } return nil } diff --git a/storelogs/main.go b/storelogs/main.go index 35e9908f4..71f8ea524 100644 --- a/storelogs/main.go +++ b/storelogs/main.go @@ -35,11 +35,11 @@ func (l *LogsStore) SaveLog(log string) { //l.MapLogs[exporter] = l.MapLogs[exporter].Next() } -//func (l *LogsStore) GetLogs(exporter string) []string { -// var logs []string -// l.MapLogs[exporter].Do(func(p interface{}) { -// log := fmt.Sprint(p) -// logs = append(logs, log) -// }) -// return logs -//} +func (l *LogsStore) GetLogs() []string { + var logs []string + l.log.Do(func(p interface{}) { + log := fmt.Sprint(p) + logs = append(logs, log) + }) + return logs +} From 9eda60e85d9b0dc96952a62eec267ff7cf117dc1 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Sun, 27 Mar 2022 23:33:17 +0300 Subject: [PATCH 04/63] Pmm-5680 store logs --- agents/supervisor/supervisor.go | 5 +++-- storelogs/main.go | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/agents/supervisor/supervisor.go b/agents/supervisor/supervisor.go index a0894f4b2..bccc5c172 100644 --- a/agents/supervisor/supervisor.go +++ b/agents/supervisor/supervisor.go @@ -121,7 +121,8 @@ func (s *Supervisor) AgentsList() []*agentlocalpb.AgentInfo { res := make([]*agentlocalpb.AgentInfo, 0, len(s.agentProcesses)+len(s.builtinAgents)) for id, agent := range s.agentProcesses { - fmt.Printf("%+v", agent.logs.GetLogs()) + logs := agent.logs.GetLogs() + fmt.Printf("%v", logs) info := &agentlocalpb.AgentInfo{ AgentId: id, AgentType: agent.requestedState.Type, @@ -349,7 +350,7 @@ func (s *Supervisor) startProcess(agentID string, agentProcess *agentpb.SetState }) l.Debugf("Starting: %s.", processParams) ringLog := new(storelogs.LogsStore) - ringLog.SetUp(100, l) + ringLog.SetUp(5, l) process := process.New(processParams, agentProcess.RedactWords, l, ringLog) go pprof.Do(ctx, pprof.Labels("agentID", agentID, "type", agentType), process.Run) diff --git a/storelogs/main.go b/storelogs/main.go index 71f8ea524..f7d48ea16 100644 --- a/storelogs/main.go +++ b/storelogs/main.go @@ -39,7 +39,9 @@ func (l *LogsStore) GetLogs() []string { var logs []string l.log.Do(func(p interface{}) { log := fmt.Sprint(p) - logs = append(logs, log) + if p != nil { + logs = append(logs, log) + } }) return logs } From a6faa0bd147b5cbfafaae680cecf6b4fa60b5974 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Sat, 2 Apr 2022 16:53:16 +0300 Subject: [PATCH 05/63] Pmm-5680 store logs --- agentlocal/agent_local.go | 5 +++++ agents/supervisor/supervisor.go | 15 +++++++++++-- client/client.go | 38 ++++++++++++++++----------------- docker-compose.yml | 32 +++++++++++++-------------- main.go | 7 ++---- storelogs/main.go | 13 ++++------- 6 files changed, 59 insertions(+), 51 deletions(-) diff --git a/agentlocal/agent_local.go b/agentlocal/agent_local.go index 268b4761d..4fd29035e 100644 --- a/agentlocal/agent_local.go +++ b/agentlocal/agent_local.go @@ -63,6 +63,11 @@ type Server struct { reloadCloseOnce sync.Once } +func (s *Server) mustEmbedUnimplementedAgentLocalServer() { + //TODO implement me + panic("implement me") +} + // NewServer creates new server. // // Caller should call Run. diff --git a/agents/supervisor/supervisor.go b/agents/supervisor/supervisor.go index bccc5c172..32aff310d 100644 --- a/agents/supervisor/supervisor.go +++ b/agents/supervisor/supervisor.go @@ -122,12 +122,13 @@ func (s *Supervisor) AgentsList() []*agentlocalpb.AgentInfo { for id, agent := range s.agentProcesses { logs := agent.logs.GetLogs() - fmt.Printf("%v", logs) + //fmt.Printf("%v", logs) info := &agentlocalpb.AgentInfo{ AgentId: id, AgentType: agent.requestedState.Type, Status: s.lastStatuses[id], ListenPort: uint32(agent.listenPort), + Logs: logs, } res = append(res, info) } @@ -145,6 +146,16 @@ func (s *Supervisor) AgentsList() []*agentlocalpb.AgentInfo { return res } +//func (s *Supervisor) AgentsLogs() (res []*agentlocalpb.AgentLogs) { +// for id, agent := range s.agentProcesses { +// +// logs := agent.logs.GetLogs() +// fmt.Printf("%v", logs) +// res = append(res, ag) +// } +// return +//} + // Changes returns channel with Agent's state changes. func (s *Supervisor) Changes() <-chan *agentpb.StateChangedRequest { return s.changes @@ -350,7 +361,7 @@ func (s *Supervisor) startProcess(agentID string, agentProcess *agentpb.SetState }) l.Debugf("Starting: %s.", processParams) ringLog := new(storelogs.LogsStore) - ringLog.SetUp(5, l) + ringLog.SetUp(30, l) process := process.New(processParams, agentProcess.RedactWords, l, ringLog) go pprof.Do(ctx, pprof.Labels("agentID", agentID, "type", agentType), process.Run) diff --git a/client/client.go b/client/client.go index 0d3c6751f..247c4fac3 100644 --- a/client/client.go +++ b/client/client.go @@ -363,25 +363,25 @@ func (c *Client) processChannelRequests(ctx context.Context) { TempDir: c.cfg.Paths.TempDir, }) - case *agentpb.StartActionRequest_MongodbQueryReplsetgetstatusParams: - action = actions.NewMongoDBQueryAdmincommandAction(actions.MongoDBQueryAdmincommandActionParams{ - ID: p.ActionId, - DSN: params.MongodbQueryReplsetgetstatusParams.Dsn, - Files: params.MongodbQueryReplsetgetstatusParams.TextFiles, - Command: "replSetGetStatus", - Arg: 1, - TempDir: c.cfg.Paths.TempDir, - }) - - case *agentpb.StartActionRequest_MongodbQueryGetdiagnosticdataParams: - action = actions.NewMongoDBQueryAdmincommandAction(actions.MongoDBQueryAdmincommandActionParams{ - ID: p.ActionId, - DSN: params.MongodbQueryGetdiagnosticdataParams.Dsn, - Files: params.MongodbQueryGetdiagnosticdataParams.TextFiles, - Command: "getDiagnosticData", - Arg: 1, - TempDir: c.cfg.Paths.TempDir, - }) + //case *agentpb.StartActionRequest_MongodbQueryReplsetgetstatusParams: + // action = actions.NewMongoDBQueryAdmincommandAction(actions.MongoDBQueryAdmincommandActionParams{ + // ID: p.ActionId, + // DSN: params.MongodbQueryReplsetgetstatusParams.Dsn, + // Files: params.MongodbQueryReplsetgetstatusParams.TextFiles, + // Command: "replSetGetStatus", + // Arg: 1, + // TempDir: c.cfg.Paths.TempDir, + // }) + // + //case *agentpb.StartActionRequest_MongodbQueryGetdiagnosticdataParams: + // action = actions.NewMongoDBQueryAdmincommandAction(actions.MongoDBQueryAdmincommandActionParams{ + // ID: p.ActionId, + // DSN: params.MongodbQueryGetdiagnosticdataParams.Dsn, + // Files: params.MongodbQueryGetdiagnosticdataParams.TextFiles, + // Command: "getDiagnosticData", + // Arg: 1, + // TempDir: c.cfg.Paths.TempDir, + // }) case *agentpb.StartActionRequest_PtSummaryParams: action = actions.NewProcessAction(p.ActionId, c.cfg.Paths.PTSummary, []string{}) diff --git a/docker-compose.yml b/docker-compose.yml index 6477bd61c..84b73d607 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,22 +2,22 @@ version: '3.7' services: - pmm-server: - image: ${PMM_SERVER_IMAGE:-perconalab/pmm-server:dev-latest} - container_name: pmm-agent_pmm-server - ports: - - "127.0.0.1:80:80" - - "127.0.0.1:443:443" - environment: - - PMM_DEBUG=1 - - PERCONA_TEST_CHECKS_INTERVAL=10s - # for local development - - PERCONA_TEST_CHECKS_FILE=/srv/checks/custom-checks.yml - # for check-dev - # - PERCONA_TEST_SAAS_HOST=check-dev.percona.com:443 - # - PERCONA_TEST_CHECKS_PUBLIC_KEY=RWTg+ZmCCjt7O8eWeAmTLAqW+1ozUbpRSKSwNTmO+exlS5KEIPYWuYdX - volumes: - - ./testdata/checks:/srv/checks +# pmm-server: +# image: ${PMM_SERVER_IMAGE:-perconalab/pmm-server:dev-latest} +# container_name: pmm-agent_pmm-server +# ports: +# - "127.0.0.1:80:80" +# - "127.0.0.1:443:443" +# environment: +# - PMM_DEBUG=1 +# - PERCONA_TEST_CHECKS_INTERVAL=10s +# # for local development +# - PERCONA_TEST_CHECKS_FILE=/srv/checks/custom-checks.yml +# # for check-dev +# # - PERCONA_TEST_SAAS_HOST=check-dev.percona.com:443 +# # - PERCONA_TEST_CHECKS_PUBLIC_KEY=RWTg+ZmCCjt7O8eWeAmTLAqW+1ozUbpRSKSwNTmO+exlS5KEIPYWuYdX +# volumes: +# - ./testdata/checks:/srv/checks test_db: image: aleksi/test_db:1.1.0 diff --git a/main.go b/main.go index 343b573a7..f93c5af58 100644 --- a/main.go +++ b/main.go @@ -17,13 +17,11 @@ package main import ( "fmt" - "path/filepath" - "runtime" - "time" - "github.com/percona/pmm/version" "github.com/sirupsen/logrus" "gopkg.in/alecthomas/kingpin.v2" + "path/filepath" + "runtime" "github.com/percona/pmm-agent/commands" "github.com/percona/pmm-agent/config" @@ -34,7 +32,6 @@ func main() { if version.Version == "" { panic("pmm-agent version is not set during build.") } - time.Sleep(time.Second * 30) // we don't have configuration options for formatter, so set it once there logrus.SetFormatter(&logrus.TextFormatter{ // Enable multiline-friendly formatter in both development (with terminal) and production (without terminal): diff --git a/storelogs/main.go b/storelogs/main.go index f7d48ea16..5e071e312 100644 --- a/storelogs/main.go +++ b/storelogs/main.go @@ -4,6 +4,7 @@ import ( "container/ring" "fmt" "github.com/sirupsen/logrus" + "time" ) type LogsStore struct { @@ -16,16 +17,10 @@ func (l *LogsStore) SetUp(countLogs int, entry *logrus.Entry) { l.entry = entry } -//func (l *LogsStore) LenLogs(exporter string) int { -// r, ok := l.MapLogs[exporter] -// if !ok { -// return 0 -// } -// return r.Len() -//} - func (l *LogsStore) SaveLog(log string) { - log = l.entry.Level.String() + ": " + log + dt := time.Now() + dt.Format("01-02-2006 15:04:05") + log = dt.Format("01-02-2006 15:04:05") + " " + l.entry.Level.String() + ": " + log for _, v := range l.entry.Data { log = log + fmt.Sprintf(" %v", v) } From 6f615093598eea1cff56a407fd6f8b0b3d541222 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Sat, 2 Apr 2022 17:52:35 +0300 Subject: [PATCH 06/63] Pmm-5680 store logs --- agents/process/process.go | 8 +- agents/supervisor/supervisor.go | 11 -- client/client.go | 38 ++-- docker-compose.yml | 32 ++-- go.mod | 32 ++-- go.sum | 323 ++++++++++++++++++++++++++++++++ main.go | 5 +- storelogs/main.go | 5 +- 8 files changed, 380 insertions(+), 74 deletions(-) diff --git a/agents/process/process.go b/agents/process/process.go index 6fb52cfd6..61daddc39 100644 --- a/agents/process/process.go +++ b/agents/process/process.go @@ -88,8 +88,7 @@ func (p *Params) String() string { } // New creates new process. -//func New(params *Params, redactWords []string, l *logrus.Entry) *Process { -func New(params *Params, redactWords []string, l *logrus.Entry, rl *storelogs.LogsStore) *Process { +func New(params *Params, redactWords []string, l *logrus.Entry, sl *storelogs.LogsStore) *Process { return &Process{ params: params, l: l, @@ -97,7 +96,7 @@ func New(params *Params, redactWords []string, l *logrus.Entry, rl *storelogs.Lo changes: make(chan inventorypb.AgentStatus, 10), backoff: backoff.New(backoffMinDelay, backoffMaxDelay), ctxDone: make(chan struct{}), - savelog: rl, + savelog: sl, } } @@ -108,8 +107,6 @@ func (p *Process) Run(ctx context.Context) { <-ctx.Done() p.l.Infof("Process: context canceled.") p.savelog.SaveLog("Process: context canceled.") - //p.l.Data - close(p.ctxDone) } @@ -185,7 +182,6 @@ func (p *Process) toWaiting() { p.l.Infof("Process: waiting %s.", delay) p.savelog.SaveLog(fmt.Sprintf("Process: waiting %s.", delay)) - p.changes <- inventorypb.AgentStatus_WAITING t := time.NewTimer(delay) diff --git a/agents/supervisor/supervisor.go b/agents/supervisor/supervisor.go index 32aff310d..6704de96b 100644 --- a/agents/supervisor/supervisor.go +++ b/agents/supervisor/supervisor.go @@ -122,7 +122,6 @@ func (s *Supervisor) AgentsList() []*agentlocalpb.AgentInfo { for id, agent := range s.agentProcesses { logs := agent.logs.GetLogs() - //fmt.Printf("%v", logs) info := &agentlocalpb.AgentInfo{ AgentId: id, AgentType: agent.requestedState.Type, @@ -146,16 +145,6 @@ func (s *Supervisor) AgentsList() []*agentlocalpb.AgentInfo { return res } -//func (s *Supervisor) AgentsLogs() (res []*agentlocalpb.AgentLogs) { -// for id, agent := range s.agentProcesses { -// -// logs := agent.logs.GetLogs() -// fmt.Printf("%v", logs) -// res = append(res, ag) -// } -// return -//} - // Changes returns channel with Agent's state changes. func (s *Supervisor) Changes() <-chan *agentpb.StateChangedRequest { return s.changes diff --git a/client/client.go b/client/client.go index 247c4fac3..0d3c6751f 100644 --- a/client/client.go +++ b/client/client.go @@ -363,25 +363,25 @@ func (c *Client) processChannelRequests(ctx context.Context) { TempDir: c.cfg.Paths.TempDir, }) - //case *agentpb.StartActionRequest_MongodbQueryReplsetgetstatusParams: - // action = actions.NewMongoDBQueryAdmincommandAction(actions.MongoDBQueryAdmincommandActionParams{ - // ID: p.ActionId, - // DSN: params.MongodbQueryReplsetgetstatusParams.Dsn, - // Files: params.MongodbQueryReplsetgetstatusParams.TextFiles, - // Command: "replSetGetStatus", - // Arg: 1, - // TempDir: c.cfg.Paths.TempDir, - // }) - // - //case *agentpb.StartActionRequest_MongodbQueryGetdiagnosticdataParams: - // action = actions.NewMongoDBQueryAdmincommandAction(actions.MongoDBQueryAdmincommandActionParams{ - // ID: p.ActionId, - // DSN: params.MongodbQueryGetdiagnosticdataParams.Dsn, - // Files: params.MongodbQueryGetdiagnosticdataParams.TextFiles, - // Command: "getDiagnosticData", - // Arg: 1, - // TempDir: c.cfg.Paths.TempDir, - // }) + case *agentpb.StartActionRequest_MongodbQueryReplsetgetstatusParams: + action = actions.NewMongoDBQueryAdmincommandAction(actions.MongoDBQueryAdmincommandActionParams{ + ID: p.ActionId, + DSN: params.MongodbQueryReplsetgetstatusParams.Dsn, + Files: params.MongodbQueryReplsetgetstatusParams.TextFiles, + Command: "replSetGetStatus", + Arg: 1, + TempDir: c.cfg.Paths.TempDir, + }) + + case *agentpb.StartActionRequest_MongodbQueryGetdiagnosticdataParams: + action = actions.NewMongoDBQueryAdmincommandAction(actions.MongoDBQueryAdmincommandActionParams{ + ID: p.ActionId, + DSN: params.MongodbQueryGetdiagnosticdataParams.Dsn, + Files: params.MongodbQueryGetdiagnosticdataParams.TextFiles, + Command: "getDiagnosticData", + Arg: 1, + TempDir: c.cfg.Paths.TempDir, + }) case *agentpb.StartActionRequest_PtSummaryParams: action = actions.NewProcessAction(p.ActionId, c.cfg.Paths.PTSummary, []string{}) diff --git a/docker-compose.yml b/docker-compose.yml index 84b73d607..6477bd61c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,22 +2,22 @@ version: '3.7' services: -# pmm-server: -# image: ${PMM_SERVER_IMAGE:-perconalab/pmm-server:dev-latest} -# container_name: pmm-agent_pmm-server -# ports: -# - "127.0.0.1:80:80" -# - "127.0.0.1:443:443" -# environment: -# - PMM_DEBUG=1 -# - PERCONA_TEST_CHECKS_INTERVAL=10s -# # for local development -# - PERCONA_TEST_CHECKS_FILE=/srv/checks/custom-checks.yml -# # for check-dev -# # - PERCONA_TEST_SAAS_HOST=check-dev.percona.com:443 -# # - PERCONA_TEST_CHECKS_PUBLIC_KEY=RWTg+ZmCCjt7O8eWeAmTLAqW+1ozUbpRSKSwNTmO+exlS5KEIPYWuYdX -# volumes: -# - ./testdata/checks:/srv/checks + pmm-server: + image: ${PMM_SERVER_IMAGE:-perconalab/pmm-server:dev-latest} + container_name: pmm-agent_pmm-server + ports: + - "127.0.0.1:80:80" + - "127.0.0.1:443:443" + environment: + - PMM_DEBUG=1 + - PERCONA_TEST_CHECKS_INTERVAL=10s + # for local development + - PERCONA_TEST_CHECKS_FILE=/srv/checks/custom-checks.yml + # for check-dev + # - PERCONA_TEST_SAAS_HOST=check-dev.percona.com:443 + # - PERCONA_TEST_CHECKS_PUBLIC_KEY=RWTg+ZmCCjt7O8eWeAmTLAqW+1ozUbpRSKSwNTmO+exlS5KEIPYWuYdX + volumes: + - ./testdata/checks:/srv/checks test_db: image: aleksi/test_db:1.1.0 diff --git a/go.mod b/go.mod index 78315a0aa..781635a2e 100644 --- a/go.mod +++ b/go.mod @@ -18,28 +18,28 @@ require ( github.com/davecgh/go-spew v1.1.1 github.com/go-openapi/runtime v0.19.20 github.com/go-sql-driver/mysql v1.5.0 - github.com/golang/protobuf v1.4.3 - github.com/grpc-ecosystem/grpc-gateway v1.15.1 + github.com/golang/protobuf v1.5.2 + github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/hashicorp/go-version v1.3.0 github.com/lfittl/pg_query_go v1.0.2 github.com/lib/pq v1.10.0 github.com/percona/exporter_shared v0.7.3 github.com/percona/go-mysql v0.0.0-20200630114833-b77f37c0bfa2 github.com/percona/percona-toolkit v3.2.1+incompatible - github.com/percona/pmm v0.0.0-20220310104949-dd33560bcdde + github.com/percona/pmm v0.0.0-20220402125834-c15e36d4238d github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.5.1 - github.com/prometheus/common v0.10.0 + github.com/prometheus/client_golang v1.12.1 + github.com/prometheus/common v0.32.1 github.com/sirupsen/logrus v1.6.0 github.com/stretchr/objx v0.2.0 - github.com/stretchr/testify v1.6.1 + github.com/stretchr/testify v1.7.1 go.mongodb.org/mongo-driver v1.7.1 - golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c - google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 - google.golang.org/grpc v1.32.0 - google.golang.org/protobuf v1.25.0 + golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 + google.golang.org/genproto v0.0.0-20220302033224-9aa15565e42a + google.golang.org/grpc v1.45.0 + google.golang.org/protobuf v1.27.1 gopkg.in/alecthomas/kingpin.v2 v2.2.6 - gopkg.in/reform.v1 v1.5.0 + gopkg.in/reform.v1 v1.5.1 gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b ) @@ -50,7 +50,7 @@ require ( github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.1.1 // indirect + github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/go-openapi/analysis v0.19.10 // indirect github.com/go-openapi/errors v0.19.6 // indirect github.com/go-openapi/jsonpointer v0.19.3 // indirect @@ -73,15 +73,15 @@ require ( github.com/mwitkow/go-proto-validators v0.3.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/procfs v0.5.0 // indirect + github.com/prometheus/procfs v0.7.3 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/scram v1.0.2 // indirect github.com/xdg-go/stringprep v1.0.2 // indirect github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 // indirect - golang.org/x/net v0.0.0-20200707034311-ab3426394381 // indirect + golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect golang.org/x/sync v0.0.0-20201207232520-09787c993a3a // indirect - golang.org/x/text v0.3.5 // indirect + golang.org/x/text v0.3.7 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect - gopkg.in/yaml.v2 v2.3.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/go.sum b/go.sum index f38989de0..5ae95ce1a 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,40 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/AlekSi/pointer v1.1.0 h1:SSDMPcXD9jSl8FPy9cRzoRaMJtm9g9ggGTxecRUbQoI= github.com/AlekSi/pointer v1.1.0/go.mod h1:y7BvfRI3wXPWKXEBhU71nbnIEEZX0QTSB2Bj48UJIZE= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/Percona-Lab/kingpin v2.2.6-percona+incompatible h1:N5oM40aAatvf8bCYjv69YsVdxJLIUhY/MerUG1jRL9Y= @@ -38,8 +70,17 @@ github.com/brianvoe/gofakeit v3.18.0+incompatible/go.mod h1:kfwdRA90vvNhPutZWfH7 github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -52,14 +93,21 @@ github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDD github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= @@ -161,48 +209,94 @@ github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1 h1:G5FRp8JnTd7RQH5kemVNlMeyXQAztQ3mOWV95KxsXH8= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/grpc-ecosystem/grpc-gateway v1.15.0/go.mod h1:vO11I9oWA+KsxmfFQPhLnnIb1VDE24M+pdxZFiuZcA8= github.com/grpc-ecosystem/grpc-gateway v1.15.1 h1:0y7lFdG8f+jgY7YfiBFl9mIGM0VrPtAkA2R1WjVXv20= github.com/grpc-ecosystem/grpc-gateway v1.15.1/go.mod h1:vO11I9oWA+KsxmfFQPhLnnIb1VDE24M+pdxZFiuZcA8= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.8.0/go.mod h1:/fckq3NE+vGiJsd4fDt4ge1XrK8cN+e5G5QWIzdg7Q8= github.com/hashicorp/go-version v1.3.0 h1:McDWVJIU/y+u1BRV06dPaLfLCaT7fUTJLp5r04x7iNw= github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jackc/fake v0.0.0-20150926172116-812a484cc733/go.mod h1:WrMFNQdiFJ80sQsxDoMokWK1W5TQtxBFNpzWTD84ibQ= github.com/jackc/pgx v3.6.2+incompatible h1:2zP5OD7kiyR3xzRYMhOcXVvkDZsImVXfj+yIyTQf3/o= github.com/jackc/pgx v3.6.2+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= @@ -244,9 +338,11 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe h1:iruDEfMl2E6fbMZ9s0scYfZQ84/6SPL6zC8ACM2oIL0= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-proto-validators v0.3.2 h1:qRlmpTzm2pstMKKzTdvwPCF5QfBNURSlAgN/R+qbKos= github.com/mwitkow/go-proto-validators v0.3.2/go.mod h1:ej0Qp0qMgHN/KtDyUt+Q1/tA7a5VarXUOUxD+oeD30w= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= @@ -262,6 +358,8 @@ github.com/percona/percona-toolkit v3.2.1+incompatible h1:5jLvtZKcu9fDmaLRB8qA4b github.com/percona/percona-toolkit v3.2.1+incompatible/go.mod h1:netQWdWMaF1cnmwiIS+i5uyaqNXz46yNeM6HKkR6yeI= github.com/percona/pmm v0.0.0-20220310104949-dd33560bcdde h1:yla7hvLtr6ROQ0EwE3XzsHLMiIcrQ1OBKuaebchERsU= github.com/percona/pmm v0.0.0-20220310104949-dd33560bcdde/go.mod h1:OmWayvQAavtvlzLkvpea5tAqaWGGNNyG+xj4MJUsNm4= +github.com/percona/pmm v0.0.0-20220402125834-c15e36d4238d h1:aqdDEjww1P8W3kR48UlAph1jGGcrVtSE4kxv3jAaNuo= +github.com/percona/pmm v0.0.0-20220402125834-c15e36d4238d/go.mod h1:stX2hCHtTjCsIhcvZXuu7VoaCiU+DYHwHxzANI/7Ps0= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -273,6 +371,9 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= github.com/prometheus/client_golang v1.5.1 h1:bdHYieyGlH+6OLEk2YQha8THib30KP0/yD0YH9m6xcA= github.com/prometheus/client_golang v1.5.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -284,6 +385,8 @@ github.com/prometheus/common v0.8.0/go.mod h1:PC/OgXc+UN7B4ALwvn1yzVZmVwvhXp5Jsb github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= @@ -291,6 +394,8 @@ github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+Gx github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.5.0 h1:ICtgn8CchRgPjUV2P2qwqAAPVDd5CFZsFOpkBRc1vS0= github.com/prometheus/procfs v0.5.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -311,8 +416,11 @@ github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoH github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= @@ -325,27 +433,65 @@ github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhe github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= go.mongodb.org/mongo-driver v1.3.4/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= go.mongodb.org/mongo-driver v1.7.1 h1:jwqTeEM3x6L9xDXrCxN0Hbg7vdGfPBOTIkr0+/LYZDA= go.mongodb.org/mongo-driver v1.7.1/go.mod h1:Q4oFMbo1+MSNqICAdYMlC/zSTrwCogR4R8NzkI+yfU8= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/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-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -356,17 +502,41 @@ golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -374,60 +544,198 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200722175500-76b94024e4b6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c h1:UIcGWL6/wpCfyGuJnRFJRurA+yj8RrW7Q6x2YMCXt6c= golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20220302033224-9aa15565e42a/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -436,8 +744,12 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -446,6 +758,7 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/reform.v1 v1.5.0 h1:UquCsOMOGKs2kStiqVQfI9lKFa97iV64HQyUDYRoPbw= gopkg.in/reform.v1 v1.5.0/go.mod h1:AIv0CbDRJ0ljQwptGeaIXfpDRo02uJwTq92aMFELEeU= +gopkg.in/reform.v1 v1.5.1/go.mod h1:AIv0CbDRJ0ljQwptGeaIXfpDRo02uJwTq92aMFELEeU= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -454,10 +767,20 @@ gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 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-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/main.go b/main.go index f93c5af58..80898cd3c 100644 --- a/main.go +++ b/main.go @@ -17,11 +17,12 @@ package main import ( "fmt" + "path/filepath" + "runtime" + "github.com/percona/pmm/version" "github.com/sirupsen/logrus" "gopkg.in/alecthomas/kingpin.v2" - "path/filepath" - "runtime" "github.com/percona/pmm-agent/commands" "github.com/percona/pmm-agent/config" diff --git a/storelogs/main.go b/storelogs/main.go index 5e071e312..e84c017ad 100644 --- a/storelogs/main.go +++ b/storelogs/main.go @@ -19,15 +19,12 @@ func (l *LogsStore) SetUp(countLogs int, entry *logrus.Entry) { func (l *LogsStore) SaveLog(log string) { dt := time.Now() - dt.Format("01-02-2006 15:04:05") log = dt.Format("01-02-2006 15:04:05") + " " + l.entry.Level.String() + ": " + log for _, v := range l.entry.Data { - log = log + fmt.Sprintf(" %v", v) + log = log + fmt.Sprintf(" %v", v) } l.log.Value = log l.log = l.log.Next() - //l.MapLogs[exporter].Value = log - //l.MapLogs[exporter] = l.MapLogs[exporter].Next() } func (l *LogsStore) GetLogs() []string { From 20a3ee29da90a38beb41da382d2a03db887b3820 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Sat, 2 Apr 2022 18:05:24 +0300 Subject: [PATCH 07/63] Pmm-5680 store logs --- go.mod | 2 -- go.sum | 46 +++++++++++++++++----------------------------- 2 files changed, 17 insertions(+), 31 deletions(-) diff --git a/go.mod b/go.mod index 781635a2e..6f4c36fe7 100644 --- a/go.mod +++ b/go.mod @@ -63,7 +63,6 @@ require ( github.com/go-stack/stack v1.8.0 // indirect github.com/gogo/protobuf v1.3.1 // indirect github.com/golang/snappy v0.0.1 // indirect - github.com/google/uuid v1.1.2 // indirect github.com/klauspost/compress v1.9.5 // indirect github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect github.com/mailru/easyjson v0.7.1 // indirect @@ -82,6 +81,5 @@ require ( golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect golang.org/x/sync v0.0.0-20201207232520-09787c993a3a // indirect golang.org/x/text v0.3.7 // indirect - golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/go.sum b/go.sum index 5ae95ce1a..df6069980 100644 --- a/go.sum +++ b/go.sum @@ -68,8 +68,8 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/brianvoe/gofakeit v3.18.0+incompatible h1:wDOmHc9DLG4nRjUVVaxA+CEglKOW72Y5+4WNxUIkjM8= github.com/brianvoe/gofakeit v3.18.0+incompatible/go.mod h1:kfwdRA90vvNhPutZWfH7WPaDzUjz+CZFqG+rPkOjGOc= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= @@ -234,9 +234,9 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -249,9 +249,9 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -271,9 +271,7 @@ github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/grpc-ecosystem/grpc-gateway v1.15.0/go.mod h1:vO11I9oWA+KsxmfFQPhLnnIb1VDE24M+pdxZFiuZcA8= -github.com/grpc-ecosystem/grpc-gateway v1.15.1 h1:0y7lFdG8f+jgY7YfiBFl9mIGM0VrPtAkA2R1WjVXv20= -github.com/grpc-ecosystem/grpc-gateway v1.15.1/go.mod h1:vO11I9oWA+KsxmfFQPhLnnIb1VDE24M+pdxZFiuZcA8= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.8.0/go.mod h1:/fckq3NE+vGiJsd4fDt4ge1XrK8cN+e5G5QWIzdg7Q8= github.com/hashicorp/go-version v1.3.0 h1:McDWVJIU/y+u1BRV06dPaLfLCaT7fUTJLp5r04x7iNw= @@ -289,7 +287,6 @@ github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqx github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= @@ -356,10 +353,10 @@ github.com/percona/go-mysql v0.0.0-20200630114833-b77f37c0bfa2 h1:0tQBti5FIrKfH3 github.com/percona/go-mysql v0.0.0-20200630114833-b77f37c0bfa2/go.mod h1:/SGLf9OMxlnK6jq4mkFiImBcJXXk5jwD+lDrwDaGXcw= github.com/percona/percona-toolkit v3.2.1+incompatible h1:5jLvtZKcu9fDmaLRB8qA4bLR727t5iYyguHJJQTk9w0= github.com/percona/percona-toolkit v3.2.1+incompatible/go.mod h1:netQWdWMaF1cnmwiIS+i5uyaqNXz46yNeM6HKkR6yeI= -github.com/percona/pmm v0.0.0-20220310104949-dd33560bcdde h1:yla7hvLtr6ROQ0EwE3XzsHLMiIcrQ1OBKuaebchERsU= -github.com/percona/pmm v0.0.0-20220310104949-dd33560bcdde/go.mod h1:OmWayvQAavtvlzLkvpea5tAqaWGGNNyG+xj4MJUsNm4= github.com/percona/pmm v0.0.0-20220402125834-c15e36d4238d h1:aqdDEjww1P8W3kR48UlAph1jGGcrVtSE4kxv3jAaNuo= github.com/percona/pmm v0.0.0-20220402125834-c15e36d4238d/go.mod h1:stX2hCHtTjCsIhcvZXuu7VoaCiU+DYHwHxzANI/7Ps0= +github.com/percona/pmm v2.18.0+incompatible h1:zfrJCPrV4fPausJ0kE5Tr3RANUbck1kEoaR04YJChls= +github.com/percona/pmm v2.18.0+incompatible/go.mod h1:nN14kK4Dfl2Ub1k05aOnAHv7SmLEQtCsYX+DEfLgrkU= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -369,8 +366,7 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= -github.com/prometheus/client_golang v1.5.1 h1:bdHYieyGlH+6OLEk2YQha8THib30KP0/yD0YH9m6xcA= -github.com/prometheus/client_golang v1.5.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= +github.com/prometheus/client_golang v1.7.1 h1:NTGy1Ja9pByO+xAeH/qiWnLrKtr3hJPNjaVUwnjpdpA= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= @@ -382,7 +378,6 @@ github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6T github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.8.0/go.mod h1:PC/OgXc+UN7B4ALwvn1yzVZmVwvhXp5JsbBv6wSv6i0= -github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= @@ -390,11 +385,9 @@ github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.5.0 h1:ICtgn8CchRgPjUV2P2qwqAAPVDd5CFZsFOpkBRc1vS0= -github.com/prometheus/procfs v0.5.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -417,9 +410,9 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= @@ -510,7 +503,6 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -524,11 +516,11 @@ golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -584,9 +576,6 @@ golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200722175500-76b94024e4b6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c h1:UIcGWL6/wpCfyGuJnRFJRurA+yj8RrW7Q6x2YMCXt6c= -golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -596,6 +585,7 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -605,9 +595,9 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -711,12 +701,12 @@ google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20220302033224-9aa15565e42a h1:uqouglH745GoGeZ1YFZbPBiu961tgi/9Qm5jaorajjQ= google.golang.org/genproto v0.0.0-20220302033224-9aa15565e42a/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -730,11 +720,10 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -745,10 +734,10 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -756,8 +745,7 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/reform.v1 v1.5.0 h1:UquCsOMOGKs2kStiqVQfI9lKFa97iV64HQyUDYRoPbw= -gopkg.in/reform.v1 v1.5.0/go.mod h1:AIv0CbDRJ0ljQwptGeaIXfpDRo02uJwTq92aMFELEeU= +gopkg.in/reform.v1 v1.5.1 h1:7vhDFW1n1xAPC6oDSvIvVvpRkaRpXlxgJ4QB4s3aDdo= gopkg.in/reform.v1 v1.5.1/go.mod h1:AIv0CbDRJ0ljQwptGeaIXfpDRo02uJwTq92aMFELEeU= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -765,8 +753,8 @@ gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 229845d3e9f25557cb4e7b4587345eb37554fbac Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Sat, 2 Apr 2022 18:10:37 +0300 Subject: [PATCH 08/63] Pmm-5680 save logs process Done --- agents/process/process.go | 1 + 1 file changed, 1 insertion(+) diff --git a/agents/process/process.go b/agents/process/process.go index 61daddc39..da989ade4 100644 --- a/agents/process/process.go +++ b/agents/process/process.go @@ -235,6 +235,7 @@ func (p *Process) toStopping() { } func (p *Process) toDone() { + p.l.Trace("Process: done.") p.l.Trace("Process: done.") p.changes <- inventorypb.AgentStatus_DONE From 91613451f5231721a13c0d97fa3cafdb52fa7cfe Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Wed, 6 Apr 2022 23:54:54 +0300 Subject: [PATCH 09/63] Pmm-5680 save logs process --- agents/process/process.go | 53 ++++++++--------------- agents/supervisor/supervisor.go | 4 +- storelogs/main.go | 77 ++++++++++++++++++++++++++------- 3 files changed, 81 insertions(+), 53 deletions(-) diff --git a/agents/process/process.go b/agents/process/process.go index da989ade4..ea43b3140 100644 --- a/agents/process/process.go +++ b/agents/process/process.go @@ -26,7 +26,6 @@ import ( "github.com/percona/pmm/api/inventorypb" "github.com/percona/pmm/utils/pdeathsig" - "github.com/sirupsen/logrus" "golang.org/x/sys/unix" "github.com/percona/pmm-agent/utils/backoff" @@ -56,12 +55,11 @@ const ( // only to avoid stack overflow; there are no extra goroutines for states. type Process struct { params *Params - l *logrus.Entry pl *processLogger changes chan inventorypb.AgentStatus backoff *backoff.Backoff ctxDone chan struct{} - savelog *storelogs.LogsStore + logs *storelogs.LogsStore // recreated on each restart cmd *exec.Cmd cmdDone chan struct{} @@ -88,15 +86,14 @@ func (p *Params) String() string { } // New creates new process. -func New(params *Params, redactWords []string, l *logrus.Entry, sl *storelogs.LogsStore) *Process { +func New(params *Params, redactWords []string, sl *storelogs.LogsStore) *Process { return &Process{ params: params, - l: l, - pl: newProcessLogger(l, keepLogLines, redactWords), + pl: newProcessLogger(sl.Entry, keepLogLines, redactWords), changes: make(chan inventorypb.AgentStatus, 10), backoff: backoff.New(backoffMinDelay, backoffMaxDelay), ctxDone: make(chan struct{}), - savelog: sl, + logs: sl, } } @@ -105,16 +102,14 @@ func (p *Process) Run(ctx context.Context) { go p.toStarting() <-ctx.Done() - p.l.Infof("Process: context canceled.") - p.savelog.SaveLog("Process: context canceled.") + p.logs.Infof("Process: context canceled.") close(p.ctxDone) } // STARTING -> RUNNING // STARTING -> WAITING func (p *Process) toStarting() { - p.l.Tracef("Process: starting.") - p.savelog.SaveLog("Process: starting.") + p.logs.Tracef("Process: starting.") p.changes <- inventorypb.AgentStatus_STARTING p.cmd = exec.Command(p.params.Path, p.params.Args...) //nolint:gosec @@ -132,8 +127,7 @@ func (p *Process) toStarting() { p.cmdDone = make(chan struct{}) if err := p.cmd.Start(); err != nil { - p.l.Warnf("Process: failed to start: %s.", err) - p.savelog.SaveLog(fmt.Sprintf("Process: failed to start: %s.", err)) + p.logs.Warnf("Process: failed to start: %s.", err) go p.toWaiting() return } @@ -150,8 +144,7 @@ func (p *Process) toStarting() { case <-t.C: go p.toRunning() case <-p.cmdDone: - p.l.Warnf("Process: exited early: %s.", p.cmd.ProcessState) - p.savelog.SaveLog(fmt.Sprintf("Process: exited early: %s.", p.cmd.ProcessState)) + p.logs.Warnf("Process: exited early: %s.", p.cmd.ProcessState) go p.toWaiting() } } @@ -159,8 +152,7 @@ func (p *Process) toStarting() { // RUNNING -> STOPPING // RUNNING -> WAITING func (p *Process) toRunning() { - p.l.Tracef("Process: running.") - p.savelog.SaveLog("Process: running.") + p.logs.Tracef("Process: running.") p.changes <- inventorypb.AgentStatus_RUNNING p.backoff.Reset() @@ -169,8 +161,7 @@ func (p *Process) toRunning() { case <-p.ctxDone: go p.toStopping() case <-p.cmdDone: - p.l.Warnf("Process: exited: %s.", p.cmd.ProcessState) - p.savelog.SaveLog(fmt.Sprintf("Process: exited: %s.", p.cmd.ProcessState)) + p.logs.Warnf("Process: exited: %s.", p.cmd.ProcessState) go p.toWaiting() } } @@ -180,8 +171,7 @@ func (p *Process) toRunning() { func (p *Process) toWaiting() { delay := p.backoff.Delay() - p.l.Infof("Process: waiting %s.", delay) - p.savelog.SaveLog(fmt.Sprintf("Process: waiting %s.", delay)) + p.logs.Infof("Process: waiting %s.", delay) p.changes <- inventorypb.AgentStatus_WAITING t := time.NewTimer(delay) @@ -192,8 +182,7 @@ func (p *Process) toWaiting() { if p.params.Type == inventorypb.AgentType_VM_AGENT { _, err := p.params.TemplateRenderer.RenderFiles(p.params.TemplateParams) if err != nil { - p.l.Warnf("Process: failed to regenerate config in %s.", p.params.TemplateRenderer.TempDir) - p.savelog.SaveLog(fmt.Sprintf("Process: failed to regenerate config in %s.", p.params.TemplateRenderer.TempDir)) + p.logs.Warnf("Process: failed to regenerate config in %s.", p.params.TemplateRenderer.TempDir) } } @@ -205,13 +194,11 @@ func (p *Process) toWaiting() { // STOPPING -> DONE func (p *Process) toStopping() { - p.l.Tracef("Process: stopping (sending SIGTERM)...") - p.savelog.SaveLog("Process: stopping (sending SIGTERM)...") + p.logs.Tracef("Process: stopping (sending SIGTERM)...") p.changes <- inventorypb.AgentStatus_STOPPING if err := p.cmd.Process.Signal(unix.SIGTERM); err != nil { - p.l.Errorf("Process: failed to send SIGTERM: %s.", err) - p.savelog.SaveLog(fmt.Sprintf("Process: failed to send SIGTERM: %s.", err)) + p.logs.Errorf("Process: failed to send SIGTERM: %s.", err) } t := time.NewTimer(killT) @@ -220,23 +207,19 @@ func (p *Process) toStopping() { case <-p.cmdDone: // nothing case <-t.C: - p.l.Warnf("Process: still alive after %s, sending SIGKILL...", killT) - p.savelog.SaveLog(fmt.Sprintf("Process: still alive after %s, sending SIGKILL...", killT)) + p.logs.Warnf("Process: still alive after %s, sending SIGKILL...", killT) if err := p.cmd.Process.Signal(unix.SIGKILL); err != nil { - p.l.Errorf("Process: failed to send SIGKILL: %s.", err) - p.savelog.SaveLog(fmt.Sprintf("Process: failed to send SIGKILL: %s.", err)) + p.logs.Errorf("Process: failed to send SIGKILL: %s.", err) } <-p.cmdDone } - p.l.Infof("Process: exited: %s.", p.cmd.ProcessState) - p.savelog.SaveLog(fmt.Sprintf("Process: exited: %s.", p.cmd.ProcessState)) + p.logs.Infof("Process: exited: %s.", p.cmd.ProcessState) go p.toDone() } func (p *Process) toDone() { - p.l.Trace("Process: done.") - p.l.Trace("Process: done.") + p.logs.Trace("Process: done.") p.changes <- inventorypb.AgentStatus_DONE close(p.changes) diff --git a/agents/supervisor/supervisor.go b/agents/supervisor/supervisor.go index 6704de96b..a14212082 100644 --- a/agents/supervisor/supervisor.go +++ b/agents/supervisor/supervisor.go @@ -350,8 +350,8 @@ func (s *Supervisor) startProcess(agentID string, agentProcess *agentpb.SetState }) l.Debugf("Starting: %s.", processParams) ringLog := new(storelogs.LogsStore) - ringLog.SetUp(30, l) - process := process.New(processParams, agentProcess.RedactWords, l, ringLog) + ringLog.SetUp(l) + process := process.New(processParams, agentProcess.RedactWords, ringLog) go pprof.Do(ctx, pprof.Labels("agentID", agentID, "type", agentType), process.Run) done := make(chan struct{}) diff --git a/storelogs/main.go b/storelogs/main.go index e84c017ad..daecd6a7a 100644 --- a/storelogs/main.go +++ b/storelogs/main.go @@ -1,6 +1,7 @@ package storelogs import ( + "bytes" "container/ring" "fmt" "github.com/sirupsen/logrus" @@ -9,31 +10,75 @@ import ( type LogsStore struct { log *ring.Ring - entry *logrus.Entry + Entry *logrus.Entry + count int } -func (l *LogsStore) SetUp(countLogs int, entry *logrus.Entry) { - l.log = ring.New(countLogs) - l.entry = entry +func (l *LogsStore) SetUp(entry *logrus.Entry) { + if l.count == 0 { + l.count = 10 + } + l.log = ring.New(l.count) + l.Entry = entry +} + +func (l *LogsStore) SetCountLogs(countLogs int) { + l.count = countLogs } func (l *LogsStore) SaveLog(log string) { dt := time.Now() - log = dt.Format("01-02-2006 15:04:05") + " " + l.entry.Level.String() + ": " + log - for _, v := range l.entry.Data { - log = log + fmt.Sprintf(" %v", v) + var b bytes.Buffer + b.WriteString(l.Entry.Level.String()) + b.WriteString(" [") + b.WriteString(dt.Format("01-02-2006 15:04:05")) + b.WriteString("] ") + b.WriteString(log) + for _, v := range l.Entry.Data { + b.WriteString(fmt.Sprintf(" %v", v)) } - l.log.Value = log + l.log.Value = b.String() l.log = l.log.Next() } -func (l *LogsStore) GetLogs() []string { - var logs []string - l.log.Do(func(p interface{}) { - log := fmt.Sprint(p) - if p != nil { - logs = append(logs, log) - } - }) +func (l *LogsStore) GetLogs() (logs []string) { + if l != nil { + l.log.Do(func(p interface{}) { + log := fmt.Sprint(p) + if p != nil { + logs = append(logs, log) + } + }) + } return logs } + +func (l *LogsStore) Warnf(format string, v ...interface{}) { + l.SaveLog(fmt.Sprintf(format, v...)) + l.Entry.Warnf(format, v) +} + +func (l *LogsStore) Infof(format string, v ...interface{}) { + l.SaveLog(fmt.Sprintf(format, v...)) + l.Entry.Infof(format, v) +} + +func (l *LogsStore) Debugf(format string, v ...interface{}) { + l.SaveLog(fmt.Sprintf(format, v...)) + l.Entry.Debugf(format, v) +} + +func (l *LogsStore) Tracef(format string, v ...interface{}) { + l.SaveLog(fmt.Sprintf(format, v...)) + l.Entry.Tracef(format, v) +} + +func (l *LogsStore) Errorf(format string, v ...interface{}) { + l.SaveLog(fmt.Sprintf(format, v...)) + l.Entry.Errorf(format, v) +} + +func (l *LogsStore) Trace(message string) { + l.SaveLog(message) + l.Entry.Trace(message, nil) +} From aa77af2307b068775b5bb1ec6e0ee9e3ca68ac51 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Thu, 14 Apr 2022 15:40:04 +0300 Subject: [PATCH 10/63] Pmm-5680 change dependency --- agentlocal/agent_local.go | 5 --- go.mod | 48 ++++++++++++++-------------- go.sum | 67 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+), 29 deletions(-) diff --git a/agentlocal/agent_local.go b/agentlocal/agent_local.go index 4fd29035e..268b4761d 100644 --- a/agentlocal/agent_local.go +++ b/agentlocal/agent_local.go @@ -63,11 +63,6 @@ type Server struct { reloadCloseOnce sync.Once } -func (s *Server) mustEmbedUnimplementedAgentLocalServer() { - //TODO implement me - panic("implement me") -} - // NewServer creates new server. // // Caller should call Run. diff --git a/go.mod b/go.mod index 6f4c36fe7..7b1142c15 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/AlekSi/pointer v1.1.0 github.com/DATA-DOG/go-sqlmock v1.5.0 github.com/davecgh/go-spew v1.1.1 - github.com/go-openapi/runtime v0.19.20 + github.com/go-openapi/runtime v0.23.3 github.com/go-sql-driver/mysql v1.5.0 github.com/golang/protobuf v1.5.2 github.com/grpc-ecosystem/grpc-gateway v1.16.0 @@ -26,18 +26,18 @@ require ( github.com/percona/exporter_shared v0.7.3 github.com/percona/go-mysql v0.0.0-20200630114833-b77f37c0bfa2 github.com/percona/percona-toolkit v3.2.1+incompatible - github.com/percona/pmm v0.0.0-20220402125834-c15e36d4238d + github.com/percona/pmm v0.0.0-20220413231946-84d9f7d044b2 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.12.1 - github.com/prometheus/common v0.32.1 + github.com/prometheus/common v0.33.0 github.com/sirupsen/logrus v1.6.0 github.com/stretchr/objx v0.2.0 github.com/stretchr/testify v1.7.1 - go.mongodb.org/mongo-driver v1.7.1 - golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 - google.golang.org/genproto v0.0.0-20220302033224-9aa15565e42a + go.mongodb.org/mongo-driver v1.9.0 + golang.org/x/sys v0.0.0-20220412211240-33da011f77ad + google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9 google.golang.org/grpc v1.45.0 - google.golang.org/protobuf v1.27.1 + google.golang.org/protobuf v1.28.0 gopkg.in/alecthomas/kingpin.v2 v2.2.6 gopkg.in/reform.v1 v1.5.1 gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b @@ -48,26 +48,26 @@ require ( github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect - github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 // indirect + github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect - github.com/go-openapi/analysis v0.19.10 // indirect - github.com/go-openapi/errors v0.19.6 // indirect - github.com/go-openapi/jsonpointer v0.19.3 // indirect - github.com/go-openapi/jsonreference v0.19.4 // indirect - github.com/go-openapi/loads v0.19.5 // indirect - github.com/go-openapi/spec v0.19.8 // indirect - github.com/go-openapi/strfmt v0.19.5 // indirect - github.com/go-openapi/swag v0.19.9 // indirect - github.com/go-openapi/validate v0.19.10 // indirect - github.com/go-stack/stack v1.8.0 // indirect - github.com/gogo/protobuf v1.3.1 // indirect + github.com/go-openapi/analysis v0.21.3 // indirect + github.com/go-openapi/errors v0.20.2 // indirect + github.com/go-openapi/jsonpointer v0.19.5 // indirect + github.com/go-openapi/jsonreference v0.20.0 // indirect + github.com/go-openapi/loads v0.21.1 // indirect + github.com/go-openapi/spec v0.20.5 // indirect + github.com/go-openapi/strfmt v0.21.2 // indirect + github.com/go-openapi/swag v0.21.1 // indirect + github.com/go-openapi/validate v0.21.0 // indirect + github.com/go-stack/stack v1.8.1 // indirect + github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/snappy v0.0.1 // indirect - github.com/klauspost/compress v1.9.5 // indirect + github.com/klauspost/compress v1.13.6 // indirect github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect - github.com/mailru/easyjson v0.7.1 // indirect + github.com/mailru/easyjson v0.7.7 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect - github.com/mitchellh/mapstructure v1.3.3 // indirect + github.com/mitchellh/mapstructure v1.4.3 // indirect github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect github.com/mwitkow/go-proto-validators v0.3.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect @@ -77,8 +77,8 @@ require ( github.com/xdg-go/scram v1.0.2 // indirect github.com/xdg-go/stringprep v1.0.2 // indirect github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect - golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 // indirect - golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect + golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f // indirect + golang.org/x/net v0.0.0-20220412020605-290c469a71a5 // indirect golang.org/x/sync v0.0.0-20201207232520-09787c993a3a // indirect golang.org/x/text v0.3.7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index df6069980..b336f29f8 100644 --- a/go.sum +++ b/go.sum @@ -61,6 +61,8 @@ github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:l github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 h1:4daAzAu0S6Vi7/lbWECcX0j45yZReDZ56BQsrVBOEEY= github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= +github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= +github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -105,9 +107,11 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2 github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= @@ -116,23 +120,33 @@ github.com/go-openapi/analysis v0.19.4/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9sn github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= github.com/go-openapi/analysis v0.19.10 h1:5BHISBAXOc/aJK25irLZnx2D3s6WyYaY9D4gmuz9fdE= github.com/go-openapi/analysis v0.19.10/go.mod h1:qmhS3VNFxBlquFJ0RGoDtylO9y4pgTAUNE9AEEMdlJQ= +github.com/go-openapi/analysis v0.21.2/go.mod h1:HZwRk4RRisyG8vx2Oe6aqeSQcoxRp47Xkp3+K6q+LdY= +github.com/go-openapi/analysis v0.21.3 h1:CPEa+B2oYCkb+lIKB4xP6Ork8Gvh0GNg9dm/twI3+QA= +github.com/go-openapi/analysis v0.21.3/go.mod h1:2rtHDVV21tLgvJd+eXu+ExiOhfMO4+dNb7496llyke0= github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= github.com/go-openapi/errors v0.19.3/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= github.com/go-openapi/errors v0.19.6 h1:xZMThgv5SQ7SMbWtKFkCf9bBdvR2iEyw9k3zGZONuys= github.com/go-openapi/errors v0.19.6/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.19.9/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.20.2/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= github.com/go-openapi/jsonreference v0.19.4 h1:3Vw+rh13uq2JFNxgnMTGE1rnoieU9FmyE1gvnyylsYg= github.com/go-openapi/jsonreference v0.19.4/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= +github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= +github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= +github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= @@ -140,12 +154,14 @@ github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix github.com/go-openapi/loads v0.19.3/go.mod h1:YVfqhUCdahYwR3f3iiwQLhicVRvLlU/WO5WPaZvcvSI= github.com/go-openapi/loads v0.19.5 h1:jZVYWawIQiA1NBnHla28ktg6hrcfTHsCE+3QLVRBIls= github.com/go-openapi/loads v0.19.5/go.mod h1:dswLCAdonkRufe/gSUC3gN8nTSaB9uaS2es0x5/IbjY= +github.com/go-openapi/loads v0.21.1/go.mod h1:/DtAMXXneXFjbQMGEtbamCZb+4x7eGwkvZCvBmwUG+g= github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo= github.com/go-openapi/runtime v0.19.20 h1:J/t+QIjbcoq8WJvjGxRKiFBhqUE8slS9SbmD0Oi/raQ= github.com/go-openapi/runtime v0.19.20/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk= +github.com/go-openapi/runtime v0.23.3/go.mod h1:AKurw9fNre+h3ELZfk6ILsfvPN+bvvlaU/M9q/r9hpk= github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= @@ -153,6 +169,9 @@ github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8 github.com/go-openapi/spec v0.19.6/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= github.com/go-openapi/spec v0.19.8 h1:qAdZLh1r6QF/hI/gTq+TJTvsQUodZsM7KLqkAJdiJNg= github.com/go-openapi/spec v0.19.8/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= +github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= +github.com/go-openapi/spec v0.20.5 h1:skHa8av4VnAtJU5zyAUXrrdK/NDiVX8lchbG+BfcdrE= +github.com/go-openapi/spec v0.20.5/go.mod h1:QbfOSIVt3/sac+a1wzmKbbcLXm5NdZnyBZYtCijp43o= github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= @@ -161,6 +180,9 @@ github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6 github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= github.com/go-openapi/strfmt v0.19.5 h1:0utjKrw+BAh8s57XE9Xz8DUBsVvPmRUB6styvl9wWIM= github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= +github.com/go-openapi/strfmt v0.21.0/go.mod h1:ZRQ409bWMj+SOgXofQAGTIo2Ebu72Gs+WaRADcS5iNg= +github.com/go-openapi/strfmt v0.21.1/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= +github.com/go-openapi/strfmt v0.21.2/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= @@ -168,15 +190,19 @@ github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh github.com/go-openapi/swag v0.19.7/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= github.com/go-openapi/swag v0.19.9 h1:1IxuqvBUU3S2Bi4YC7tlP9SJF1gVpCvqN0T2Qof4azE= github.com/go-openapi/swag v0.19.9/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= +github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7vS9k0lo6zwJo= github.com/go-openapi/validate v0.19.10 h1:tG3SZ5DC5KF4cyt7nqLVcQXGj5A7mpaYkAcNPlDK+Yk= github.com/go-openapi/validate v0.19.10/go.mod h1:RKEZTUWDkxKQxN2jDT7ZnZi2bhZlbNMAuKvKB+IaGx8= +github.com/go-openapi/validate v0.21.0/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= @@ -206,6 +232,7 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -274,6 +301,7 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.8.0/go.mod h1:/fckq3NE+vGiJsd4fDt4ge1XrK8cN+e5G5QWIzdg7Q8= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.0/go.mod h1:XnLCLFp3tjoZJszVKjfpyAK6J8sYIcQXWQxmqLWF21I= github.com/hashicorp/go-version v1.3.0 h1:McDWVJIU/y+u1BRV06dPaLfLCaT7fUTJLp5r04x7iNw= github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -284,6 +312,7 @@ github.com/jackc/fake v0.0.0-20150926172116-812a484cc733/go.mod h1:WrMFNQdiFJ80s github.com/jackc/pgx v3.6.2+incompatible h1:2zP5OD7kiyR3xzRYMhOcXVvkDZsImVXfj+yIyTQf3/o= github.com/jackc/pgx v3.6.2+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -297,9 +326,11 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8 github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.9.5 h1:U+CaK85mrNNb4k8BNOfgJtJ/gr6kswUCFj6miSzVC6M= github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= @@ -321,6 +352,8 @@ github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.1 h1:mdxE1MF9o53iCb2Ghj1VfWvh7ZOwHpnVG/xwXrV90U8= github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/mattn/go-sqlite3 v1.14.0 h1:mLyGNKR8+Vv9CAU7PphKa2hkEqxxhn8i32J6FPj1/QA= @@ -331,6 +364,8 @@ github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= @@ -344,6 +379,8 @@ github.com/mwitkow/go-proto-validators v0.3.2 h1:qRlmpTzm2pstMKKzTdvwPCF5QfBNURS github.com/mwitkow/go-proto-validators v0.3.2/go.mod h1:ej0Qp0qMgHN/KtDyUt+Q1/tA7a5VarXUOUxD+oeD30w= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= @@ -355,6 +392,8 @@ github.com/percona/percona-toolkit v3.2.1+incompatible h1:5jLvtZKcu9fDmaLRB8qA4b github.com/percona/percona-toolkit v3.2.1+incompatible/go.mod h1:netQWdWMaF1cnmwiIS+i5uyaqNXz46yNeM6HKkR6yeI= github.com/percona/pmm v0.0.0-20220402125834-c15e36d4238d h1:aqdDEjww1P8W3kR48UlAph1jGGcrVtSE4kxv3jAaNuo= github.com/percona/pmm v0.0.0-20220402125834-c15e36d4238d/go.mod h1:stX2hCHtTjCsIhcvZXuu7VoaCiU+DYHwHxzANI/7Ps0= +github.com/percona/pmm v0.0.0-20220413231946-84d9f7d044b2 h1:ZeS+rOGtPzNzzKq7YcOU1+Xj5ppTj9nY5AgD4ZqiPCc= +github.com/percona/pmm v0.0.0-20220413231946-84d9f7d044b2/go.mod h1:NVF1oAaKuXVum37J1Iesuqtcygg98pLJtKktn49gXcg= github.com/percona/pmm v2.18.0+incompatible h1:zfrJCPrV4fPausJ0kE5Tr3RANUbck1kEoaR04YJChls= github.com/percona/pmm v2.18.0+incompatible/go.mod h1:nN14kK4Dfl2Ub1k05aOnAHv7SmLEQtCsYX+DEfLgrkU= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -382,6 +421,7 @@ github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lN github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.33.0/go.mod h1:gB3sOl7P0TvJabZpLY5uQMpUqRCPPCyRLCZYc7JZTNE= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= @@ -429,12 +469,18 @@ github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7Jul github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= go.mongodb.org/mongo-driver v1.3.4/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= go.mongodb.org/mongo-driver v1.7.1 h1:jwqTeEM3x6L9xDXrCxN0Hbg7vdGfPBOTIkr0+/LYZDA= go.mongodb.org/mongo-driver v1.7.1/go.mod h1:Q4oFMbo1+MSNqICAdYMlC/zSTrwCogR4R8NzkI+yfU8= +go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= +go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= +go.mongodb.org/mongo-driver v1.8.3/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY= +go.mongodb.org/mongo-driver v1.9.0 h1:f3aLGJvQmBl8d9S40IL+jEyBC6hfLPbJjv9t5hEM9ck= +go.mongodb.org/mongo-driver v1.9.0/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -455,6 +501,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f h1:aZp0e2vLN4MToVqnjNEYEtrEA8RH8U8FN1CU7JgqsPU= +golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -518,10 +566,15 @@ golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5 h1:bRb386wvrE+oBNdF1d/Xh9mQrfQ4ecYhW5qJ5GvTGT4= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -529,6 +582,7 @@ golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -538,6 +592,7 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -559,6 +614,7 @@ golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -577,9 +633,11 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -587,6 +645,9 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad h1:ntjMns5wyP/fN65tdBD4g8J5w8n015+iIIs9rtjXkY0= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -646,9 +707,11 @@ golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -708,6 +771,9 @@ google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220302033224-9aa15565e42a h1:uqouglH745GoGeZ1YFZbPBiu961tgi/9Qm5jaorajjQ= google.golang.org/genproto v0.0.0-20220302033224-9aa15565e42a/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220317150908-0efb43f6373e/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= +google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9 h1:XGQ6tc+EnM35IAazg4y6AHmUg4oK8NXsXaILte1vRlk= +google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -739,6 +805,7 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 5163ca9f1f2ceb92e0d673b4769f5b2ea4e97254 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Thu, 14 Apr 2022 15:52:17 +0300 Subject: [PATCH 11/63] Pmm-5680 update dependency --- go.mod | 52 +++++++-------- go.sum | 196 ++++++++++++++++++++++----------------------------------- 2 files changed, 103 insertions(+), 145 deletions(-) diff --git a/go.mod b/go.mod index 206978a6c..b1338cf7f 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/AlekSi/pointer v1.2.0 github.com/DATA-DOG/go-sqlmock v1.5.0 github.com/davecgh/go-spew v1.1.1 - github.com/go-openapi/runtime v0.19.20 + github.com/go-openapi/runtime v0.23.3 github.com/go-sql-driver/mysql v1.5.0 github.com/golang/protobuf v1.5.2 github.com/grpc-ecosystem/grpc-gateway v1.16.0 @@ -26,49 +26,51 @@ require ( github.com/percona/go-mysql v0.0.0-20200630114833-b77f37c0bfa2 github.com/percona/percona-toolkit v3.2.1+incompatible github.com/percona/pmm v0.0.0-20220413231946-84d9f7d044b2 + github.com/pganalyze/pg_query_go v1.0.3 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.12.1 - github.com/prometheus/common v0.32.1 + github.com/prometheus/common v0.33.0 github.com/sirupsen/logrus v1.8.1 github.com/stretchr/objx v0.2.0 github.com/stretchr/testify v1.7.1 - go.mongodb.org/mongo-driver v1.7.1 - golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 - google.golang.org/genproto v0.0.0-20220302033224-9aa15565e42a + go.mongodb.org/mongo-driver v1.9.0 + golang.org/x/sys v0.0.0-20220412211240-33da011f77ad + google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9 google.golang.org/grpc v1.45.0 - google.golang.org/protobuf v1.27.1 + google.golang.org/protobuf v1.28.0 gopkg.in/alecthomas/kingpin.v2 v2.2.6 gopkg.in/reform.v1 v1.5.1 gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b ) require ( - github.com/PuerkitoBio/purell v1.1.1 // indirect - github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect - github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 // indirect + github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect - github.com/go-openapi/analysis v0.19.10 // indirect - github.com/go-openapi/errors v0.19.6 // indirect - github.com/go-openapi/jsonpointer v0.19.3 // indirect - github.com/go-openapi/jsonreference v0.19.4 // indirect - github.com/go-openapi/loads v0.19.5 // indirect - github.com/go-openapi/spec v0.19.8 // indirect - github.com/go-openapi/strfmt v0.19.5 // indirect - github.com/go-openapi/swag v0.19.9 // indirect - github.com/go-openapi/validate v0.19.10 // indirect - github.com/go-stack/stack v1.8.0 // indirect + github.com/go-openapi/analysis v0.21.3 // indirect + github.com/go-openapi/errors v0.20.2 // indirect + github.com/go-openapi/jsonpointer v0.19.5 // indirect + github.com/go-openapi/jsonreference v0.20.0 // indirect + github.com/go-openapi/loads v0.21.1 // indirect + github.com/go-openapi/spec v0.20.5 // indirect + github.com/go-openapi/strfmt v0.21.2 // indirect + github.com/go-openapi/swag v0.21.1 // indirect + github.com/go-openapi/validate v0.21.0 // indirect + github.com/go-stack/stack v1.8.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/snappy v0.0.1 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.8.0 // indirect - github.com/klauspost/compress v1.9.5 // indirect - github.com/mailru/easyjson v0.7.1 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.0 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/klauspost/compress v1.13.6 // indirect + github.com/mailru/easyjson v0.7.7 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect - github.com/mitchellh/mapstructure v1.3.3 // indirect + github.com/mitchellh/mapstructure v1.4.3 // indirect github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect github.com/mwitkow/go-proto-validators v0.3.2 // indirect + github.com/oklog/ulid v1.3.1 // indirect + github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/procfs v0.7.3 // indirect @@ -76,8 +78,8 @@ require ( github.com/xdg-go/scram v1.0.2 // indirect github.com/xdg-go/stringprep v1.0.2 // indirect github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect - golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 // indirect - golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect + golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f // indirect + golang.org/x/net v0.0.0-20220412020605-290c469a71a5 // indirect golang.org/x/sync v0.0.0-20201207232520-09787c993a3a // indirect golang.org/x/text v0.3.7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index ebbdede06..b52a68778 100644 --- a/go.sum +++ b/go.sum @@ -43,10 +43,7 @@ github.com/Percona-Lab/kingpin v2.2.6-percona+incompatible/go.mod h1:UC6j/e2eqpH github.com/Percona-Lab/pg_query_go v1.0.3-percona h1:z0co9LzCdA9YuZBgOWTSr3+bGj14T/ngFIsHJA8A46E= github.com/Percona-Lab/pg_query_go v1.0.3-percona/go.mod h1:tR53lU3ddnExxb0XeLyYuQIK3dkR03FjQ9sj8AV/up8= github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc= -github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= @@ -57,11 +54,9 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2c github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= -github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 h1:4daAzAu0S6Vi7/lbWECcX0j45yZReDZ56BQsrVBOEEY= -github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= +github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= +github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ= +github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -89,7 +84,6 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/denisenkom/go-mssqldb v0.9.0 h1:RSohk2RsiZqLZ0zCjtfn3S4Gp4exhpBWHyQ7D0yGjAk= github.com/denisenkom/go-mssqldb v0.9.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= -github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -98,86 +92,52 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= -github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= -github.com/go-openapi/analysis v0.19.4/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= -github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= -github.com/go-openapi/analysis v0.19.10 h1:5BHISBAXOc/aJK25irLZnx2D3s6WyYaY9D4gmuz9fdE= -github.com/go-openapi/analysis v0.19.10/go.mod h1:qmhS3VNFxBlquFJ0RGoDtylO9y4pgTAUNE9AEEMdlJQ= -github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/errors v0.19.3/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/errors v0.19.6 h1:xZMThgv5SQ7SMbWtKFkCf9bBdvR2iEyw9k3zGZONuys= -github.com/go-openapi/errors v0.19.6/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-openapi/analysis v0.21.2/go.mod h1:HZwRk4RRisyG8vx2Oe6aqeSQcoxRp47Xkp3+K6q+LdY= +github.com/go-openapi/analysis v0.21.3 h1:CPEa+B2oYCkb+lIKB4xP6Ork8Gvh0GNg9dm/twI3+QA= +github.com/go-openapi/analysis v0.21.3/go.mod h1:2rtHDVV21tLgvJd+eXu+ExiOhfMO4+dNb7496llyke0= +github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.19.9/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.20.2 h1:dxy7PGTqEh94zj2E3h1cUmQQWiM1+aeCROfAr02EmK8= +github.com/go-openapi/errors v0.20.2/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/jsonreference v0.19.4 h1:3Vw+rh13uq2JFNxgnMTGE1rnoieU9FmyE1gvnyylsYg= -github.com/go-openapi/jsonreference v0.19.4/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= -github.com/go-openapi/loads v0.19.3/go.mod h1:YVfqhUCdahYwR3f3iiwQLhicVRvLlU/WO5WPaZvcvSI= -github.com/go-openapi/loads v0.19.5 h1:jZVYWawIQiA1NBnHla28ktg6hrcfTHsCE+3QLVRBIls= -github.com/go-openapi/loads v0.19.5/go.mod h1:dswLCAdonkRufe/gSUC3gN8nTSaB9uaS2es0x5/IbjY= -github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= -github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= -github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= -github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo= -github.com/go-openapi/runtime v0.19.20 h1:J/t+QIjbcoq8WJvjGxRKiFBhqUE8slS9SbmD0Oi/raQ= -github.com/go-openapi/runtime v0.19.20/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk= -github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/spec v0.19.6/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= -github.com/go-openapi/spec v0.19.8 h1:qAdZLh1r6QF/hI/gTq+TJTvsQUodZsM7KLqkAJdiJNg= -github.com/go-openapi/spec v0.19.8/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= -github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= -github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= -github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= -github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= -github.com/go-openapi/strfmt v0.19.5 h1:0utjKrw+BAh8s57XE9Xz8DUBsVvPmRUB6styvl9wWIM= -github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= -github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= +github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= +github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= +github.com/go-openapi/loads v0.21.1 h1:Wb3nVZpdEzDTcly8S4HMkey6fjARRzb7iEaySimlDW0= +github.com/go-openapi/loads v0.21.1/go.mod h1:/DtAMXXneXFjbQMGEtbamCZb+4x7eGwkvZCvBmwUG+g= +github.com/go-openapi/runtime v0.23.3 h1:/dxjx4KCOQI5ImBMz036F6v/DzZ2NUjSRvbLJs1rgoE= +github.com/go-openapi/runtime v0.23.3/go.mod h1:AKurw9fNre+h3ELZfk6ILsfvPN+bvvlaU/M9q/r9hpk= +github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= +github.com/go-openapi/spec v0.20.5 h1:skHa8av4VnAtJU5zyAUXrrdK/NDiVX8lchbG+BfcdrE= +github.com/go-openapi/spec v0.20.5/go.mod h1:QbfOSIVt3/sac+a1wzmKbbcLXm5NdZnyBZYtCijp43o= +github.com/go-openapi/strfmt v0.21.0/go.mod h1:ZRQ409bWMj+SOgXofQAGTIo2Ebu72Gs+WaRADcS5iNg= +github.com/go-openapi/strfmt v0.21.1/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= +github.com/go-openapi/strfmt v0.21.2 h1:5NDNgadiX1Vhemth/TH4gCGopWSTdDjxl60H3B7f+os= +github.com/go-openapi/strfmt v0.21.2/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.7/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= -github.com/go-openapi/swag v0.19.9 h1:1IxuqvBUU3S2Bi4YC7tlP9SJF1gVpCvqN0T2Qof4azE= -github.com/go-openapi/swag v0.19.9/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= -github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= -github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= -github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7vS9k0lo6zwJo= -github.com/go-openapi/validate v0.19.10 h1:tG3SZ5DC5KF4cyt7nqLVcQXGj5A7mpaYkAcNPlDK+Yk= -github.com/go-openapi/validate v0.19.10/go.mod h1:RKEZTUWDkxKQxN2jDT7ZnZi2bhZlbNMAuKvKB+IaGx8= +github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.21.1 h1:wm0rhTb5z7qpJRHBdPOMuY4QjVUMbF6/kwoYeRAOrKU= +github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/validate v0.21.0 h1:+Wqk39yKOhfpLqNLEC0/eViCkzM5FVXVqrvt526+wcI= +github.com/go-openapi/validate v0.21.0/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= +github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= @@ -266,7 +226,6 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -274,8 +233,8 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.8.0 h1:/57CcG6YAO31FWwTVUnNl+2RcDUAaT55HtI71KQAXVw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.8.0/go.mod h1:/fckq3NE+vGiJsd4fDt4ge1XrK8cN+e5G5QWIzdg7Q8= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.0 h1:ESEyqQqXXFIcImj/BE8oKEX37Zsuceb2cZI+EL/zNCY= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.0/go.mod h1:XnLCLFp3tjoZJszVKjfpyAK6J8sYIcQXWQxmqLWF21I= github.com/hashicorp/go-version v1.4.0 h1:aAQzgqIrRKRa7w75CKpbBxYsmUoPjzVm1W59ca1L0J4= github.com/hashicorp/go-version v1.4.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -286,6 +245,8 @@ github.com/jackc/fake v0.0.0-20150926172116-812a484cc733/go.mod h1:WrMFNQdiFJ80s github.com/jackc/pgx v3.6.2+incompatible h1:2zP5OD7kiyR3xzRYMhOcXVvkDZsImVXfj+yIyTQf3/o= github.com/jackc/pgx v3.6.2+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -301,8 +262,8 @@ github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0Lh github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.9.5 h1:U+CaK85mrNNb4k8BNOfgJtJ/gr6kswUCFj6miSzVC6M= -github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc= +github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -311,29 +272,27 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.5 h1:J+gdV2cUmX7ZqL2B0lFcW0m+egaHC2V3lpO8nWxyYiQ= github.com/lib/pq v1.10.5/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.1 h1:mdxE1MF9o53iCb2Ghj1VfWvh7ZOwHpnVG/xwXrV90U8= -github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/mattn/go-sqlite3 v1.14.0 h1:mLyGNKR8+Vv9CAU7PphKa2hkEqxxhn8i32J6FPj1/QA= github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= +github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= @@ -347,8 +306,10 @@ github.com/mwitkow/go-proto-validators v0.3.2 h1:qRlmpTzm2pstMKKzTdvwPCF5QfBNURS github.com/mwitkow/go-proto-validators v0.3.2/go.mod h1:ej0Qp0qMgHN/KtDyUt+Q1/tA7a5VarXUOUxD+oeD30w= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= +github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= +github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/percona/exporter_shared v0.7.3 h1:TX4LisZ08jo8KIlekBTwPX13JlM6gOOKgmwg7QEf+r8= github.com/percona/exporter_shared v0.7.3/go.mod h1:AWk9lgTPzI7tC5PzpeBGvhhqjSJNxpPNFaF7qLIJqmo= @@ -356,8 +317,8 @@ github.com/percona/go-mysql v0.0.0-20200630114833-b77f37c0bfa2 h1:0tQBti5FIrKfH3 github.com/percona/go-mysql v0.0.0-20200630114833-b77f37c0bfa2/go.mod h1:/SGLf9OMxlnK6jq4mkFiImBcJXXk5jwD+lDrwDaGXcw= github.com/percona/percona-toolkit v3.2.1+incompatible h1:5jLvtZKcu9fDmaLRB8qA4bLR727t5iYyguHJJQTk9w0= github.com/percona/percona-toolkit v3.2.1+incompatible/go.mod h1:netQWdWMaF1cnmwiIS+i5uyaqNXz46yNeM6HKkR6yeI= -github.com/percona/pmm v0.0.0-20220404174627-9de9a91ebd60 h1:foaElnWcHW3psgUBAPhWlTo5j8M7876cWWASrJIzcrs= -github.com/percona/pmm v0.0.0-20220404174627-9de9a91ebd60/go.mod h1:stX2hCHtTjCsIhcvZXuu7VoaCiU+DYHwHxzANI/7Ps0= +github.com/percona/pmm v0.0.0-20220413231946-84d9f7d044b2 h1:ZeS+rOGtPzNzzKq7YcOU1+Xj5ppTj9nY5AgD4ZqiPCc= +github.com/percona/pmm v0.0.0-20220413231946-84d9f7d044b2/go.mod h1:NVF1oAaKuXVum37J1Iesuqtcygg98pLJtKktn49gXcg= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -381,8 +342,9 @@ github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+ github.com/prometheus/common v0.8.0/go.mod h1:PC/OgXc+UN7B4ALwvn1yzVZmVwvhXp5JsbBv6wSv6i0= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.33.0 h1:rHgav/0a6+uYgGdNt3jwz8FNSesO/Hsang3O0T9A5SE= +github.com/prometheus/common v0.33.0/go.mod h1:gB3sOl7P0TvJabZpLY5uQMpUqRCPPCyRLCZYc7JZTNE= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= @@ -424,20 +386,17 @@ github.com/xdg-go/scram v1.0.2 h1:akYIkZ28e6A96dkWNJQu3nmCzH3YfwMPQExUYDaRv7w= github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= github.com/xdg-go/stringprep v1.0.2 h1:6iq84/ryjjeRmMJwxutI51F2GIPlP5BfTvXHeYjyhBc= github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= -github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= -github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= -go.mongodb.org/mongo-driver v1.3.4/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= -go.mongodb.org/mongo-driver v1.7.1 h1:jwqTeEM3x6L9xDXrCxN0Hbg7vdGfPBOTIkr0+/LYZDA= -go.mongodb.org/mongo-driver v1.7.1/go.mod h1:Q4oFMbo1+MSNqICAdYMlC/zSTrwCogR4R8NzkI+yfU8= +go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= +go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= +go.mongodb.org/mongo-driver v1.8.3/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY= +go.mongodb.org/mongo-driver v1.9.0 h1:f3aLGJvQmBl8d9S40IL+jEyBC6hfLPbJjv9t5hEM9ck= +go.mongodb.org/mongo-driver v1.9.0/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -446,18 +405,15 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/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-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f h1:aZp0e2vLN4MToVqnjNEYEtrEA8RH8U8FN1CU7JgqsPU= +golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -491,12 +447,10 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -505,7 +459,6 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -517,15 +470,17 @@ golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5 h1:bRb386wvrE+oBNdF1d/Xh9mQrfQ4ecYhW5qJ5GvTGT4= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -533,6 +488,7 @@ golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -550,7 +506,6 @@ golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -559,7 +514,6 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -587,13 +541,16 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad h1:ntjMns5wyP/fN65tdBD4g8J5w8n015+iIIs9rtjXkY0= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -624,8 +581,6 @@ golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -715,8 +670,9 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20220302033224-9aa15565e42a h1:uqouglH745GoGeZ1YFZbPBiu961tgi/9Qm5jaorajjQ= -google.golang.org/genproto v0.0.0-20220302033224-9aa15565e42a/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220317150908-0efb43f6373e/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= +google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9 h1:XGQ6tc+EnM35IAazg4y6AHmUg4oK8NXsXaILte1vRlk= +google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -731,7 +687,6 @@ google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -746,8 +701,9 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From e35cbc45a7778c4bdcc0524ee2dca644f15b1514 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Thu, 14 Apr 2022 16:09:16 +0300 Subject: [PATCH 12/63] Pmm-5680 add mutex --- storelogs/main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/storelogs/main.go b/storelogs/main.go index daecd6a7a..a102cefd0 100644 --- a/storelogs/main.go +++ b/storelogs/main.go @@ -5,6 +5,7 @@ import ( "container/ring" "fmt" "github.com/sirupsen/logrus" + "sync" "time" ) @@ -12,6 +13,7 @@ type LogsStore struct { log *ring.Ring Entry *logrus.Entry count int + m sync.RWMutex } func (l *LogsStore) SetUp(entry *logrus.Entry) { @@ -37,11 +39,14 @@ func (l *LogsStore) SaveLog(log string) { for _, v := range l.Entry.Data { b.WriteString(fmt.Sprintf(" %v", v)) } + l.m.Lock() l.log.Value = b.String() + l.m.Unlock() l.log = l.log.Next() } func (l *LogsStore) GetLogs() (logs []string) { + l.m.Lock() if l != nil { l.log.Do(func(p interface{}) { log := fmt.Sprint(p) @@ -50,6 +55,7 @@ func (l *LogsStore) GetLogs() (logs []string) { } }) } + l.m.Unlock() return logs } From 89a98da220c1361f6dd06883715c77f81b01adde Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Thu, 14 Apr 2022 20:09:42 +0300 Subject: [PATCH 13/63] Pmm-5680 fix tests --- agents/supervisor/supervisor_test.go | 53 ++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 15 deletions(-) diff --git a/agents/supervisor/supervisor_test.go b/agents/supervisor/supervisor_test.go index d006909d8..39adc3538 100644 --- a/agents/supervisor/supervisor_test.go +++ b/agents/supervisor/supervisor_test.go @@ -65,7 +65,10 @@ func TestSupervisor(t *testing.T) { "noop3": {Type: type_TEST_NOOP, Dsn: "30"}, }, }) - + agentList := s.AgentsList() + for _, agent := range agentList { + agent.Logs = nil + } assertChanges(t, s, &agentpb.StateChangedRequest{AgentId: "noop3", Status: inventorypb.AgentStatus_STARTING}, &agentpb.StateChangedRequest{AgentId: "sleep1", Status: inventorypb.AgentStatus_STARTING, ListenPort: 65000}) @@ -73,7 +76,7 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_NOOP, AgentId: "noop3", Status: inventorypb.AgentStatus_STARTING}, {AgentType: type_TEST_SLEEP, AgentId: "sleep1", Status: inventorypb.AgentStatus_STARTING, ListenPort: 65000}, } - assert.Equal(t, expectedList, s.AgentsList()) + assert.Equal(t, expectedList, agentList) assertChanges(t, s, &agentpb.StateChangedRequest{AgentId: "noop3", Status: inventorypb.AgentStatus_RUNNING}, @@ -82,15 +85,19 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_NOOP, AgentId: "noop3", Status: inventorypb.AgentStatus_RUNNING}, {AgentType: type_TEST_SLEEP, AgentId: "sleep1", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65000}, } - assert.Equal(t, expectedList, s.AgentsList()) + assert.Equal(t, expectedList, agentList) }) t.Run("Restart1Start2", func(t *testing.T) { + agentList := s.AgentsList() + for _, agent := range agentList { + agent.Logs = nil + } expectedList := []*agentlocalpb.AgentInfo{ {AgentType: type_TEST_NOOP, AgentId: "noop3", Status: inventorypb.AgentStatus_RUNNING}, {AgentType: type_TEST_SLEEP, AgentId: "sleep1", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65000}, } - require.Equal(t, expectedList, s.AgentsList()) + require.Equal(t, expectedList, agentList) s.SetState(&agentpb.SetStateRequest{ AgentProcesses: map[string]*agentpb.SetStateRequest_AgentProcess{ @@ -115,7 +122,7 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_SLEEP, AgentId: "sleep1", Status: inventorypb.AgentStatus_STARTING, ListenPort: 65000}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_STARTING, ListenPort: 65001}, } - assert.Equal(t, expectedList, s.AgentsList()) + assert.Equal(t, expectedList, agentList) assertChanges(t, s, &agentpb.StateChangedRequest{AgentId: "sleep1", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65000}, @@ -125,16 +132,20 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_SLEEP, AgentId: "sleep1", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65000}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65001}, } - assert.Equal(t, expectedList, s.AgentsList()) + assert.Equal(t, expectedList, agentList) }) t.Run("Restart3Start4", func(t *testing.T) { + agentList := s.AgentsList() + for _, agent := range agentList { + agent.Logs = nil + } expectedList := []*agentlocalpb.AgentInfo{ {AgentType: type_TEST_NOOP, AgentId: "noop3", Status: inventorypb.AgentStatus_RUNNING}, {AgentType: type_TEST_SLEEP, AgentId: "sleep1", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65000}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65001}, } - require.Equal(t, expectedList, s.AgentsList()) + require.Equal(t, expectedList, agentList) s.SetState(&agentpb.SetStateRequest{ AgentProcesses: map[string]*agentpb.SetStateRequest_AgentProcess{ @@ -161,7 +172,7 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_SLEEP, AgentId: "sleep1", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65000}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65001}, } - assert.Equal(t, expectedList, s.AgentsList()) + assert.Equal(t, expectedList, agentList) assertChanges(t, s, &agentpb.StateChangedRequest{AgentId: "noop3", Status: inventorypb.AgentStatus_RUNNING}, @@ -172,17 +183,21 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_SLEEP, AgentId: "sleep1", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65000}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65001}, } - assert.Equal(t, expectedList, s.AgentsList()) + assert.Equal(t, expectedList, agentList) }) t.Run("Stop1", func(t *testing.T) { + agentList := s.AgentsList() + for _, agent := range agentList { + agent.Logs = nil + } expectedList := []*agentlocalpb.AgentInfo{ {AgentType: type_TEST_NOOP, AgentId: "noop3", Status: inventorypb.AgentStatus_RUNNING}, {AgentType: type_TEST_NOOP, AgentId: "noop4", Status: inventorypb.AgentStatus_RUNNING}, {AgentType: type_TEST_SLEEP, AgentId: "sleep1", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65000}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65001}, } - require.Equal(t, expectedList, s.AgentsList()) + require.Equal(t, expectedList, agentList) s.SetState(&agentpb.SetStateRequest{ AgentProcesses: map[string]*agentpb.SetStateRequest_AgentProcess{ @@ -203,16 +218,20 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_NOOP, AgentId: "noop4", Status: inventorypb.AgentStatus_RUNNING}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65001}, } - require.Equal(t, expectedList, s.AgentsList()) + require.Equal(t, expectedList, agentList) }) t.Run("Stop3", func(t *testing.T) { + agentList := s.AgentsList() + for _, agent := range agentList { + agent.Logs = nil + } expectedList := []*agentlocalpb.AgentInfo{ {AgentType: type_TEST_NOOP, AgentId: "noop3", Status: inventorypb.AgentStatus_RUNNING}, {AgentType: type_TEST_NOOP, AgentId: "noop4", Status: inventorypb.AgentStatus_RUNNING}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65001}, } - require.Equal(t, expectedList, s.AgentsList()) + require.Equal(t, expectedList, agentList) s.SetState(&agentpb.SetStateRequest{ AgentProcesses: map[string]*agentpb.SetStateRequest_AgentProcess{ @@ -231,15 +250,19 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_NOOP, AgentId: "noop4", Status: inventorypb.AgentStatus_RUNNING}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65001}, } - require.Equal(t, expectedList, s.AgentsList()) + require.Equal(t, expectedList, agentList) }) t.Run("Exit", func(t *testing.T) { + agentList := s.AgentsList() + for _, agent := range agentList { + agent.Logs = nil + } expectedList := []*agentlocalpb.AgentInfo{ {AgentType: type_TEST_NOOP, AgentId: "noop4", Status: inventorypb.AgentStatus_RUNNING}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65001}, } - require.Equal(t, expectedList, s.AgentsList()) + require.Equal(t, expectedList, agentList) cancel() @@ -250,7 +273,7 @@ func TestSupervisor(t *testing.T) { &agentpb.StateChangedRequest{AgentId: "noop4", Status: inventorypb.AgentStatus_DONE}) assertChanges(t, s, nil) expectedList = []*agentlocalpb.AgentInfo{} - require.Equal(t, expectedList, s.AgentsList()) + require.Equal(t, expectedList, agentList) }) } From 989bb4f83d12367892307e20f32302b1a57ca933 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Thu, 14 Apr 2022 20:45:34 +0300 Subject: [PATCH 14/63] Pmm-5680 fix tests --- agents/supervisor/supervisor.go | 9 +++++ agents/supervisor/supervisor_test.go | 55 +++++++++------------------- 2 files changed, 26 insertions(+), 38 deletions(-) diff --git a/agents/supervisor/supervisor.go b/agents/supervisor/supervisor.go index 247a275e1..5c25f18a6 100644 --- a/agents/supervisor/supervisor.go +++ b/agents/supervisor/supervisor.go @@ -145,6 +145,15 @@ func (s *Supervisor) AgentsList() []*agentlocalpb.AgentInfo { return res } +// AgentsListWithoutLogs returns info for all Agents managed by this supervisor without logs. +func (s *Supervisor) AgentsListWithoutLogs() []*agentlocalpb.AgentInfo { + agentList := s.AgentsList() + for i, _ := range agentList { + agentList[i].Logs = nil + } + return agentList +} + // Changes returns channel with Agent's state changes. func (s *Supervisor) Changes() <-chan *agentpb.StateChangedRequest { return s.changes diff --git a/agents/supervisor/supervisor_test.go b/agents/supervisor/supervisor_test.go index 39adc3538..4561c7a93 100644 --- a/agents/supervisor/supervisor_test.go +++ b/agents/supervisor/supervisor_test.go @@ -65,10 +65,7 @@ func TestSupervisor(t *testing.T) { "noop3": {Type: type_TEST_NOOP, Dsn: "30"}, }, }) - agentList := s.AgentsList() - for _, agent := range agentList { - agent.Logs = nil - } + assertChanges(t, s, &agentpb.StateChangedRequest{AgentId: "noop3", Status: inventorypb.AgentStatus_STARTING}, &agentpb.StateChangedRequest{AgentId: "sleep1", Status: inventorypb.AgentStatus_STARTING, ListenPort: 65000}) @@ -76,7 +73,8 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_NOOP, AgentId: "noop3", Status: inventorypb.AgentStatus_STARTING}, {AgentType: type_TEST_SLEEP, AgentId: "sleep1", Status: inventorypb.AgentStatus_STARTING, ListenPort: 65000}, } - assert.Equal(t, expectedList, agentList) + + assert.Equal(t, expectedList, s.AgentsListWithoutLogs()) assertChanges(t, s, &agentpb.StateChangedRequest{AgentId: "noop3", Status: inventorypb.AgentStatus_RUNNING}, @@ -85,19 +83,15 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_NOOP, AgentId: "noop3", Status: inventorypb.AgentStatus_RUNNING}, {AgentType: type_TEST_SLEEP, AgentId: "sleep1", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65000}, } - assert.Equal(t, expectedList, agentList) + assert.Equal(t, expectedList, s.AgentsListWithoutLogs()) }) t.Run("Restart1Start2", func(t *testing.T) { - agentList := s.AgentsList() - for _, agent := range agentList { - agent.Logs = nil - } expectedList := []*agentlocalpb.AgentInfo{ {AgentType: type_TEST_NOOP, AgentId: "noop3", Status: inventorypb.AgentStatus_RUNNING}, {AgentType: type_TEST_SLEEP, AgentId: "sleep1", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65000}, } - require.Equal(t, expectedList, agentList) + require.Equal(t, expectedList, s.AgentsListWithoutLogs()) s.SetState(&agentpb.SetStateRequest{ AgentProcesses: map[string]*agentpb.SetStateRequest_AgentProcess{ @@ -122,7 +116,7 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_SLEEP, AgentId: "sleep1", Status: inventorypb.AgentStatus_STARTING, ListenPort: 65000}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_STARTING, ListenPort: 65001}, } - assert.Equal(t, expectedList, agentList) + assert.Equal(t, expectedList, s.AgentsListWithoutLogs()) assertChanges(t, s, &agentpb.StateChangedRequest{AgentId: "sleep1", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65000}, @@ -132,20 +126,17 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_SLEEP, AgentId: "sleep1", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65000}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65001}, } - assert.Equal(t, expectedList, agentList) + + assert.Equal(t, expectedList, s.AgentsListWithoutLogs()) }) t.Run("Restart3Start4", func(t *testing.T) { - agentList := s.AgentsList() - for _, agent := range agentList { - agent.Logs = nil - } expectedList := []*agentlocalpb.AgentInfo{ {AgentType: type_TEST_NOOP, AgentId: "noop3", Status: inventorypb.AgentStatus_RUNNING}, {AgentType: type_TEST_SLEEP, AgentId: "sleep1", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65000}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65001}, } - require.Equal(t, expectedList, agentList) + require.Equal(t, expectedList, s.AgentsListWithoutLogs()) s.SetState(&agentpb.SetStateRequest{ AgentProcesses: map[string]*agentpb.SetStateRequest_AgentProcess{ @@ -172,7 +163,7 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_SLEEP, AgentId: "sleep1", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65000}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65001}, } - assert.Equal(t, expectedList, agentList) + assert.Equal(t, expectedList, s.AgentsListWithoutLogs()) assertChanges(t, s, &agentpb.StateChangedRequest{AgentId: "noop3", Status: inventorypb.AgentStatus_RUNNING}, @@ -183,21 +174,17 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_SLEEP, AgentId: "sleep1", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65000}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65001}, } - assert.Equal(t, expectedList, agentList) + assert.Equal(t, expectedList, s.AgentsListWithoutLogs()) }) t.Run("Stop1", func(t *testing.T) { - agentList := s.AgentsList() - for _, agent := range agentList { - agent.Logs = nil - } expectedList := []*agentlocalpb.AgentInfo{ {AgentType: type_TEST_NOOP, AgentId: "noop3", Status: inventorypb.AgentStatus_RUNNING}, {AgentType: type_TEST_NOOP, AgentId: "noop4", Status: inventorypb.AgentStatus_RUNNING}, {AgentType: type_TEST_SLEEP, AgentId: "sleep1", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65000}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65001}, } - require.Equal(t, expectedList, agentList) + require.Equal(t, expectedList, s.AgentsListWithoutLogs()) s.SetState(&agentpb.SetStateRequest{ AgentProcesses: map[string]*agentpb.SetStateRequest_AgentProcess{ @@ -218,20 +205,16 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_NOOP, AgentId: "noop4", Status: inventorypb.AgentStatus_RUNNING}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65001}, } - require.Equal(t, expectedList, agentList) + require.Equal(t, expectedList, s.AgentsListWithoutLogs()) }) t.Run("Stop3", func(t *testing.T) { - agentList := s.AgentsList() - for _, agent := range agentList { - agent.Logs = nil - } expectedList := []*agentlocalpb.AgentInfo{ {AgentType: type_TEST_NOOP, AgentId: "noop3", Status: inventorypb.AgentStatus_RUNNING}, {AgentType: type_TEST_NOOP, AgentId: "noop4", Status: inventorypb.AgentStatus_RUNNING}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65001}, } - require.Equal(t, expectedList, agentList) + require.Equal(t, expectedList, s.AgentsListWithoutLogs()) s.SetState(&agentpb.SetStateRequest{ AgentProcesses: map[string]*agentpb.SetStateRequest_AgentProcess{ @@ -250,19 +233,15 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_NOOP, AgentId: "noop4", Status: inventorypb.AgentStatus_RUNNING}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65001}, } - require.Equal(t, expectedList, agentList) + require.Equal(t, expectedList, s.AgentsListWithoutLogs()) }) t.Run("Exit", func(t *testing.T) { - agentList := s.AgentsList() - for _, agent := range agentList { - agent.Logs = nil - } expectedList := []*agentlocalpb.AgentInfo{ {AgentType: type_TEST_NOOP, AgentId: "noop4", Status: inventorypb.AgentStatus_RUNNING}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65001}, } - require.Equal(t, expectedList, agentList) + require.Equal(t, expectedList, s.AgentsListWithoutLogs()) cancel() @@ -273,7 +252,7 @@ func TestSupervisor(t *testing.T) { &agentpb.StateChangedRequest{AgentId: "noop4", Status: inventorypb.AgentStatus_DONE}) assertChanges(t, s, nil) expectedList = []*agentlocalpb.AgentInfo{} - require.Equal(t, expectedList, agentList) + require.Equal(t, expectedList, s.AgentsList()) }) } From 9169b92dcfaed6d98149f64a47d152e9514be454 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Thu, 14 Apr 2022 21:04:58 +0300 Subject: [PATCH 15/63] Pmm-5680 fix tests --- storelogs/main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/storelogs/main.go b/storelogs/main.go index a102cefd0..a30fe88fb 100644 --- a/storelogs/main.go +++ b/storelogs/main.go @@ -61,27 +61,27 @@ func (l *LogsStore) GetLogs() (logs []string) { func (l *LogsStore) Warnf(format string, v ...interface{}) { l.SaveLog(fmt.Sprintf(format, v...)) - l.Entry.Warnf(format, v) + l.Entry.Warnf(format, v...) } func (l *LogsStore) Infof(format string, v ...interface{}) { l.SaveLog(fmt.Sprintf(format, v...)) - l.Entry.Infof(format, v) + l.Entry.Infof(format, v...) } func (l *LogsStore) Debugf(format string, v ...interface{}) { l.SaveLog(fmt.Sprintf(format, v...)) - l.Entry.Debugf(format, v) + l.Entry.Debugf(format, v...) } func (l *LogsStore) Tracef(format string, v ...interface{}) { l.SaveLog(fmt.Sprintf(format, v...)) - l.Entry.Tracef(format, v) + l.Entry.Tracef(format, v...) } func (l *LogsStore) Errorf(format string, v ...interface{}) { l.SaveLog(fmt.Sprintf(format, v...)) - l.Entry.Errorf(format, v) + l.Entry.Errorf(format, v...) } func (l *LogsStore) Trace(message string) { From 8562fbcb375a6c65f26ee532cf6ca117a8f836df Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Thu, 14 Apr 2022 21:27:23 +0300 Subject: [PATCH 16/63] Pmm-5680 fix tests --- agents/process/process_test.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/agents/process/process_test.go b/agents/process/process_test.go index 7cb36f3a3..69e56af0d 100644 --- a/agents/process/process_test.go +++ b/agents/process/process_test.go @@ -17,6 +17,7 @@ package process import ( "context" + "github.com/percona/pmm-agent/storelogs" "io/ioutil" "os" "os/exec" @@ -60,13 +61,15 @@ func build(t *testing.T, tag string, fileName string, outputFile string) *exec.C return cmd } -func setup(t *testing.T) (context.Context, context.CancelFunc, *logrus.Entry) { +func setup(t *testing.T) (context.Context, context.CancelFunc, *storelogs.LogsStore) { t.Helper() t.Parallel() ctx, cancel := context.WithCancel(context.Background()) l := logrus.WithField("test", t.Name()) - return ctx, cancel, l + ringLog := new(storelogs.LogsStore) + ringLog.SetUp(l) + return ctx, cancel, ringLog } func TestProcess(t *testing.T) { @@ -159,7 +162,7 @@ func TestProcess(t *testing.T) { ctx, cancel, l := setup(t) defer cancel() - logger := newProcessLogger(l, 2, nil) + logger := newProcessLogger(l.Entry, 2, nil) pCmd := exec.CommandContext(ctx, f.Name()) //nolint:gosec pCmd.Stdout = logger From f0b2d6a6bccf8f8ea3acce56b5cf099d2bf14556 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Thu, 14 Apr 2022 21:47:23 +0300 Subject: [PATCH 17/63] Pmm-5680 change process_child.go --- agents/process/process_child.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/agents/process/process_child.go b/agents/process/process_child.go index 734be28e0..b741e962d 100644 --- a/agents/process/process_child.go +++ b/agents/process/process_child.go @@ -28,6 +28,7 @@ import ( "io/ioutil" "time" + "github.com/percona/pmm-agent/storelogs" "github.com/percona/pmm/api/inventorypb" "github.com/sirupsen/logrus" @@ -39,9 +40,9 @@ func main() { logger := logrus.New() logger.SetOutput(ioutil.Discard) l := logrus.NewEntry(logger) - ringLogs := ring.New(30) - - p := process.New(&process.Params{Path: "sleep", Args: []string{"100500"}}, nil, l, ringLogs) + ringLog := new(storelogs.LogsStore) + ringLog.SetUp(l) + p := process.New(&process.Params{Path: "sleep", Args: []string{"100500"}}, nil, ringLogs) go p.Run(context.Background()) // Wait until the process is running. From 7a4863a2118357c2d06a6a4a9da347798c328cbf Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Thu, 14 Apr 2022 21:56:38 +0300 Subject: [PATCH 18/63] Pmm-5680 fix process_child.go --- agents/process/process_child.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agents/process/process_child.go b/agents/process/process_child.go index b741e962d..3ca41b9b4 100644 --- a/agents/process/process_child.go +++ b/agents/process/process_child.go @@ -42,7 +42,7 @@ func main() { l := logrus.NewEntry(logger) ringLog := new(storelogs.LogsStore) ringLog.SetUp(l) - p := process.New(&process.Params{Path: "sleep", Args: []string{"100500"}}, nil, ringLogs) + p := process.New(&process.Params{Path: "sleep", Args: []string{"100500"}}, nil, ringLog) go p.Run(context.Background()) // Wait until the process is running. From c20a64c04afe8f90d17101d3aff443c776f34b8a Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Thu, 14 Apr 2022 22:31:08 +0300 Subject: [PATCH 19/63] Pmm-5680 fix mysql_show_table_status_action_test.go --- actions/mysql_show_table_status_action_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/mysql_show_table_status_action_test.go b/actions/mysql_show_table_status_action_test.go index 96c0cee58..ed7fdedb1 100644 --- a/actions/mysql_show_table_status_action_test.go +++ b/actions/mysql_show_table_status_action_test.go @@ -104,7 +104,7 @@ func TestShowTableStatus(t *testing.T) { actual[1][11] = createTime assert.Equal(t, []interface{}{ "city", "InnoDB", 10.0, "Dynamic", 4188.0, 97.0, 409600.0, 0.0, - 131072.0, 0.0, 4080.0, "2019-06-10 12:04:29", nil, nil, "latin1_swedish_ci", + 262144.0, 0.0, 4080.0, "2019-06-10 12:04:29", nil, nil, "latin1_swedish_ci", nil, "", "", 0.0, "N", }, actual[1]) From f2d3a40c4612a837b972d45ffdb91eb5337643d6 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Thu, 14 Apr 2022 22:49:53 +0300 Subject: [PATCH 20/63] Pmm-5680 gen --- agents/process/process.go | 3 ++- agents/process/process_child.go | 3 ++- agents/process/process_test.go | 3 ++- agents/supervisor/supervisor.go | 5 +++-- storelogs/main.go | 3 ++- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/agents/process/process.go b/agents/process/process.go index ea43b3140..0c2214db2 100644 --- a/agents/process/process.go +++ b/agents/process/process.go @@ -19,11 +19,12 @@ package process import ( "context" "fmt" - "github.com/percona/pmm-agent/storelogs" "os/exec" "strings" "time" + "github.com/percona/pmm-agent/storelogs" + "github.com/percona/pmm/api/inventorypb" "github.com/percona/pmm/utils/pdeathsig" "golang.org/x/sys/unix" diff --git a/agents/process/process_child.go b/agents/process/process_child.go index 3ca41b9b4..9b7ffca04 100644 --- a/agents/process/process_child.go +++ b/agents/process/process_child.go @@ -28,10 +28,11 @@ import ( "io/ioutil" "time" - "github.com/percona/pmm-agent/storelogs" "github.com/percona/pmm/api/inventorypb" "github.com/sirupsen/logrus" + "github.com/percona/pmm-agent/storelogs" + "github.com/percona/pmm-agent/agents/process" ) diff --git a/agents/process/process_test.go b/agents/process/process_test.go index 69e56af0d..235efd3ac 100644 --- a/agents/process/process_test.go +++ b/agents/process/process_test.go @@ -17,7 +17,6 @@ package process import ( "context" - "github.com/percona/pmm-agent/storelogs" "io/ioutil" "os" "os/exec" @@ -26,6 +25,8 @@ import ( "testing" "time" + "github.com/percona/pmm-agent/storelogs" + "github.com/percona/pmm/api/inventorypb" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" diff --git a/agents/supervisor/supervisor.go b/agents/supervisor/supervisor.go index 5c25f18a6..86bb093ff 100644 --- a/agents/supervisor/supervisor.go +++ b/agents/supervisor/supervisor.go @@ -19,7 +19,6 @@ package supervisor import ( "context" "fmt" - "github.com/percona/pmm-agent/storelogs" "path/filepath" "regexp" "runtime/pprof" @@ -27,6 +26,8 @@ import ( "strings" "sync" + "github.com/percona/pmm-agent/storelogs" + "github.com/percona/pmm/api/agentlocalpb" "github.com/percona/pmm/api/agentpb" "github.com/percona/pmm/api/inventorypb" @@ -148,7 +149,7 @@ func (s *Supervisor) AgentsList() []*agentlocalpb.AgentInfo { // AgentsListWithoutLogs returns info for all Agents managed by this supervisor without logs. func (s *Supervisor) AgentsListWithoutLogs() []*agentlocalpb.AgentInfo { agentList := s.AgentsList() - for i, _ := range agentList { + for i := range agentList { agentList[i].Logs = nil } return agentList diff --git a/storelogs/main.go b/storelogs/main.go index a30fe88fb..307ebf765 100644 --- a/storelogs/main.go +++ b/storelogs/main.go @@ -4,9 +4,10 @@ import ( "bytes" "container/ring" "fmt" - "github.com/sirupsen/logrus" "sync" "time" + + "github.com/sirupsen/logrus" ) type LogsStore struct { From 50ebcafd7649682b7f7769de80fa721953b3b667 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Thu, 14 Apr 2022 23:05:44 +0300 Subject: [PATCH 21/63] Pmm-5680 fix --- agents/process/process_test.go | 2 +- agents/supervisor/supervisor.go | 2 +- storelogs/main.go | 20 ++++++++++++++++++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/agents/process/process_test.go b/agents/process/process_test.go index 235efd3ac..20bde4f46 100644 --- a/agents/process/process_test.go +++ b/agents/process/process_test.go @@ -68,7 +68,7 @@ func setup(t *testing.T) (context.Context, context.CancelFunc, *storelogs.LogsSt ctx, cancel := context.WithCancel(context.Background()) l := logrus.WithField("test", t.Name()) - ringLog := new(storelogs.LogsStore) + ringLog := &storelogs.LogsStore{} ringLog.SetUp(l) return ctx, cancel, ringLog } diff --git a/agents/supervisor/supervisor.go b/agents/supervisor/supervisor.go index 86bb093ff..96f324f8b 100644 --- a/agents/supervisor/supervisor.go +++ b/agents/supervisor/supervisor.go @@ -359,7 +359,7 @@ func (s *Supervisor) startProcess(agentID string, agentProcess *agentpb.SetState "type": agentType, }) l.Debugf("Starting: %s.", processParams) - ringLog := new(storelogs.LogsStore) + ringLog := &storelogs.LogsStore{} ringLog.SetUp(l) process := process.New(processParams, agentProcess.RedactWords, ringLog) go pprof.Do(ctx, pprof.Labels("agentID", agentID, "type", agentType), process.Run) diff --git a/storelogs/main.go b/storelogs/main.go index 307ebf765..8658eb6fd 100644 --- a/storelogs/main.go +++ b/storelogs/main.go @@ -1,3 +1,19 @@ +// pmm-agent +// Copyright 2019 Percona LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package storelogs help to store logs package storelogs import ( @@ -47,16 +63,16 @@ func (l *LogsStore) SaveLog(log string) { } func (l *LogsStore) GetLogs() (logs []string) { - l.m.Lock() if l != nil { + l.m.Lock() l.log.Do(func(p interface{}) { log := fmt.Sprint(p) if p != nil { logs = append(logs, log) } }) + l.m.Unlock() } - l.m.Unlock() return logs } From a0a6d442e3cd2855e793455ee2d6eacf6528a58e Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Fri, 15 Apr 2022 00:12:05 +0300 Subject: [PATCH 22/63] Pmm-5680 update dependency --- .../mysql_show_table_status_action_test.go | 2 +- go.mod | 2 +- go.sum | 95 +++++++++++++++++++ 3 files changed, 97 insertions(+), 2 deletions(-) diff --git a/actions/mysql_show_table_status_action_test.go b/actions/mysql_show_table_status_action_test.go index ed7fdedb1..96c0cee58 100644 --- a/actions/mysql_show_table_status_action_test.go +++ b/actions/mysql_show_table_status_action_test.go @@ -104,7 +104,7 @@ func TestShowTableStatus(t *testing.T) { actual[1][11] = createTime assert.Equal(t, []interface{}{ "city", "InnoDB", 10.0, "Dynamic", 4188.0, 97.0, 409600.0, 0.0, - 262144.0, 0.0, 4080.0, "2019-06-10 12:04:29", nil, nil, "latin1_swedish_ci", + 131072.0, 0.0, 4080.0, "2019-06-10 12:04:29", nil, nil, "latin1_swedish_ci", nil, "", "", 0.0, "N", }, actual[1]) diff --git a/go.mod b/go.mod index b1338cf7f..70922d5e6 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( github.com/percona/exporter_shared v0.7.3 github.com/percona/go-mysql v0.0.0-20200630114833-b77f37c0bfa2 github.com/percona/percona-toolkit v3.2.1+incompatible - github.com/percona/pmm v0.0.0-20220413231946-84d9f7d044b2 + github.com/percona/pmm v0.0.0-20220414205931-d83c6722ef32 github.com/pganalyze/pg_query_go v1.0.3 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.12.1 diff --git a/go.sum b/go.sum index b52a68778..cce390ad6 100644 --- a/go.sum +++ b/go.sum @@ -43,6 +43,7 @@ github.com/Percona-Lab/kingpin v2.2.6-percona+incompatible/go.mod h1:UC6j/e2eqpH github.com/Percona-Lab/pg_query_go v1.0.3-percona h1:z0co9LzCdA9YuZBgOWTSr3+bGj14T/ngFIsHJA8A46E= github.com/Percona-Lab/pg_query_go v1.0.3-percona/go.mod h1:tR53lU3ddnExxb0XeLyYuQIK3dkR03FjQ9sj8AV/up8= github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc= +github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -54,6 +55,10 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2c github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= +github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ= github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= @@ -84,6 +89,7 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/denisenkom/go-mssqldb v0.9.0 h1:RSohk2RsiZqLZ0zCjtfn3S4Gp4exhpBWHyQ7D0yGjAk= github.com/denisenkom/go-mssqldb v0.9.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= +github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -92,6 +98,8 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= +github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -103,34 +111,87 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9 github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= +github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= +github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= +github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= +github.com/go-openapi/analysis v0.19.4/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= +github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= +github.com/go-openapi/analysis v0.19.10/go.mod h1:qmhS3VNFxBlquFJ0RGoDtylO9y4pgTAUNE9AEEMdlJQ= github.com/go-openapi/analysis v0.21.2/go.mod h1:HZwRk4RRisyG8vx2Oe6aqeSQcoxRp47Xkp3+K6q+LdY= github.com/go-openapi/analysis v0.21.3 h1:CPEa+B2oYCkb+lIKB4xP6Ork8Gvh0GNg9dm/twI3+QA= github.com/go-openapi/analysis v0.21.3/go.mod h1:2rtHDVV21tLgvJd+eXu+ExiOhfMO4+dNb7496llyke0= +github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= +github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= +github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= +github.com/go-openapi/errors v0.19.3/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= +github.com/go-openapi/errors v0.19.6/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/errors v0.19.9/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/errors v0.20.2 h1:dxy7PGTqEh94zj2E3h1cUmQQWiM1+aeCROfAr02EmK8= github.com/go-openapi/errors v0.20.2/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= +github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= +github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= +github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/jsonreference v0.19.4/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= +github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= +github.com/go-openapi/loads v0.19.3/go.mod h1:YVfqhUCdahYwR3f3iiwQLhicVRvLlU/WO5WPaZvcvSI= +github.com/go-openapi/loads v0.19.5/go.mod h1:dswLCAdonkRufe/gSUC3gN8nTSaB9uaS2es0x5/IbjY= github.com/go-openapi/loads v0.21.1 h1:Wb3nVZpdEzDTcly8S4HMkey6fjARRzb7iEaySimlDW0= github.com/go-openapi/loads v0.21.1/go.mod h1:/DtAMXXneXFjbQMGEtbamCZb+4x7eGwkvZCvBmwUG+g= +github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= +github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= +github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= +github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo= +github.com/go-openapi/runtime v0.19.20/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk= github.com/go-openapi/runtime v0.23.3 h1:/dxjx4KCOQI5ImBMz036F6v/DzZ2NUjSRvbLJs1rgoE= github.com/go-openapi/runtime v0.23.3/go.mod h1:AKurw9fNre+h3ELZfk6ILsfvPN+bvvlaU/M9q/r9hpk= +github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= +github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= +github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= +github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= +github.com/go-openapi/spec v0.19.6/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= +github.com/go-openapi/spec v0.19.8/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= github.com/go-openapi/spec v0.20.5 h1:skHa8av4VnAtJU5zyAUXrrdK/NDiVX8lchbG+BfcdrE= github.com/go-openapi/spec v0.20.5/go.mod h1:QbfOSIVt3/sac+a1wzmKbbcLXm5NdZnyBZYtCijp43o= +github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= +github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= +github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= +github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= +github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= +github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= +github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= github.com/go-openapi/strfmt v0.21.0/go.mod h1:ZRQ409bWMj+SOgXofQAGTIo2Ebu72Gs+WaRADcS5iNg= github.com/go-openapi/strfmt v0.21.1/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= github.com/go-openapi/strfmt v0.21.2 h1:5NDNgadiX1Vhemth/TH4gCGopWSTdDjxl60H3B7f+os= github.com/go-openapi/strfmt v0.21.2/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= +github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= +github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= +github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.7/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= +github.com/go-openapi/swag v0.19.9/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-openapi/swag v0.21.1 h1:wm0rhTb5z7qpJRHBdPOMuY4QjVUMbF6/kwoYeRAOrKU= github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= +github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= +github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7vS9k0lo6zwJo= +github.com/go-openapi/validate v0.19.10/go.mod h1:RKEZTUWDkxKQxN2jDT7ZnZi2bhZlbNMAuKvKB+IaGx8= github.com/go-openapi/validate v0.21.0 h1:+Wqk39yKOhfpLqNLEC0/eViCkzM5FVXVqrvt526+wcI= github.com/go-openapi/validate v0.21.0/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= @@ -226,6 +287,7 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -233,6 +295,7 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.8.0/go.mod h1:/fckq3NE+vGiJsd4fDt4ge1XrK8cN+e5G5QWIzdg7Q8= github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.0 h1:ESEyqQqXXFIcImj/BE8oKEX37Zsuceb2cZI+EL/zNCY= github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.0/go.mod h1:XnLCLFp3tjoZJszVKjfpyAK6J8sYIcQXWQxmqLWF21I= github.com/hashicorp/go-version v1.4.0 h1:aAQzgqIrRKRa7w75CKpbBxYsmUoPjzVm1W59ca1L0J4= @@ -262,6 +325,7 @@ github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0Lh github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -272,14 +336,18 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.5 h1:J+gdV2cUmX7ZqL2B0lFcW0m+egaHC2V3lpO8nWxyYiQ= github.com/lib/pq v1.10.5/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= @@ -289,6 +357,8 @@ github.com/mattn/go-sqlite3 v1.14.0 h1:mLyGNKR8+Vv9CAU7PphKa2hkEqxxhn8i32J6FPj1/ github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= @@ -310,6 +380,8 @@ github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/percona/exporter_shared v0.7.3 h1:TX4LisZ08jo8KIlekBTwPX13JlM6gOOKgmwg7QEf+r8= github.com/percona/exporter_shared v0.7.3/go.mod h1:AWk9lgTPzI7tC5PzpeBGvhhqjSJNxpPNFaF7qLIJqmo= @@ -319,6 +391,8 @@ github.com/percona/percona-toolkit v3.2.1+incompatible h1:5jLvtZKcu9fDmaLRB8qA4b github.com/percona/percona-toolkit v3.2.1+incompatible/go.mod h1:netQWdWMaF1cnmwiIS+i5uyaqNXz46yNeM6HKkR6yeI= github.com/percona/pmm v0.0.0-20220413231946-84d9f7d044b2 h1:ZeS+rOGtPzNzzKq7YcOU1+Xj5ppTj9nY5AgD4ZqiPCc= github.com/percona/pmm v0.0.0-20220413231946-84d9f7d044b2/go.mod h1:NVF1oAaKuXVum37J1Iesuqtcygg98pLJtKktn49gXcg= +github.com/percona/pmm v0.0.0-20220414205931-d83c6722ef32 h1:R71UUQzwYCBsY0d5IXxPC52PVgsZgZEDCplcXYRXwHY= +github.com/percona/pmm v0.0.0-20220414205931-d83c6722ef32/go.mod h1:stX2hCHtTjCsIhcvZXuu7VoaCiU+DYHwHxzANI/7Ps0= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -386,12 +460,19 @@ github.com/xdg-go/scram v1.0.2 h1:akYIkZ28e6A96dkWNJQu3nmCzH3YfwMPQExUYDaRv7w= github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= github.com/xdg-go/stringprep v1.0.2 h1:6iq84/ryjjeRmMJwxutI51F2GIPlP5BfTvXHeYjyhBc= github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= +github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= +github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= +go.mongodb.org/mongo-driver v1.3.4/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= +go.mongodb.org/mongo-driver v1.7.1/go.mod h1:Q4oFMbo1+MSNqICAdYMlC/zSTrwCogR4R8NzkI+yfU8= go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= go.mongodb.org/mongo-driver v1.8.3/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY= @@ -405,10 +486,14 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/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-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -447,10 +532,12 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -459,6 +546,7 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -470,6 +558,7 @@ golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= @@ -506,6 +595,7 @@ golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -514,6 +604,7 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -581,6 +672,8 @@ golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -670,6 +763,7 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20220302033224-9aa15565e42a/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220317150908-0efb43f6373e/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9 h1:XGQ6tc+EnM35IAazg4y6AHmUg4oK8NXsXaILte1vRlk= google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= @@ -687,6 +781,7 @@ google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= From a4bffaf5272b3aaad2963e98770f485131c2cbc7 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Fri, 15 Apr 2022 00:32:14 +0300 Subject: [PATCH 23/63] Pmm-5680 change name for logs --- agents/process/process.go | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/agents/process/process.go b/agents/process/process.go index 0c2214db2..2ae9d0e6b 100644 --- a/agents/process/process.go +++ b/agents/process/process.go @@ -60,7 +60,7 @@ type Process struct { changes chan inventorypb.AgentStatus backoff *backoff.Backoff ctxDone chan struct{} - logs *storelogs.LogsStore + l *storelogs.LogsStore // recreated on each restart cmd *exec.Cmd cmdDone chan struct{} @@ -94,7 +94,7 @@ func New(params *Params, redactWords []string, sl *storelogs.LogsStore) *Process changes: make(chan inventorypb.AgentStatus, 10), backoff: backoff.New(backoffMinDelay, backoffMaxDelay), ctxDone: make(chan struct{}), - logs: sl, + l: sl, } } @@ -103,14 +103,14 @@ func (p *Process) Run(ctx context.Context) { go p.toStarting() <-ctx.Done() - p.logs.Infof("Process: context canceled.") + p.l.Infof("Process: context canceled.") close(p.ctxDone) } // STARTING -> RUNNING // STARTING -> WAITING func (p *Process) toStarting() { - p.logs.Tracef("Process: starting.") + p.l.Tracef("Process: starting.") p.changes <- inventorypb.AgentStatus_STARTING p.cmd = exec.Command(p.params.Path, p.params.Args...) //nolint:gosec @@ -128,7 +128,7 @@ func (p *Process) toStarting() { p.cmdDone = make(chan struct{}) if err := p.cmd.Start(); err != nil { - p.logs.Warnf("Process: failed to start: %s.", err) + p.l.Warnf("Process: failed to start: %s.", err) go p.toWaiting() return } @@ -145,7 +145,7 @@ func (p *Process) toStarting() { case <-t.C: go p.toRunning() case <-p.cmdDone: - p.logs.Warnf("Process: exited early: %s.", p.cmd.ProcessState) + p.l.Warnf("Process: exited early: %s.", p.cmd.ProcessState) go p.toWaiting() } } @@ -153,7 +153,7 @@ func (p *Process) toStarting() { // RUNNING -> STOPPING // RUNNING -> WAITING func (p *Process) toRunning() { - p.logs.Tracef("Process: running.") + p.l.Tracef("Process: running.") p.changes <- inventorypb.AgentStatus_RUNNING p.backoff.Reset() @@ -162,7 +162,7 @@ func (p *Process) toRunning() { case <-p.ctxDone: go p.toStopping() case <-p.cmdDone: - p.logs.Warnf("Process: exited: %s.", p.cmd.ProcessState) + p.l.Warnf("Process: exited: %s.", p.cmd.ProcessState) go p.toWaiting() } } @@ -172,7 +172,7 @@ func (p *Process) toRunning() { func (p *Process) toWaiting() { delay := p.backoff.Delay() - p.logs.Infof("Process: waiting %s.", delay) + p.l.Infof("Process: waiting %s.", delay) p.changes <- inventorypb.AgentStatus_WAITING t := time.NewTimer(delay) @@ -183,7 +183,7 @@ func (p *Process) toWaiting() { if p.params.Type == inventorypb.AgentType_VM_AGENT { _, err := p.params.TemplateRenderer.RenderFiles(p.params.TemplateParams) if err != nil { - p.logs.Warnf("Process: failed to regenerate config in %s.", p.params.TemplateRenderer.TempDir) + p.l.Warnf("Process: failed to regenerate config in %s.", p.params.TemplateRenderer.TempDir) } } @@ -195,11 +195,11 @@ func (p *Process) toWaiting() { // STOPPING -> DONE func (p *Process) toStopping() { - p.logs.Tracef("Process: stopping (sending SIGTERM)...") + p.l.Tracef("Process: stopping (sending SIGTERM)...") p.changes <- inventorypb.AgentStatus_STOPPING if err := p.cmd.Process.Signal(unix.SIGTERM); err != nil { - p.logs.Errorf("Process: failed to send SIGTERM: %s.", err) + p.l.Errorf("Process: failed to send SIGTERM: %s.", err) } t := time.NewTimer(killT) @@ -208,19 +208,19 @@ func (p *Process) toStopping() { case <-p.cmdDone: // nothing case <-t.C: - p.logs.Warnf("Process: still alive after %s, sending SIGKILL...", killT) + p.l.Warnf("Process: still alive after %s, sending SIGKILL...", killT) if err := p.cmd.Process.Signal(unix.SIGKILL); err != nil { - p.logs.Errorf("Process: failed to send SIGKILL: %s.", err) + p.l.Errorf("Process: failed to send SIGKILL: %s.", err) } <-p.cmdDone } - p.logs.Infof("Process: exited: %s.", p.cmd.ProcessState) + p.l.Infof("Process: exited: %s.", p.cmd.ProcessState) go p.toDone() } func (p *Process) toDone() { - p.logs.Trace("Process: done.") + p.l.Trace("Process: done.") p.changes <- inventorypb.AgentStatus_DONE close(p.changes) @@ -231,7 +231,7 @@ func (p *Process) Changes() <-chan inventorypb.AgentStatus { return p.changes } -// Logs returns latest process logs. +// Logs returns latest process l. func (p *Process) Logs() []string { return p.pl.Latest() } From fb648464b76cfbc61f06d2821cb3bf00ab89e205 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Fri, 15 Apr 2022 08:39:08 +0300 Subject: [PATCH 24/63] Pmm-5680 fix git actions --- agents/process/process.go | 1 - agents/process/process_child.go | 2 +- agents/process/process_test.go | 3 +-- agents/supervisor/supervisor.go | 4 ++-- storelogs/main.go | 26 ++++++++++++++++++-------- 5 files changed, 22 insertions(+), 14 deletions(-) diff --git a/agents/process/process.go b/agents/process/process.go index 2ae9d0e6b..9ba4da99c 100644 --- a/agents/process/process.go +++ b/agents/process/process.go @@ -24,7 +24,6 @@ import ( "time" "github.com/percona/pmm-agent/storelogs" - "github.com/percona/pmm/api/inventorypb" "github.com/percona/pmm/utils/pdeathsig" "golang.org/x/sys/unix" diff --git a/agents/process/process_child.go b/agents/process/process_child.go index 9b7ffca04..dfa298358 100644 --- a/agents/process/process_child.go +++ b/agents/process/process_child.go @@ -42,7 +42,7 @@ func main() { logger.SetOutput(ioutil.Discard) l := logrus.NewEntry(logger) ringLog := new(storelogs.LogsStore) - ringLog.SetUp(l) + ringLog.Init(l) p := process.New(&process.Params{Path: "sleep", Args: []string{"100500"}}, nil, ringLog) go p.Run(context.Background()) diff --git a/agents/process/process_test.go b/agents/process/process_test.go index 20bde4f46..f47ecb906 100644 --- a/agents/process/process_test.go +++ b/agents/process/process_test.go @@ -26,7 +26,6 @@ import ( "time" "github.com/percona/pmm-agent/storelogs" - "github.com/percona/pmm/api/inventorypb" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" @@ -69,7 +68,7 @@ func setup(t *testing.T) (context.Context, context.CancelFunc, *storelogs.LogsSt ctx, cancel := context.WithCancel(context.Background()) l := logrus.WithField("test", t.Name()) ringLog := &storelogs.LogsStore{} - ringLog.SetUp(l) + ringLog.Init(l) return ctx, cancel, ringLog } diff --git a/agents/supervisor/supervisor.go b/agents/supervisor/supervisor.go index 96f324f8b..ffaf867aa 100644 --- a/agents/supervisor/supervisor.go +++ b/agents/supervisor/supervisor.go @@ -72,7 +72,7 @@ type agentProcessInfo struct { done <-chan struct{} // closes when Process.Changes() channel closes requestedState *agentpb.SetStateRequest_AgentProcess listenPort uint16 - logs *storelogs.LogsStore //store logs + logs *storelogs.LogsStore // store logs } // builtinAgentInfo describes built-in Agent. @@ -360,7 +360,7 @@ func (s *Supervisor) startProcess(agentID string, agentProcess *agentpb.SetState }) l.Debugf("Starting: %s.", processParams) ringLog := &storelogs.LogsStore{} - ringLog.SetUp(l) + ringLog.Init(l) process := process.New(processParams, agentProcess.RedactWords, ringLog) go pprof.Do(ctx, pprof.Labels("agentID", agentID, "type", agentType), process.Run) diff --git a/storelogs/main.go b/storelogs/main.go index 8658eb6fd..5a4b6a932 100644 --- a/storelogs/main.go +++ b/storelogs/main.go @@ -26,6 +26,7 @@ import ( "github.com/sirupsen/logrus" ) +// LogsStore implement ring save logs type LogsStore struct { log *ring.Ring Entry *logrus.Entry @@ -33,7 +34,8 @@ type LogsStore struct { m sync.RWMutex } -func (l *LogsStore) SetUp(entry *logrus.Entry) { +// Init initializes basic parameters +func (l *LogsStore) Init(entry *logrus.Entry) { if l.count == 0 { l.count = 10 } @@ -41,11 +43,12 @@ func (l *LogsStore) SetUp(entry *logrus.Entry) { l.Entry = entry } +// SetCountLogs sets the number of logs to store func (l *LogsStore) SetCountLogs(countLogs int) { l.count = countLogs } -func (l *LogsStore) SaveLog(log string) { +func (l *LogsStore) saveLog(log string) { dt := time.Now() var b bytes.Buffer b.WriteString(l.Entry.Level.String()) @@ -62,6 +65,7 @@ func (l *LogsStore) SaveLog(log string) { l.log = l.log.Next() } +//GetLogs return all logs func (l *LogsStore) GetLogs() (logs []string) { if l != nil { l.m.Lock() @@ -76,32 +80,38 @@ func (l *LogsStore) GetLogs() (logs []string) { return logs } +// Warnf Save log and print Warnf func (l *LogsStore) Warnf(format string, v ...interface{}) { - l.SaveLog(fmt.Sprintf(format, v...)) + l.saveLog(fmt.Sprintf(format, v...)) l.Entry.Warnf(format, v...) } +// Infof Save log and print Infof func (l *LogsStore) Infof(format string, v ...interface{}) { - l.SaveLog(fmt.Sprintf(format, v...)) + l.saveLog(fmt.Sprintf(format, v...)) l.Entry.Infof(format, v...) } +// Debugf Save log and print Debugf func (l *LogsStore) Debugf(format string, v ...interface{}) { - l.SaveLog(fmt.Sprintf(format, v...)) + l.saveLog(fmt.Sprintf(format, v...)) l.Entry.Debugf(format, v...) } +// Tracef Save log and print Tracef func (l *LogsStore) Tracef(format string, v ...interface{}) { - l.SaveLog(fmt.Sprintf(format, v...)) + l.saveLog(fmt.Sprintf(format, v...)) l.Entry.Tracef(format, v...) } +// Errorf Save log and print Errorf func (l *LogsStore) Errorf(format string, v ...interface{}) { - l.SaveLog(fmt.Sprintf(format, v...)) + l.saveLog(fmt.Sprintf(format, v...)) l.Entry.Errorf(format, v...) } +// Trace Save log and print Trace func (l *LogsStore) Trace(message string) { - l.SaveLog(message) + l.saveLog(message) l.Entry.Trace(message, nil) } From fdc9f1af4357beeb67524236129758b0df4db9a1 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Fri, 15 Apr 2022 08:42:34 +0300 Subject: [PATCH 25/63] Pmm-5680 fix git actions --- agents/process/process.go | 3 ++- agents/process/process_test.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/agents/process/process.go b/agents/process/process.go index 9ba4da99c..11031b383 100644 --- a/agents/process/process.go +++ b/agents/process/process.go @@ -23,11 +23,12 @@ import ( "strings" "time" - "github.com/percona/pmm-agent/storelogs" "github.com/percona/pmm/api/inventorypb" "github.com/percona/pmm/utils/pdeathsig" "golang.org/x/sys/unix" + "github.com/percona/pmm-agent/storelogs" + "github.com/percona/pmm-agent/utils/backoff" "github.com/percona/pmm-agent/utils/templates" ) diff --git a/agents/process/process_test.go b/agents/process/process_test.go index f47ecb906..404c00d2e 100644 --- a/agents/process/process_test.go +++ b/agents/process/process_test.go @@ -25,12 +25,13 @@ import ( "testing" "time" - "github.com/percona/pmm-agent/storelogs" "github.com/percona/pmm/api/inventorypb" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "golang.org/x/sys/unix" + + "github.com/percona/pmm-agent/storelogs" ) // assertStates checks expected statuses in the same order. From 60dc79d9239b7653263a1c1d5802140590289e96 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Fri, 15 Apr 2022 09:58:29 +0300 Subject: [PATCH 26/63] Pmm-5680 fix test --- actions/mysql_show_table_status_action_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/mysql_show_table_status_action_test.go b/actions/mysql_show_table_status_action_test.go index 96c0cee58..092defe81 100644 --- a/actions/mysql_show_table_status_action_test.go +++ b/actions/mysql_show_table_status_action_test.go @@ -91,7 +91,7 @@ func TestShowTableStatus(t *testing.T) { actual[1][11] = createTime assert.Equal(t, []interface{}{ "city", "InnoDB", 10.0, "Dynamic", 4188.0, 97.0, 409600.0, 0.0, - 131072.0, 0.0, 4080.0, "2019-06-10 12:04:29", nil, nil, "latin1_swedish_ci", + 0.0, 0.0, 4080.0, "2019-06-10 12:04:29", nil, nil, "latin1_swedish_ci", nil, "", "", }, actual[1]) From 8312f49749171ab710d5019e8746fd26766f973d Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Fri, 15 Apr 2022 10:50:02 +0300 Subject: [PATCH 27/63] Pmm-5680 fix test --- actions/mysql_show_table_status_action_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/mysql_show_table_status_action_test.go b/actions/mysql_show_table_status_action_test.go index 092defe81..f9c5e0ca7 100644 --- a/actions/mysql_show_table_status_action_test.go +++ b/actions/mysql_show_table_status_action_test.go @@ -104,7 +104,7 @@ func TestShowTableStatus(t *testing.T) { actual[1][11] = createTime assert.Equal(t, []interface{}{ "city", "InnoDB", 10.0, "Dynamic", 4188.0, 97.0, 409600.0, 0.0, - 131072.0, 0.0, 4080.0, "2019-06-10 12:04:29", nil, nil, "latin1_swedish_ci", + 0.0, 0.0, 4080.0, "2019-06-10 12:04:29", nil, nil, "latin1_swedish_ci", nil, "", "", 0.0, "N", }, actual[1]) From 3daddceb648076e542d8ae7c507d8d42badabd08 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Fri, 15 Apr 2022 11:05:10 +0300 Subject: [PATCH 28/63] Pmm-5680 fix test --- actions/mysql_show_table_status_action_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/actions/mysql_show_table_status_action_test.go b/actions/mysql_show_table_status_action_test.go index f9c5e0ca7..96c0cee58 100644 --- a/actions/mysql_show_table_status_action_test.go +++ b/actions/mysql_show_table_status_action_test.go @@ -91,7 +91,7 @@ func TestShowTableStatus(t *testing.T) { actual[1][11] = createTime assert.Equal(t, []interface{}{ "city", "InnoDB", 10.0, "Dynamic", 4188.0, 97.0, 409600.0, 0.0, - 0.0, 0.0, 4080.0, "2019-06-10 12:04:29", nil, nil, "latin1_swedish_ci", + 131072.0, 0.0, 4080.0, "2019-06-10 12:04:29", nil, nil, "latin1_swedish_ci", nil, "", "", }, actual[1]) @@ -104,7 +104,7 @@ func TestShowTableStatus(t *testing.T) { actual[1][11] = createTime assert.Equal(t, []interface{}{ "city", "InnoDB", 10.0, "Dynamic", 4188.0, 97.0, 409600.0, 0.0, - 0.0, 0.0, 4080.0, "2019-06-10 12:04:29", nil, nil, "latin1_swedish_ci", + 131072.0, 0.0, 4080.0, "2019-06-10 12:04:29", nil, nil, "latin1_swedish_ci", nil, "", "", 0.0, "N", }, actual[1]) From dfc1597493baaa31e77f52b00c527490aa04fc8b Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Sat, 16 Apr 2022 18:43:55 +0300 Subject: [PATCH 29/63] Pmm-5680 fix lint --- storelogs/main.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/storelogs/main.go b/storelogs/main.go index 5a4b6a932..9749c050a 100644 --- a/storelogs/main.go +++ b/storelogs/main.go @@ -26,7 +26,7 @@ import ( "github.com/sirupsen/logrus" ) -// LogsStore implement ring save logs +// LogsStore implement ring save logs. type LogsStore struct { log *ring.Ring Entry *logrus.Entry @@ -34,7 +34,7 @@ type LogsStore struct { m sync.RWMutex } -// Init initializes basic parameters +// Init initializes basic parameters. func (l *LogsStore) Init(entry *logrus.Entry) { if l.count == 0 { l.count = 10 @@ -43,7 +43,7 @@ func (l *LogsStore) Init(entry *logrus.Entry) { l.Entry = entry } -// SetCountLogs sets the number of logs to store +// SetCountLogs sets the number of logs to store. func (l *LogsStore) SetCountLogs(countLogs int) { l.count = countLogs } @@ -65,7 +65,7 @@ func (l *LogsStore) saveLog(log string) { l.log = l.log.Next() } -//GetLogs return all logs +// GetLogs return all logs. func (l *LogsStore) GetLogs() (logs []string) { if l != nil { l.m.Lock() @@ -80,37 +80,37 @@ func (l *LogsStore) GetLogs() (logs []string) { return logs } -// Warnf Save log and print Warnf +// Warnf Save log and print Warnf. func (l *LogsStore) Warnf(format string, v ...interface{}) { l.saveLog(fmt.Sprintf(format, v...)) l.Entry.Warnf(format, v...) } -// Infof Save log and print Infof +// Infof Save log and print Infof. func (l *LogsStore) Infof(format string, v ...interface{}) { l.saveLog(fmt.Sprintf(format, v...)) l.Entry.Infof(format, v...) } -// Debugf Save log and print Debugf +// Debugf Save log and print Debugf. func (l *LogsStore) Debugf(format string, v ...interface{}) { l.saveLog(fmt.Sprintf(format, v...)) l.Entry.Debugf(format, v...) } -// Tracef Save log and print Tracef +// Tracef Save log and print Tracef. func (l *LogsStore) Tracef(format string, v ...interface{}) { l.saveLog(fmt.Sprintf(format, v...)) l.Entry.Tracef(format, v...) } -// Errorf Save log and print Errorf +// Errorf Save log and print Errorf. func (l *LogsStore) Errorf(format string, v ...interface{}) { l.saveLog(fmt.Sprintf(format, v...)) l.Entry.Errorf(format, v...) } -// Trace Save log and print Trace +// Trace Save log and print Trace. func (l *LogsStore) Trace(message string) { l.saveLog(message) l.Entry.Trace(message, nil) From cd38bd3b61f40fd5eecc384b5d061f0cbb67957d Mon Sep 17 00:00:00 2001 From: Nurlan Moldomurov Date: Wed, 20 Apr 2022 03:28:34 +0300 Subject: [PATCH 30/63] PMM-5680 Improvements --- agents/process/process.go | 11 ++- agents/process/process_child.go | 6 +- agents/process/process_test.go | 10 +-- agents/supervisor/supervisor.go | 37 ++++++---- go.sum | 2 - storelogs/main.go | 117 -------------------------------- storelogs/storelogs.go | 59 ++++++++++++++++ 7 files changed, 90 insertions(+), 152 deletions(-) delete mode 100644 storelogs/main.go create mode 100644 storelogs/storelogs.go diff --git a/agents/process/process.go b/agents/process/process.go index 11031b383..bf8de5e3b 100644 --- a/agents/process/process.go +++ b/agents/process/process.go @@ -25,10 +25,9 @@ import ( "github.com/percona/pmm/api/inventorypb" "github.com/percona/pmm/utils/pdeathsig" + "github.com/sirupsen/logrus" "golang.org/x/sys/unix" - "github.com/percona/pmm-agent/storelogs" - "github.com/percona/pmm-agent/utils/backoff" "github.com/percona/pmm-agent/utils/templates" ) @@ -56,11 +55,11 @@ const ( // only to avoid stack overflow; there are no extra goroutines for states. type Process struct { params *Params + l *logrus.Entry pl *processLogger changes chan inventorypb.AgentStatus backoff *backoff.Backoff ctxDone chan struct{} - l *storelogs.LogsStore // recreated on each restart cmd *exec.Cmd cmdDone chan struct{} @@ -87,14 +86,14 @@ func (p *Params) String() string { } // New creates new process. -func New(params *Params, redactWords []string, sl *storelogs.LogsStore) *Process { +func New(params *Params, redactWords []string, l *logrus.Entry) *Process { return &Process{ params: params, - pl: newProcessLogger(sl.Entry, keepLogLines, redactWords), + l: l, + pl: newProcessLogger(l, keepLogLines, redactWords), changes: make(chan inventorypb.AgentStatus, 10), backoff: backoff.New(backoffMinDelay, backoffMaxDelay), ctxDone: make(chan struct{}), - l: sl, } } diff --git a/agents/process/process_child.go b/agents/process/process_child.go index dfa298358..b597854ee 100644 --- a/agents/process/process_child.go +++ b/agents/process/process_child.go @@ -31,8 +31,6 @@ import ( "github.com/percona/pmm/api/inventorypb" "github.com/sirupsen/logrus" - "github.com/percona/pmm-agent/storelogs" - "github.com/percona/pmm-agent/agents/process" ) @@ -41,9 +39,7 @@ func main() { logger := logrus.New() logger.SetOutput(ioutil.Discard) l := logrus.NewEntry(logger) - ringLog := new(storelogs.LogsStore) - ringLog.Init(l) - p := process.New(&process.Params{Path: "sleep", Args: []string{"100500"}}, nil, ringLog) + p := process.New(&process.Params{Path: "sleep", Args: []string{"100500"}}, nil, l) go p.Run(context.Background()) // Wait until the process is running. diff --git a/agents/process/process_test.go b/agents/process/process_test.go index 404c00d2e..7cb36f3a3 100644 --- a/agents/process/process_test.go +++ b/agents/process/process_test.go @@ -30,8 +30,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "golang.org/x/sys/unix" - - "github.com/percona/pmm-agent/storelogs" ) // assertStates checks expected statuses in the same order. @@ -62,15 +60,13 @@ func build(t *testing.T, tag string, fileName string, outputFile string) *exec.C return cmd } -func setup(t *testing.T) (context.Context, context.CancelFunc, *storelogs.LogsStore) { +func setup(t *testing.T) (context.Context, context.CancelFunc, *logrus.Entry) { t.Helper() t.Parallel() ctx, cancel := context.WithCancel(context.Background()) l := logrus.WithField("test", t.Name()) - ringLog := &storelogs.LogsStore{} - ringLog.Init(l) - return ctx, cancel, ringLog + return ctx, cancel, l } func TestProcess(t *testing.T) { @@ -163,7 +159,7 @@ func TestProcess(t *testing.T) { ctx, cancel, l := setup(t) defer cancel() - logger := newProcessLogger(l.Entry, 2, nil) + logger := newProcessLogger(l, 2, nil) pCmd := exec.CommandContext(ctx, f.Name()) //nolint:gosec pCmd.Stdout = logger diff --git a/agents/supervisor/supervisor.go b/agents/supervisor/supervisor.go index ffaf867aa..c1833e476 100644 --- a/agents/supervisor/supervisor.go +++ b/agents/supervisor/supervisor.go @@ -19,6 +19,8 @@ package supervisor import ( "context" "fmt" + "io" + "os" "path/filepath" "regexp" "runtime/pprof" @@ -82,6 +84,7 @@ type builtinAgentInfo struct { requestedState *agentpb.SetStateRequest_BuiltinAgent describe func(chan<- *prometheus.Desc) // agent's func to describe Prometheus metrics collect func(chan<- prometheus.Metric) // agent's func to provide Prometheus metrics + logs *storelogs.LogsStore // store logs } // NewSupervisor creates new Supervisor object. @@ -122,13 +125,12 @@ func (s *Supervisor) AgentsList() []*agentlocalpb.AgentInfo { res := make([]*agentlocalpb.AgentInfo, 0, len(s.agentProcesses)+len(s.builtinAgents)) for id, agent := range s.agentProcesses { - logs := agent.logs.GetLogs() info := &agentlocalpb.AgentInfo{ AgentId: id, AgentType: agent.requestedState.Type, Status: s.lastStatuses[id], ListenPort: uint32(agent.listenPort), - Logs: logs, + Logs: agent.logs.GetLogs(), } res = append(res, info) } @@ -138,6 +140,7 @@ func (s *Supervisor) AgentsList() []*agentlocalpb.AgentInfo { AgentId: id, AgentType: agent.requestedState.Type, Status: s.lastStatuses[id], + Logs: agent.logs.GetLogs(), } res = append(res, info) } @@ -353,15 +356,9 @@ func (s *Supervisor) startProcess(agentID string, agentProcess *agentpb.SetState ctx, cancel := context.WithCancel(s.ctx) agentType := strings.ToLower(agentProcess.Type.String()) - l := logrus.WithFields(logrus.Fields{ - "component": "agent-process", - "agentID": agentID, - "type": agentType, - }) + ringLog, l := s.newLogger("agent-process", agentID, agentType) l.Debugf("Starting: %s.", processParams) - ringLog := &storelogs.LogsStore{} - ringLog.Init(l) - process := process.New(processParams, agentProcess.RedactWords, ringLog) + process := process.New(processParams, agentProcess.RedactWords, l) go pprof.Do(ctx, pprof.Labels("agentID", agentID, "type", agentType), process.Run) done := make(chan struct{}) @@ -388,16 +385,25 @@ func (s *Supervisor) startProcess(agentID string, agentProcess *agentpb.SetState return nil } +func (s *Supervisor) newLogger(component string, agentID string, agentType string) (*storelogs.LogsStore, *logrus.Entry) { + ringLog := storelogs.NewLogsStore(10) + logger := logrus.New() + logger.SetFormatter(logrus.StandardLogger().Formatter) + logger.Out = io.MultiWriter(os.Stderr, ringLog) + l := logger.WithFields(logrus.Fields{ + "component": component, + "agentID": agentID, + "type": agentType, + }) + return ringLog, l +} + // startBuiltin starts built-in Agent. // Must be called with s.rw held for writing. func (s *Supervisor) startBuiltin(agentID string, builtinAgent *agentpb.SetStateRequest_BuiltinAgent) error { ctx, cancel := context.WithCancel(s.ctx) agentType := strings.ToLower(builtinAgent.Type.String()) - l := logrus.WithFields(logrus.Fields{ - "component": "agent-builtin", - "agentID": agentID, - "type": agentType, - }) + ringLog, l := s.newLogger("agent-process", agentID, agentType) done := make(chan struct{}) var agent agents.BuiltinAgent @@ -502,6 +508,7 @@ func (s *Supervisor) startBuiltin(agentID string, builtinAgent *agentpb.SetState requestedState: proto.Clone(builtinAgent).(*agentpb.SetStateRequest_BuiltinAgent), describe: agent.Describe, collect: agent.Collect, + logs: ringLog, } return nil } diff --git a/go.sum b/go.sum index cce390ad6..022b135ff 100644 --- a/go.sum +++ b/go.sum @@ -389,8 +389,6 @@ github.com/percona/go-mysql v0.0.0-20200630114833-b77f37c0bfa2 h1:0tQBti5FIrKfH3 github.com/percona/go-mysql v0.0.0-20200630114833-b77f37c0bfa2/go.mod h1:/SGLf9OMxlnK6jq4mkFiImBcJXXk5jwD+lDrwDaGXcw= github.com/percona/percona-toolkit v3.2.1+incompatible h1:5jLvtZKcu9fDmaLRB8qA4bLR727t5iYyguHJJQTk9w0= github.com/percona/percona-toolkit v3.2.1+incompatible/go.mod h1:netQWdWMaF1cnmwiIS+i5uyaqNXz46yNeM6HKkR6yeI= -github.com/percona/pmm v0.0.0-20220413231946-84d9f7d044b2 h1:ZeS+rOGtPzNzzKq7YcOU1+Xj5ppTj9nY5AgD4ZqiPCc= -github.com/percona/pmm v0.0.0-20220413231946-84d9f7d044b2/go.mod h1:NVF1oAaKuXVum37J1Iesuqtcygg98pLJtKktn49gXcg= github.com/percona/pmm v0.0.0-20220414205931-d83c6722ef32 h1:R71UUQzwYCBsY0d5IXxPC52PVgsZgZEDCplcXYRXwHY= github.com/percona/pmm v0.0.0-20220414205931-d83c6722ef32/go.mod h1:stX2hCHtTjCsIhcvZXuu7VoaCiU+DYHwHxzANI/7Ps0= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= diff --git a/storelogs/main.go b/storelogs/main.go deleted file mode 100644 index 9749c050a..000000000 --- a/storelogs/main.go +++ /dev/null @@ -1,117 +0,0 @@ -// pmm-agent -// Copyright 2019 Percona LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package storelogs help to store logs -package storelogs - -import ( - "bytes" - "container/ring" - "fmt" - "sync" - "time" - - "github.com/sirupsen/logrus" -) - -// LogsStore implement ring save logs. -type LogsStore struct { - log *ring.Ring - Entry *logrus.Entry - count int - m sync.RWMutex -} - -// Init initializes basic parameters. -func (l *LogsStore) Init(entry *logrus.Entry) { - if l.count == 0 { - l.count = 10 - } - l.log = ring.New(l.count) - l.Entry = entry -} - -// SetCountLogs sets the number of logs to store. -func (l *LogsStore) SetCountLogs(countLogs int) { - l.count = countLogs -} - -func (l *LogsStore) saveLog(log string) { - dt := time.Now() - var b bytes.Buffer - b.WriteString(l.Entry.Level.String()) - b.WriteString(" [") - b.WriteString(dt.Format("01-02-2006 15:04:05")) - b.WriteString("] ") - b.WriteString(log) - for _, v := range l.Entry.Data { - b.WriteString(fmt.Sprintf(" %v", v)) - } - l.m.Lock() - l.log.Value = b.String() - l.m.Unlock() - l.log = l.log.Next() -} - -// GetLogs return all logs. -func (l *LogsStore) GetLogs() (logs []string) { - if l != nil { - l.m.Lock() - l.log.Do(func(p interface{}) { - log := fmt.Sprint(p) - if p != nil { - logs = append(logs, log) - } - }) - l.m.Unlock() - } - return logs -} - -// Warnf Save log and print Warnf. -func (l *LogsStore) Warnf(format string, v ...interface{}) { - l.saveLog(fmt.Sprintf(format, v...)) - l.Entry.Warnf(format, v...) -} - -// Infof Save log and print Infof. -func (l *LogsStore) Infof(format string, v ...interface{}) { - l.saveLog(fmt.Sprintf(format, v...)) - l.Entry.Infof(format, v...) -} - -// Debugf Save log and print Debugf. -func (l *LogsStore) Debugf(format string, v ...interface{}) { - l.saveLog(fmt.Sprintf(format, v...)) - l.Entry.Debugf(format, v...) -} - -// Tracef Save log and print Tracef. -func (l *LogsStore) Tracef(format string, v ...interface{}) { - l.saveLog(fmt.Sprintf(format, v...)) - l.Entry.Tracef(format, v...) -} - -// Errorf Save log and print Errorf. -func (l *LogsStore) Errorf(format string, v ...interface{}) { - l.saveLog(fmt.Sprintf(format, v...)) - l.Entry.Errorf(format, v...) -} - -// Trace Save log and print Trace. -func (l *LogsStore) Trace(message string) { - l.saveLog(message) - l.Entry.Trace(message, nil) -} diff --git a/storelogs/storelogs.go b/storelogs/storelogs.go new file mode 100644 index 000000000..f3dd01af2 --- /dev/null +++ b/storelogs/storelogs.go @@ -0,0 +1,59 @@ +// pmm-agent +// Copyright 2019 Percona LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package storelogs help to store logs +package storelogs + +import ( + "container/ring" + "fmt" + "sync" +) + +// LogsStore implement ring save logs. +type LogsStore struct { + log *ring.Ring + m sync.RWMutex +} + +func NewLogsStore(count int) *LogsStore { + return &LogsStore{ + log: ring.New(count), + m: sync.RWMutex{}, + } +} + +func (l *LogsStore) Write(b []byte) (n int, err error) { + l.m.Lock() + l.log.Value = string(b) + l.m.Unlock() + l.log = l.log.Next() + return len(b), nil +} + +// GetLogs return all logs. +func (l *LogsStore) GetLogs() (logs []string) { + if l != nil { + l.m.Lock() + l.log.Do(func(p interface{}) { + log := fmt.Sprint(p) + if p != nil { + logs = append(logs, log) + } + }) + l.m.Unlock() + } + return logs +} From 9ff8dc0dbecc526b2214fcc1ec848af898b006e3 Mon Sep 17 00:00:00 2001 From: Nurlan Moldomurov Date: Wed, 20 Apr 2022 03:33:02 +0300 Subject: [PATCH 31/63] PMM-5680 Improvements --- agents/supervisor/supervisor.go | 2 +- storelogs/storelogs.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/agents/supervisor/supervisor.go b/agents/supervisor/supervisor.go index c1833e476..8b0dc7849 100644 --- a/agents/supervisor/supervisor.go +++ b/agents/supervisor/supervisor.go @@ -386,7 +386,7 @@ func (s *Supervisor) startProcess(agentID string, agentProcess *agentpb.SetState } func (s *Supervisor) newLogger(component string, agentID string, agentType string) (*storelogs.LogsStore, *logrus.Entry) { - ringLog := storelogs.NewLogsStore(10) + ringLog := storelogs.New(10) logger := logrus.New() logger.SetFormatter(logrus.StandardLogger().Formatter) logger.Out = io.MultiWriter(os.Stderr, ringLog) diff --git a/storelogs/storelogs.go b/storelogs/storelogs.go index f3dd01af2..fa8a43997 100644 --- a/storelogs/storelogs.go +++ b/storelogs/storelogs.go @@ -28,7 +28,7 @@ type LogsStore struct { m sync.RWMutex } -func NewLogsStore(count int) *LogsStore { +func New(count int) *LogsStore { return &LogsStore{ log: ring.New(count), m: sync.RWMutex{}, From 221a0b90314f7e622b69465659376409c2cf9825 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Wed, 20 Apr 2022 23:11:36 +0300 Subject: [PATCH 32/63] Pmm-5680 update storelogs --- agents/process/process_child.go | 2 +- agents/process/process_test.go | 3 +-- agents/supervisor/supervisor.go | 4 ++-- storelogs/main.go | 6 ++++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/agents/process/process_child.go b/agents/process/process_child.go index dfa298358..8ab682b6e 100644 --- a/agents/process/process_child.go +++ b/agents/process/process_child.go @@ -40,7 +40,7 @@ func main() { flag.Parse() logger := logrus.New() logger.SetOutput(ioutil.Discard) - l := logrus.NewEntry(logger) + ringLog := new(storelogs.LogsStore) ringLog.Init(l) p := process.New(&process.Params{Path: "sleep", Args: []string{"100500"}}, nil, ringLog) diff --git a/agents/process/process_test.go b/agents/process/process_test.go index 404c00d2e..cbba1cfde 100644 --- a/agents/process/process_test.go +++ b/agents/process/process_test.go @@ -68,8 +68,7 @@ func setup(t *testing.T) (context.Context, context.CancelFunc, *storelogs.LogsSt ctx, cancel := context.WithCancel(context.Background()) l := logrus.WithField("test", t.Name()) - ringLog := &storelogs.LogsStore{} - ringLog.Init(l) + ringLog := storelogs.InitLogStore(l) return ctx, cancel, ringLog } diff --git a/agents/supervisor/supervisor.go b/agents/supervisor/supervisor.go index ffaf867aa..6d4a4bf7f 100644 --- a/agents/supervisor/supervisor.go +++ b/agents/supervisor/supervisor.go @@ -359,8 +359,8 @@ func (s *Supervisor) startProcess(agentID string, agentProcess *agentpb.SetState "type": agentType, }) l.Debugf("Starting: %s.", processParams) - ringLog := &storelogs.LogsStore{} - ringLog.Init(l) + + ringLog := storelogs.InitLogStore(l) process := process.New(processParams, agentProcess.RedactWords, ringLog) go pprof.Do(ctx, pprof.Labels("agentID", agentID, "type", agentType), process.Run) diff --git a/storelogs/main.go b/storelogs/main.go index 9749c050a..74aa29d76 100644 --- a/storelogs/main.go +++ b/storelogs/main.go @@ -34,13 +34,15 @@ type LogsStore struct { m sync.RWMutex } -// Init initializes basic parameters. -func (l *LogsStore) Init(entry *logrus.Entry) { +// InitLogStore initializes basic parameters. +func InitLogStore(entry *logrus.Entry) *LogsStore { + l := new(LogsStore) if l.count == 0 { l.count = 10 } l.log = ring.New(l.count) l.Entry = entry + return l } // SetCountLogs sets the number of logs to store. From 729e3f1a9c0404ab1147f4aa4fa6aacc4b562f99 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Thu, 21 Apr 2022 21:43:43 +0300 Subject: [PATCH 33/63] Pmm-5680 remove function countLogs --- storelogs/main.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/storelogs/main.go b/storelogs/main.go index 74aa29d76..ded30a737 100644 --- a/storelogs/main.go +++ b/storelogs/main.go @@ -45,11 +45,6 @@ func InitLogStore(entry *logrus.Entry) *LogsStore { return l } -// SetCountLogs sets the number of logs to store. -func (l *LogsStore) SetCountLogs(countLogs int) { - l.count = countLogs -} - func (l *LogsStore) saveLog(log string) { dt := time.Now() var b bytes.Buffer From 7bd784bfdbb1b4fd113f838ce1537dc6fa03892a Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Thu, 28 Apr 2022 00:16:35 +0300 Subject: [PATCH 34/63] Pmm-85680 update dependency --- go.mod | 40 ++++++++++++++++++++-------------------- go.sum | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index 0be2680e3..803b1292f 100644 --- a/go.mod +++ b/go.mod @@ -23,9 +23,9 @@ require ( github.com/hashicorp/go-version v1.4.0 github.com/lib/pq v1.10.5 github.com/percona/exporter_shared v0.7.3 - github.com/percona/go-mysql v0.0.0-20200630114833-b77f37c0bfa2 + github.com/percona/go-mysql v0.0.0-20210427141028-73d29c6da78c github.com/percona/percona-toolkit v3.2.1+incompatible - github.com/percona/pmm v0.0.0-20220418101857-7c8201461efd + github.com/percona/pmm v0.0.0-20220427205915-cdd2b512827f github.com/pganalyze/pg_query_go v1.0.3 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.12.1 @@ -34,10 +34,10 @@ require ( github.com/stretchr/objx v0.3.0 github.com/stretchr/testify v1.7.1 go.mongodb.org/mongo-driver v1.9.0 - golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 - google.golang.org/genproto v0.0.0-20220302033224-9aa15565e42a + golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 + google.golang.org/genproto v0.0.0-20220426171045-31bebdecfb46 google.golang.org/grpc v1.46.0 - google.golang.org/protobuf v1.27.1 + google.golang.org/protobuf v1.28.0 gopkg.in/alecthomas/kingpin.v2 v2.2.6 gopkg.in/reform.v1 v1.5.1 gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b @@ -47,29 +47,29 @@ require ( github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect - github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect + github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect - github.com/go-openapi/analysis v0.21.2 // indirect + github.com/go-openapi/analysis v0.21.3 // indirect github.com/go-openapi/errors v0.20.2 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.0 // indirect github.com/go-openapi/loads v0.21.1 // indirect - github.com/go-openapi/spec v0.20.4 // indirect + github.com/go-openapi/spec v0.20.5 // indirect github.com/go-openapi/strfmt v0.21.2 // indirect github.com/go-openapi/swag v0.21.1 // indirect github.com/go-openapi/validate v0.21.0 // indirect github.com/go-stack/stack v1.8.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/snappy v0.0.1 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.8.0 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.0 // indirect github.com/josharian/intern v1.0.0 // indirect - github.com/klauspost/compress v1.13.6 // indirect + github.com/klauspost/compress v1.15.2 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect - github.com/mitchellh/mapstructure v1.4.3 // indirect - github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/montanaflynn/stats v0.6.6 // indirect github.com/mwitkow/go-proto-validators v0.3.2 // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect @@ -77,12 +77,12 @@ require ( github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/procfs v0.7.3 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect - github.com/xdg-go/scram v1.0.2 // indirect - github.com/xdg-go/stringprep v1.0.2 // indirect - github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect - golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f // indirect - golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect - golang.org/x/sync v0.0.0-20201207232520-09787c993a3a // indirect + github.com/xdg-go/scram v1.1.1 // indirect + github.com/xdg-go/stringprep v1.0.3 // indirect + github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect + golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f // indirect + golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect + golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect golang.org/x/text v0.3.7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/go.sum b/go.sum index 022b135ff..86498dbc2 100644 --- a/go.sum +++ b/go.sum @@ -53,6 +53,8 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc= +github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= @@ -81,6 +83,7 @@ github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnht github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -96,6 +99,7 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= @@ -196,6 +200,8 @@ github.com/go-openapi/validate v0.21.0 h1:+Wqk39yKOhfpLqNLEC0/eViCkzM5FVXVqrvt52 github.com/go-openapi/validate v0.21.0/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= +github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= @@ -262,6 +268,8 @@ github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -274,6 +282,7 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -328,6 +337,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/compress v1.15.2 h1:3WH+AG7s2+T8o3nrM/8u2rdqUEcQhmga7smjrT41nAw= +github.com/klauspost/compress v1.15.2/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -363,6 +374,8 @@ github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= @@ -370,6 +383,8 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe h1:iruDEfMl2E6fbMZ9s0scYfZQ84/6SPL6zC8ACM2oIL0= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= +github.com/montanaflynn/stats v0.6.6 h1:Duep6KMIDpY4Yo11iFsvyqJDyfzLF9+sndUKT+v64GQ= +github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-proto-validators v0.3.2 h1:qRlmpTzm2pstMKKzTdvwPCF5QfBNURSlAgN/R+qbKos= @@ -387,10 +402,14 @@ github.com/percona/exporter_shared v0.7.3 h1:TX4LisZ08jo8KIlekBTwPX13JlM6gOOKgmw github.com/percona/exporter_shared v0.7.3/go.mod h1:AWk9lgTPzI7tC5PzpeBGvhhqjSJNxpPNFaF7qLIJqmo= github.com/percona/go-mysql v0.0.0-20200630114833-b77f37c0bfa2 h1:0tQBti5FIrKfH3VQZX06DOudy6bT8Z/oamDejgjYzoA= github.com/percona/go-mysql v0.0.0-20200630114833-b77f37c0bfa2/go.mod h1:/SGLf9OMxlnK6jq4mkFiImBcJXXk5jwD+lDrwDaGXcw= +github.com/percona/go-mysql v0.0.0-20210427141028-73d29c6da78c h1:1SZ7nS+kSaO63IpaKspf/gf8602QcgP2eXNPMNOIc0M= +github.com/percona/go-mysql v0.0.0-20210427141028-73d29c6da78c/go.mod h1:/SGLf9OMxlnK6jq4mkFiImBcJXXk5jwD+lDrwDaGXcw= github.com/percona/percona-toolkit v3.2.1+incompatible h1:5jLvtZKcu9fDmaLRB8qA4bLR727t5iYyguHJJQTk9w0= github.com/percona/percona-toolkit v3.2.1+incompatible/go.mod h1:netQWdWMaF1cnmwiIS+i5uyaqNXz46yNeM6HKkR6yeI= github.com/percona/pmm v0.0.0-20220414205931-d83c6722ef32 h1:R71UUQzwYCBsY0d5IXxPC52PVgsZgZEDCplcXYRXwHY= github.com/percona/pmm v0.0.0-20220414205931-d83c6722ef32/go.mod h1:stX2hCHtTjCsIhcvZXuu7VoaCiU+DYHwHxzANI/7Ps0= +github.com/percona/pmm v0.0.0-20220427205915-cdd2b512827f h1:LcZpoOo7uQvqFdyH0oVhxFuHwaLOcAv2cPQpEFH4vU0= +github.com/percona/pmm v0.0.0-20220427205915-cdd2b512827f/go.mod h1:FFbpyZXm+Ilg8M/GewuhdjJhPaW1/v1zjRRerYhCfEA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -417,6 +436,8 @@ github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9 github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.33.0 h1:rHgav/0a6+uYgGdNt3jwz8FNSesO/Hsang3O0T9A5SE= github.com/prometheus/common v0.33.0/go.mod h1:gB3sOl7P0TvJabZpLY5uQMpUqRCPPCyRLCZYc7JZTNE= +github.com/prometheus/common v0.34.0 h1:RBmGO9d/FVjqHT0yUGQwBJhkwKV+wPCn7KGpvfab0uE= +github.com/prometheus/common v0.34.0/go.mod h1:gB3sOl7P0TvJabZpLY5uQMpUqRCPPCyRLCZYc7JZTNE= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= @@ -442,6 +463,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As= +github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -456,12 +479,18 @@ github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.0.2 h1:akYIkZ28e6A96dkWNJQu3nmCzH3YfwMPQExUYDaRv7w= github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= +github.com/xdg-go/scram v1.1.1 h1:VOMT+81stJgXW3CpHyqHN3AXDYIMsx56mEFrB37Mb/E= +github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= github.com/xdg-go/stringprep v1.0.2 h1:6iq84/ryjjeRmMJwxutI51F2GIPlP5BfTvXHeYjyhBc= github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= +github.com/xdg-go/stringprep v1.0.3 h1:kdwGpVNwPFtjs98xCGkHjQtGKh86rDcRZN17QEMCOIs= +github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= +github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a h1:fZHgsYlfvtyqToslyjUt3VOPF4J7aK/3MPcK7xp3PDk= +github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a/go.mod h1:ul22v+Nro/R083muKhosV54bj5niojjWZvU8xrevuH4= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -497,6 +526,8 @@ golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f h1:aZp0e2vLN4MToVqnjNEYEtrEA8RH8U8FN1CU7JgqsPU= golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f h1:OeJjE6G4dgCY4PIXvIRQbE8+RX+uXZyGhUy/ksMGJoc= +golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -568,6 +599,8 @@ golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220412020605-290c469a71a5 h1:bRb386wvrE+oBNdF1d/Xh9mQrfQ4ecYhW5qJ5GvTGT4= golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -588,6 +621,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -628,6 +663,7 @@ golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -639,6 +675,8 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad h1:ntjMns5wyP/fN65tdBD4g8J5w8n015+iIIs9rtjXkY0= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 h1:xHms4gcpe1YE7A3yIllJXP16CMAGuqwO2lX1mTyyRRc= +golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -765,6 +803,9 @@ google.golang.org/genproto v0.0.0-20220302033224-9aa15565e42a/go.mod h1:kGP+zUP2 google.golang.org/genproto v0.0.0-20220317150908-0efb43f6373e/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9 h1:XGQ6tc+EnM35IAazg4y6AHmUg4oK8NXsXaILte1vRlk= google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220426171045-31bebdecfb46 h1:G1IeWbjrqEq9ChWxEuRPJu6laA67+XgTFHVSAvepr38= +google.golang.org/genproto v0.0.0-20220426171045-31bebdecfb46/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -782,6 +823,8 @@ google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.46.0 h1:oCjezcn6g6A75TGoKYBPgKmVBLexhYLM6MebdrPApP8= +google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= From c53f29108c1b462cd192d0a11df83efeded704ae Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Tue, 3 May 2022 00:44:39 +0300 Subject: [PATCH 35/63] Pmm-5680 response zipfile --- agentlocal/agent_local.go | 56 +++++++++++++++++++++++++++- agentlocal/deps.go | 1 + agents/supervisor/supervisor.go | 35 +++++++++++++---- agents/supervisor/supervisor_test.go | 28 +++++++------- go.mod | 4 +- go.sum | 4 ++ 6 files changed, 102 insertions(+), 26 deletions(-) diff --git a/agentlocal/agent_local.go b/agentlocal/agent_local.go index 2da5b4250..2a903a2bf 100644 --- a/agentlocal/agent_local.go +++ b/agentlocal/agent_local.go @@ -16,10 +16,16 @@ package agentlocal import ( + "archive/zip" "bytes" "context" + "encoding/json" _ "expvar" // register /debug/vars + "fmt" + "github.com/percona/pmm-agent/storelogs" + "github.com/percona/pmm/api/inventorypb" "html/template" + "io" "log" "net" "net/http" @@ -61,23 +67,35 @@ type Server struct { configFilepath string l *logrus.Entry + ringLogs *storelogs.LogsStore reload chan struct{} reloadCloseOnce sync.Once agentlocalpb.UnimplementedAgentLocalServer } +type AgentLogs struct { + Type inventorypb.AgentType + Id string + Logs *storelogs.LogsStore +} + // NewServer creates new server. // // Caller should call Run. func NewServer(cfg *config.Config, supervisor supervisor, client client, configFilepath string) *Server { + ringLog := storelogs.New(10) + logger := logrus.New() + logger.Out = io.MultiWriter(os.Stderr, ringLog) + return &Server{ cfg: cfg, supervisor: supervisor, client: client, configFilepath: configFilepath, - l: logrus.WithField("component", "local-server"), + l: logger.WithField("component", "local-server"), reload: make(chan struct{}), + ringLogs: ringLog, } } @@ -289,6 +307,30 @@ func (s *Server) runJSONServer(ctx context.Context, grpcAddress string) { mux.Handle("/debug/", http.DefaultServeMux) mux.Handle("/debug", debugPageHandler) mux.Handle("/", proxyMux) + mux.HandleFunc("/logs.zip", func(w http.ResponseWriter, r *http.Request) { + buf := new(bytes.Buffer) + writer := zip.NewWriter(buf) + b, err := json.MarshalIndent(s.ringLogs.GetLogs(), "", " ") + if err != nil { + log.Fatal(err) + } + addData(writer, "server.json", b) + + for _, agent := range s.supervisor.AgentsLogs() { + if err != nil { + log.Fatal(err) + } + addData(writer, strings.Join([]string{agent.Type.String(), agent.Id}, " ")+".json", b) + } + err = writer.Close() + if err != nil { + log.Fatal(err) + } + w.Header().Set("Content-Type", "application/zip") + w.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s.zip\"", "logs")) + //io.Copy(w, buf) + w.Write(buf.Bytes()) + }) server := &http.Server{ Addr: address, @@ -314,6 +356,18 @@ func (s *Server) runJSONServer(ctx context.Context, grpcAddress string) { _ = server.Close() // call Close() in all cases } +// addData add data to zip file +func addData(zipW *zip.Writer, name string, data []byte) { + f, err := zipW.Create(name) + if err != nil { + log.Fatal(err) + } + _, err = f.Write(data) + if err != nil { + log.Fatal(err) + } +} + // check interfaces var ( _ agentlocalpb.AgentLocalServer = (*Server)(nil) diff --git a/agentlocal/deps.go b/agentlocal/deps.go index 2ff667d19..2af4fb6fc 100644 --- a/agentlocal/deps.go +++ b/agentlocal/deps.go @@ -39,4 +39,5 @@ type client interface { // We use it instead of real type for testing and to avoid dependency cycle. type supervisor interface { AgentsList() []*agentlocalpb.AgentInfo + AgentsLogs() []*AgentLogs } diff --git a/agents/supervisor/supervisor.go b/agents/supervisor/supervisor.go index 8b0dc7849..ffeba3fbf 100644 --- a/agents/supervisor/supervisor.go +++ b/agents/supervisor/supervisor.go @@ -19,6 +19,7 @@ package supervisor import ( "context" "fmt" + "github.com/percona/pmm-agent/agentlocal" "io" "os" "path/filepath" @@ -130,7 +131,6 @@ func (s *Supervisor) AgentsList() []*agentlocalpb.AgentInfo { AgentType: agent.requestedState.Type, Status: s.lastStatuses[id], ListenPort: uint32(agent.listenPort), - Logs: agent.logs.GetLogs(), } res = append(res, info) } @@ -140,7 +140,6 @@ func (s *Supervisor) AgentsList() []*agentlocalpb.AgentInfo { AgentId: id, AgentType: agent.requestedState.Type, Status: s.lastStatuses[id], - Logs: agent.logs.GetLogs(), } res = append(res, info) } @@ -149,13 +148,33 @@ func (s *Supervisor) AgentsList() []*agentlocalpb.AgentInfo { return res } -// AgentsListWithoutLogs returns info for all Agents managed by this supervisor without logs. -func (s *Supervisor) AgentsListWithoutLogs() []*agentlocalpb.AgentInfo { - agentList := s.AgentsList() - for i := range agentList { - agentList[i].Logs = nil +// AgentsLogs returns logs for all Agents managed by this supervisor. +func (s *Supervisor) AgentsLogs() []*agentlocal.AgentLogs { + s.rw.RLock() + defer s.rw.RUnlock() + s.arw.RLock() + defer s.arw.RUnlock() + + res := make([]*agentlocal.AgentLogs, 0, len(s.agentProcesses)+len(s.builtinAgents)) + + for id, agent := range s.agentProcesses { + info := &agentlocal.AgentLogs{ + Id: id, + Type: agent.requestedState.Type, + Logs: agent.logs, + } + res = append(res, info) } - return agentList + + for id, agent := range s.builtinAgents { + info := &agentlocal.AgentLogs{ + Id: id, + Type: agent.requestedState.Type, + Logs: agent.logs, + } + res = append(res, info) + } + return res } // Changes returns channel with Agent's state changes. diff --git a/agents/supervisor/supervisor_test.go b/agents/supervisor/supervisor_test.go index 10dc319ec..db8647b0b 100644 --- a/agents/supervisor/supervisor_test.go +++ b/agents/supervisor/supervisor_test.go @@ -72,8 +72,7 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_NOOP, AgentId: "noop3", Status: inventorypb.AgentStatus_STARTING}, {AgentType: type_TEST_SLEEP, AgentId: "sleep1", Status: inventorypb.AgentStatus_STARTING, ListenPort: 65000}, } - - assert.Equal(t, expectedList, s.AgentsListWithoutLogs()) + assert.Equal(t, expectedList, s.AgentsList()) assertChanges(t, s, &agentpb.StateChangedRequest{AgentId: "noop3", Status: inventorypb.AgentStatus_RUNNING}, @@ -82,7 +81,7 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_NOOP, AgentId: "noop3", Status: inventorypb.AgentStatus_RUNNING}, {AgentType: type_TEST_SLEEP, AgentId: "sleep1", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65000}, } - assert.Equal(t, expectedList, s.AgentsListWithoutLogs()) + assert.Equal(t, expectedList, s.AgentsList()) }) t.Run("Restart1Start2", func(t *testing.T) { @@ -90,7 +89,7 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_NOOP, AgentId: "noop3", Status: inventorypb.AgentStatus_RUNNING}, {AgentType: type_TEST_SLEEP, AgentId: "sleep1", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65000}, } - require.Equal(t, expectedList, s.AgentsListWithoutLogs()) + require.Equal(t, expectedList, s.AgentsList()) s.SetState(&agentpb.SetStateRequest{ AgentProcesses: map[string]*agentpb.SetStateRequest_AgentProcess{ @@ -115,7 +114,7 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_SLEEP, AgentId: "sleep1", Status: inventorypb.AgentStatus_STARTING, ListenPort: 65000}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_STARTING, ListenPort: 65001}, } - assert.Equal(t, expectedList, s.AgentsListWithoutLogs()) + assert.Equal(t, expectedList, s.AgentsList()) assertChanges(t, s, &agentpb.StateChangedRequest{AgentId: "sleep1", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65000}, @@ -125,8 +124,7 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_SLEEP, AgentId: "sleep1", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65000}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65001}, } - - assert.Equal(t, expectedList, s.AgentsListWithoutLogs()) + assert.Equal(t, expectedList, s.AgentsList()) }) t.Run("Restart3Start4", func(t *testing.T) { @@ -135,7 +133,7 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_SLEEP, AgentId: "sleep1", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65000}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65001}, } - require.Equal(t, expectedList, s.AgentsListWithoutLogs()) + require.Equal(t, expectedList, s.AgentsList()) s.SetState(&agentpb.SetStateRequest{ AgentProcesses: map[string]*agentpb.SetStateRequest_AgentProcess{ @@ -162,7 +160,7 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_SLEEP, AgentId: "sleep1", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65000}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65001}, } - assert.Equal(t, expectedList, s.AgentsListWithoutLogs()) + assert.Equal(t, expectedList, s.AgentsList()) assertChanges(t, s, &agentpb.StateChangedRequest{AgentId: "noop3", Status: inventorypb.AgentStatus_RUNNING}, @@ -173,7 +171,7 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_SLEEP, AgentId: "sleep1", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65000}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65001}, } - assert.Equal(t, expectedList, s.AgentsListWithoutLogs()) + assert.Equal(t, expectedList, s.AgentsList()) }) t.Run("Stop1", func(t *testing.T) { @@ -183,7 +181,7 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_SLEEP, AgentId: "sleep1", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65000}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65001}, } - require.Equal(t, expectedList, s.AgentsListWithoutLogs()) + require.Equal(t, expectedList, s.AgentsList()) s.SetState(&agentpb.SetStateRequest{ AgentProcesses: map[string]*agentpb.SetStateRequest_AgentProcess{ @@ -204,7 +202,7 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_NOOP, AgentId: "noop4", Status: inventorypb.AgentStatus_RUNNING}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65001}, } - require.Equal(t, expectedList, s.AgentsListWithoutLogs()) + require.Equal(t, expectedList, s.AgentsList()) }) t.Run("Stop3", func(t *testing.T) { @@ -213,7 +211,7 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_NOOP, AgentId: "noop4", Status: inventorypb.AgentStatus_RUNNING}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65001}, } - require.Equal(t, expectedList, s.AgentsListWithoutLogs()) + require.Equal(t, expectedList, s.AgentsList()) s.SetState(&agentpb.SetStateRequest{ AgentProcesses: map[string]*agentpb.SetStateRequest_AgentProcess{ @@ -232,7 +230,7 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_NOOP, AgentId: "noop4", Status: inventorypb.AgentStatus_RUNNING}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65001}, } - require.Equal(t, expectedList, s.AgentsListWithoutLogs()) + require.Equal(t, expectedList, s.AgentsList()) }) t.Run("Exit", func(t *testing.T) { @@ -240,7 +238,7 @@ func TestSupervisor(t *testing.T) { {AgentType: type_TEST_NOOP, AgentId: "noop4", Status: inventorypb.AgentStatus_RUNNING}, {AgentType: type_TEST_SLEEP, AgentId: "sleep2", Status: inventorypb.AgentStatus_RUNNING, ListenPort: 65001}, } - require.Equal(t, expectedList, s.AgentsListWithoutLogs()) + require.Equal(t, expectedList, s.AgentsList()) cancel() diff --git a/go.mod b/go.mod index 803b1292f..9c00d6ff8 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/AlekSi/pointer v1.2.0 github.com/DATA-DOG/go-sqlmock v1.5.0 github.com/davecgh/go-spew v1.1.1 - github.com/go-openapi/runtime v0.23.3 + github.com/go-openapi/runtime v0.24.0 github.com/go-sql-driver/mysql v1.6.0 github.com/golang/protobuf v1.5.2 github.com/grpc-ecosystem/grpc-gateway v1.16.0 @@ -25,7 +25,7 @@ require ( github.com/percona/exporter_shared v0.7.3 github.com/percona/go-mysql v0.0.0-20210427141028-73d29c6da78c github.com/percona/percona-toolkit v3.2.1+incompatible - github.com/percona/pmm v0.0.0-20220427205915-cdd2b512827f + github.com/percona/pmm v0.0.0-20220502071646-9e8908e2d2bf github.com/pganalyze/pg_query_go v1.0.3 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.12.1 diff --git a/go.sum b/go.sum index 86498dbc2..d42f581b9 100644 --- a/go.sum +++ b/go.sum @@ -163,6 +163,8 @@ github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2g github.com/go-openapi/runtime v0.19.20/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk= github.com/go-openapi/runtime v0.23.3 h1:/dxjx4KCOQI5ImBMz036F6v/DzZ2NUjSRvbLJs1rgoE= github.com/go-openapi/runtime v0.23.3/go.mod h1:AKurw9fNre+h3ELZfk6ILsfvPN+bvvlaU/M9q/r9hpk= +github.com/go-openapi/runtime v0.24.0 h1:vTgDijpGLCgJOJTdAp5kG+O+nRsVCbH417YQ3O0iZo0= +github.com/go-openapi/runtime v0.24.0/go.mod h1:AKurw9fNre+h3ELZfk6ILsfvPN+bvvlaU/M9q/r9hpk= github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= @@ -410,6 +412,8 @@ github.com/percona/pmm v0.0.0-20220414205931-d83c6722ef32 h1:R71UUQzwYCBsY0d5IXx github.com/percona/pmm v0.0.0-20220414205931-d83c6722ef32/go.mod h1:stX2hCHtTjCsIhcvZXuu7VoaCiU+DYHwHxzANI/7Ps0= github.com/percona/pmm v0.0.0-20220427205915-cdd2b512827f h1:LcZpoOo7uQvqFdyH0oVhxFuHwaLOcAv2cPQpEFH4vU0= github.com/percona/pmm v0.0.0-20220427205915-cdd2b512827f/go.mod h1:FFbpyZXm+Ilg8M/GewuhdjJhPaW1/v1zjRRerYhCfEA= +github.com/percona/pmm v0.0.0-20220502071646-9e8908e2d2bf h1:OcZ6WJphvtkmGGz0rr6bWBKAW/5lq13hW2TVpfDH13k= +github.com/percona/pmm v0.0.0-20220502071646-9e8908e2d2bf/go.mod h1:k7HS59HPX33tmrSZGiNzUTYuLr0+a49F3BEZ48MAbuo= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= From 847932ffc719338f053633d6450cc56c372d347d Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Tue, 3 May 2022 00:54:53 +0300 Subject: [PATCH 36/63] Pmm-5680 response zipfile --- agentlocal/agent_local.go | 8 ++++---- agentlocal/mock_supervisor_test.go | 16 ++++++++++++++++ agents/supervisor/supervisor.go | 5 ++--- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/agentlocal/agent_local.go b/agentlocal/agent_local.go index 2a903a2bf..960a8f5ff 100644 --- a/agentlocal/agent_local.go +++ b/agentlocal/agent_local.go @@ -22,14 +22,12 @@ import ( "encoding/json" _ "expvar" // register /debug/vars "fmt" - "github.com/percona/pmm-agent/storelogs" - "github.com/percona/pmm/api/inventorypb" "html/template" "io" "log" "net" "net/http" - _ "net/http/pprof" // register /debug/pprof + _ "net/http/pprof" "os" "strconv" "strings" @@ -39,6 +37,7 @@ import ( grpc_gateway "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/percona/pmm/api/agentlocalpb" "github.com/percona/pmm/api/agentpb" + "github.com/percona/pmm/api/inventorypb" "github.com/percona/pmm/version" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/collectors" @@ -53,6 +52,7 @@ import ( "google.golang.org/protobuf/types/known/durationpb" "github.com/percona/pmm-agent/config" + "github.com/percona/pmm-agent/storelogs" ) const ( @@ -328,7 +328,7 @@ func (s *Server) runJSONServer(ctx context.Context, grpcAddress string) { } w.Header().Set("Content-Type", "application/zip") w.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s.zip\"", "logs")) - //io.Copy(w, buf) + // io.Copy(w, buf) w.Write(buf.Bytes()) }) diff --git a/agentlocal/mock_supervisor_test.go b/agentlocal/mock_supervisor_test.go index 720b4c9bc..2f3b67598 100644 --- a/agentlocal/mock_supervisor_test.go +++ b/agentlocal/mock_supervisor_test.go @@ -27,3 +27,19 @@ func (_m *mockSupervisor) AgentsList() []*agentlocalpb.AgentInfo { return r0 } + +// AgentsLogs provides a mock function with given fields: +func (_m *mockSupervisor) AgentsLogs() []*AgentLogs { + ret := _m.Called() + + var r0 []*AgentLogs + if rf, ok := ret.Get(0).(func() []*AgentLogs); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*AgentLogs) + } + } + + return r0 +} diff --git a/agents/supervisor/supervisor.go b/agents/supervisor/supervisor.go index ffeba3fbf..ba339d500 100644 --- a/agents/supervisor/supervisor.go +++ b/agents/supervisor/supervisor.go @@ -19,7 +19,6 @@ package supervisor import ( "context" "fmt" - "github.com/percona/pmm-agent/agentlocal" "io" "os" "path/filepath" @@ -29,8 +28,6 @@ import ( "strings" "sync" - "github.com/percona/pmm-agent/storelogs" - "github.com/percona/pmm/api/agentlocalpb" "github.com/percona/pmm/api/agentpb" "github.com/percona/pmm/api/inventorypb" @@ -39,6 +36,7 @@ import ( "github.com/sirupsen/logrus" "google.golang.org/protobuf/proto" + "github.com/percona/pmm-agent/agentlocal" "github.com/percona/pmm-agent/agents" "github.com/percona/pmm-agent/agents/mongodb" "github.com/percona/pmm-agent/agents/mysql/perfschema" @@ -48,6 +46,7 @@ import ( "github.com/percona/pmm-agent/agents/postgres/pgstatstatements" "github.com/percona/pmm-agent/agents/process" "github.com/percona/pmm-agent/config" + "github.com/percona/pmm-agent/storelogs" "github.com/percona/pmm-agent/utils/templates" ) From 77c8c83e689d5bf4053d8a424201850cba0571da Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Tue, 3 May 2022 10:52:18 +0300 Subject: [PATCH 37/63] Pmm-5680 fix mistake --- agentlocal/agent_local.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agentlocal/agent_local.go b/agentlocal/agent_local.go index 960a8f5ff..bbd3bc0e9 100644 --- a/agentlocal/agent_local.go +++ b/agentlocal/agent_local.go @@ -308,7 +308,7 @@ func (s *Server) runJSONServer(ctx context.Context, grpcAddress string) { mux.Handle("/debug", debugPageHandler) mux.Handle("/", proxyMux) mux.HandleFunc("/logs.zip", func(w http.ResponseWriter, r *http.Request) { - buf := new(bytes.Buffer) + buf := &bytes.Buffer{} writer := zip.NewWriter(buf) b, err := json.MarshalIndent(s.ringLogs.GetLogs(), "", " ") if err != nil { From c686b5eea71f5bd93a4271e12c43353006d5b1d3 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Tue, 3 May 2022 11:45:34 +0300 Subject: [PATCH 38/63] Pmm-5680 fix test --- main_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main_test.go b/main_test.go index 1cd8e1996..1defdb230 100644 --- a/main_test.go +++ b/main_test.go @@ -113,10 +113,10 @@ func TestImports(t *testing.T) { "github.com/percona/pmm-agent/agents/postgres/pgstatstatements", "github.com/percona/pmm-agent/agents/process", "github.com/percona/pmm-agent/agents/cache", + "github.com/percona/pmm-agent/agentlocal", } { c := constraint{ denyPrefixes: []string{ - "github.com/percona/pmm-agent/agentlocal", "github.com/percona/pmm-agent/agents/", "github.com/percona/pmm-agent/client", "github.com/percona/pmm-agent/config", From c0bb0057b84845f9f028fd266d9d4ae0b42be1f6 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Tue, 3 May 2022 12:11:31 +0300 Subject: [PATCH 39/63] Pmm-5680 fix test --- agentlocal/agent_local.go | 8 ++++++-- main_test.go | 2 +- storelogs/storelogs.go | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/agentlocal/agent_local.go b/agentlocal/agent_local.go index bbd3bc0e9..1e1be627f 100644 --- a/agentlocal/agent_local.go +++ b/agentlocal/agent_local.go @@ -27,7 +27,7 @@ import ( "log" "net" "net/http" - _ "net/http/pprof" + _ "net/http/pprof" // register /debug/pprof "os" "strconv" "strings" @@ -74,6 +74,7 @@ type Server struct { agentlocalpb.UnimplementedAgentLocalServer } +// AgentLogs contains information about Agent logs type AgentLogs struct { Type inventorypb.AgentType Id string @@ -329,7 +330,10 @@ func (s *Server) runJSONServer(ctx context.Context, grpcAddress string) { w.Header().Set("Content-Type", "application/zip") w.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s.zip\"", "logs")) // io.Copy(w, buf) - w.Write(buf.Bytes()) + _, err = w.Write(buf.Bytes()) + if err != nil { + log.Fatal(err) + } }) server := &http.Server{ diff --git a/main_test.go b/main_test.go index 1defdb230..79515f6a7 100644 --- a/main_test.go +++ b/main_test.go @@ -113,7 +113,6 @@ func TestImports(t *testing.T) { "github.com/percona/pmm-agent/agents/postgres/pgstatstatements", "github.com/percona/pmm-agent/agents/process", "github.com/percona/pmm-agent/agents/cache", - "github.com/percona/pmm-agent/agentlocal", } { c := constraint{ denyPrefixes: []string{ @@ -172,6 +171,7 @@ func TestImports(t *testing.T) { // just to add them to packages.dot for _, service := range []string{ "github.com/percona/pmm-agent/commands", + "github.com/percona/pmm-agent/agentlocal", } { constraints[service] = constraint{} } diff --git a/storelogs/storelogs.go b/storelogs/storelogs.go index fa8a43997..7b253b17c 100644 --- a/storelogs/storelogs.go +++ b/storelogs/storelogs.go @@ -28,6 +28,7 @@ type LogsStore struct { m sync.RWMutex } +// New creates LogsStore func New(count int) *LogsStore { return &LogsStore{ log: ring.New(count), @@ -35,6 +36,7 @@ func New(count int) *LogsStore { } } +// Write writes log for store func (l *LogsStore) Write(b []byte) (n int, err error) { l.m.Lock() l.log.Value = string(b) From a70990458458ad2acb692a473dbc41f6838f4c4c Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Tue, 3 May 2022 12:49:42 +0300 Subject: [PATCH 40/63] Pmm-5680 fix test --- main_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main_test.go b/main_test.go index 79515f6a7..815d9ad4d 100644 --- a/main_test.go +++ b/main_test.go @@ -116,6 +116,7 @@ func TestImports(t *testing.T) { } { c := constraint{ denyPrefixes: []string{ + "github.com/percona/pmm-agent/agentlocal", "github.com/percona/pmm-agent/agents/", "github.com/percona/pmm-agent/client", "github.com/percona/pmm-agent/config", @@ -150,8 +151,8 @@ func TestImports(t *testing.T) { packs := []string{ // TODO https://jira.percona.com/browse/PMM-7206 // "github.com/percona/pmm-agent/actions", - - "github.com/percona/pmm-agent/agentlocal", + // TODO https://jira.percona.com/browse/PMM-5680 + //"github.com/percona/pmm-agent/agentlocal", "github.com/percona/pmm-agent/agents/supervisor", "github.com/percona/pmm-agent/client", "github.com/percona/pmm-agent/connectionchecker", @@ -171,7 +172,6 @@ func TestImports(t *testing.T) { // just to add them to packages.dot for _, service := range []string{ "github.com/percona/pmm-agent/commands", - "github.com/percona/pmm-agent/agentlocal", } { constraints[service] = constraint{} } From e1da1acad964f75f3f0908d6493c3ca8968441b9 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Tue, 3 May 2022 13:42:13 +0300 Subject: [PATCH 41/63] Pmm-5680 pretty --- agentlocal/agent_local.go | 8 ++++---- main_test.go | 2 +- storelogs/storelogs.go | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/agentlocal/agent_local.go b/agentlocal/agent_local.go index 1e1be627f..f4bdb8200 100644 --- a/agentlocal/agent_local.go +++ b/agentlocal/agent_local.go @@ -74,15 +74,15 @@ type Server struct { agentlocalpb.UnimplementedAgentLocalServer } -// AgentLogs contains information about Agent logs +// AgentLogs contains information about Agent logs. type AgentLogs struct { Type inventorypb.AgentType - Id string + ID string Logs *storelogs.LogsStore } // NewServer creates new server. -// +//` // Caller should call Run. func NewServer(cfg *config.Config, supervisor supervisor, client client, configFilepath string) *Server { ringLog := storelogs.New(10) @@ -321,7 +321,7 @@ func (s *Server) runJSONServer(ctx context.Context, grpcAddress string) { if err != nil { log.Fatal(err) } - addData(writer, strings.Join([]string{agent.Type.String(), agent.Id}, " ")+".json", b) + addData(writer, strings.Join([]string{agent.Type.String(), agent.ID}, " ")+".json", b) } err = writer.Close() if err != nil { diff --git a/main_test.go b/main_test.go index 815d9ad4d..27df8f652 100644 --- a/main_test.go +++ b/main_test.go @@ -152,7 +152,7 @@ func TestImports(t *testing.T) { // TODO https://jira.percona.com/browse/PMM-7206 // "github.com/percona/pmm-agent/actions", // TODO https://jira.percona.com/browse/PMM-5680 - //"github.com/percona/pmm-agent/agentlocal", + // "github.com/percona/pmm-agent/agentlocal", "github.com/percona/pmm-agent/agents/supervisor", "github.com/percona/pmm-agent/client", "github.com/percona/pmm-agent/connectionchecker", diff --git a/storelogs/storelogs.go b/storelogs/storelogs.go index 7b253b17c..89bf8c4e0 100644 --- a/storelogs/storelogs.go +++ b/storelogs/storelogs.go @@ -28,7 +28,7 @@ type LogsStore struct { m sync.RWMutex } -// New creates LogsStore +// New creates LogsStore. func New(count int) *LogsStore { return &LogsStore{ log: ring.New(count), @@ -36,7 +36,7 @@ func New(count int) *LogsStore { } } -// Write writes log for store +// Write writes log for store. func (l *LogsStore) Write(b []byte) (n int, err error) { l.m.Lock() l.log.Value = string(b) From 5202e8360c5a0ca2e0c2abc92c5dd143895779c7 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Tue, 3 May 2022 13:51:22 +0300 Subject: [PATCH 42/63] Pmm-5680 fix bug --- agents/supervisor/supervisor.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agents/supervisor/supervisor.go b/agents/supervisor/supervisor.go index ba339d500..986d38269 100644 --- a/agents/supervisor/supervisor.go +++ b/agents/supervisor/supervisor.go @@ -158,7 +158,7 @@ func (s *Supervisor) AgentsLogs() []*agentlocal.AgentLogs { for id, agent := range s.agentProcesses { info := &agentlocal.AgentLogs{ - Id: id, + ID: id, Type: agent.requestedState.Type, Logs: agent.logs, } @@ -167,7 +167,7 @@ func (s *Supervisor) AgentsLogs() []*agentlocal.AgentLogs { for id, agent := range s.builtinAgents { info := &agentlocal.AgentLogs{ - Id: id, + ID: id, Type: agent.requestedState.Type, Logs: agent.logs, } From e44958a6788e21d96521a6a5cf4e2b4608ef7226 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Wed, 4 May 2022 11:54:47 +0300 Subject: [PATCH 43/63] Pmm-5680 fix bugs --- agentlocal/agent_local.go | 10 +++++++--- agents/supervisor/supervisor.go | 12 ++++++------ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/agentlocal/agent_local.go b/agentlocal/agent_local.go index f4bdb8200..09edddbf8 100644 --- a/agentlocal/agent_local.go +++ b/agentlocal/agent_local.go @@ -76,9 +76,9 @@ type Server struct { // AgentLogs contains information about Agent logs. type AgentLogs struct { - Type inventorypb.AgentType - ID string - Logs *storelogs.LogsStore + Type inventorypb.AgentType + ID string + RingLogs *storelogs.LogsStore } // NewServer creates new server. @@ -318,6 +318,10 @@ func (s *Server) runJSONServer(ctx context.Context, grpcAddress string) { addData(writer, "server.json", b) for _, agent := range s.supervisor.AgentsLogs() { + if err != nil { + log.Fatal(err) + } + b, err := json.MarshalIndent(agent.RingLogs.GetLogs(), "", " ") if err != nil { log.Fatal(err) } diff --git a/agents/supervisor/supervisor.go b/agents/supervisor/supervisor.go index 986d38269..3895c4701 100644 --- a/agents/supervisor/supervisor.go +++ b/agents/supervisor/supervisor.go @@ -158,18 +158,18 @@ func (s *Supervisor) AgentsLogs() []*agentlocal.AgentLogs { for id, agent := range s.agentProcesses { info := &agentlocal.AgentLogs{ - ID: id, - Type: agent.requestedState.Type, - Logs: agent.logs, + ID: id, + Type: agent.requestedState.Type, + RingLogs: agent.logs, } res = append(res, info) } for id, agent := range s.builtinAgents { info := &agentlocal.AgentLogs{ - ID: id, - Type: agent.requestedState.Type, - Logs: agent.logs, + ID: id, + Type: agent.requestedState.Type, + RingLogs: agent.logs, } res = append(res, info) } From 1657e703893d7d301638625b81ab67337698639b Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Mon, 9 May 2022 20:41:37 +0300 Subject: [PATCH 44/63] Pmm-5680 change JSON to text --- agentlocal/agent_local.go | 23 ++++++++++++++--------- agents/process/process.go | 3 ++- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/agentlocal/agent_local.go b/agentlocal/agent_local.go index 09edddbf8..619754ddb 100644 --- a/agentlocal/agent_local.go +++ b/agentlocal/agent_local.go @@ -19,7 +19,6 @@ import ( "archive/zip" "bytes" "context" - "encoding/json" _ "expvar" // register /debug/vars "fmt" "html/template" @@ -311,21 +310,27 @@ func (s *Server) runJSONServer(ctx context.Context, grpcAddress string) { mux.HandleFunc("/logs.zip", func(w http.ResponseWriter, r *http.Request) { buf := &bytes.Buffer{} writer := zip.NewWriter(buf) - b, err := json.MarshalIndent(s.ringLogs.GetLogs(), "", " ") - if err != nil { - log.Fatal(err) + b := &bytes.Buffer{} + for _, serverLog := range s.ringLogs.GetLogs() { + _, err := b.WriteString(serverLog) + if err != nil { + log.Fatal(err) + } } - addData(writer, "server.json", b) + addData(writer, "server.txt", b.Bytes()) for _, agent := range s.supervisor.AgentsLogs() { if err != nil { log.Fatal(err) } - b, err := json.MarshalIndent(agent.RingLogs.GetLogs(), "", " ") - if err != nil { - log.Fatal(err) + b := &bytes.Buffer{} + for _, agentLog := range agent.RingLogs.GetLogs() { + _, err := b.WriteString(agentLog + "\n") + if err != nil { + log.Fatal(err) + } } - addData(writer, strings.Join([]string{agent.Type.String(), agent.ID}, " ")+".json", b) + addData(writer, fmt.Sprintf("%s %s.txt", agent.Type.String(), agent.ID), b.Bytes()) } err = writer.Close() if err != nil { diff --git a/agents/process/process.go b/agents/process/process.go index bf8de5e3b..f25cc2636 100644 --- a/agents/process/process.go +++ b/agents/process/process.go @@ -60,6 +60,7 @@ type Process struct { changes chan inventorypb.AgentStatus backoff *backoff.Backoff ctxDone chan struct{} + // recreated on each restart cmd *exec.Cmd cmdDone chan struct{} @@ -230,7 +231,7 @@ func (p *Process) Changes() <-chan inventorypb.AgentStatus { return p.changes } -// Logs returns latest process l. +// Logs returns latest process logs. func (p *Process) Logs() []string { return p.pl.Latest() } From c18be41eb6ed71eb712340c82d894d00ce8b9af1 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Mon, 9 May 2022 20:41:53 +0300 Subject: [PATCH 45/63] Pmm-5680 revert test --- main_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main_test.go b/main_test.go index 27df8f652..1cd8e1996 100644 --- a/main_test.go +++ b/main_test.go @@ -151,8 +151,8 @@ func TestImports(t *testing.T) { packs := []string{ // TODO https://jira.percona.com/browse/PMM-7206 // "github.com/percona/pmm-agent/actions", - // TODO https://jira.percona.com/browse/PMM-5680 - // "github.com/percona/pmm-agent/agentlocal", + + "github.com/percona/pmm-agent/agentlocal", "github.com/percona/pmm-agent/agents/supervisor", "github.com/percona/pmm-agent/client", "github.com/percona/pmm-agent/connectionchecker", From 1d7720319aa26d7e9216037e053680967f1abc6b Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Tue, 10 May 2022 00:32:10 +0300 Subject: [PATCH 46/63] Pmm-5680 store serve logs --- agentlocal/agent_local.go | 16 +++++++--------- agentlocal/agent_local_test.go | 7 +++++-- agentlocal/deps.go | 4 +++- agentlocal/mock_supervisor_test.go | 10 ++++++---- agents/supervisor/supervisor.go | 16 +++++++++++----- commands/run.go | 4 +++- 6 files changed, 35 insertions(+), 22 deletions(-) diff --git a/agentlocal/agent_local.go b/agentlocal/agent_local.go index 619754ddb..9bb42e195 100644 --- a/agentlocal/agent_local.go +++ b/agentlocal/agent_local.go @@ -36,7 +36,6 @@ import ( grpc_gateway "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/percona/pmm/api/agentlocalpb" "github.com/percona/pmm/api/agentpb" - "github.com/percona/pmm/api/inventorypb" "github.com/percona/pmm/version" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/collectors" @@ -73,18 +72,17 @@ type Server struct { agentlocalpb.UnimplementedAgentLocalServer } -// AgentLogs contains information about Agent logs. -type AgentLogs struct { - Type inventorypb.AgentType - ID string - RingLogs *storelogs.LogsStore -} +//// AgentLogs contains information about Agent logs. +//type AgentLogs struct { +// Type inventorypb.AgentType +// ID string +// RingLogs *storelogs.LogsStore +//} // NewServer creates new server. //` // Caller should call Run. -func NewServer(cfg *config.Config, supervisor supervisor, client client, configFilepath string) *Server { - ringLog := storelogs.New(10) +func NewServer(cfg *config.Config, supervisor supervisor, client client, configFilepath string, ringLog *storelogs.LogsStore) *Server { logger := logrus.New() logger.Out = io.MultiWriter(os.Stderr, ringLog) diff --git a/agentlocal/agent_local_test.go b/agentlocal/agent_local_test.go index db99612c3..b49cbbfe0 100644 --- a/agentlocal/agent_local_test.go +++ b/agentlocal/agent_local_test.go @@ -17,6 +17,7 @@ package agentlocal import ( "context" + "github.com/percona/pmm-agent/storelogs" "testing" "time" @@ -61,7 +62,8 @@ func TestServerStatus(t *testing.T) { agentInfo, supervisor, client, cfg := setup(t) defer supervisor.AssertExpectations(t) defer client.AssertExpectations(t) - s := NewServer(cfg, supervisor, client, "/some/dir/pmm-agent.yaml") + ringLog := storelogs.New(500) + s := NewServer(cfg, supervisor, client, "/some/dir/pmm-agent.yaml", ringLog) // without network info actual, err := s.Status(context.Background(), &agentlocalpb.StatusRequest{GetNetworkInfo: false}) @@ -87,7 +89,8 @@ func TestServerStatus(t *testing.T) { client.On("GetNetworkInformation").Return(latency, clockDrift, nil) defer supervisor.AssertExpectations(t) defer client.AssertExpectations(t) - s := NewServer(cfg, supervisor, client, "/some/dir/pmm-agent.yaml") + ringLog := storelogs.New(500) + s := NewServer(cfg, supervisor, client, "/some/dir/pmm-agent.yaml", ringLog) // with network info actual, err := s.Status(context.Background(), &agentlocalpb.StatusRequest{GetNetworkInfo: true}) diff --git a/agentlocal/deps.go b/agentlocal/deps.go index 2af4fb6fc..8769b2522 100644 --- a/agentlocal/deps.go +++ b/agentlocal/deps.go @@ -21,6 +21,8 @@ import ( "github.com/percona/pmm/api/agentlocalpb" "github.com/percona/pmm/api/agentpb" "github.com/prometheus/client_golang/prometheus" + + sp "github.com/percona/pmm-agent/agents/supervisor" ) //go:generate mockery -name=client -case=snake -inpkg -testonly @@ -39,5 +41,5 @@ type client interface { // We use it instead of real type for testing and to avoid dependency cycle. type supervisor interface { AgentsList() []*agentlocalpb.AgentInfo - AgentsLogs() []*AgentLogs + AgentsLogs() []*sp.AgentLogs } diff --git a/agentlocal/mock_supervisor_test.go b/agentlocal/mock_supervisor_test.go index 2f3b67598..b8ae131d0 100644 --- a/agentlocal/mock_supervisor_test.go +++ b/agentlocal/mock_supervisor_test.go @@ -5,6 +5,8 @@ package agentlocal import ( agentlocalpb "github.com/percona/pmm/api/agentlocalpb" mock "github.com/stretchr/testify/mock" + + supervisor "github.com/percona/pmm-agent/agents/supervisor" ) // mockSupervisor is an autogenerated mock type for the supervisor type @@ -29,15 +31,15 @@ func (_m *mockSupervisor) AgentsList() []*agentlocalpb.AgentInfo { } // AgentsLogs provides a mock function with given fields: -func (_m *mockSupervisor) AgentsLogs() []*AgentLogs { +func (_m *mockSupervisor) AgentsLogs() []*supervisor.AgentLogs { ret := _m.Called() - var r0 []*AgentLogs - if rf, ok := ret.Get(0).(func() []*AgentLogs); ok { + var r0 []*supervisor.AgentLogs + if rf, ok := ret.Get(0).(func() []*supervisor.AgentLogs); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]*AgentLogs) + r0 = ret.Get(0).([]*supervisor.AgentLogs) } } diff --git a/agents/supervisor/supervisor.go b/agents/supervisor/supervisor.go index 3895c4701..7a1db1904 100644 --- a/agents/supervisor/supervisor.go +++ b/agents/supervisor/supervisor.go @@ -36,7 +36,6 @@ import ( "github.com/sirupsen/logrus" "google.golang.org/protobuf/proto" - "github.com/percona/pmm-agent/agentlocal" "github.com/percona/pmm-agent/agents" "github.com/percona/pmm-agent/agents/mongodb" "github.com/percona/pmm-agent/agents/mysql/perfschema" @@ -87,6 +86,13 @@ type builtinAgentInfo struct { logs *storelogs.LogsStore // store logs } +// AgentLogs contains information about Agent logs. +type AgentLogs struct { + Type inventorypb.AgentType + ID string + RingLogs *storelogs.LogsStore +} + // NewSupervisor creates new Supervisor object. // // Supervisor is gracefully stopped when context passed to NewSupervisor is canceled. @@ -148,16 +154,16 @@ func (s *Supervisor) AgentsList() []*agentlocalpb.AgentInfo { } // AgentsLogs returns logs for all Agents managed by this supervisor. -func (s *Supervisor) AgentsLogs() []*agentlocal.AgentLogs { +func (s *Supervisor) AgentsLogs() []*AgentLogs { s.rw.RLock() defer s.rw.RUnlock() s.arw.RLock() defer s.arw.RUnlock() - res := make([]*agentlocal.AgentLogs, 0, len(s.agentProcesses)+len(s.builtinAgents)) + res := make([]*AgentLogs, 0, len(s.agentProcesses)+len(s.builtinAgents)) for id, agent := range s.agentProcesses { - info := &agentlocal.AgentLogs{ + info := &AgentLogs{ ID: id, Type: agent.requestedState.Type, RingLogs: agent.logs, @@ -166,7 +172,7 @@ func (s *Supervisor) AgentsLogs() []*agentlocal.AgentLogs { } for id, agent := range s.builtinAgents { - info := &agentlocal.AgentLogs{ + info := &AgentLogs{ ID: id, Type: agent.requestedState.Type, RingLogs: agent.logs, diff --git a/commands/run.go b/commands/run.go index 005abd799..2d2f0a9d9 100644 --- a/commands/run.go +++ b/commands/run.go @@ -17,6 +17,7 @@ package commands import ( "context" + "github.com/percona/pmm-agent/storelogs" "os" "os/signal" @@ -77,7 +78,8 @@ func run(ctx context.Context, cfg *config.Config, configFilepath string) { connectionChecker := connectionchecker.New(&cfg.Paths) v := versioner.New(&versioner.RealExecFunctions{}) client := client.New(cfg, supervisor, connectionChecker, v) - localServer := agentlocal.NewServer(cfg, supervisor, client, configFilepath) + ringLog := storelogs.New(500) + localServer := agentlocal.NewServer(cfg, supervisor, client, configFilepath, ringLog) go func() { _ = client.Run(ctx) From 858e68c62a365b8fafcb5842de555defea0a5a03 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Tue, 10 May 2022 11:17:07 +0300 Subject: [PATCH 47/63] Pmm-5680 store serve logs --- agentlocal/agent_local_test.go | 2 +- commands/run.go | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/agentlocal/agent_local_test.go b/agentlocal/agent_local_test.go index b49cbbfe0..c300fd67a 100644 --- a/agentlocal/agent_local_test.go +++ b/agentlocal/agent_local_test.go @@ -17,7 +17,6 @@ package agentlocal import ( "context" - "github.com/percona/pmm-agent/storelogs" "testing" "time" @@ -29,6 +28,7 @@ import ( "google.golang.org/protobuf/types/known/durationpb" "github.com/percona/pmm-agent/config" + "github.com/percona/pmm-agent/storelogs" ) func TestServerStatus(t *testing.T) { diff --git a/commands/run.go b/commands/run.go index 2d2f0a9d9..c8d258e2d 100644 --- a/commands/run.go +++ b/commands/run.go @@ -17,7 +17,6 @@ package commands import ( "context" - "github.com/percona/pmm-agent/storelogs" "os" "os/signal" @@ -29,6 +28,7 @@ import ( "github.com/percona/pmm-agent/client" "github.com/percona/pmm-agent/config" "github.com/percona/pmm-agent/connectionchecker" + "github.com/percona/pmm-agent/storelogs" "github.com/percona/pmm-agent/versioner" ) @@ -41,6 +41,7 @@ func Run() { // handle termination signals signals := make(chan os.Signal, 1) signal.Notify(signals, unix.SIGTERM, unix.SIGINT) + ringLog := storelogs.New(500) go func() { s := <-signals signal.Stop(signals) @@ -56,7 +57,7 @@ func Run() { config.ConfigureLogger(cfg) l.Debugf("Loaded configuration: %+v", cfg) - run(ctx, cfg, configFilepath) + run(ctx, cfg, configFilepath, ringLog) if ctx.Err() != nil { return @@ -66,7 +67,7 @@ func Run() { // run runs all pmm-agent components with given configuration until ctx is cancellled. // See documentation for NewXXX, Run, and Done -func run(ctx context.Context, cfg *config.Config, configFilepath string) { +func run(ctx context.Context, cfg *config.Config, configFilepath string, ringLog *storelogs.LogsStore) { var cancel context.CancelFunc ctx, cancel = context.WithCancel(ctx) @@ -78,7 +79,7 @@ func run(ctx context.Context, cfg *config.Config, configFilepath string) { connectionChecker := connectionchecker.New(&cfg.Paths) v := versioner.New(&versioner.RealExecFunctions{}) client := client.New(cfg, supervisor, connectionChecker, v) - ringLog := storelogs.New(500) + localServer := agentlocal.NewServer(cfg, supervisor, client, configFilepath, ringLog) go func() { From 611c10e4063aa74d4a764e713785d3aaa0321908 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Tue, 10 May 2022 11:42:54 +0300 Subject: [PATCH 48/63] Pmm-5680 fix test --- agentlocal/mock_supervisor_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/agentlocal/mock_supervisor_test.go b/agentlocal/mock_supervisor_test.go index b8ae131d0..6fa525bc5 100644 --- a/agentlocal/mock_supervisor_test.go +++ b/agentlocal/mock_supervisor_test.go @@ -6,7 +6,7 @@ import ( agentlocalpb "github.com/percona/pmm/api/agentlocalpb" mock "github.com/stretchr/testify/mock" - supervisor "github.com/percona/pmm-agent/agents/supervisor" + sp "github.com/percona/pmm-agent/agents/supervisor" ) // mockSupervisor is an autogenerated mock type for the supervisor type @@ -31,15 +31,15 @@ func (_m *mockSupervisor) AgentsList() []*agentlocalpb.AgentInfo { } // AgentsLogs provides a mock function with given fields: -func (_m *mockSupervisor) AgentsLogs() []*supervisor.AgentLogs { +func (_m *mockSupervisor) AgentsLogs() []*sp.AgentLogs { ret := _m.Called() - var r0 []*supervisor.AgentLogs - if rf, ok := ret.Get(0).(func() []*supervisor.AgentLogs); ok { + var r0 []*sp.AgentLogs + if rf, ok := ret.Get(0).(func() []*sp.AgentLogs); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]*supervisor.AgentLogs) + r0 = ret.Get(0).([]*sp.AgentLogs) } } From 49cc0e694dd96f4a60f9a459d699fed6f70a532c Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Tue, 10 May 2022 16:30:41 +0300 Subject: [PATCH 49/63] Pmm-5680 remove struct AgentLogs --- agentlocal/agent_local.go | 8 ++++---- agentlocal/deps.go | 4 +--- agentlocal/mock_supervisor_test.go | 10 ++++------ agents/supervisor/supervisor.go | 25 ++++--------------------- 4 files changed, 13 insertions(+), 34 deletions(-) diff --git a/agentlocal/agent_local.go b/agentlocal/agent_local.go index 9bb42e195..74d499bdc 100644 --- a/agentlocal/agent_local.go +++ b/agentlocal/agent_local.go @@ -317,18 +317,18 @@ func (s *Server) runJSONServer(ctx context.Context, grpcAddress string) { } addData(writer, "server.txt", b.Bytes()) - for _, agent := range s.supervisor.AgentsLogs() { + for id, logs := range s.supervisor.AgentsLogs() { if err != nil { log.Fatal(err) } b := &bytes.Buffer{} - for _, agentLog := range agent.RingLogs.GetLogs() { - _, err := b.WriteString(agentLog + "\n") + for _, l := range logs { + _, err := b.WriteString(l + "\n") if err != nil { log.Fatal(err) } } - addData(writer, fmt.Sprintf("%s %s.txt", agent.Type.String(), agent.ID), b.Bytes()) + addData(writer, fmt.Sprintf("%s.txt", id), b.Bytes()) } err = writer.Close() if err != nil { diff --git a/agentlocal/deps.go b/agentlocal/deps.go index 8769b2522..a7031b848 100644 --- a/agentlocal/deps.go +++ b/agentlocal/deps.go @@ -21,8 +21,6 @@ import ( "github.com/percona/pmm/api/agentlocalpb" "github.com/percona/pmm/api/agentpb" "github.com/prometheus/client_golang/prometheus" - - sp "github.com/percona/pmm-agent/agents/supervisor" ) //go:generate mockery -name=client -case=snake -inpkg -testonly @@ -41,5 +39,5 @@ type client interface { // We use it instead of real type for testing and to avoid dependency cycle. type supervisor interface { AgentsList() []*agentlocalpb.AgentInfo - AgentsLogs() []*sp.AgentLogs + AgentsLogs() map[string][]string } diff --git a/agentlocal/mock_supervisor_test.go b/agentlocal/mock_supervisor_test.go index 6fa525bc5..342574e6f 100644 --- a/agentlocal/mock_supervisor_test.go +++ b/agentlocal/mock_supervisor_test.go @@ -5,8 +5,6 @@ package agentlocal import ( agentlocalpb "github.com/percona/pmm/api/agentlocalpb" mock "github.com/stretchr/testify/mock" - - sp "github.com/percona/pmm-agent/agents/supervisor" ) // mockSupervisor is an autogenerated mock type for the supervisor type @@ -31,15 +29,15 @@ func (_m *mockSupervisor) AgentsList() []*agentlocalpb.AgentInfo { } // AgentsLogs provides a mock function with given fields: -func (_m *mockSupervisor) AgentsLogs() []*sp.AgentLogs { +func (_m *mockSupervisor) AgentsLogs() map[string][]string { ret := _m.Called() - var r0 []*sp.AgentLogs - if rf, ok := ret.Get(0).(func() []*sp.AgentLogs); ok { + var r0 map[string][]string + if rf, ok := ret.Get(0).(func() map[string][]string); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]*sp.AgentLogs) + r0 = ret.Get(0).(map[string][]string) } } diff --git a/agents/supervisor/supervisor.go b/agents/supervisor/supervisor.go index 7a1db1904..91267179e 100644 --- a/agents/supervisor/supervisor.go +++ b/agents/supervisor/supervisor.go @@ -86,13 +86,6 @@ type builtinAgentInfo struct { logs *storelogs.LogsStore // store logs } -// AgentLogs contains information about Agent logs. -type AgentLogs struct { - Type inventorypb.AgentType - ID string - RingLogs *storelogs.LogsStore -} - // NewSupervisor creates new Supervisor object. // // Supervisor is gracefully stopped when context passed to NewSupervisor is canceled. @@ -154,30 +147,20 @@ func (s *Supervisor) AgentsList() []*agentlocalpb.AgentInfo { } // AgentsLogs returns logs for all Agents managed by this supervisor. -func (s *Supervisor) AgentsLogs() []*AgentLogs { +func (s *Supervisor) AgentsLogs() map[string][]string { s.rw.RLock() defer s.rw.RUnlock() s.arw.RLock() defer s.arw.RUnlock() - res := make([]*AgentLogs, 0, len(s.agentProcesses)+len(s.builtinAgents)) + var res map[string][]string for id, agent := range s.agentProcesses { - info := &AgentLogs{ - ID: id, - Type: agent.requestedState.Type, - RingLogs: agent.logs, - } - res = append(res, info) + res[fmt.Sprintf("%s %s", id, agent.requestedState.Type.String())] = agent.logs.GetLogs() } for id, agent := range s.builtinAgents { - info := &AgentLogs{ - ID: id, - Type: agent.requestedState.Type, - RingLogs: agent.logs, - } - res = append(res, info) + res[fmt.Sprintf("%s %s", id, agent.requestedState.Type.String())] = agent.logs.GetLogs() } return res } From 60a0db641d7ebd2883ebb044e8cfb2561bf02728 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Tue, 10 May 2022 18:46:15 +0300 Subject: [PATCH 50/63] Pmm-5680 remove id from map key --- agents/supervisor/supervisor.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/agents/supervisor/supervisor.go b/agents/supervisor/supervisor.go index 91267179e..9c1dd03d1 100644 --- a/agents/supervisor/supervisor.go +++ b/agents/supervisor/supervisor.go @@ -155,12 +155,12 @@ func (s *Supervisor) AgentsLogs() map[string][]string { var res map[string][]string - for id, agent := range s.agentProcesses { - res[fmt.Sprintf("%s %s", id, agent.requestedState.Type.String())] = agent.logs.GetLogs() + for _, agent := range s.agentProcesses { + res[agent.requestedState.Type.String()] = agent.logs.GetLogs() } - for id, agent := range s.builtinAgents { - res[fmt.Sprintf("%s %s", id, agent.requestedState.Type.String())] = agent.logs.GetLogs() + for _, agent := range s.builtinAgents { + res[agent.requestedState.Type.String()] = agent.logs.GetLogs() } return res } From ed5a7ce2e58ff9336e08419bf8ea2ba8a0239e65 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Tue, 10 May 2022 18:57:06 +0300 Subject: [PATCH 51/63] Pmm-5680 set const number logs --- agentlocal/agent_local.go | 7 ------- agents/supervisor/supervisor.go | 7 ++++--- commands/run.go | 4 +++- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/agentlocal/agent_local.go b/agentlocal/agent_local.go index 74d499bdc..afec143bd 100644 --- a/agentlocal/agent_local.go +++ b/agentlocal/agent_local.go @@ -72,13 +72,6 @@ type Server struct { agentlocalpb.UnimplementedAgentLocalServer } -//// AgentLogs contains information about Agent logs. -//type AgentLogs struct { -// Type inventorypb.AgentType -// ID string -// RingLogs *storelogs.LogsStore -//} - // NewServer creates new server. //` // Caller should call Run. diff --git a/agents/supervisor/supervisor.go b/agents/supervisor/supervisor.go index 9c1dd03d1..f1484e657 100644 --- a/agents/supervisor/supervisor.go +++ b/agents/supervisor/supervisor.go @@ -349,8 +349,9 @@ func filter(existing, new map[string]agentpb.AgentParams) (toStart, toRestart, t //nolint:golint const ( - type_TEST_SLEEP inventorypb.AgentType = 998 // process - type_TEST_NOOP inventorypb.AgentType = 999 // built-in + type_TEST_SLEEP inventorypb.AgentType = 998 // process + type_TEST_NOOP inventorypb.AgentType = 999 // built-in + COUNT_AGENT_LOGS = 10 ) // startProcess starts Agent's process. @@ -393,7 +394,7 @@ func (s *Supervisor) startProcess(agentID string, agentProcess *agentpb.SetState } func (s *Supervisor) newLogger(component string, agentID string, agentType string) (*storelogs.LogsStore, *logrus.Entry) { - ringLog := storelogs.New(10) + ringLog := storelogs.New(COUNT_AGENT_LOGS) logger := logrus.New() logger.SetFormatter(logrus.StandardLogger().Formatter) logger.Out = io.MultiWriter(os.Stderr, ringLog) diff --git a/commands/run.go b/commands/run.go index c8d258e2d..9f560e25e 100644 --- a/commands/run.go +++ b/commands/run.go @@ -32,6 +32,8 @@ import ( "github.com/percona/pmm-agent/versioner" ) +const COUNT_SERVER_LOGS = 500 + // Run implements `pmm-agent run` default command. func Run() { l := logrus.WithField("component", "main") @@ -41,7 +43,7 @@ func Run() { // handle termination signals signals := make(chan os.Signal, 1) signal.Notify(signals, unix.SIGTERM, unix.SIGINT) - ringLog := storelogs.New(500) + ringLog := storelogs.New(COUNT_SERVER_LOGS) go func() { s := <-signals signal.Stop(signals) From 9d688bbde90127c1d14823ff568a21008752afa8 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Wed, 11 May 2022 00:13:18 +0300 Subject: [PATCH 52/63] Pmm-5680 change function AgentsLogs --- agents/supervisor/supervisor.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/agents/supervisor/supervisor.go b/agents/supervisor/supervisor.go index f1484e657..4cbdc14c9 100644 --- a/agents/supervisor/supervisor.go +++ b/agents/supervisor/supervisor.go @@ -152,15 +152,16 @@ func (s *Supervisor) AgentsLogs() map[string][]string { defer s.rw.RUnlock() s.arw.RLock() defer s.arw.RUnlock() + res := make(map[string][]string) - var res map[string][]string - - for _, agent := range s.agentProcesses { - res[agent.requestedState.Type.String()] = agent.logs.GetLogs() + for id, agent := range s.agentProcesses { + newId := strings.ReplaceAll(id, "/agent_id/", "") + res[fmt.Sprintf("%s %s", agent.requestedState.Type.String(), newId)] = agent.logs.GetLogs() } - for _, agent := range s.builtinAgents { - res[agent.requestedState.Type.String()] = agent.logs.GetLogs() + for id, agent := range s.builtinAgents { + newId := strings.ReplaceAll(id, "/agent_id/", "") + res[fmt.Sprintf("%s %s", agent.requestedState.Type.String(), newId)] = agent.logs.GetLogs() } return res } From 545883a57977ff14ed04c1a1c26f22543154ef47 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Wed, 11 May 2022 12:04:44 +0300 Subject: [PATCH 53/63] Pmm-5680 remove comment --- agentlocal/agent_local.go | 1 - 1 file changed, 1 deletion(-) diff --git a/agentlocal/agent_local.go b/agentlocal/agent_local.go index afec143bd..e74a871f3 100644 --- a/agentlocal/agent_local.go +++ b/agentlocal/agent_local.go @@ -329,7 +329,6 @@ func (s *Server) runJSONServer(ctx context.Context, grpcAddress string) { } w.Header().Set("Content-Type", "application/zip") w.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s.zip\"", "logs")) - // io.Copy(w, buf) _, err = w.Write(buf.Bytes()) if err != nil { log.Fatal(err) From 96f10b06b0a1bd1c035efc167b91d56ed068d959 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Wed, 11 May 2022 14:24:11 +0300 Subject: [PATCH 54/63] Pmm-5680 fix linn err --- agents/supervisor/supervisor.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/agents/supervisor/supervisor.go b/agents/supervisor/supervisor.go index 4cbdc14c9..e60bef6c3 100644 --- a/agents/supervisor/supervisor.go +++ b/agents/supervisor/supervisor.go @@ -155,13 +155,13 @@ func (s *Supervisor) AgentsLogs() map[string][]string { res := make(map[string][]string) for id, agent := range s.agentProcesses { - newId := strings.ReplaceAll(id, "/agent_id/", "") - res[fmt.Sprintf("%s %s", agent.requestedState.Type.String(), newId)] = agent.logs.GetLogs() + newID := strings.ReplaceAll(id, "/agent_id/", "") + res[fmt.Sprintf("%s %s", agent.requestedState.Type.String(), newID)] = agent.logs.GetLogs() } for id, agent := range s.builtinAgents { - newId := strings.ReplaceAll(id, "/agent_id/", "") - res[fmt.Sprintf("%s %s", agent.requestedState.Type.String(), newId)] = agent.logs.GetLogs() + newID := strings.ReplaceAll(id, "/agent_id/", "") + res[fmt.Sprintf("%s %s", agent.requestedState.Type.String(), newID)] = agent.logs.GetLogs() } return res } From 98806413dbb1e62ea3b901380b1e0caac12bd2db Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Wed, 11 May 2022 14:49:36 +0300 Subject: [PATCH 55/63] Pmm-5680 add small changes --- agentlocal/agent_local.go | 2 +- agents/supervisor/supervisor.go | 8 ++++---- commands/run.go | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/agentlocal/agent_local.go b/agentlocal/agent_local.go index e74a871f3..4318ad18e 100644 --- a/agentlocal/agent_local.go +++ b/agentlocal/agent_local.go @@ -73,7 +73,7 @@ type Server struct { } // NewServer creates new server. -//` + // Caller should call Run. func NewServer(cfg *config.Config, supervisor supervisor, client client, configFilepath string, ringLog *storelogs.LogsStore) *Server { logger := logrus.New() diff --git a/agents/supervisor/supervisor.go b/agents/supervisor/supervisor.go index e60bef6c3..a7b3df318 100644 --- a/agents/supervisor/supervisor.go +++ b/agents/supervisor/supervisor.go @@ -350,9 +350,9 @@ func filter(existing, new map[string]agentpb.AgentParams) (toStart, toRestart, t //nolint:golint const ( - type_TEST_SLEEP inventorypb.AgentType = 998 // process - type_TEST_NOOP inventorypb.AgentType = 999 // built-in - COUNT_AGENT_LOGS = 10 + type_TEST_SLEEP inventorypb.AgentType = 998 // process + type_TEST_NOOP inventorypb.AgentType = 999 // built-in + maxAgentLogs = 200 // max number logs can store each agent ) // startProcess starts Agent's process. @@ -395,7 +395,7 @@ func (s *Supervisor) startProcess(agentID string, agentProcess *agentpb.SetState } func (s *Supervisor) newLogger(component string, agentID string, agentType string) (*storelogs.LogsStore, *logrus.Entry) { - ringLog := storelogs.New(COUNT_AGENT_LOGS) + ringLog := storelogs.New(maxAgentLogs) logger := logrus.New() logger.SetFormatter(logrus.StandardLogger().Formatter) logger.Out = io.MultiWriter(os.Stderr, ringLog) diff --git a/commands/run.go b/commands/run.go index 9f560e25e..c30b2ef38 100644 --- a/commands/run.go +++ b/commands/run.go @@ -32,7 +32,7 @@ import ( "github.com/percona/pmm-agent/versioner" ) -const COUNT_SERVER_LOGS = 500 +const maxServerLogs = 500 // max number logs can store server // Run implements `pmm-agent run` default command. func Run() { @@ -43,7 +43,7 @@ func Run() { // handle termination signals signals := make(chan os.Signal, 1) signal.Notify(signals, unix.SIGTERM, unix.SIGINT) - ringLog := storelogs.New(COUNT_SERVER_LOGS) + ringLog := storelogs.New(maxServerLogs) go func() { s := <-signals signal.Stop(signals) From 60e10a4459035a0de4b2d3f6a672e0e182e028ee Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Mon, 16 May 2022 20:18:02 +0300 Subject: [PATCH 56/63] Pmm-5680 create test --- agentlocal/agent_local.go | 71 +++++++++++++++++----------------- agentlocal/agent_local_test.go | 27 +++++++++++++ 2 files changed, 62 insertions(+), 36 deletions(-) diff --git a/agentlocal/agent_local.go b/agentlocal/agent_local.go index 4318ad18e..040130e38 100644 --- a/agentlocal/agent_local.go +++ b/agentlocal/agent_local.go @@ -298,42 +298,7 @@ func (s *Server) runJSONServer(ctx context.Context, grpcAddress string) { mux.Handle("/debug/", http.DefaultServeMux) mux.Handle("/debug", debugPageHandler) mux.Handle("/", proxyMux) - mux.HandleFunc("/logs.zip", func(w http.ResponseWriter, r *http.Request) { - buf := &bytes.Buffer{} - writer := zip.NewWriter(buf) - b := &bytes.Buffer{} - for _, serverLog := range s.ringLogs.GetLogs() { - _, err := b.WriteString(serverLog) - if err != nil { - log.Fatal(err) - } - } - addData(writer, "server.txt", b.Bytes()) - - for id, logs := range s.supervisor.AgentsLogs() { - if err != nil { - log.Fatal(err) - } - b := &bytes.Buffer{} - for _, l := range logs { - _, err := b.WriteString(l + "\n") - if err != nil { - log.Fatal(err) - } - } - addData(writer, fmt.Sprintf("%s.txt", id), b.Bytes()) - } - err = writer.Close() - if err != nil { - log.Fatal(err) - } - w.Header().Set("Content-Type", "application/zip") - w.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s.zip\"", "logs")) - _, err = w.Write(buf.Bytes()) - if err != nil { - log.Fatal(err) - } - }) + mux.HandleFunc("/logs.zip", s.Zip) server := &http.Server{ Addr: address, @@ -375,3 +340,37 @@ func addData(zipW *zip.Writer, name string, data []byte) { var ( _ agentlocalpb.AgentLocalServer = (*Server)(nil) ) + +func (s *Server) Zip(w http.ResponseWriter, r *http.Request) { + buf := &bytes.Buffer{} + writer := zip.NewWriter(buf) + b := &bytes.Buffer{} + for _, serverLog := range s.ringLogs.GetLogs() { + _, err := b.WriteString(serverLog) + if err != nil { + log.Fatal(err) + } + } + addData(writer, "server.txt", b.Bytes()) + + for id, logs := range s.supervisor.AgentsLogs() { + b := &bytes.Buffer{} + for _, l := range logs { + _, err := b.WriteString(l + "\n") + if err != nil { + log.Fatal(err) + } + } + addData(writer, fmt.Sprintf("%s.txt", id), b.Bytes()) + } + err := writer.Close() + if err != nil { + log.Fatal(err) + } + w.Header().Set("Content-Type", "application/zip") + w.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s.zip\"", "logs")) + _, err = w.Write(buf.Bytes()) + if err != nil { + log.Fatal(err) + } +} diff --git a/agentlocal/agent_local_test.go b/agentlocal/agent_local_test.go index c300fd67a..6a3ba3605 100644 --- a/agentlocal/agent_local_test.go +++ b/agentlocal/agent_local_test.go @@ -17,6 +17,8 @@ package agentlocal import ( "context" + "fmt" + "net/http/httptest" "testing" "time" @@ -41,6 +43,12 @@ func TestServerStatus(t *testing.T) { var supervisor mockSupervisor supervisor.Test(t) supervisor.On("AgentsList").Return(agentInfo) + agentLogs := make(map[string][]string) + agentLogs[inventorypb.AgentType_NODE_EXPORTER.String()] = []string{ + "logs1", + "logs2", + } + supervisor.On("AgentsLogs").Return(agentInfo) var client mockClient client.Test(t) client.On("GetServerConnectMetadata").Return(&agentpb.ServerConnectMetadata{ @@ -110,4 +118,23 @@ func TestServerStatus(t *testing.T) { } assert.Equal(t, expected, actual) }) + t.Run("with network info", func(t *testing.T) { + _, supervisor, client, cfg := setup(t) + latency := 5 * time.Millisecond + clockDrift := time.Second + client.On("GetNetworkInformation").Return(latency, clockDrift, nil) + defer supervisor.AssertExpectations(t) + defer client.AssertExpectations(t) + ringLog := storelogs.New(500) + s := NewServer(cfg, supervisor, client, "/some/dir/pmm-agent.yaml", ringLog) + + // with network info + rec := httptest.NewRecorder() + req := httptest.NewRequest("GET", "/logs.zip", nil) + s.Zip(rec, req) + //handler.ServeHTTP(rec, req) + fmt.Println(rec.Body) + //fmt.Println(handler) + + }) } From a0b10af588435ae6f3436587ea71d76a0d757123 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Thu, 19 May 2022 23:57:23 +0300 Subject: [PATCH 57/63] =?UTF-8?q?Pmm-5680=20=D1=84=D0=B2=D0=B2=20=D0=B5?= =?UTF-8?q?=D1=83=D1=8B=D0=B5=20=D1=8F=D1=88=D0=B7=20=D0=B0=D1=88=D0=B4?= =?UTF-8?q?=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- agentlocal/agent_local_test.go | 103 +++++++++++++++++++++++++++------ storelogs/storelogs.go | 4 +- 2 files changed, 89 insertions(+), 18 deletions(-) diff --git a/agentlocal/agent_local_test.go b/agentlocal/agent_local_test.go index 6a3ba3605..b66fd9e51 100644 --- a/agentlocal/agent_local_test.go +++ b/agentlocal/agent_local_test.go @@ -16,8 +16,13 @@ package agentlocal import ( + "archive/zip" + //"bufio" + "bytes" "context" "fmt" + //"github.com/sirupsen/logrus" + "io/ioutil" "net/http/httptest" "testing" "time" @@ -43,12 +48,6 @@ func TestServerStatus(t *testing.T) { var supervisor mockSupervisor supervisor.Test(t) supervisor.On("AgentsList").Return(agentInfo) - agentLogs := make(map[string][]string) - agentLogs[inventorypb.AgentType_NODE_EXPORTER.String()] = []string{ - "logs1", - "logs2", - } - supervisor.On("AgentsLogs").Return(agentInfo) var client mockClient client.Test(t) client.On("GetServerConnectMetadata").Return(&agentpb.ServerConnectMetadata{ @@ -118,23 +117,93 @@ func TestServerStatus(t *testing.T) { } assert.Equal(t, expected, actual) }) - t.Run("with network info", func(t *testing.T) { +} + +func TestGetZipFile(t *testing.T) { + setup := func(t *testing.T) ([]*agentlocalpb.AgentInfo, *mockSupervisor, *mockClient, *config.Config) { + agentInfo := []*agentlocalpb.AgentInfo{{ + AgentId: "/agent_id/00000000-0000-4000-8000-000000000002", + AgentType: inventorypb.AgentType_NODE_EXPORTER, + Status: inventorypb.AgentStatus_RUNNING, + }} + var supervisor mockSupervisor + supervisor.Test(t) + supervisor.On("AgentsList").Return(agentInfo) + agentLogs := make(map[string][]string) + agentLogs[inventorypb.AgentType_NODE_EXPORTER.String()] = []string{ + "logs1", + "logs2", + } + supervisor.On("AgentsLogs").Return(agentLogs) + var client mockClient + client.Test(t) + client.On("GetServerConnectMetadata").Return(&agentpb.ServerConnectMetadata{ + AgentRunsOnNodeID: "/node_id/00000000-0000-4000-8000-000000000003", + ServerVersion: "2.0.0-dev", + }) + cfg := &config.Config{ + ID: "/agent_id/00000000-0000-4000-8000-000000000001", + Server: config.Server{ + Address: "127.0.0.1:8443", + Username: "username", + Password: "password", + }, + } + return agentInfo, &supervisor, &client, cfg + } + + t.Run("test zip file", func(t *testing.T) { _, supervisor, client, cfg := setup(t) - latency := 5 * time.Millisecond - clockDrift := time.Second - client.On("GetNetworkInformation").Return(latency, clockDrift, nil) defer supervisor.AssertExpectations(t) defer client.AssertExpectations(t) - ringLog := storelogs.New(500) + ringLog := storelogs.New(10) s := NewServer(cfg, supervisor, client, "/some/dir/pmm-agent.yaml", ringLog) - - // with network info + _, err := s.Status(context.Background(), &agentlocalpb.StatusRequest{GetNetworkInfo: false}) + //fmt.Sprintf("%v %v", actual, err) rec := httptest.NewRecorder() req := httptest.NewRequest("GET", "/logs.zip", nil) s.Zip(rec, req) - //handler.ServeHTTP(rec, req) - fmt.Println(rec.Body) - //fmt.Println(handler) - + b, err := ioutil.ReadAll(rec.Body) + if err != nil { + t.Errorf("Fail readBody: %+v", err) + } + expectedFile, err := generateTestZip(s) + if err != nil { + t.Errorf("Fail to generate ZipFile: %+v", err) + } + assert.Equal(t, expectedFile, b) }) } +func generateTestZip(s *Server) ([]byte, error) { + agentLogs := make(map[string][]string) + agentLogs[inventorypb.AgentType_NODE_EXPORTER.String()] = []string{ + "logs1", + "logs2", + } + buf := &bytes.Buffer{} + writer := zip.NewWriter(buf) + b := &bytes.Buffer{} + for _, serverLog := range s.ringLogs.GetLogs() { + _, err := b.WriteString(serverLog) + if err != nil { + return nil, err + } + } + addData(writer, "server.txt", b.Bytes()) + + for id, logs := range agentLogs { + b := &bytes.Buffer{} + for _, l := range logs { + _, err := b.WriteString(l + "\n") + if err != nil { + return nil, err + } + } + addData(writer, fmt.Sprintf("%s.txt", id), b.Bytes()) + } + err := writer.Close() + if err != nil { + return nil, err + } + return buf.Bytes(), nil +} diff --git a/storelogs/storelogs.go b/storelogs/storelogs.go index 89bf8c4e0..b21f57ff9 100644 --- a/storelogs/storelogs.go +++ b/storelogs/storelogs.go @@ -19,6 +19,7 @@ package storelogs import ( "container/ring" "fmt" + "strings" "sync" ) @@ -51,8 +52,9 @@ func (l *LogsStore) GetLogs() (logs []string) { l.m.Lock() l.log.Do(func(p interface{}) { log := fmt.Sprint(p) + replacer := strings.NewReplacer("\u001B[36m", "", "\u001B[0m", "", "\u001B[33", "", "\u001B[31m", "", " ", " ") if p != nil { - logs = append(logs, log) + logs = append(logs, replacer.Replace(log)) } }) l.m.Unlock() From ecbac3dc9cbb145baada004bfc3e4628aa24bbc2 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Fri, 20 May 2022 00:04:58 +0300 Subject: [PATCH 58/63] Pmm-5680 make gen --- agentlocal/agent_local_test.go | 4 +++- agents/supervisor/supervisor.go | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/agentlocal/agent_local_test.go b/agentlocal/agent_local_test.go index b66fd9e51..e396b2313 100644 --- a/agentlocal/agent_local_test.go +++ b/agentlocal/agent_local_test.go @@ -21,6 +21,7 @@ import ( "bytes" "context" "fmt" + //"github.com/sirupsen/logrus" "io/ioutil" "net/http/httptest" @@ -159,7 +160,7 @@ func TestGetZipFile(t *testing.T) { ringLog := storelogs.New(10) s := NewServer(cfg, supervisor, client, "/some/dir/pmm-agent.yaml", ringLog) _, err := s.Status(context.Background(), &agentlocalpb.StatusRequest{GetNetworkInfo: false}) - //fmt.Sprintf("%v %v", actual, err) + // fmt.Sprintf("%v %v", actual, err) rec := httptest.NewRecorder() req := httptest.NewRequest("GET", "/logs.zip", nil) s.Zip(rec, req) @@ -174,6 +175,7 @@ func TestGetZipFile(t *testing.T) { assert.Equal(t, expectedFile, b) }) } + func generateTestZip(s *Server) ([]byte, error) { agentLogs := make(map[string][]string) agentLogs[inventorypb.AgentType_NODE_EXPORTER.String()] = []string{ diff --git a/agents/supervisor/supervisor.go b/agents/supervisor/supervisor.go index 49807e0e9..e1702065a 100644 --- a/agents/supervisor/supervisor.go +++ b/agents/supervisor/supervisor.go @@ -74,6 +74,7 @@ type agentProcessInfo struct { requestedState *agentpb.SetStateRequest_AgentProcess listenPort uint16 processExecPath string + logs *storelogs.LogsStore // store logs } // builtinAgentInfo describes built-in Agent. @@ -392,7 +393,7 @@ func (s *Supervisor) startProcess(agentID string, agentProcess *agentpb.SetState requestedState: proto.Clone(agentProcess).(*agentpb.SetStateRequest_AgentProcess), listenPort: port, processExecPath: processParams.Path, - logs: ringLog, + logs: ringLog, } return nil } From 592965b6b426bea926bbf6a1a49e8aff5a020c64 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Fri, 20 May 2022 10:21:13 +0300 Subject: [PATCH 59/63] Pmm-5680 fix test --- agentlocal/agent_local_test.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/agentlocal/agent_local_test.go b/agentlocal/agent_local_test.go index e396b2313..192be907e 100644 --- a/agentlocal/agent_local_test.go +++ b/agentlocal/agent_local_test.go @@ -17,12 +17,9 @@ package agentlocal import ( "archive/zip" - //"bufio" "bytes" "context" "fmt" - - //"github.com/sirupsen/logrus" "io/ioutil" "net/http/httptest" "testing" @@ -160,18 +157,16 @@ func TestGetZipFile(t *testing.T) { ringLog := storelogs.New(10) s := NewServer(cfg, supervisor, client, "/some/dir/pmm-agent.yaml", ringLog) _, err := s.Status(context.Background(), &agentlocalpb.StatusRequest{GetNetworkInfo: false}) + require.NoError(t, err) // fmt.Sprintf("%v %v", actual, err) rec := httptest.NewRecorder() req := httptest.NewRequest("GET", "/logs.zip", nil) s.Zip(rec, req) b, err := ioutil.ReadAll(rec.Body) - if err != nil { - t.Errorf("Fail readBody: %+v", err) - } + require.NoError(t, err) + expectedFile, err := generateTestZip(s) - if err != nil { - t.Errorf("Fail to generate ZipFile: %+v", err) - } + require.NoError(t, err) assert.Equal(t, expectedFile, b) }) } From f379d59c091b95fcb9488d90be6b87eae58383e1 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Wed, 25 May 2022 23:53:39 +0300 Subject: [PATCH 60/63] Pmm-5680 fix test --- agentlocal/agent_local_test.go | 45 +++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/agentlocal/agent_local_test.go b/agentlocal/agent_local_test.go index 192be907e..f2e1169d9 100644 --- a/agentlocal/agent_local_test.go +++ b/agentlocal/agent_local_test.go @@ -17,10 +17,12 @@ package agentlocal import ( "archive/zip" + "bufio" "bytes" "context" "fmt" "io/ioutil" + "log" "net/http/httptest" "testing" "time" @@ -158,19 +160,33 @@ func TestGetZipFile(t *testing.T) { s := NewServer(cfg, supervisor, client, "/some/dir/pmm-agent.yaml", ringLog) _, err := s.Status(context.Background(), &agentlocalpb.StatusRequest{GetNetworkInfo: false}) require.NoError(t, err) - // fmt.Sprintf("%v %v", actual, err) + rec := httptest.NewRecorder() req := httptest.NewRequest("GET", "/logs.zip", nil) s.Zip(rec, req) - b, err := ioutil.ReadAll(rec.Body) + existFile, err := ioutil.ReadAll(rec.Body) require.NoError(t, err) expectedFile, err := generateTestZip(s) require.NoError(t, err) - assert.Equal(t, expectedFile, b) + bufExp := bytes.NewReader(expectedFile) + bufExs := bytes.NewReader(existFile) + + zipExp, err := zip.NewReader(bufExp, bufExp.Size()) + require.NoError(t, err) + zipExs, err := zip.NewReader(bufExp, bufExs.Size()) + require.NoError(t, err) + + for i, ex := range zipExp.File { + assert.Equal(t, ex.Name, zipExs.File[i].Name) + deepCompare(t, ex, zipExs.File[i]) + } + require.NoError(t, err) + assert.Equal(t, expectedFile, existFile) }) } +// generateTestZip generate test zip file. func generateTestZip(s *Server) ([]byte, error) { agentLogs := make(map[string][]string) agentLogs[inventorypb.AgentType_NODE_EXPORTER.String()] = []string{ @@ -204,3 +220,26 @@ func generateTestZip(s *Server) ([]byte, error) { } return buf.Bytes(), nil } + +// deepCompare compare two zip files. +func deepCompare(t *testing.T, file1, file2 *zip.File) bool { + sf, err := file1.Open() + if err != nil { + log.Fatal(err) + } + + df, err := file2.Open() + if err != nil { + log.Fatal(err) + } + + sscan := bufio.NewScanner(sf) + dscan := bufio.NewScanner(df) + + for sscan.Scan() { + dscan.Scan() + assert.Equal(t, sscan.Bytes(), dscan.Bytes()) + } + + return false +} From 29028f2a13af5ffc9aa993d93ddfce4da60ed89d Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Thu, 26 May 2022 00:21:29 +0300 Subject: [PATCH 61/63] Pmm-5680 fix test --- agents/mysql/perfschema/perfschema_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/agents/mysql/perfschema/perfschema_test.go b/agents/mysql/perfschema/perfschema_test.go index c11151410..1685904a7 100644 --- a/agents/mysql/perfschema/perfschema_test.go +++ b/agents/mysql/perfschema/perfschema_test.go @@ -286,19 +286,19 @@ func TestPerfSchema(t *testing.T) { case "10.2-mariadb": digests = map[string]string{ "SELECT `sleep` (?)": "e58c348e4947db23b7f3ad30b7ed184a", - "SELECT * FROM `city`": "e0f47172152e8750d070a854e607123f", + "SELECT * FROM `city`": "7e30fa1763d6d9aa88f359236cedaa78", } case "10.3-mariadb": digests = map[string]string{ - "SELECT `sleep` (?)": "af50128de9089f71d749eda5ba3d02cd", + "SELECT `sleep` (?)": "b0062e3bc75dd6e57cdc90696ba47688", "SELECT * FROM `city`": "2153d686f335a2ca39f3aca05bf9709a", } case "10.4-mariadb": digests = map[string]string{ "SELECT `sleep` (?)": "84a33aa2dff8b023bfd9c28247516e55", - "SELECT * FROM `city`": "639b3ffc239a110c57ade746773952ab", + "SELECT * FROM `city`": "0d4348c89b36f2739b082c2aef07b3d4", } default: From f43cd913f40a7718a4ae11cf42ece49e6e590c3f Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Thu, 26 May 2022 00:36:14 +0300 Subject: [PATCH 62/63] Pmm-5680 fix test --- agents/mysql/perfschema/perfschema_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/agents/mysql/perfschema/perfschema_test.go b/agents/mysql/perfschema/perfschema_test.go index 1685904a7..c11151410 100644 --- a/agents/mysql/perfschema/perfschema_test.go +++ b/agents/mysql/perfschema/perfschema_test.go @@ -286,19 +286,19 @@ func TestPerfSchema(t *testing.T) { case "10.2-mariadb": digests = map[string]string{ "SELECT `sleep` (?)": "e58c348e4947db23b7f3ad30b7ed184a", - "SELECT * FROM `city`": "7e30fa1763d6d9aa88f359236cedaa78", + "SELECT * FROM `city`": "e0f47172152e8750d070a854e607123f", } case "10.3-mariadb": digests = map[string]string{ - "SELECT `sleep` (?)": "b0062e3bc75dd6e57cdc90696ba47688", + "SELECT `sleep` (?)": "af50128de9089f71d749eda5ba3d02cd", "SELECT * FROM `city`": "2153d686f335a2ca39f3aca05bf9709a", } case "10.4-mariadb": digests = map[string]string{ "SELECT `sleep` (?)": "84a33aa2dff8b023bfd9c28247516e55", - "SELECT * FROM `city`": "0d4348c89b36f2739b082c2aef07b3d4", + "SELECT * FROM `city`": "639b3ffc239a110c57ade746773952ab", } default: From 796c46d82bc336c84a0c762a5b8694a1ce182322 Mon Sep 17 00:00:00 2001 From: "i.rybachuk" Date: Wed, 1 Jun 2022 15:07:28 +0300 Subject: [PATCH 63/63] pmm-5680 little changes --- agentlocal/agent_local.go | 4 ++-- agentlocal/agent_local_test.go | 2 +- storelogs/storelogs.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/agentlocal/agent_local.go b/agentlocal/agent_local.go index 040130e38..a7f2c3fbf 100644 --- a/agentlocal/agent_local.go +++ b/agentlocal/agent_local.go @@ -73,7 +73,7 @@ type Server struct { } // NewServer creates new server. - +// // Caller should call Run. func NewServer(cfg *config.Config, supervisor supervisor, client client, configFilepath string, ringLog *storelogs.LogsStore) *Server { logger := logrus.New() @@ -351,7 +351,7 @@ func (s *Server) Zip(w http.ResponseWriter, r *http.Request) { log.Fatal(err) } } - addData(writer, "server.txt", b.Bytes()) + addData(writer, "pmm-agent.txt", b.Bytes()) for id, logs := range s.supervisor.AgentsLogs() { b := &bytes.Buffer{} diff --git a/agentlocal/agent_local_test.go b/agentlocal/agent_local_test.go index f2e1169d9..6f7051ad5 100644 --- a/agentlocal/agent_local_test.go +++ b/agentlocal/agent_local_test.go @@ -202,7 +202,7 @@ func generateTestZip(s *Server) ([]byte, error) { return nil, err } } - addData(writer, "server.txt", b.Bytes()) + addData(writer, "pmm-agent.txt", b.Bytes()) for id, logs := range agentLogs { b := &bytes.Buffer{} diff --git a/storelogs/storelogs.go b/storelogs/storelogs.go index b21f57ff9..076e81b22 100644 --- a/storelogs/storelogs.go +++ b/storelogs/storelogs.go @@ -41,8 +41,8 @@ func New(count int) *LogsStore { func (l *LogsStore) Write(b []byte) (n int, err error) { l.m.Lock() l.log.Value = string(b) - l.m.Unlock() l.log = l.log.Next() + l.m.Unlock() return len(b), nil }