Documentation
¶
Index ¶
- Constants
- Variables
- type EdgeInfo
- type EntityId
- type EntityInfo
- type EntityRelationship
- type RelationshipMap
- type ResourceEntity
- type ResourceEntityCache
- func (ec *ResourceEntityCache) GetAllEntities() []byte
- func (ec *ResourceEntityCache) ProvisionPackagedObject(po *graphpb.PackagedObject)
- 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 string, entityId *EntityId, attributes map[string]string) (*ResourceEntity, bool)
Constants ¶
View Source
const ( BelongsToAccount = "belongs to account" BelongsToCluster = "belongs to cluster" BelongsToNamespace = "belongs to namespace" BelongsToProvider = "belongs to provider" BelongsToRegion = "belongs to region" BelongsToZone = "belongs to zone" CallsEndpoint = "calls endpoint" CallsGRPCEndpoint = "calls gRPC endpoint" ConsumesFrom = "consumes from" ExecutesQuery = "executes query" ContainsAvailabilityZone = "contains availability zone" ContainsContainer = "contains container" ContainsNamespace = "contains namespace" ContainsPod = "contains pod" ContainsRegion = "contains region" ContainsService = "contains service" ContainsTask = "contains task" HasCollection = "has a collection" HasInstance = "has instance" HasNamespace = "has a namespace" HasNode = "has a node" HasResourcesInRegion = "has resources in region" HostedOnNode = "hosted on node" HostsCluster = "hosts cluster" HostsPod = "hosts pod" HostsService = "hosts service" IsACronJobFor = "is a cronjob for" IsAJobFor = "is a job for" IsAPodFor = "is a pod for" IsAPodForService = "is a pod for service" IsAssociatedWith = "is associated with" IsAssociatedWithCluster = "is associated with cluster" IsAssociatedWithNode = "is associated with node" IsAssociatedWithTask = "is associated with task" IsCalledByService = "is called by service" IsCollectionHostedOn = "is a collection hosted on" IsConsumedFromByService = "is consumed from by service" IsDaemonSetFor = "is daemonset for" IsDatabaseHostedOn = "is a database hosted on" IsDeployedOnCluster = "is deployed on cluster" IsDeployedOnContainer = "is deployed on container" IsDeployedOnNode = "is deployed on node" IsDeployedOnPod = "is deployed on pod" IsHostedOnNode = "is hosted on node" IsInstanceOfFunction = "is instance of function" IsManagedByCronJob = "is managed by cronjob" IsManagedByDaemonSet = "is managed by daemonset" IsManagedByDeployment = "is managed by deployment" IsManagedByJob = "is managed by job" IsManagedByReplicaSet = "is managed by replicaset" IsManagedByStatefulSet = "is managed by statefulset" IsPartOfCluster = "is part of cluster" IsPartOfDatabase = "is part of database" IsPartOfNamespace = "is part of namespace" IsRunningOnNode = "is running on node" IsServedByService = "is served by service" IsSpawnedByService = "is spawned by service" IsStatefulSetFor = "is statefulset for" IsUsedByContainer = "is used by container" IsUsedByCronJob = "is used by cronjob" IsUsedByDaemonSet = "is used by daemonset" IsUsedByDeployment = "is used by deployment" IsUsedByJob = "is used by job" IsUsedByPod = "is used by pod" IsUsedByReplicaSet = "is used by replicaset" IsUsedByService = "is used by service" IsUsedByStatefulSet = "is used by statefulset" ManagesAccount = "manages account" ManagesReplicaset = "manages replicaset" ManagesPod = "manages pod" ManagesJob = "manages job" ProducesTo = "produces to" RunsInPod = "runs in pod" RunsOnOperatingSystem = "runs on operating system" RunsProcess = "runs process" ServesEndpoint = "serves endpoint" ServesGRPCEndpoint = "serves gRPC endpoint" SettlesMessagesTo = "settles messages to" UsesConfigMap = "uses configmap" UsesDatabase = "uses database" UsesDatabaseCollection = "uses database collection" UsesContainerImage = "uses container image" UsesMessagingDestination = "uses messaging destination" UsesSecret = "uses secret" DataHashPrefix = "data.hash." Replicas = "replicas" ReadyReplicas = "ready.replicas" CurrentReplicas = "current.replicas" DesiredReplicas = "desired.replicas" UpdatedReplicas = "updated.replicas" MinReplicas = "min.replicas" MaxReplicas = "max.replicas" AvailableReplicas = "available.replicas" Deployment = "Deployment" StatefulSet = "StatefulSet" DaemonSet = "DaemonSet" ReplicaSet = "ReplicaSet" Job = "Job" CronJob = "CronJob" IsHorizontallyScaledBy = "is horizontally scaled by" HorizontallyScales = "horizontally scales" UsesDataBaseHostedOn = "uses database hosted on" HostsDatabaseFor = "hosts database for" )
View Source
const ( DBQuerySummary = "db.query.summary" DBStatement = "db.statement" SpanKindString = "span.kind.string" NetPeerName = "net.peer.name" AwsEcsCluster = "aws.ecs.cluster" AwsEcsContainer = "aws.ecs.container" AwsEcsTask = "aws.ecs.task" AwsEksCluster = "aws.eks.cluster" CloudAccount = "cloud.account" CloudAvailabilityZone = "cloud.availability_zone" CloudProvider = "cloud.provider" IsDatabaseHost = "is.database.host" CloudService = "cloud.service" CloudRegion = "cloud.region" CloudResourceId = "cloud.resource_id" Container = "container" ContainerImage = "container.image" ContainerImageName = string(semconv.ContainerImageNameKey) ContainerImageID = string(semconv.ContainerImageIDKey) Database = "database" DatabaseCollection = "database.collection" DatabaseHost = "database.host" Endpoint = "endpoint" FaasFunction = "faas.function" FaasInstance = "faas.instance" GRPC = "grpc" Host = "host" HostIp = "host.ip" K8SPodIp = "k8s.pod.ip" KubernetesCluster = "k8s.cluster" KubernetesConfigMap = "k8s.configmap" KubernetesContainer = "k8s.container" KubernetesCronJob = "k8s.cronjob" KubernetesDaemonSet = "k8s.daemonset" KubernetesDeployment = "k8s.deployment" KubernetesHPA = "k8s.hpa" KubernetesJob = "k8s.job" KubernetesNamespace = "k8s.namespace" KubernetesPod = "k8s.pod" KubernetesReplicaSet = "k8s.replicaset" KubernetesSecret = "k8s.secret" KubernetesStatefulSet = "k8s.statefulset" MessagingConsumerGroup = "messaging.consumer.group" MessagingDestination = "messaging.destination" Node = "k8s.node" OperatingSystem = "os" PendingReason = "pending.reason" PodPhase = "pod.phase" Process = "process" Service = "service" ContainerImageNamePrefix = "container.image.name." ContainerImageIDPrefix = "container.image.id." ContainerPortPrefix = "container.port." CrashLoopBackOff = "CrashLoopBackOff" ImagePullBackOff = "ImagePullBackOff" OOMKilled = "OOMKilled" RestartCount = "restart_count" ScalingLimitedMessageAttribute = "scaling.limited.message" ScalingLimitedReasonAttribute = "scaling.limited.reason" ScalingLimitedStatusAttribute = "scaling.limited.status" ScalingTargetName = "scaling.target.name" ScalingTargetKind = "scaling.target.kind" ScalingTargetAPIVersion = "scaling.target.api_version" RDSSuffix = ".rds.amazonaws.com" )
Variables ¶
View Source
var EntityRelationships = RelationshipMap{ string(semconv.K8SClusterNameKey): { Type: KubernetesCluster, Relationships: map[string]string{ string(semconv.K8SNodeNameKey): HasNode, string(semconv.K8SNamespaceNameKey): ContainsNamespace, }, 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), }, OtherIDAttributes: []string{ string(semconv.K8SClusterNameKey), }, }, string(semconv.K8SNamespaceNameKey): { Type: KubernetesNamespace, Relationships: map[string]string{ string(semconv.ServiceNameKey): ContainsService, string(semconv.K8SNodeNameKey): HostedOnNode, }, AttributeNames: []string{ string(semconv.K8SNodeNameKey), string(semconv.K8SClusterNameKey), }, AttributePrefixes: []string{}, OtherIDAttributes: []string{ string(semconv.K8SNamespaceNameKey), string(semconv.K8SClusterNameKey), }, }, string(semconv.URLTemplateKey): { Type: Endpoint, DeriveRelationshipCallbacks: map[string]func(pcommon.Map) string{ string(semconv.ServiceNameKey): func(m pcommon.Map) string { spanKindCode, spanKindCodeFound := m.Get(SpanKindString) if spanKindCodeFound { spanKind := spanKindCode.AsString() if spanKind == ptrace.SpanKindServer.String() { return IsServedByService } else if spanKind == ptrace.SpanKindClient.String() { return IsCalledByService } } return "" }, }, ShouldCreateCallBack: func(m pcommon.Map) bool { httpStatusCode, httpStatusCodeFound := m.Get(string(semconv.HTTPResponseStatusCodeKey)) return httpStatusCodeFound && httpStatusCode.Int() != 404 }, }, string(semconv.RPCMethodKey): { Type: Endpoint, DeriveRelationshipCallbacks: map[string]func(pcommon.Map) string{ string(semconv.ServiceNameKey): func(m pcommon.Map) string { spanKindCode, spanKindCodeFound := m.Get(SpanKindString) if spanKindCodeFound { spanKind := spanKindCode.AsString() if spanKind == ptrace.SpanKindServer.String() { return IsServedByService } else if spanKind == ptrace.SpanKindClient.String() { return IsCalledByService } } return "" }, }, ShouldCreateCallBack: func(m pcommon.Map) bool { rpcSystem, rpcSystemFound := m.Get(string(semconv.RPCSystemKey)) return rpcSystemFound && rpcSystem.AsString() == GRPC }, AttributeNames: []string{ string(semconv.RPCSystemKey), string(semconv.RPCServiceKey), }, OtherIDAttributes: []string{ string(semconv.RPCSystemKey), string(semconv.RPCServiceKey), }, }, string(semconv.ServiceNameKey): { Type: Service, Relationships: map[string]string{ string(semconv.K8SDaemonSetNameKey): IsManagedByDaemonSet, string(semconv.K8SDeploymentNameKey): IsManagedByDeployment, string(semconv.K8SStatefulSetNameKey): IsManagedByStatefulSet, string(semconv.K8SCronJobNameKey): IsManagedByCronJob, string(semconv.K8SJobNameKey): IsManagedByJob, string(semconv.K8SNamespaceNameKey): BelongsToNamespace, string(semconv.DBNamespaceKey): UsesDatabase, string(semconv.MessagingConsumerGroupNameKey): ConsumesFrom, string(semconv.K8SNodeNameKey): IsHostedOnNode, string(semconv.K8SClusterNameKey): IsDeployedOnCluster, string(semconv.ProcessCommandKey): RunsProcess, }, AttributeNames: []string{ string(semconv.ServiceInstanceIDKey), string(semconv.ServiceVersionKey), string(semconv.ServiceNamespaceKey), string(semconv.TelemetrySDKNameKey), string(semconv.TelemetrySDKLanguageKey), string(semconv.TelemetrySDKVersionKey), string(semconv.ContainerImageNameKey), }, AttributePrefixes: []string{}, CreateEntityRelationshipsCallback: func(m pcommon.Map) []EntityRelationship { serverAddressVal, found := m.Get(string(semconv.ServerAddressKey)) if !found { return nil } serverAddressStr := serverAddressVal.AsString() if !strings.HasSuffix(serverAddressStr, RDSSuffix) { return nil } parts := strings.Split(serverAddressStr, ".") if len(parts) < 2 { return nil } clusterName := parts[0] if !strings.HasPrefix(parts[1], "cluster-") { clusterName = parts[0][:strings.LastIndex(parts[0], "-")] } relationships := []EntityRelationship{} relationships = append(relationships, EntityRelationship{ EntityName: clusterName, EntityType: Service, Relationship: UsesDataBaseHostedOn, ReverseRelationship: HostsDatabaseFor, EntityAttributes: map[string]string{ IsDatabaseHost: "true", CloudProvider: "aws", CloudService: "rds", }, }) return relationships }, DeriveRelationshipCallbacks: map[string]func(m pcommon.Map) string{ string(semconv.DBCollectionNameKey): func(m pcommon.Map) string { dbQuery, dbQueryFound := m.Get(string(semconv.DBQuerySummaryKey)) if dbQueryFound { return fmt.Sprintf("%s %s", ExecutesQuery, dbQuery.AsString()) } return UsesDatabaseCollection }, string(semconv.MessagingDestinationNameKey): func(m pcommon.Map) string { _, mcgVFound := m.Get(string(semconv.MessagingConsumerGroupNameKey)) if mcgVFound { return ConsumesFrom } monV, monVFound := m.Get(string(semconv.MessagingOperationTypeKey)) if monVFound { operation := monV.AsString() if _, ok := messagingPublishOperations[operation]; ok { return ProducesTo } if _, ok := messagingConsumeOperations[operation]; ok { return ConsumesFrom } if operation == "settle" { return SettlesMessagesTo } } return UsesMessagingDestination }, string(semconv.URLTemplateKey): func(m pcommon.Map) string { spanKindCode, spanKindCodeFound := m.Get(SpanKindString) if spanKindCodeFound { spanKind := spanKindCode.AsString() if spanKind == ptrace.SpanKindServer.String() { return ServesEndpoint } else if spanKind == ptrace.SpanKindClient.String() { return CallsEndpoint } } return "" }, string(semconv.RPCMethodKey): func(m pcommon.Map) string { spanKindCode, spanKindCodeFound := m.Get(SpanKindString) rpcSystem, rpcSystemFound := m.Get(string(semconv.RPCSystemKey)) if spanKindCodeFound && rpcSystemFound && rpcSystem.AsString() == GRPC { spanKind := spanKindCode.AsString() if spanKind == ptrace.SpanKindServer.String() { return ServesGRPCEndpoint } else if spanKind == ptrace.SpanKindClient.String() { return CallsGRPCEndpoint } } return "" }, }, OtherIDAttributes: []string{ string(semconv.K8SClusterNameKey), string(semconv.K8SNamespaceNameKey), }, }, string(semconv.K8SDaemonSetNameKey): { Type: KubernetesDaemonSet, Relationships: map[string]string{ string(semconv.K8SPodNameKey): ContainsPod, string(semconv.ServiceNameKey): IsDaemonSetFor, }, AttributeNames: []string{string(semconv.K8SStatefulSetUIDKey)}, AttributePrefixes: []string{}, OtherIDAttributes: []string{ string(semconv.K8SClusterNameKey), string(semconv.K8SNamespaceNameKey), }, }, string(semconv.K8SDeploymentNameKey): { Type: KubernetesDeployment, Relationships: map[string]string{ string(semconv.K8SReplicaSetNameKey): ManagesReplicaset, string(semconv.ServiceNameKey): IsManagedByDeployment, }, AttributeNames: []string{ string(semconv.K8SDeploymentUIDKey), string(semconv.K8SNamespaceNameKey), string(semconv.K8SNodeNameKey), string(semconv.ServiceNameKey), string(semconv.K8SClusterNameKey), }, AttributePrefixes: []string{}, OtherIDAttributes: []string{ string(semconv.K8SClusterNameKey), string(semconv.K8SNamespaceNameKey), }, }, string(semconv.K8SReplicaSetNameKey): { Type: KubernetesReplicaSet, Relationships: map[string]string{ string(semconv.K8SPodNameKey): ContainsPod, string(semconv.K8SDeploymentNameKey): IsManagedByDeployment, }, AttributeNames: []string{ string(semconv.K8SReplicaSetUIDKey), string(semconv.K8SDeploymentNameKey), string(semconv.K8SNamespaceNameKey), string(semconv.ServiceNameKey), string(semconv.K8SNodeNameKey), string(semconv.K8SClusterNameKey), }, AttributePrefixes: []string{}, OtherIDAttributes: []string{ string(semconv.K8SClusterNameKey), string(semconv.K8SNamespaceNameKey), }, }, string(semconv.K8SStatefulSetNameKey): { Type: KubernetesStatefulSet, Relationships: map[string]string{ string(semconv.K8SPodNameKey): ContainsPod, string(semconv.ServiceNameKey): IsStatefulSetFor, }, AttributeNames: []string{ string(semconv.K8SStatefulSetUIDKey), string(semconv.K8SNamespaceNameKey), string(semconv.K8SNodeNameKey), string(semconv.ServiceNameKey), string(semconv.K8SClusterNameKey), }, AttributePrefixes: []string{}, OtherIDAttributes: []string{ string(semconv.K8SClusterNameKey), string(semconv.K8SNamespaceNameKey), }, }, string(semconv.K8SJobNameKey): { Type: KubernetesJob, Relationships: map[string]string{ string(semconv.K8SPodNameKey): ContainsPod, string(semconv.ServiceNameKey): IsAJobFor, }, AttributeNames: []string{ string(semconv.K8SJobUIDKey), string(semconv.K8SNamespaceNameKey), string(semconv.K8SNodeNameKey), string(semconv.ServiceNameKey), string(semconv.K8SClusterNameKey), }, AttributePrefixes: []string{}, OtherIDAttributes: []string{ string(semconv.K8SClusterNameKey), string(semconv.K8SNamespaceNameKey), }, }, string(semconv.K8SCronJobNameKey): { Type: KubernetesCronJob, Relationships: map[string]string{ string(semconv.K8SPodNameKey): ContainsPod, string(semconv.ServiceNameKey): IsACronJobFor, }, AttributeNames: []string{ string(semconv.K8SCronJobUIDKey), string(semconv.K8SNamespaceNameKey), string(semconv.K8SNodeNameKey), string(semconv.ServiceNameKey), string(semconv.K8SClusterNameKey), }, AttributePrefixes: []string{}, OtherIDAttributes: []string{ string(semconv.K8SClusterNameKey), string(semconv.K8SNamespaceNameKey), }, }, string(semconv.K8SPodNameKey): { Type: KubernetesPod, Relationships: map[string]string{ string(semconv.K8SContainerNameKey): RunsInPod, string(semconv.K8SCronJobNameKey): IsAPodFor, string(semconv.K8SDaemonSetNameKey): IsAPodFor, string(semconv.K8SJobNameKey): IsAPodFor, string(semconv.K8SStatefulSetNameKey): IsAPodFor, string(semconv.K8SReplicaSetNameKey): IsAPodFor, }, AttributeNames: []string{ K8SPodIp, string(semconv.K8SNamespaceNameKey), string(semconv.K8SNodeNameKey), string(semconv.ServiceNameKey), string(semconv.K8SClusterNameKey), string(semconv.K8SPodUIDKey), }, AttributePrefixes: []string{"k8s.pod.label.", "k8s.pod.annotation."}, OtherIDAttributes: []string{ string(semconv.K8SClusterNameKey), string(semconv.K8SNamespaceNameKey), }, }, 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), string(semconv.K8SNamespaceNameKey), string(semconv.K8SNodeNameKey), string(semconv.ServiceNameKey), string(semconv.K8SClusterNameKey), }, AttributePrefixes: []string{}, OtherIDAttributes: []string{ string(semconv.K8SClusterNameKey), string(semconv.K8SNamespaceNameKey), }, }, string(semconv.ContainerNameKey): { Type: Container, Relationships: map[string]string{ string(semconv.ServiceNameKey): IsDeployedOnContainer, }, AttributeNames: []string{ string(semconv.ContainerIDKey), string(semconv.ContainerCommandKey), string(semconv.ContainerCommandArgsKey), string(semconv.ContainerRuntimeKey), string(semconv.ContainerCommandLineKey), }, AttributePrefixes: []string{"container.label"}, }, string(semconv.OSNameKey): { Type: OperatingSystem, 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.DBNamespaceKey): { Type: Database, Relationships: map[string]string{ string(semconv.ServiceNameKey): IsUsedByService, string(semconv.DBCollectionNameKey): HasCollection, }, AttributeNames: []string{ string(semconv.DBSystemNameKey), }, AttributePrefixes: []string{}, OtherIDAttributes: []string{ string(semconv.ServerAddressKey), }, }, string(semconv.DBCollectionNameKey): { Type: DatabaseCollection, Relationships: map[string]string{ string(semconv.ServiceNameKey): IsUsedByService, string(semconv.DBNamespaceKey): IsPartOfDatabase, }, AttributeNames: []string{ string(semconv.DBSystemNameKey), }, AttributePrefixes: []string{}, NameTransformer: func(s string) string { return functions.ScrubWord(s) }, OtherIDAttributes: []string{ string(semconv.DBNamespaceKey), string(semconv.ServerAddressKey), }, }, string(semconv.MessagingDestinationNameKey): { Type: MessagingDestination, Relationships: map[string]string{ string(semconv.ServiceNameKey): IsUsedByService, }, AttributeNames: []string{ string(semconv.MessagingSystemKey), }, AttributePrefixes: []string{}, }, string(semconv.MessagingConsumerGroupNameKey): { Type: MessagingConsumerGroup, Relationships: map[string]string{ string(semconv.ServiceNameKey): IsConsumedFromByService, }, AttributeNames: []string{ string(semconv.MessagingSystemKey), string(semconv.MessagingDestinationNameKey), }, 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, string(semconv.K8SDaemonSetNameKey): 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 EntityId ¶ added in v0.23.4
func ToEntityId ¶ added in v0.23.5
func ToKubernetesEntityId ¶ added in v0.23.8
type EntityInfo ¶
type EntityInfo struct {
Type string
Relationships map[string]string
AttributeNames []string
AttributePrefixes []string
NameTransformer func(string) string
CreateEntityRelationshipsCallback func(m pcommon.Map) []EntityRelationship
DeriveRelationshipCallbacks map[string]func(pcommon.Map) string
ShouldCreateCallBack func(p pcommon.Map) bool
OtherIDAttributes []string
}
type EntityRelationship ¶ added in v0.24.22
type RelationshipMap ¶
type RelationshipMap map[string]*EntityInfo
type ResourceEntity ¶
type ResourceEntity struct {
EntityId *EntityId
AttributeName string
Attributes map[string]string
Edges map[string]*EdgeInfo
// contains filtered or unexported fields
}
func (*ResourceEntity) AddEdge ¶
func (re *ResourceEntity) AddEdge(target *EntityId, relationship string)
AddEdge adds an edge from this entity to the target entity with the given relationship.
func (*ResourceEntity) AddEdgeBacklink ¶ added in v0.23.11
func (re *ResourceEntity) AddEdgeBacklink(source *EntityId, relationship string)
AddEdgeBacklink adds an edge from the source entity back to this entity with the given relationship.
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) ProvisionPackagedObject ¶ added in v0.23.8
func (ec *ResourceEntityCache) ProvisionPackagedObject(po *graphpb.PackagedObject)
ProvisionPackagedObject does the obvious. It also MODIFIES the passed in PackagedObject, specificially the ResourceAttributes, so this makes the PackagedObject not safe for concurrent use.
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 string, entityId *EntityId, attributes map[string]string) (*ResourceEntity, bool)
Directories
¶
| Path | Synopsis |
|---|---|
|
Package graphpb holds source and generated code for the graph objects that we collect from Kubernetes and other sources.
|
Package graphpb holds source and generated code for the graph objects that we collect from Kubernetes and other sources. |
|
tools
command
This tool generates the GetBaseObject() method for the PackagedObject message.
|
This tool generates the GetBaseObject() method for the PackagedObject message. |
Click to show internal directories.
Click to hide internal directories.