ebpf

package
v1.0.60 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Director

type Director interface {
	Language() common.ProgrammingLanguage
	Instrument(ctx context.Context, pid int, podDetails types.NamespacedName, podWorkload *common.PodWorkload, appName string, containerName string) error
	Cleanup(podDetails types.NamespacedName)
	Shutdown()
}

Director manages the instrumentation for a specific SDK in a specific language

type DirectorKey

type DirectorKey struct {
	Language common.ProgrammingLanguage
	common.OtelSdk
}

type DirectorsMap

type DirectorsMap map[DirectorKey]Director

type EbpfDirector

type EbpfDirector[T OtelEbpfSdk] struct {
	// contains filtered or unexported fields
}

func NewEbpfDirector

func NewEbpfDirector[T OtelEbpfSdk](language common.ProgrammingLanguage, instrumentationFactory InstrumentationFactory[T]) *EbpfDirector[T]

func (*EbpfDirector[T]) Cleanup

func (d *EbpfDirector[T]) Cleanup(pod types.NamespacedName)

func (*EbpfDirector[T]) GetWorkloadInstrumentations

func (d *EbpfDirector[T]) GetWorkloadInstrumentations(workload *common.PodWorkload) []T

func (*EbpfDirector[T]) Instrument

func (d *EbpfDirector[T]) Instrument(ctx context.Context, pid int, pod types.NamespacedName, podWorkload *common.PodWorkload, appName string, containerName string) error

func (*EbpfDirector[T]) Language

func (d *EbpfDirector[T]) Language() common.ProgrammingLanguage

func (*EbpfDirector[T]) Shutdown

func (d *EbpfDirector[T]) Shutdown()

type GoInstrumentationFactory

type GoInstrumentationFactory struct{}

func (*GoInstrumentationFactory) CreateEbpfInstrumentation

func (g *GoInstrumentationFactory) CreateEbpfInstrumentation(ctx context.Context, pid int, serviceName string, podWorkload *common.PodWorkload, containerName string, podName string) (*GoOtelEbpfSdk, error)

type GoOtelEbpfSdk

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

func (*GoOtelEbpfSdk) Close

func (g *GoOtelEbpfSdk) Close(ctx context.Context) error

func (*GoOtelEbpfSdk) Run

func (g *GoOtelEbpfSdk) Run(ctx context.Context) error

type InstrumentationFactory

type InstrumentationFactory[T OtelEbpfSdk] interface {
	CreateEbpfInstrumentation(ctx context.Context, pid int, serviceName string, podWorkload *common.PodWorkload, containerName string, podName string) (T, error)
}

users can use different eBPF otel SDKs by returning them from this function

func NewGoInstrumentationFactory

func NewGoInstrumentationFactory() InstrumentationFactory[*GoOtelEbpfSdk]

type OtelEbpfSdk

type OtelEbpfSdk interface {
	Run(ctx context.Context) error
	Close(ctx context.Context) error
}

This interface should be implemented by all ebpf sdks for example, the go auto instrumentation sdk implements it

Jump to

Keyboard shortcuts

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