Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

PMM-7110 Changed log level #219

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions commands/summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import (
"gopkg.in/alecthomas/kingpin.v2"

"github.com/percona/pmm-admin/agentlocal"
"github.com/percona/pmm-admin/helpers"
)

var summaryResultT = ParseTemplate(`
Expand Down Expand Up @@ -263,7 +264,10 @@ func addPprofData(ctx context.Context, zipW *zip.Writer, skipServer bool) {
sources := map[string]string{
"client/pprof/pmm-agent": fmt.Sprintf("http://%s:%d/debug/pprof", agentlocal.Localhost, GlobalFlags.PMMAgentListenPort),
}
if !skipServer {

isRunOnPmmServer, _ := helpers.IsOnPmmServer()

if !skipServer && isRunOnPmmServer {
sources["server/pprof/pmm-managed"] = fmt.Sprintf("http://%s:7773/debug/pprof", agentlocal.Localhost)
sources["server/pprof/qan-api2"] = fmt.Sprintf("http://%s:9933/debug/pprof", agentlocal.Localhost)
}
Expand All @@ -283,7 +287,7 @@ func addPprofData(ctx context.Context, zipW *zip.Writer, skipServer bool) {
logrus.Infof("Getting %s ...", url)
data, err := getURL(ctx, url)
if err != nil {
logrus.Debugf("%s", err)
logrus.Warnf("%s", err)
return
}

Expand Down
10 changes: 10 additions & 0 deletions helpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,13 @@ func GetNodeName(node *nodes.GetNodeOKBody) (string, error) {
return "", errors.Wrap(errNoNode, "unknown node type")
}
}

// IsOnPmmServer returns true if pmm-admin is running on pmm-server.
func IsOnPmmServer() (bool, error) {
status, err := agentlocal.GetStatus(agentlocal.DoNotRequestNetworkInfo)
if err != nil {
return false, errors.Wrap(err, "can't get local pmm-agent status")
}

return status.NodeID == "pmm-server", nil
}