Documentation
¶
Index ¶
- Constants
- Variables
- type EntityInfo
- type RelationshipMap
- type ResourceEntity
- type ResourceEntityCache
- func (ec *ResourceEntityCache) GetAllEntities() []byte
- func (ec *ResourceEntityCache) ProvisionRecordAttributes(resourceEntityMap map[string]*ResourceEntity, recordAttributes pcommon.Map)
- func (ec *ResourceEntityCache) ProvisionResourceAttributes(attributes pcommon.Map) map[string]*ResourceEntity
- func (ec *ResourceEntityCache) PutEntity(attributeName, entityName, entityType string, attributes map[string]string) *ResourceEntity
- func (ec *ResourceEntityCache) PutEntityObject(entity *ResourceEntity)
Constants ¶
View Source
const ( IsAPodForService = "is a pod for service" BelongsToNamespace = "belongs to namespace" IsPartOfCluster = "is part of cluster" IsDeployedOnPod = "is deployed on pod" IsRunningOnNode = "is running on node" IsManagedByDeployment = "is managed by deployment" IsManagedByStatefulSet = "is managed by statefulset" IsManagedByReplicaSet = "is managed by replicaset" IsManagedByCronJob = "is managed by cronjob" IsManagedByJob = "is managed by job" HasNode = "has a node" HasNamespace = "has a namespace" HasCollection = "has a collection" BelongsToCluster = "belongs to cluster" ContainsNamespace = "contains namespace" ContainsService = "contains service" HostedOnNode = "hosted on node" RunsOnOperatingSystem = "runs on operating system" ContainsPod = "contains pod" IsStatefulSetFor = "is statefulset for" IsAJobFor = "is a job for" IsACronJobFor = "is a cronjob for" IsAPodFor = "is a pod for" RunsInPod = "runs in pod" IsPartOfNamespace = "is part of namespace" IsDeployedOnNode = "is deployed on node" IsDeployedOnContainer = "is deployed on container" ManagesReplicaset = "manages replicaset" UsesImage = "uses image" IsUsedByContainer = "is used by container" IsAssociatedWithTask = "is associated with task" IsAssociatedWithCluster = "is associated with cluster" IsAssociatedWithNode = "is associated with node" IsInstanceOfFunction = "is instance of function" HasInstance = "has instance" ContainsTask = "contains task" ManagesAccount = "manages account" ContainsRegion = "contains region" ContainsAvailabilityZone = "contains availability zone" BelongsToProvider = "belongs to provider" HasResourcesInRegion = "has resources in region" BelongsToRegion = "belongs to region" BelongsToZone = "belongs to zone" BelongsToAccount = "belongs to account" HostsService = "hosts service" HostsPod = "hosts pod" HostsCluster = "hosts cluster" IsAssociatedWith = "is associated with" NetPeerName = "net.peer.name" DBQuerySummary = "db.query.summary" DBStatement = "db.statement" UsesDatabase = "uses database" IsDatabaseHostedOn = "is a database hosted on" IsCollectionHostedOn = "is a collection hosted on" ConsumesFrom = "consumes from" ProducesTo = "produces to" IsSpawnedByService = "is spawned by service" )
View Source
const ( Service = "service" KubernetesPod = "k8s.pod" KubernetesContainer = "k8s.container" KubernetesCluster = "k8s.cluster" Node = "k8s.node" KubernetesNamespace = "k8s.namespace" KubernetesReplicaSet = "k8s.replicaset" KubernetesDeployment = "k8s.deployment" KubernetesStatefulSet = "k8s.statefulset" KubernetesJob = "k8s.job" KubernetesCronJob = "k8s.cronjob" Container = "container" ContainerImage = "container.image" Os = "os" Process = "process" AwsEcsContainer = "aws.ecs.container" AwsEcsTask = "aws.ecs.task" AwsEcsCluster = "aws.ecs.cluster" AwsEksCluster = "aws.eks.cluster" FaasInstance = "faas.instance" FaasFunction = "faas.function" CloudProvider = "cloud.provider" CloudAccount = "cloud.account" CloudRegion = "cloud.region" CloudAvailabilityZone = "cloud.availability_zone" CloudResourceId = "cloud.resource_id" Host = "host" )
Variables ¶
View Source
var EntityRelationships = RelationshipMap{ string(semconv.K8SClusterNameKey): { Type: KubernetesCluster, Relationships: map[string]string{ string(semconv.K8SNodeNameKey): HasNode, }, AttributeNames: []string{ string(semconv.K8SClusterUIDKey), }, }, string(semconv.K8SNodeNameKey): { Type: Node, Relationships: map[string]string{ string(semconv.K8SNamespaceNameKey): ContainsNamespace, string(semconv.K8SClusterNameKey): BelongsToCluster, string(semconv.OSNameKey): RunsOnOperatingSystem, }, AttributeNames: []string{ string(semconv.K8SNodeUIDKey), }, }, string(semconv.K8SNamespaceNameKey): { Type: KubernetesNamespace, Relationships: map[string]string{ string(semconv.ServiceNameKey): ContainsService, string(semconv.K8SNodeNameKey): HostedOnNode, }, AttributeNames: []string{}, AttributePrefixes: []string{}, }, string(semconv.ServiceNameKey): { Type: Service, Relationships: map[string]string{ string(semconv.K8SDaemonSetNameKey): IsManagedByDeployment, string(semconv.K8SDeploymentNameKey): IsManagedByDeployment, string(semconv.K8SStatefulSetNameKey): IsManagedByStatefulSet, string(semconv.K8SCronJobNameKey): IsManagedByCronJob, string(semconv.K8SJobNameKey): IsManagedByJob, string(semconv.K8SNamespaceNameKey): BelongsToNamespace, string(semconv.DBSystemKey): UsesDatabase, string(semconv.MessagingConsumerGroupNameKey): ConsumesFrom, string(semconv.MessagingDestinationNameKey): ProducesTo, }, AttributeNames: []string{ string(semconv.ServiceInstanceIDKey), string(semconv.ServiceVersionKey), string(semconv.ServiceNamespaceKey), string(semconv.TelemetrySDKNameKey), string(semconv.TelemetrySDKLanguageKey), string(semconv.TelemetrySDKVersionKey), }, AttributePrefixes: []string{}, }, string(semconv.K8SDeploymentNameKey): { Type: KubernetesDeployment, Relationships: map[string]string{ string(semconv.K8SReplicaSetNameKey): ManagesReplicaset, string(semconv.ServiceNameKey): IsManagedByDeployment, }, AttributeNames: []string{string(semconv.K8SDeploymentUIDKey)}, AttributePrefixes: []string{}, }, string(semconv.K8SReplicaSetNameKey): { Type: KubernetesReplicaSet, Relationships: map[string]string{ string(semconv.K8SPodNameKey): ContainsPod, string(semconv.K8SDeploymentNameKey): IsManagedByDeployment, }, AttributeNames: []string{string(semconv.K8SReplicaSetUIDKey)}, AttributePrefixes: []string{}, }, string(semconv.K8SStatefulSetNameKey): { Type: KubernetesStatefulSet, Relationships: map[string]string{ string(semconv.K8SPodNameKey): ContainsPod, string(semconv.ServiceNameKey): IsStatefulSetFor, }, AttributeNames: []string{string(semconv.K8SStatefulSetUIDKey)}, AttributePrefixes: []string{}, }, string(semconv.K8SJobNameKey): { Type: KubernetesJob, Relationships: map[string]string{ string(semconv.K8SPodNameKey): ContainsPod, string(semconv.ServiceNameKey): IsAJobFor, }, AttributeNames: []string{string(semconv.K8SJobUIDKey)}, AttributePrefixes: []string{}, }, string(semconv.K8SCronJobNameKey): { Type: KubernetesCronJob, Relationships: map[string]string{ string(semconv.K8SPodNameKey): ContainsPod, string(semconv.ServiceNameKey): IsACronJobFor, }, AttributeNames: []string{string(semconv.K8SCronJobUIDKey)}, AttributePrefixes: []string{}, }, string(semconv.K8SPodNameKey): { Type: KubernetesPod, Relationships: map[string]string{ string(semconv.K8SContainerNameKey): RunsInPod, string(semconv.K8SCronJobNameKey): IsAPodFor, string(semconv.K8SJobNameKey): IsAPodFor, string(semconv.K8SStatefulSetNameKey): IsAPodFor, string(semconv.K8SReplicaSetNameKey): IsAPodFor, }, AttributeNames: []string{ "k8s.pod.ip", string(semconv.K8SPodUIDKey), }, AttributePrefixes: []string{"k8s.pod.label.", "k8s.pod.annotation."}, }, string(semconv.K8SContainerNameKey): { Type: KubernetesContainer, Relationships: map[string]string{ string(semconv.K8SPodNameKey): RunsInPod, string(semconv.K8SNamespaceNameKey): IsPartOfNamespace, string(semconv.K8SNodeNameKey): IsDeployedOnNode, }, AttributeNames: []string{ string(semconv.K8SContainerRestartCountKey), string(semconv.K8SContainerStatusLastTerminatedReasonKey), }, AttributePrefixes: []string{}, }, string(semconv.ContainerNameKey): { Type: Container, Relationships: map[string]string{ string(semconv.ServiceNameKey): IsDeployedOnContainer, string(semconv.ContainerImageNameKey): UsesImage, }, AttributeNames: []string{ string(semconv.ContainerIDKey), string(semconv.ContainerCommandKey), string(semconv.ContainerCommandArgsKey), string(semconv.ContainerRuntimeKey), string(semconv.ContainerCommandLineKey), }, AttributePrefixes: []string{"container.label"}, }, string(semconv.ContainerImageNameKey): { Type: ContainerImage, Relationships: map[string]string{ string(semconv.ContainerNameKey): IsUsedByContainer, }, AttributeNames: []string{ string(semconv.ContainerImageIDKey), string(semconv.ContainerImageTagsKey), string(semconv.ContainerImageRepoDigestsKey), }, AttributePrefixes: []string{}, }, string(semconv.OSNameKey): { Type: Os, Relationships: map[string]string{}, AttributeNames: []string{ string(semconv.OSVersionKey), string(semconv.OSDescriptionKey), string(semconv.OSBuildIDKey), }, AttributePrefixes: []string{}, }, string(semconv.ProcessCommandKey): { Type: Process, Relationships: map[string]string{ string(semconv.ServiceNameKey): IsSpawnedByService, }, AttributeNames: []string{ string(semconv.ProcessExecutableNameKey), string(semconv.ProcessExecutablePathKey), string(semconv.ProcessCommandKey), string(semconv.ProcessCommandArgsKey), string(semconv.ProcessCommandLineKey), string(semconv.ProcessOwnerKey), string(semconv.ProcessCreationTimeKey), string(semconv.ProcessContextSwitchTypeKey), string(semconv.ProcessGroupLeaderPIDKey), string(semconv.ProcessParentPIDKey), string(semconv.ProcessPIDKey), }, AttributePrefixes: []string{}, }, string(semconv.AWSECSContainerARNKey): { Type: AwsEcsContainer, Relationships: map[string]string{ string(semconv.AWSECSClusterARNKey): IsPartOfCluster, string(semconv.AWSECSTaskARNKey): IsAssociatedWithTask, }, AttributeNames: []string{}, AttributePrefixes: []string{}, }, string(semconv.AWSECSTaskARNKey): { Type: AwsEcsTask, Relationships: map[string]string{ string(semconv.AWSECSClusterARNKey): IsPartOfCluster, }, AttributeNames: []string{ string(semconv.AWSECSTaskFamilyKey), string(semconv.AWSECSTaskRevisionKey), string(semconv.AWSECSTaskIDKey), }, AttributePrefixes: []string{}, }, string(semconv.AWSECSClusterARNKey): { Type: AwsEcsCluster, Relationships: map[string]string{ string(semconv.AWSECSTaskIDKey): ContainsTask, }, AttributeNames: []string{ string(semconv.AWSECSLaunchtypeKey), }, AttributePrefixes: []string{}, }, string(semconv.AWSEKSClusterARNKey): { Type: AwsEksCluster, Relationships: map[string]string{ string(semconv.K8SClusterNameKey): IsAssociatedWithCluster, string(semconv.K8SNodeNameKey): IsAssociatedWithNode, }, AttributeNames: []string{}, AttributePrefixes: []string{}, }, string(semconv.FaaSInstanceKey): { Type: FaasInstance, Relationships: map[string]string{ string(semconv.FaaSNameKey): IsInstanceOfFunction, }, AttributeNames: []string{}, AttributePrefixes: []string{}, }, string(semconv.FaaSNameKey): { Type: FaasFunction, Relationships: map[string]string{ string(semconv.FaaSInstanceKey): HasInstance, }, AttributeNames: []string{ string(semconv.FaaSColdstartKey), string(semconv.FaaSCronKey), string(semconv.FaaSDocumentCollectionKey), string(semconv.FaaSDocumentOperationKey), string(semconv.FaaSDocumentNameKey), string(semconv.FaaSDocumentTimeKey), string(semconv.FaaSInvokedRegionKey), string(semconv.FaaSMaxMemoryKey), string(semconv.FaaSInvokedNameKey), }, AttributePrefixes: []string{}, }, string(semconv.CloudProviderKey): { Type: CloudProvider, Relationships: map[string]string{ string(semconv.CloudAccountIDKey): ManagesAccount, string(semconv.CloudRegionKey): ContainsRegion, string(semconv.CloudAvailabilityZoneKey): ContainsAvailabilityZone, }, AttributeNames: []string{}, AttributePrefixes: []string{}, }, string(semconv.CloudAccountIDKey): { Type: CloudAccount, Relationships: map[string]string{ string(semconv.CloudProviderKey): BelongsToProvider, string(semconv.CloudRegionKey): HasResourcesInRegion, string(semconv.CloudAvailabilityZoneKey): ContainsAvailabilityZone, }, AttributeNames: []string{}, AttributePrefixes: []string{}, }, string(semconv.CloudRegionKey): { Type: CloudRegion, Relationships: map[string]string{ string(semconv.CloudProviderKey): BelongsToProvider, string(semconv.CloudAvailabilityZoneKey): ContainsAvailabilityZone, string(semconv.CloudAccountIDKey): BelongsToAccount, }, AttributeNames: []string{}, AttributePrefixes: []string{}, }, string(semconv.CloudAvailabilityZoneKey): { Type: CloudAvailabilityZone, Relationships: map[string]string{ string(semconv.CloudRegionKey): BelongsToRegion, string(semconv.CloudAccountIDKey): BelongsToAccount, string(semconv.CloudProviderKey): BelongsToProvider, }, AttributeNames: []string{}, AttributePrefixes: []string{}, }, string(semconv.CloudResourceIDKey): { Type: CloudResourceId, Relationships: map[string]string{ string(semconv.CloudRegionKey): BelongsToRegion, string(semconv.CloudAvailabilityZoneKey): BelongsToZone, string(semconv.CloudAccountIDKey): BelongsToAccount, string(semconv.CloudProviderKey): BelongsToProvider, }, AttributeNames: []string{}, AttributePrefixes: []string{}, }, string(semconv.HostNameKey): { Type: Host, Relationships: map[string]string{ string(semconv.ServiceNameKey): HostsService, string(semconv.K8SClusterNameKey): HostsCluster, string(semconv.K8SPodNameKey): HostsPod, string(semconv.K8SStatefulSetNameKey): HostsPod, }, AttributeNames: []string{ string(semconv.HostIDKey), string(semconv.HostTypeKey), string(semconv.HostImageIDKey), string(semconv.HostImageNameKey), string(semconv.HostImageVersionKey), string(semconv.HostCPUFamilyKey), string(semconv.HostCPUSteppingKey), string(semconv.HostCPUCacheL2SizeKey), string(semconv.HostCPUVendorIDKey), string(semconv.HostArchKey), string(semconv.HostIPKey), }, AttributePrefixes: []string{}, }, }
View Source
var RestrictedNamespaces = map[string]bool{ "datadog-agent": true, }
View Source
var RestrictedServices = map[string]bool{ "kubernetes-nodes": true, "kubernetes-nodes-cadvisor": true, }
Functions ¶
This section is empty.
Types ¶
type EntityInfo ¶
type RelationshipMap ¶
type RelationshipMap map[string]*EntityInfo
type ResourceEntity ¶
type ResourceEntity struct { AttributeName string `json:"-"` Name string `json:"name"` Type string `json:"type"` Attributes map[string]string `json:"attributes"` Edges map[string]string `json:"edges"` // contains filtered or unexported fields }
func (*ResourceEntity) AddEdge ¶
func (re *ResourceEntity) AddEdge(targetName, targetType, relationship string)
func (*ResourceEntity) PutAttribute ¶ added in v0.9.0
func (re *ResourceEntity) PutAttribute(k, v string)
type ResourceEntityCache ¶
type ResourceEntityCache struct {
// contains filtered or unexported fields
}
func NewResourceEntityCache ¶
func NewResourceEntityCache() *ResourceEntityCache
func (*ResourceEntityCache) GetAllEntities ¶
func (ec *ResourceEntityCache) GetAllEntities() []byte
func (*ResourceEntityCache) ProvisionRecordAttributes ¶ added in v0.8.6
func (ec *ResourceEntityCache) ProvisionRecordAttributes(resourceEntityMap map[string]*ResourceEntity, recordAttributes pcommon.Map)
func (*ResourceEntityCache) ProvisionResourceAttributes ¶ added in v0.8.6
func (ec *ResourceEntityCache) ProvisionResourceAttributes(attributes pcommon.Map) map[string]*ResourceEntity
func (*ResourceEntityCache) PutEntity ¶
func (ec *ResourceEntityCache) PutEntity(attributeName, entityName, entityType string, attributes map[string]string) *ResourceEntity
func (*ResourceEntityCache) PutEntityObject ¶ added in v0.8.5
func (ec *ResourceEntityCache) PutEntityObject(entity *ResourceEntity)
Click to show internal directories.
Click to hide internal directories.