Documentation ¶
Index ¶
- Variables
- func TopOwner(pod *informer.PodInfo) *informer.Owner
- type MetaSourceLabels
- type MetadataConfig
- type MetadataProvider
- func (mp *MetadataProvider) CurrentNodeName(ctx context.Context) (string, error)
- func (mp *MetadataProvider) ForceDisable()
- func (mp *MetadataProvider) Get(ctx context.Context) (*Store, error)
- func (mp *MetadataProvider) IsKubeEnabled() bool
- func (mp *MetadataProvider) KubeClient() (kubernetes.Interface, error)
- type OTelServiceNamePair
- type Store
- func (s *Store) AddProcess(pid uint32)
- func (s *Store) DeleteProcess(pid uint32)
- func (s *Store) ID() string
- func (s *Store) ObjectMetaByIP(ip string) *informer.ObjectMeta
- func (s *Store) On(event *informer.Event) error
- func (s *Store) PodByContainerID(cid string) *informer.ObjectMeta
- func (s *Store) PodContainerByPIDNs(pidns uint32) (*informer.ObjectMeta, string)
- func (s *Store) ServiceNameNamespaceForIP(ip string) (string, string)
- func (s *Store) ServiceNameNamespaceForMetadata(om *informer.ObjectMeta) (string, string)
- func (s *Store) Subscribe(observer meta.Observer)
Constants ¶
This section is empty.
Variables ¶
var InfoForPID = container.InfoForPID
InfoForPID is an injectable dependency for system-independent testing
Functions ¶
Types ¶
type MetaSourceLabels ¶ added in v1.9.0
type MetaSourceLabels struct { ServiceName string `yaml:"service_name" env:"BEYLA_KUBE_META_SOURCE_LABEL_SERVICE_NAME"` ServiceNamespace string `yaml:"service_namespace" env:"BEYLA_KUBE_META_SOURCE_LABEL_SERVICE_NAMESPACE"` }
MetaSourceLabels allow overriding some metadata from kubernetes labels
type MetadataConfig ¶ added in v1.9.0
type MetadataConfig struct { Enable kubeflags.EnableFlag DisabledInformers []string KubeConfigPath string SyncTimeout time.Duration ResyncPeriod time.Duration MetaCacheAddr string MetaSourceLabels MetaSourceLabels }
type MetadataProvider ¶ added in v1.7.0
type MetadataProvider struct {
// contains filtered or unexported fields
}
func NewMetadataProvider ¶ added in v1.7.0
func NewMetadataProvider(config MetadataConfig) *MetadataProvider
func (*MetadataProvider) CurrentNodeName ¶ added in v1.9.0
func (mp *MetadataProvider) CurrentNodeName(ctx context.Context) (string, error)
func (*MetadataProvider) ForceDisable ¶ added in v1.7.0
func (mp *MetadataProvider) ForceDisable()
func (*MetadataProvider) Get ¶ added in v1.7.0
func (mp *MetadataProvider) Get(ctx context.Context) (*Store, error)
func (*MetadataProvider) IsKubeEnabled ¶ added in v1.7.0
func (mp *MetadataProvider) IsKubeEnabled() bool
func (*MetadataProvider) KubeClient ¶ added in v1.7.0
func (mp *MetadataProvider) KubeClient() (kubernetes.Interface, error)
type OTelServiceNamePair ¶ added in v1.9.0
type Store ¶ added in v1.9.0
type Store struct { // Instead of subscribing to the informer directly, the rest of components // will subscribe to this store, to make sure that any "new object" notification // they receive is already present in the store meta.BaseNotifier // contains filtered or unexported fields }
Store aggregates Kubernetes information from multiple sources: - the informer that keep an indexed copy of the existing pods and replicasets. - the inspected container.Info objects, indexed either by container ID and PID namespace - a cache of decorated PodInfo that would avoid reconstructing them on each trace decoration
func NewStore ¶ added in v1.9.0
func NewStore(kubeMetadata meta.Notifier, sourceLabels MetaSourceLabels) *Store
func (*Store) AddProcess ¶ added in v1.9.0
func (*Store) DeleteProcess ¶ added in v1.9.0
func (*Store) ObjectMetaByIP ¶ added in v1.9.0
func (s *Store) ObjectMetaByIP(ip string) *informer.ObjectMeta
func (*Store) On ¶ added in v1.9.0
On is invoked by the informer when a new Kube object is created, updated or deleted. It will forward the notification to all the Store subscribers
func (*Store) PodByContainerID ¶ added in v1.9.0
func (s *Store) PodByContainerID(cid string) *informer.ObjectMeta
func (*Store) PodContainerByPIDNs ¶ added in v1.9.0
func (s *Store) PodContainerByPIDNs(pidns uint32) (*informer.ObjectMeta, string)
PodContainerByPIDNs second return value: container Name
func (*Store) ServiceNameNamespaceForIP ¶ added in v1.9.0
ServiceNameNamespaceForIP returns the service name and namespace for a given IP address This means that, for a given Pod, we will not return the Pod Name, but the Pod Owner Name
func (*Store) ServiceNameNamespaceForMetadata ¶ added in v1.9.0
func (s *Store) ServiceNameNamespaceForMetadata(om *informer.ObjectMeta) (string, string)