Documentation
¶
Index ¶
- Constants
- Variables
- func TopOwner(pod *informer.PodInfo) *informer.Owner
- type CachedObjMeta
- 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 ResourceLabels
- 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) *CachedObjMeta
- func (s *Store) On(event *informer.Event) error
- func (s *Store) PodByContainerID(cid string) *CachedObjMeta
- func (s *Store) PodContainerByPIDNs(pidns uint32) (*CachedObjMeta, 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 ¶
const ( ResourceAttributesPrefix = "resource.opentelemetry.io/" ServiceNameAnnotation = ResourceAttributesPrefix + serviceNameKey ServiceNamespaceAnnotation = ResourceAttributesPrefix + serviceNamespaceKey EnvResourceAttributes = "OTEL_RESOURCE_ATTRIBUTES" EnvServiceName = "OTEL_SERVICE_NAME" EnvServiceNamespace = "OTEL_SERVICE_NAMESPACE" )
Variables ¶
var DefaultResourceLabels = ResourceLabels{ "service.name": []string{"app.kubernetes.io/name"}, "service.namespace": []string{"app.kubernetes.io/part-of"}, }
var InfoForPID = container.InfoForPID
InfoForPID is an injectable dependency for system-independent testing
Functions ¶
Types ¶
type CachedObjMeta ¶
type MetaSourceLabels ¶
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 Deprecated. Left here for backwards-compatibility.
type MetadataConfig ¶
type MetadataProvider ¶
type MetadataProvider struct {
// contains filtered or unexported fields
}
func NewMetadataProvider ¶
func NewMetadataProvider(config MetadataConfig) *MetadataProvider
func (*MetadataProvider) CurrentNodeName ¶
func (mp *MetadataProvider) CurrentNodeName(ctx context.Context) (string, error)
func (*MetadataProvider) ForceDisable ¶
func (mp *MetadataProvider) ForceDisable()
func (*MetadataProvider) IsKubeEnabled ¶
func (mp *MetadataProvider) IsKubeEnabled() bool
func (*MetadataProvider) KubeClient ¶
func (mp *MetadataProvider) KubeClient() (kubernetes.Interface, error)
type OTelServiceNamePair ¶
type ResourceLabels ¶
type Store ¶
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 (*Store) AddProcess ¶
func (*Store) DeleteProcess ¶
func (*Store) ObjectMetaByIP ¶
func (s *Store) ObjectMetaByIP(ip string) *CachedObjMeta
func (*Store) On ¶
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 ¶
func (s *Store) PodByContainerID(cid string) *CachedObjMeta
func (*Store) PodContainerByPIDNs ¶
func (s *Store) PodContainerByPIDNs(pidns uint32) (*CachedObjMeta, string)
PodContainerByPIDNs second return value: container Name
func (*Store) ServiceNameNamespaceForIP ¶
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 ¶
func (s *Store) ServiceNameNamespaceForMetadata(om *informer.ObjectMeta) (string, string)