Documentation
¶
Index ¶
- Variables
- func NewManager(client client.Client, logger logr.Logger, opts InstrumentationManagerOptions, ...) (instrumentation.Manager, error)
- type ConfigProvider
- type ConfigurableOtelEbpfSdk
- type Directordeprecated
- type DirectorKey
- type DirectorsMapdeprecated
- type EbpfDirectordeprecated
- func (d *EbpfDirector[T]) ApplyInstrumentationConfiguration(ctx context.Context, workload *k8sconsts.PodWorkload, ...) error
- func (d *EbpfDirector[T]) Cleanup(pod types.NamespacedName)
- func (d *EbpfDirector[T]) GetWorkloadInstrumentations(workload *k8sconsts.PodWorkload) []T
- func (d *EbpfDirector[T]) Instrument(ctx context.Context, pid int, pod types.NamespacedName, ...) error
- func (d *EbpfDirector[T]) Language() common.ProgrammingLanguage
- func (d *EbpfDirector[T]) ShouldInstrument(pid int, details []process.Details) bool
- func (d *EbpfDirector[T]) Shutdown()
- type InstrumentationFactory
- type InstrumentationHealth
- type InstrumentationManagerOptions
- type InstrumentationStatusReason
- type InstrumentedProcess
- type K8sConfigGroup
- type K8sProcessDetails
- type OtelEbpfSdk
Constants ¶
This section is empty.
Variables ¶
var CleanupInterval = 30 * time.Second
CleanupInterval is the interval in which the director will check if the instrumented processes are still running and clean up the resources associated to the ones that are not. It is not const for testing purposes.
var IsProcessExists = func(pid int) bool { p, err := os.FindProcess(pid) if err != nil { return false } err = p.Signal(syscall.Signal(0)) if err == nil { return true } if errors.Is(err, os.ErrProcessDone) { return false } errno, ok := err.(syscall.Errno) if !ok { return false } if errno == syscall.EPERM { return true } return false }
defining this function here allows mocking it in tests
Functions ¶
func NewManager ¶ added in v1.0.134
func NewManager(client client.Client, logger logr.Logger, opts InstrumentationManagerOptions, configUpdates <-chan instrumentation.ConfigUpdate[K8sConfigGroup]) (instrumentation.Manager, error)
NewManager creates a new instrumentation manager for eBPF which is configured to work with Kubernetes. Instrumentation factories must be provided in order to create the instrumentation objects. Detector options can be provided to configure the process detector, but if not provided, default options will be used.
Types ¶
type ConfigProvider ¶ added in v1.0.98
type ConfigProvider[C any] struct { // contains filtered or unexported fields }
func NewConfigProvider ¶ added in v1.0.98
func NewConfigProvider[C any](initialConfig C) *ConfigProvider[C]
NewConfigProvider creates a new configProvider with the given initial config. It allows for updating the configuration of a running instrumentation.
func (*ConfigProvider[C]) InitialConfig ¶ added in v1.0.98
func (c *ConfigProvider[C]) InitialConfig(_ context.Context) C
func (*ConfigProvider[C]) SendConfig ¶ added in v1.0.98
func (c *ConfigProvider[C]) SendConfig(ctx context.Context, newConfig C) error
SendConfig sends a new configuration to the instrumentation. If the instrumentation was closed or cannot accept the new configuration within a configured timeout, an error is returned.
func (*ConfigProvider[C]) Shutdown ¶ added in v1.0.98
func (c *ConfigProvider[C]) Shutdown(_ context.Context) error
func (*ConfigProvider[C]) Watch ¶ added in v1.0.98
func (c *ConfigProvider[C]) Watch() <-chan C
type ConfigurableOtelEbpfSdk ¶ added in v1.0.98
type ConfigurableOtelEbpfSdk interface { OtelEbpfSdk ApplyConfig(ctx context.Context, config *odigosv1.InstrumentationConfig) error }
type Director
deprecated
type Director interface { Language() common.ProgrammingLanguage Instrument(ctx context.Context, pid int, podDetails types.NamespacedName, podWorkload *k8sconsts.PodWorkload, appName string, containerName string) error Cleanup(podDetails types.NamespacedName) Shutdown() // TODO: once all our implementation move to this function we can rename it to ApplyInstrumentationConfig, // currently that name is reserved for the old API until it is removed. ApplyInstrumentationConfiguration(ctx context.Context, workload *k8sconsts.PodWorkload, instrumentationConfig *odigosv1.InstrumentationConfig) error ShouldInstrument(pid int, details []process.Details) bool }
Director manages the instrumentation for a specific SDK in a specific language
Deprecated: this will be removed once we fully move to the process event based approach
type DirectorKey ¶
type DirectorKey struct { Language common.ProgrammingLanguage common.OtelSdk }
type DirectorsMap
deprecated
type DirectorsMap map[DirectorKey]Director
Deprecated: this will be removed once we fully move to the process event based approach
type EbpfDirector
deprecated
type EbpfDirector[T OtelEbpfSdk] struct { // contains filtered or unexported fields }
Deprecated: this will be removed once we fully move to the process event based approach
func NewEbpfDirector ¶
func NewEbpfDirector[T OtelEbpfSdk](ctx context.Context, client client.Client, scheme *runtime.Scheme, language common.ProgrammingLanguage, instrumentationFactory InstrumentationFactory[T]) *EbpfDirector[T]
func (*EbpfDirector[T]) ApplyInstrumentationConfiguration ¶ added in v1.0.98
func (d *EbpfDirector[T]) ApplyInstrumentationConfiguration(ctx context.Context, workload *k8sconsts.PodWorkload, instrumentationConfig *odigosv1.InstrumentationConfig) error
func (*EbpfDirector[T]) Cleanup ¶
func (d *EbpfDirector[T]) Cleanup(pod types.NamespacedName)
Cleanup cleans up the resources associated with the given pod including all the instrumented processes.
func (*EbpfDirector[T]) GetWorkloadInstrumentations ¶
func (d *EbpfDirector[T]) GetWorkloadInstrumentations(workload *k8sconsts.PodWorkload) []T
func (*EbpfDirector[T]) Instrument ¶
func (d *EbpfDirector[T]) Instrument(ctx context.Context, pid int, pod types.NamespacedName, podWorkload *k8sconsts.PodWorkload, appName string, containerName string) error
func (*EbpfDirector[T]) Language ¶
func (d *EbpfDirector[T]) Language() common.ProgrammingLanguage
func (*EbpfDirector[T]) ShouldInstrument ¶ added in v1.0.105
func (d *EbpfDirector[T]) ShouldInstrument(pid int, details []process.Details) bool
func (*EbpfDirector[T]) Shutdown ¶
func (d *EbpfDirector[T]) Shutdown()
type InstrumentationFactory ¶
type InstrumentationFactory[T OtelEbpfSdk] interface { CreateEbpfInstrumentation(ctx context.Context, pid int, serviceName string, podWorkload *k8sconsts.PodWorkload, containerName string, podName string, loadedIndicator chan struct{}) (T, error) }
users can use different eBPF otel SDKs by returning them from this function Deprecated: this will be removed once we fully move to the generic instrumentation manager
type InstrumentationHealth ¶ added in v1.0.134
type InstrumentationHealth bool
const ( InstrumentationHealthy InstrumentationHealth = true InstrumentationUnhealthy InstrumentationHealth = false )
type InstrumentationManagerOptions ¶ added in v1.0.158
type InstrumentationManagerOptions struct { Factories map[instrumentation.OtelDistribution]instrumentation.Factory DistributionGetter *distros.Getter }
type InstrumentationStatusReason ¶ added in v1.0.64
type InstrumentationStatusReason string
const ( FailedToLoad InstrumentationStatusReason = "FailedToLoad" FailedToInitialize InstrumentationStatusReason = "FailedToInitialize" LoadedSuccessfully InstrumentationStatusReason = "LoadedSuccessfully" FailedToRun InstrumentationStatusReason = "FailedToRun" )
type InstrumentedProcess ¶ added in v1.0.108
type InstrumentedProcess[T OtelEbpfSdk] struct { PID int // contains filtered or unexported fields }
type K8sConfigGroup ¶ added in v1.0.137
type K8sConfigGroup struct { Pw k8sconsts.PodWorkload Lang common.ProgrammingLanguage }
type K8sProcessDetails ¶ added in v1.0.140
type K8sProcessDetails struct {
// contains filtered or unexported fields
}
func (K8sProcessDetails) String ¶ added in v1.0.140
func (kd K8sProcessDetails) String() string
type OtelEbpfSdk ¶
type OtelEbpfSdk interface { // this is temporary until we move to the generic instrumentation manager Load(ctx context.Context) error // Run starts the eBPF instrumentation. // It should block until the instrumentation is stopped or the context is canceled or an error occurs. Run(ctx context.Context) error // Close cleans up the resources associated with the eBPF instrumentation. Close(ctx context.Context) error }
This interface should be implemented by all ebpf sdks for example, the go auto instrumentation sdk implements it Deprecated: this will be removed once we fully move to the generic instrumentation manager