inject

package
v0.2.1-alpha Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Injector

type Injector struct {
	TotalCPUs         uint32
	AllocationDetails *process.AllocationDetails
	// contains filtered or unexported fields
}

Injector injects OpenTelemetry instrumentation Go packages.

func New

func New(target *process.TargetDetails) (*Injector, error)

New returns an Injector configured for the target.

func (*Injector) Inject

func (i *Injector) Inject(loadBpf loadBpfFunc, library string, libVersion string, fields []*StructField, initAlloc bool) (*ebpf.CollectionSpec, error)

Inject injects instrumentation for the provided library data type.

type StructField

type StructField struct {
	VarName    string
	StructName string
	Field      string
}

StructField is the definition of a structure field for which instrumentation is injected.

type TrackedField

type TrackedField struct {
	// Versions range that are tracked for this given field
	Versions VersionInfo `json:"versions"`
	// Offsets are the sorted version offsets for the field. These need to be
	// sorted in descending order.
	Offsets []VersionedOffset `json:"offsets"`
}

TrackedField are the field offsets for a tracked struct.

type TrackedOffsets

type TrackedOffsets struct {
	// Data key: struct name, which includes the library name in external
	// libraries.
	Data map[string]TrackedStruct `json:"data"`
}

TrackedOffsets are the offsets for all instrumented packages.

type TrackedStruct

type TrackedStruct map[string]TrackedField

TrackedStruct maps fields names to the tracked fields offsets.

type VersionInfo

type VersionInfo struct {
	Oldest string `json:"oldest"`
	Newest string `json:"newest"`
}

VersionInfo is the span of supported versions.

type VersionedOffset

type VersionedOffset struct {
	Offset uint64 `json:"offset"`
	Since  string `json:"since"`
}

VersionedOffset is the offset for a particular version of a data type from a package.

Jump to

Keyboard shortcuts

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