agent

package
v0.3.28 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2023 License: BSD-3-Clause Imports: 21 Imported by: 497

Documentation

Overview

Package agent provides hooks programs can register to retrieve diagnostics data by using gops.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close added in v0.1.0

func Close()

Close closes the agent, removing temporary files and closing the TCP listener. If no agent is listening, Close does nothing.

func Listen added in v0.1.0

func Listen(opts Options) error

Listen starts the gops agent on a host process. Once agent started, users can use the advanced gops features. The agent will listen to Interrupt signals and exit the process, if you need to perform further work on the Interrupt signal use the options parameter to configure the agent accordingly.

Note: The agent exposes an endpoint via a TCP connection that can be used by any program on the system. Review your security requirements before starting the agent.

Types

type Options added in v0.1.0

type Options struct {
	// Addr is the host:port the agent will be listening at.
	// Optional.
	Addr string

	// ConfigDir is the directory to store the configuration file,
	// PID of the gops process, filename, port as well as content.
	// Optional.
	ConfigDir string

	// ShutdownCleanup automatically cleans up resources if the
	// running process receives an interrupt. Otherwise, users
	// can call Close before shutting down.
	// Optional.
	ShutdownCleanup bool

	// ReuseSocketAddrAndPort determines whether the SO_REUSEADDR and
	// SO_REUSEPORT socket options should be set on the listening socket of
	// the agent. This option is only effective on unix-like OSes and if
	// Addr is set to a fixed host:port.
	// Optional.
	ReuseSocketAddrAndPort bool
}

Options allows configuring the started agent.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL