utils

package
v0.19.0-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Attributes

func Attributes(dest pcommon.Map, attrs ...attribute.KeyValue)

func BootOffsetToTime

func BootOffsetToTime(nsec uint64) time.Time

BootOffsetToTime returns the timestamp that is nsec number of nanoseconds after the estimated boot time of the system.

func BootOffsetToTimestamp

func BootOffsetToTimestamp(nsec uint64) pcommon.Timestamp

BootOffsetToTimestamp returns the pcommon.Timestamp that is nsec number of nanoseconds after the estimated boot time of the system.

func GetCPUCount

func GetCPUCount() (int, error)

func GetCPUCountFromProc

func GetCPUCountFromProc() (int, error)

func GetCPUCountFromSysDevices

func GetCPUCountFromSysDevices() (int, error)

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

func TimeToBootOffset(timestamp time.Time) uint64

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

Jump to

Keyboard shortcuts

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