Documentation ¶
Index ¶
- func Attributes(dest pcommon.Map, attrs ...attribute.KeyValue)
- func BootOffsetToTime(nsec uint64) time.Time
- func BootOffsetToTimestamp(nsec uint64) pcommon.Timestamp
- func GetCPUCount() (int, error)
- func GetCPUCountFromProc() (int, error)
- func GetCPUCountFromSysDevices() (int, error)
- func GetLinuxKernelVersion() (*version.Version, error)
- func InitializeEBPFCollection(spec *ebpf.CollectionSpec, opts *ebpf.CollectionOptions) (*ebpf.Collection, error)
- func ShouldShowVerifierLogs() bool
- func SupportsContextPropagation() bool
- func TimeToBootOffset(timestamp time.Time) uint64
- type KernelLockdown
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BootOffsetToTime ¶
BootOffsetToTime returns the timestamp that is nsec number of nanoseconds after the estimated boot time of the system.
func BootOffsetToTimestamp ¶
BootOffsetToTimestamp returns the pcommon.Timestamp that is nsec number of nanoseconds after the estimated boot time of the system.
func GetCPUCount ¶
func GetCPUCountFromProc ¶
func GetLinuxKernelVersion ¶
func GetLinuxKernelVersion() (*version.Version, error)
parse logic adapted from https://github.com/golang/go/blob/go1.21.3/src/internal/syscall/unix/kernel_version_linux.go
func InitializeEBPFCollection ¶
func InitializeEBPFCollection(spec *ebpf.CollectionSpec, opts *ebpf.CollectionOptions) (*ebpf.Collection, error)
InitializeEBPFCollection loads eBPF objects from the given spec and returns a collection corresponding to the spec. If the environment variable OTEL_GO_AUTO_SHOW_VERIFIER_LOG is set to true, the verifier log will be printed.
func ShouldShowVerifierLogs ¶
func ShouldShowVerifierLogs() bool
ShouldShowVerifierLogs returns if the user has configured verifier logs to be emitted.
func SupportsContextPropagation ¶
func SupportsContextPropagation() bool
Does kernel version check and /sys/kernel/security/lockdown inspection to determine if it's safe to use bpf_probe_write_user.
func TimeToBootOffset ¶
TimeToBootOffset returns the number of nanoseconds after the estimated boot time of the process that the timestamp represent.
Types ¶
type KernelLockdown ¶
type KernelLockdown uint8
KernelLockdown is the lockdown state of the Linux kernel.
const ( // Linux Kernel security lockdown mode [none]. KernelLockdownNone KernelLockdown = iota + 1 // Linux Kernel security lockdown mode [integrity]. KernelLockdownIntegrity // Linux Kernel security lockdown mode [confidentiality]. KernelLockdownConfidentiality // Linux Kernel security lockdown mode unknown. KernelLockdownOther )
func KernelLockdownMode ¶
func KernelLockdownMode() KernelLockdown