Documentation
¶
Overview ¶
Package agentlocal provides facilities for accessing local pmm-agent API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotSetUp = fmt.Errorf("pmm-agent is running, but not set up")
ErrNotSetUp is returned by GetStatus when pmm-agent is running, but not set up.
Functions ¶
func GetRawStatus ¶
func GetRawStatus(ctx context.Context, requestNetworkInfo NetworkInfo) (*agentlocal.StatusOKBody, error)
GetRawStatus returns raw local pmm-agent status. No special cases. Most callers should use GetStatus instead.
func SetTransport ¶
SetTransport configures transport for accessing local pmm-agent API.
Types ¶
type AgentStatus ¶
type NetworkInfo ¶
type NetworkInfo bool
const ( RequestNetworkInfo NetworkInfo = true DoNotRequestNetworkInfo NetworkInfo = false )
type Status ¶
type Status struct { AgentID string `json:"agent_id"` NodeID string `json:"node_id"` ServerURL *url.URL `json:"server_url"` ServerInsecureTLS bool `json:"server_insecure_tls"` ServerVersion string `json:"server_version"` Agents []AgentStatus `json:"agents"` Connected bool `json:"connected"` ServerClockDrift time.Duration `json:"server_clock_drift,omitempty"` ServerLatency time.Duration `json:"server_latency,omitempty"` }
Status represents pmm-agent status.
func GetStatus ¶
func GetStatus(requestNetworkInfo NetworkInfo) (*Status, error)
GetStatus returns local pmm-agent status. As a special case, if pmm-agent is running, but not set up, ErrNotSetUp is returned.
Click to show internal directories.
Click to hide internal directories.