instrumentation

package
v0.0.0-...-c0007b8 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImmutableWorkloadError

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

func (ImmutableWorkloadError) Error

func (e ImmutableWorkloadError) Error() string

type Instrumenter

type Instrumenter struct {
	client.Client
	Clientset            *kubernetes.Clientset
	Recorder             record.EventRecorder
	Images               util.Images
	OTelCollectorBaseUrl string
	IsIPv6Cluster        bool
}

func (*Instrumenter) CheckSettingsAndInstrumentExistingWorkloads

func (i *Instrumenter) CheckSettingsAndInstrumentExistingWorkloads(
	ctx context.Context,
	dash0MonitoringResource *dash0v1alpha1.Dash0Monitoring,
	logger *logr.Logger,
) error

CheckSettingsAndInstrumentExistingWorkloads is the main instrumentation function that is called in the controller's reconcile loop. It checks the settings of the Dash0 monitoring resource and instruments existing workloads accodingly.

func (*Instrumenter) InstrumentAtStartup

func (i *Instrumenter) InstrumentAtStartup(
	ctx context.Context,
	k8sClient client.Client,
	logger *logr.Logger,
)

InstrumentAtStartup is run once, when the controller process starts. Its main purpose is to upgrade workloads that have already been instrumented, in namespaces where the Dash0 monitoring resource already exists. For those workloads, it is not guaranteed that a reconcile request will be triggered when the operator controller image is updated and restarted - reconcile requests are only triggered when the Dash0 monitoring resource is installed/changed/deleted. Since it runs the full instrumentation process, it might also as a byproduct instrument workloads that are not instrumented yet. It will only cover namespaces where a Dash0 monitoring resource exists, because it works by listing all Dash0 monitoring resources and then instrumenting workloads in the corresponding namespaces.

func (*Instrumenter) UninstrumentWorkloadsIfAvailable

func (i *Instrumenter) UninstrumentWorkloadsIfAvailable(
	ctx context.Context,
	dash0MonitoringResource *dash0v1alpha1.Dash0Monitoring,
	logger *logr.Logger,
) error

UninstrumentWorkloadsIfAvailable is the main uninstrumentation function that is called in the controller's reconcile loop. It checks whether the Dash0 monitoring resource is marked as available; if it is, it uninstruments existing workloads.

Jump to

Keyboard shortcuts

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