origindetection

package module
v0.78.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: Apache-2.0 Imports: 3 Imported by: 8

Documentation

Overview

Package origindetection contains the types and functions used for Origin Detection.

Index

Constants

View Source
const (
	// ProductOriginDogStatsDLegacy is the ProductOrigin for DogStatsD in Legacy mode.
	// TODO: remove this when dogstatsd_origin_detection_unified is enabled by default
	ProductOriginDogStatsDLegacy ProductOrigin = iota
	// ProductOriginDogStatsD is the ProductOrigin for DogStatsD.
	ProductOriginDogStatsD ProductOrigin = iota
	// ProductOriginAPM is the ProductOrigin for APM.
	ProductOriginAPM ProductOrigin = iota
	// ProductOriginOTel is the ProductOrigin for OTel.
	ProductOriginOTel ProductOrigin = iota

	// LocalDataContainerIDPrefix is the prefix used for the Container ID sent in the Local Data list.
	LocalDataContainerIDPrefix = "ci-"
	// LocalDataLegacyContainerIDPrefix is the Legacy prefix used by APM for the Container ID sent in the Local Data list.
	LocalDataLegacyContainerIDPrefix = "cid-"
	// LocalDataInodePrefix is the prefix used for the Inode sent in the Local Data list.
	LocalDataInodePrefix = "in-"

	// ExternalDataInitPrefix is the prefix for the Init flag in the External Data.
	ExternalDataInitPrefix = "it-"
	// ExternalDataContainerNamePrefix is the prefix for the Container Name in the External Data.
	ExternalDataContainerNamePrefix = "cn-"
	// ExternalDataPodUIDPrefix is the prefix for the Pod UID in the External Data.
	ExternalDataPodUIDPrefix = "pu-"
)

Variables

This section is empty.

Functions

func ExternalDataString added in v0.63.0

func ExternalDataString(externalData ExternalData) string

ExternalDataString returns a string representation of the ExternalData.

func LocalDataString added in v0.63.0

func LocalDataString(localData LocalData) string

LocalDataString returns a string representation of the LocalData.

func OriginInfoString added in v0.63.0

func OriginInfoString(originInfo OriginInfo) string

OriginInfoString returns a string representation of the OriginInfo.

Types

type ExternalData

type ExternalData struct {
	Init          bool   // Init is true if the container is an init container.
	ContainerName string // ContainerName is the name of the container as seen by the Admission Controller.
	PodUID        string // PodUID is the UID of the pod as seen by the Admission Controller.
}

ExternalData generated by the Admission Controller and sent to the Agent.

func ParseExternalData

func ParseExternalData(externalEnv string) (ExternalData, error)

ParseExternalData parses the external data string into an ExternalData struct.

type GenerateContainerIDFromExternalData

type GenerateContainerIDFromExternalData func(externalData ExternalData) (string, error)

GenerateContainerIDFromExternalData generates a container ID from the external data.

type LocalData

type LocalData struct {
	ProcessID   uint32 // ProcessID of the container process on the host.
	ContainerID string // ContainerID sent from the client.
	Inode       uint64 // Inode is the Cgroup inode of the container.
	PodUID      string // PodUID of the pod sent from the client.
}

LocalData that is generated by the client and sent to the Agent.

func ParseLocalData added in v0.63.0

func ParseLocalData(rawLocalData string) (LocalData, error)

ParseLocalData parses the local data string into a LocalData struct.

type OriginInfo

type OriginInfo struct {
	LocalData     LocalData     // LocalData is the local data list.
	ExternalData  ExternalData  // ExternalData is the external data list.
	Cardinality   string        // Cardinality is the cardinality of the resolved origin.
	ProductOrigin ProductOrigin // ProductOrigin is the product that sent the origin information.
}

OriginInfo contains the Origin Detection information.

type ProductOrigin

type ProductOrigin int

ProductOrigin is the origin of the product that sent the entity.

Jump to

Keyboard shortcuts

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