Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrSkipProcess indicates that the current process being evaluated should be skipped. ErrSkipProcess = errors.New("skip process") // ErrIncompatibleDetector indicates that a specific detector is incompatible with a resource. ErrIncompatibleDetector = errors.New("incompatible detector") )
Functions ¶
This section is empty.
Types ¶
type Category ¶
type Category string
Category represents a classification type for discovered resources.
type DeviceDetector ¶
type DeviceDetector interface {
// Detect attempts to gather metadata for devices. Returns an error if the detection fails.
Detect() (*Metadata, error)
}
DeviceDetector defines an interface for detecting and categorizing devices.
type Metadata ¶
type Metadata struct {
// Categories can be one or more ordered Category entries that a detector matched. For example, a Tomcat detector
// would match both JVM and Tomcat.
Categories []Category `json:"categories"`
// Name is the identifier of the resource.
Name string `json:"name,omitempty"`
// TelemetryPort is the port for the resource that exposes telemetry.
TelemetryPort int `json:"telemetry_port,omitempty"`
// Status is the current status of telemetry availability for the resource.
Status Status `json:"status"`
}
Metadata represents discovered information about a resource including its categories, details, and current Status.
type MetadataSlice ¶
type MetadataSlice []*Metadata
MetadataSlice is a grouping on Metadata entries.
type NameExtractor ¶
type NameFilter ¶
NameFilter determines based on the detected name if a resource should be included in the detection results.
type PortExtractor ¶
type Process ¶
type Process interface {
// PID returns the process ID.
PID() int32
// ExeWithContext returns the executable path of the process.
ExeWithContext(ctx context.Context) (string, error)
// CwdWithContext returns the current working directory of the process.
CwdWithContext(ctx context.Context) (string, error)
// CmdlineSliceWithContext returns the command line arguments of the process as a slice. Includes the executable
// in the first entry.
CmdlineSliceWithContext(ctx context.Context) ([]string, error)
// EnvironWithContext returns the environment variables of the process. Each entry follows a <NAME>=<VALUE> pattern.
EnvironWithContext(ctx context.Context) ([]string, error)
// CreateTimeWithContext returns the creation time of the process in milliseconds.
CreateTimeWithContext(ctx context.Context) (int64, error)
}
Process defines an interface for interacting with system processes.
type ProcessDetector ¶
type ProcessDetector interface {
// Detect attempts to gather metadata for a given process. Returns an error if the detection fails.
Detect(ctx context.Context, process Process) (*Metadata, error)
}
ProcessDetector defines an interface for detecting and categorizing processes.
type ProcessFilter ¶
ProcessFilter determines if a process should be included in the detection results.
Click to show internal directories.
Click to hide internal directories.