process

package
v1.17.3 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

View Source
const (
	NodeVersionConst   = "NODE_VERSION"
	PythonVersionConst = "PYTHON_VERSION"
	JavaVersionConst   = "JAVA_VERSION"
	JavaHomeConst      = "JAVA_HOME"
	PhpVersionConst    = "PHP_VERSION"
	RubyVersionConst   = "RUBY_VERSION"
)
View Source
const (
	NewRelicAgentName  = "New Relic Agent"
	DynatraceAgentName = "Dynatrace Agent"
	DataDogAgentName   = "Datadog Agent"
)
View Source
const (
	NewRelicAgentEnv                 = "NEW_RELIC_CONFIG_FILE"
	DynatraceDynamizerEnv            = "DT_DYNAMIZER_TARGET_EXE"
	DynatraceDynamizerExeSubString   = "oneagentdynamizer"
	DynatraceFullStackEnvValuePrefix = "/dynatrace/"
	DataDogAgentEnv                  = "DD_TRACE_AGENT_URL"
)

Variables

View Source
var LangsVersionEnvs = map[string]struct{}{
	NodeVersionConst:   {},
	PythonVersionConst: {},
	JavaVersionConst:   {},
	JavaHomeConst:      {},
	PhpVersionConst:    {},
	RubyVersionConst:   {},
}

LangsVersionEnvs is a map of environment variables used for detecting the versions of different languages

View Source
var OtherAgentCmdSubString = map[string]string{
	"newrelic.jar": NewRelicAgentName,
}

Functions

func FindAllProcesses

func FindAllProcesses(predicate func(int) bool) ([]int, error)

Find all processes in the system. The function accepts a predicate function that can be used to filter the results.

func Group added in v1.14.0

func Group[K comparable](predicate func(int) (K, bool)) (map[K]map[int]struct{}, error)

Group processes by a key returned by the predicate function. The predicate function should return the key and a boolean indicating whether to include the process in the result. If the boolean is false, the process will be skipped. The function returns a map where the keys are the keys returned by the predicate function and the values are maps of process IDs that belong to each key.

func HostProcDir added in v1.2.1

func HostProcDir() string

func ProcFilePath added in v1.2.1

func ProcFilePath(pid int, fileName string) string

ProcFilePath constructs the file path for a given process ID and file name in the /proc filesystem.

Types

type Details

type Details struct {
	ProcessID           int
	ExePath             string
	CmdLine             string
	Environments        ProcessEnvs
	SecureExecutionMode *bool
}

func GetPidDetails

func GetPidDetails(pid int, runtimeDetectionEnvs map[string]struct{}) Details

func (*Details) GetDetailedEnvsValue added in v1.0.93

func (d *Details) GetDetailedEnvsValue(key string) (string, bool)

func (*Details) GetOverwriteEnvsValue added in v1.0.93

func (d *Details) GetOverwriteEnvsValue(key string) (string, bool)

type ProcessContext added in v1.0.165

type ProcessContext struct {
	Details
	// contains filtered or unexported fields
}

func NewProcessContext added in v1.0.165

func NewProcessContext(details Details) *ProcessContext

func (*ProcessContext) CloseFiles added in v1.0.165

func (pcx *ProcessContext) CloseFiles() error

Close method to close any open file handles.

func (*ProcessContext) GetExeFile added in v1.0.165

func (pcx *ProcessContext) GetExeFile() (ProcessFile, error)

func (*ProcessContext) GetMapsFile added in v1.0.165

func (pcx *ProcessContext) GetMapsFile() (ProcessFile, error)

type ProcessEnvs added in v1.0.93

type ProcessEnvs struct {
	DetailedEnvs map[string]string
	// OverwriteEnvs only contains environment variables that Odigos is using for auto-instrumentation and may need to be overwritten
	OverwriteEnvs map[string]string
}

type ProcessFile added in v1.0.165

type ProcessFile interface {
	io.ReadSeekCloser
	io.ReaderAt
}

ProcessFile is a read-only interface that supports reading, seeking, and reading at specific positions. Write operations should be avoided.

Jump to

Keyboard shortcuts

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