Documentation ¶
Overview ¶
Package process provides all the tools and functionality for sampling processes. It is divided in three main components:
- Status: provides OS-level information of a process at a given spot
- Harvester: fetches and creates actual Process Status from system
- Collector: uses input from the application pipeline to fetch information for all the processes from the instrumented applications, and forwards it to the next stage of the Process' pipeline.
Index ¶
- Constants
- func NewCollectorProvider(ctx context.Context, input *<-chan []request.Span, cfg *CollectConfig) pipe.StartProvider[[]*Status]
- func OTELGetters(name attr.Name) (attributes.Getter[*Status, attribute.KeyValue], bool)
- func PromGetters(name attr.Name) (attributes.Getter[*Status, string], bool)
- type CPUInfo
- type CollectConfig
- type Collector
- type Harvester
- type ID
- type RunMode
- type Status
Constants ¶
const ( RunModePrivileged = "privileged" RunModeUnprivileged = "unprivileged" )
Variables ¶
This section is empty.
Functions ¶
func NewCollectorProvider ¶
func NewCollectorProvider(ctx context.Context, input *<-chan []request.Span, cfg *CollectConfig) pipe.StartProvider[[]*Status]
NewCollectorProvider creates and returns a new process Collector, given an agent context.
func OTELGetters ¶
OTELGetters is currently empty as most attributes are resource-level, but left as a placeholder for future attribute additions. nolint:cyclop
func PromGetters ¶
nolint:cyclop
Types ¶
type CPUInfo ¶
type CPUInfo struct { // User time of CPU, in seconds UserTime float64 // System time of CPU, in seconds SystemTime float64 // Wait time of CPU, in seconds WaitTime float64 }
CPUInfo represents CPU usage statistics at a given point
type CollectConfig ¶
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector returns runtime information about the currently running processes. The collector receives each application trace from the newPids internal channel, to know which PIDs are active.
type Harvester ¶
type Harvester struct {
// contains filtered or unexported fields
}
Harvester fetches processes' information from Linux
type ID ¶
type ID struct { Service *svc.ID // UID for a process. Even if the Service field has its own UID, // a service might have multiple processes, so Application and Process // will be different resources, each one with its own UID, // which will be the composition of Service.Instance-ProcessID UID svc.UID ProcessID int32 ParentProcessID int32 User string Command string CommandArgs []string CommandLine string ExecName string ExecPath string }
type Status ¶
type Status struct { ID ID CPUTimeSystemDelta float64 CPUTimeUserDelta float64 CPUTimeWaitDelta float64 CPUUtilisationSystem float64 CPUUtilisationUser float64 CPUUtilisationWait float64 // delta values are used in OTEL UpDownCounters while absolute values are used in Prometheus gauges MemoryRSSBytes int64 MemoryVMSBytes int64 MemoryRSSBytesDelta int64 MemoryVMSBytesDelta int64 Status string ThreadCount int32 FdCount int32 IOReadCount uint64 IOWriteCount uint64 IOReadBytesDelta uint64 IOWriteBytesDelta uint64 NetTxBytesDelta int64 NetRcvBytesDelta int64 }
Status of a process after being harvested