identity

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CategoryForIdentity

func CategoryForIdentity(ident *AppIdentity) string

CategoryForIdentity also corrects persisted name-based guesses when read.

func FallbackName

func FallbackName(key string) string

FallbackName identifies command-name-only records written by older versions.

func MatchFallback

func MatchFallback(key string, candidates []*AppIdentity) string

MatchFallback prefers a unique full executable path. With no matching path, legacy short-lived and plain command-name records share one fallback bucket. Ambiguous executable paths stay separate; names never combine full paths.

Types

type AppIdentity

type AppIdentity struct {
	AppKey         string    `json:"app_key"`
	DisplayName    string    `json:"display_name"`
	Category       string    `json:"category"`
	IconOrType     string    `json:"icon_or_type"`
	ExecutablePath string    `json:"executable_path"`
	CgroupPath     string    `json:"cgroup_path"`
	FirstSeen      time.Time `json:"first_seen"`
	LastSeen       time.Time `json:"last_seen"`
}

AppIdentity represents a stable application identity

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

Resolver resolves temporary PIDs and system metadata into stable AppIdentities

func NewResolver

func NewResolver() *Resolver

NewResolver creates and initializes an identity resolver

func (*Resolver) ResolvePID

func (r *Resolver) ResolvePID(pid uint32) *AppIdentity

ResolvePID determines the stable AppIdentity for a given PID

func (*Resolver) SeedIdentities

func (r *Resolver) SeedIdentities(identities []*AppIdentity)

SeedIdentities lets command-name fallbacks reuse paths observed before a daemon restart, without guessing when several executables share a name.

func (*Resolver) SetBPFLookup

func (r *Resolver) SetBPFLookup(lookup func(pid uint32) (comm string, cgroupId uint64, ok bool))

SetBPFLookup registers a fallback lookup for short-lived processes from eBPF

Jump to

Keyboard shortcuts

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