common

package module
v1.0.179 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2025 License: Apache-2.0 Imports: 11 Imported by: 70

Documentation

Index

Constants

View Source
const LibcTypeDistroParameterName = "LIBC_TYPE"
View Source
const OdigosResourceNamespace = "instrumentation.odigos.io"

This is the resource namespace of the lister in k8s device plugin manager. from the "github.com/kubevirt/device-plugin-manager" package source: GetResourceNamespace must return namespace (vendor ID) of implemented Lister. e.g. for resources in format "color.example.com/<color>" that would be "color.example.com".

Variables

View Source
var (
	OtelSdkNativeCommunity  = OtelSdk{SdkType: NativeOtelSdkType, SdkTier: CommunityOtelSdkTier}
	OtelSdkEbpfCommunity    = OtelSdk{SdkType: EbpfOtelSdkType, SdkTier: CommunityOtelSdkTier}
	OtelSdkNativeEnterprise = OtelSdk{SdkType: NativeOtelSdkType, SdkTier: EnterpriseOtelSdkTier}
	OtelSdkEbpfEnterprise   = OtelSdk{SdkType: EbpfOtelSdkType, SdkTier: EnterpriseOtelSdkTier}
)

Functions

func GetVersion added in v1.0.97

func GetVersion(versionString string) *version.Version

func InstrumentationDeviceNameToComponents

func InstrumentationDeviceNameToComponents(deviceName string) (ProgrammingLanguage, OtelSdk)

func InstrumentationPluginName

func InstrumentationPluginName(language ProgrammingLanguage, otelSdk OtelSdk, libc *LibCType) string

func InstrumentationPluginNameToComponents

func InstrumentationPluginNameToComponents(pluginName string) (ProgrammingLanguage, OtelSdk)

func IsResourceNameOdigosInstrumentation added in v1.0.108

func IsResourceNameOdigosInstrumentation(resourceName string) bool

func MajorMinorStringOnly added in v1.0.174

func MajorMinorStringOnly(v *version.Version) string

func MapOdigosToSemConv added in v1.0.99

func MapOdigosToSemConv(odigosPrograminglang ProgrammingLanguage) string

MapOdigosToSemConv maps odigos programming language to OpenTelemetry semantic conventions It is supported only for the languages that are supported by OpenTelemetry [not for mysql, nginx, etc.]

func SpanKindOdigosToOtel

func SpanKindOdigosToOtel(kind SpanKind) trace.SpanKind

func StartPprofServer added in v1.0.71

func StartPprofServer(ctx context.Context, logger logr.Logger) error

StartPprofServer starts the pprof server. This is blocking, so it should be run in a goroutine.

Types

type AgentHealthStatus added in v1.0.87

type AgentHealthStatus string
const (
	// AgentHealthStatusHealthy represents the healthy status of an agent
	// It started the OpenTelemetry SDK with no errors, processed any configuration and is ready to receive data.
	AgentHealthStatusHealthy AgentHealthStatus = "Healthy"

	// AgentHealthStatusStarting represents that the agent is starting and there is still no health status available.
	// Once the agent finishes starting, it should report an either healthy or unhealthy status depending on the result.
	AgentHealthStatusStarting AgentHealthStatus = "Starting"

	// AgentHealthStatusUnsupportedRuntimeVersion represents that the agent is running on an unsupported runtime version
	// For example: Otel sdk supports node.js >= 14 and workload is running with node.js 12
	AgentHealthStatusUnsupportedRuntimeVersion AgentHealthStatus = "UnsupportedRuntimeVersion"

	// AgentHealthStatusNoHeartbeat is when the server did not receive a 3 heartbeats from the agent, thus it is considered unhealthy
	AgentHealthStatusNoHeartbeat AgentHealthStatus = "NoHeartbeat"

	// AgentHealthStatusProcessTerminated is when the agent process is terminated.
	// The termination can be due to normal shutdown (e.g. event loop run out of work)
	// due to explicit termination (e.g. code calls exit(), or OS signal), or due to an error (e.g. unhandled exception)
	AgentHealthProcessTerminated AgentHealthStatus = "ProcessTerminated"

	// AgentHealthStatusAgentFailure is when the opamp agent encountered an error during runtime.
	AgentFailure AgentHealthStatus = "AgentFailure"
)

type CollectorGatewayConfiguration added in v1.0.93

type CollectorGatewayConfiguration struct {
	// MinReplicas is the number of replicas for the cluster gateway collector deployment.
	// Also set the minReplicas for the HPA to this value.
	MinReplicas int `json:"minReplicas,omitempty"`

	// MaxReplicas set the maxReplicas for the HPA to this value.
	MaxReplicas int `json:"maxReplicas,omitempty"`

	// RequestMemoryMiB is the memory request for the cluster gateway collector deployment.
	// it will be embedded in the deployment as a resource request of the form "memory: <value>Mi"
	// default value is 500Mi
	RequestMemoryMiB int `json:"requestMemoryMiB,omitempty"`

	// LimitMemoryMiB is the memory limit for the cluster gateway collector deployment.
	// it will be embedded in the deployment as a resource limit of the form "memory: <value>Mi"
	// default value is 1.25 the memory request.
	LimitMemoryMiB int `json:"limitMemoryMiB,omitempty"`

	// RequestCPUm is the CPU request for the cluster gateway collector deployment.
	// it will be embedded in the deployment as a resource request of the form "cpu: <value>m"
	// default value is 500m
	RequestCPUm int `json:"requestCPUm,omitempty"`

	// LimitCPUm is the CPU limit for the cluster gateway collector deployment.
	// it will be embedded in the deployment as a resource limit of the form "cpu: <value>m"
	// default value is 1000m
	LimitCPUm int `json:"limitCPUm,omitempty"`

	// this parameter sets the "limit_mib" parameter in the memory limiter configuration for the collector gateway.
	// it is the hard limit after which a force garbage collection will be performed.
	// if not set, it will be 50Mi below the memory request.
	MemoryLimiterLimitMiB int `json:"memoryLimiterLimitMiB,omitempty"`

	// this parameter sets the "spike_limit_mib" parameter in the memory limiter configuration for the collector gateway.
	// note that this is not the processor soft limit, but the diff in Mib between the hard limit and the soft limit.
	// if not set, this will be set to 20% of the hard limit (so the soft limit will be 80% of the hard limit).
	MemoryLimiterSpikeLimitMiB int `json:"memoryLimiterSpikeLimitMiB,omitempty"`

	// the GOMEMLIMIT environment variable value for the collector gateway deployment.
	// this is when go runtime will start garbage collection.
	// if not specified, it will be set to 80% of the hard limit of the memory limiter.
	GoMemLimitMib int `json:"goMemLimitMiB,omitempty"`
}

type CollectorNodeConfiguration added in v1.0.117

type CollectorNodeConfiguration struct {
	// The port to use for exposing the collector's own metrics as a prometheus endpoint.
	// This can be used to resolve conflicting ports when a collector is using the host network.
	CollectorOwnMetricsPort int32 `json:"collectorOwnMetricsPort,omitempty"`

	// RequestMemoryMiB is the memory request for the node collector daemonset.
	// it will be embedded in the daemonset as a resource request of the form "memory: <value>Mi"
	// default value is 250Mi
	RequestMemoryMiB int `json:"requestMemoryMiB,omitempty"`

	// LimitMemoryMiB is the memory limit for the node collector daemonset.
	// it will be embedded in the daemonset as a resource limit of the form "memory: <value>Mi"
	// default value is 2x the memory request.
	LimitMemoryMiB int `json:"limitMemoryMiB,omitempty"`

	// RequestCPUm is the CPU request for the node collector daemonset.
	// it will be embedded in the daemonset as a resource request of the form "cpu: <value>m"
	// default value is 250m
	RequestCPUm int `json:"requestCPUm,omitempty"`

	// LimitCPUm is the CPU limit for the node collector daemonset.
	// it will be embedded in the daemonset as a resource limit of the form "cpu: <value>m"
	// default value is 500m
	LimitCPUm int `json:"limitCPUm,omitempty"`

	// this parameter sets the "limit_mib" parameter in the memory limiter configuration for the node collector.
	// it is the hard limit after which a force garbage collection will be performed.
	// if not set, it will be 50Mi below the memory request.
	MemoryLimiterLimitMiB int `json:"memoryLimiterLimitMiB,omitempty"`

	// this parameter sets the "spike_limit_mib" parameter in the memory limiter configuration for the node collector.
	// note that this is not the processor soft limit, but the diff in Mib between the hard limit and the soft limit.
	// if not set, this will be set to 20% of the hard limit (so the soft limit will be 80% of the hard limit).
	MemoryLimiterSpikeLimitMiB int `json:"memoryLimiterSpikeLimitMiB,omitempty"`

	// the GOMEMLIMIT environment variable value for the node collector daemonset.
	// this is when go runtime will start garbage collection.
	// if not specified, it will be set to 80% of the hard limit of the memory limiter.
	GoMemLimitMib int `json:"goMemLimitMiB,omitempty"`
}

type DestinationType

type DestinationType string
const (
	AlibabaCloudDestinationType           DestinationType = "alibabacloud"
	AppDynamicsDestinationType            DestinationType = "appdynamics"
	AWSCloudWatchDestinationType          DestinationType = "cloudwatch"
	AWSS3DestinationType                  DestinationType = "s3"
	AWSXRayDestinationType                DestinationType = "xray"
	AxiomDestinationType                  DestinationType = "axiom"
	AzureBlobDestinationType              DestinationType = "azureblob"
	BetterStackDestinationType            DestinationType = "betterstack"
	BonreeDestinationType                 DestinationType = "bonree"
	CauselyDestinationType                DestinationType = "causely"
	ChecklyDestinationType                DestinationType = "checkly"
	ChronosphereDestinationType           DestinationType = "chronosphere"
	ClickhouseDestinationType             DestinationType = "clickhouse"
	CoralogixDestinationType              DestinationType = "coralogix"
	Dash0DestinationType                  DestinationType = "dash0"
	DatadogDestinationType                DestinationType = "datadog"
	DebugDestinationType                  DestinationType = "debug"
	DynatraceDestinationType              DestinationType = "dynatrace"
	ElasticAPMDestinationType             DestinationType = "elasticapm"
	ElasticsearchDestinationType          DestinationType = "elasticsearch"
	GCSDestinationType                    DestinationType = "gcs"
	GenericOTLPDestinationType            DestinationType = "otlp"
	GoogleCloudDestinationType            DestinationType = "googlecloud"
	GrafanaCloudLokiDestinationType       DestinationType = "grafanacloudloki"
	GrafanaCloudPrometheusDestinationType DestinationType = "grafanacloudprometheus"
	GrafanaCloudTempoDestinationType      DestinationType = "grafanacloudtempo"
	GreptimeDestinationType               DestinationType = "greptime"
	GroundcoverDestinationType            DestinationType = "groundcover"
	HoneycombDestinationType              DestinationType = "honeycomb"
	HyperDxDestinationType                DestinationType = "hyperdx"
	InstanaDestinationType                DestinationType = "instana"
	JaegerDestinationType                 DestinationType = "jaeger"
	KafkaDestinationType                  DestinationType = "kafka"
	KloudMateDestinationType              DestinationType = "kloudmate"
	Last9DestinationType                  DestinationType = "last9"
	LightstepDestinationType              DestinationType = "lightstep"
	LogzioDestinationType                 DestinationType = "logzio"
	LokiDestinationType                   DestinationType = "loki"
	LumigoDestinationType                 DestinationType = "lumigo"
	MiddlewareDestinationType             DestinationType = "middleware"
	MockDestinationType                   DestinationType = "mock"
	NewRelicDestinationType               DestinationType = "newrelic"
	NopDestinationType                    DestinationType = "nop"
	ObserveDestinationType                DestinationType = "observe"
	OneUptimeDestinationType              DestinationType = "oneuptime"
	OpenObserveDestinationType            DestinationType = "openobserve"
	OpsVerseDestinationType               DestinationType = "opsverse"
	OracleDestinationType                 DestinationType = "oracle"
	OtlpHttpDestinationType               DestinationType = "otlphttp"
	PrometheusDestinationType             DestinationType = "prometheus"
	QrynDestinationType                   DestinationType = "qryn"
	QrynOSSDestinationType                DestinationType = "qryn-oss"
	QuickwitDestinationType               DestinationType = "quickwit"
	SentryDestinationType                 DestinationType = "sentry"
	SeqDestinationType                    DestinationType = "seq"
	SignozDestinationType                 DestinationType = "signoz"
	SplunkDestinationType                 DestinationType = "splunk"
	SumoLogicDestinationType              DestinationType = "sumologic"
	TelemetryHubDestinationType           DestinationType = "telemetryhub"
	TempoDestinationType                  DestinationType = "tempo"
	TingyunDestinationType                DestinationType = "tingyun"
	TraceloopDestinationType              DestinationType = "traceloop"
	UptraceDestinationType                DestinationType = "uptrace"
	VictoriaMetricsCloudDestinationType   DestinationType = "victoriametricscloud"
)

type LanguageConfig added in v1.0.179

type LanguageConfig struct {
	Enabled bool              `json:"enabled"`
	EnvVars map[string]string `json:"env,omitempty"`
}

Struct to represent configuration for each language

type LibCType added in v1.0.139

type LibCType string

+kubebuilder:validation:Enum=glibc;musl

const (
	Glibc LibCType = "glibc"
	Musl  LibCType = "musl"
)

type MountMethod added in v1.0.154

type MountMethod string

+kubebuilder:validation:Enum=k8s-virtual-device;k8s-host-path

const (
	K8sVirtualDeviceMountMethod MountMethod = "k8s-virtual-device"
	K8sHostPathMountMethod      MountMethod = "k8s-host-path"
)

type ObservabilitySignal

type ObservabilitySignal string

+kubebuilder:validation:Enum=LOGS;TRACES;METRICS

const (
	LogsObservabilitySignal    ObservabilitySignal = "LOGS"
	TracesObservabilitySignal  ObservabilitySignal = "TRACES"
	MetricsObservabilitySignal ObservabilitySignal = "METRICS"
)

type OdigosConfiguration added in v1.0.93

type OdigosConfiguration struct {
	ConfigVersion                    int                            `json:"configVersion"`
	TelemetryEnabled                 bool                           `json:"telemetryEnabled,omitempty"`
	OpenshiftEnabled                 bool                           `json:"openshiftEnabled,omitempty"`
	IgnoredNamespaces                []string                       `json:"ignoredNamespaces,omitempty"`
	IgnoredContainers                []string                       `json:"ignoredContainers,omitempty"`
	Psp                              bool                           `json:"psp,omitempty"`
	ImagePrefix                      string                         `json:"imagePrefix,omitempty"`
	SkipWebhookIssuerCreation        bool                           `json:"skipWebhookIssuerCreation,omitempty"`
	CollectorGateway                 *CollectorGatewayConfiguration `json:"collectorGateway,omitempty"`
	CollectorNode                    *CollectorNodeConfiguration    `json:"collectorNode,omitempty"`
	Profiles                         []ProfileName                  `json:"profiles,omitempty"`
	AllowConcurrentAgents            *bool                          `json:"allowConcurrentAgents,omitempty"`
	UiMode                           UiMode                         `json:"uiMode,omitempty"`
	UiPaginationLimit                int                            `json:"uiPaginationLimit,omitempty"`
	CentralBackendURL                string                         `json:"centralBackendURL,omitempty"`
	MountMethod                      *MountMethod                   `json:"mountMethod,omitempty"`
	ClusterName                      string                         `json:"clusterName,omitempty"`
	CustomContainerRuntimeSocketPath string                         `json:"customContainerRuntimeSocketPath,omitempty"`

	// Used for migration - we are migrating away from using the JAVA_OPTS env var
	// to only using the JAVA_TOOL_OPTIONS env var.
	// When this is true, we will not inject the JAVA_OPTS env var into the container.
	// when false or not set the original behavior will be used and the JAVA_OPTS env var will be injected.
	AvoidInjectingJavaOptsEnvVar *bool                    `json:"avoidInjectingJavaOptsEnvVar,omitempty"`
	UserInstrumentationEnvs      *UserInstrumentationEnvs `json:"UserInstrumentationEnvs,omitempty"`
}

OdigosConfiguration defines the desired state of OdigosConfiguration

type OdigosInstrumentationDevice

type OdigosInstrumentationDevice string

func InstrumentationDeviceName

func InstrumentationDeviceName(language ProgrammingLanguage, otelSdk OtelSdk, libc *LibCType) OdigosInstrumentationDevice

type OdigosTier

type OdigosTier string
const (

	// community is the opensource tier of odigos
	CommunityOdigosTier OdigosTier = "community"

	// cloud is the SaaS offering of odigos
	CloudOdigosTier OdigosTier = "cloud"

	// on premises comes with enterprise features and does not require
	// network connectivity to odigos cloud
	OnPremOdigosTier OdigosTier = "onprem"
)

type OtelSdk

type OtelSdk struct {
	SdkType OtelSdkType `json:"sdkType"`
	SdkTier OtelSdkTier `json:"sdkTier"`
}

type OtelSdkTier

type OtelSdkTier string
const (
	CommunityOtelSdkTier  OtelSdkTier = "community"
	EnterpriseOtelSdkTier OtelSdkTier = "enterprise"
)

type OtelSdkType

type OtelSdkType string

Odigos supports two types of OpenTelemetry SDKs: native and ebpf.

const (
	// The native SDK is implemented in the language of the application and
	// is integrated into the application code via runtime support (e.g. Java agent).
	NativeOtelSdkType OtelSdkType = "native"

	// EbpfOtelSdkType SDK can record telemetry data from the application with eBPF
	// code injected into the application process.
	EbpfOtelSdkType OtelSdkType = "ebpf"
)

type ProfileName added in v1.0.105

type ProfileName string

type ProgramLanguageDetails added in v1.0.93

type ProgramLanguageDetails struct {
	Language       ProgrammingLanguage
	RuntimeVersion *version.Version
}

type ProgrammingLanguage

type ProgrammingLanguage string

+kubebuilder:validation:Enum=java;python;go;dotnet;javascript;php;mysql;nginx;unknown;ignored

const (
	JavaProgrammingLanguage       ProgrammingLanguage = "java"
	PythonProgrammingLanguage     ProgrammingLanguage = "python"
	GoProgrammingLanguage         ProgrammingLanguage = "go"
	DotNetProgrammingLanguage     ProgrammingLanguage = "dotnet"
	JavascriptProgrammingLanguage ProgrammingLanguage = "javascript"
	PhpProgrammingLanguage        ProgrammingLanguage = "php"
	// This is an experimental feature, It is not a language
	// but in order to avoid huge refactoring we are adding it here for now
	MySQLProgrammingLanguage ProgrammingLanguage = "mysql"
	NginxProgrammingLanguage ProgrammingLanguage = "nginx"
	// Used when the language detection is not successful for all the available inspectors
	UnknownProgrammingLanguage ProgrammingLanguage = "unknown"
	// Deprecated: This is no longer supported and will not be set be odiglet
	IgnoredProgrammingLanguage ProgrammingLanguage = "ignored"
)

type SpanKind

type SpanKind string

SpanKind is already defined in opentelemetry-go as int. this value can go into the CRD in which case it will be string for user convenience. +kubebuilder:validation:Enum=client;server;producer;consumer;internal

const (
	ClientSpanKind   SpanKind = "client"
	ServerSpanKind   SpanKind = "server"
	ProducerSpanKind SpanKind = "producer"
	ConsumerSpanKind SpanKind = "consumer"
	InternalSpanKind SpanKind = "internal"
)

func ConvertSpanKindToString

func ConvertSpanKindToString(spanKind trace.SpanKind) SpanKind

type UiMode added in v1.0.144

type UiMode string

+kubebuilder:validation:Enum=normal;readonly

const (
	NormalUiMode   UiMode = "normal"
	ReadonlyUiMode UiMode = "readonly"
)

type UserInstrumentationEnvs added in v1.0.179

type UserInstrumentationEnvs struct {
	Languages map[ProgrammingLanguage]LanguageConfig `json:"languages,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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