Skip to content
2 changes: 1 addition & 1 deletion entity-types/infra-kubernetes_pod/tests/K8sPodSample.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,5 @@
"status": "Running",
"systemMemoryBytes": "8100130816",
"timestamp": 1773169450000
}
}
]
81 changes: 81 additions & 0 deletions relationships/candidates/HOST.stg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
category: HOST
lookups:
- entityTypes:
- domain: INFRA
type: HOST
tags:
matchingMode: ANY
predicates:
- tagKeys: ["host.id", "aws.ec2.host.id"]
field: cloudProviderId
- tagKeys: ["host.id", "aws.ec2.host.id"]
field: host.id
onMatch:
onMultipleMatches: RELATE_ALL
onMiss:
action: CREATE_UNINSTRUMENTED
uninstrumented:
type: HOST

- entityTypes:
- domain: INFRA
type: HOST
tags:
matchingMode: FIRST
predicates:
- tagKeys: ["displayname"]
field: displayName
- tagKeys: ["fullhostname"]
field: hostName
- tagKeys: ["hostname"]
field: hostName
onMatch:
onMultipleMatches: RELATE_ALL
onMiss:
action: CREATE_UNINSTRUMENTED
uninstrumented:
type: HOST

- entityTypes:
- domain: INFRA
type: HOST
tags:
matchingMode: ANY
predicates:
- tagKeys: ["hostname"]
field: onHostEntityHostname
onMatch:
onMultipleMatches: RELATE_ALL
onMiss:
action: CREATE_UNINSTRUMENTED
uninstrumented:
type: HOST
- entityTypes:
- domain: INFRA
type: HOST
tags:
matchingMode: ANY
predicates:
- tagKeys: ["host.id"]
field: hostId
onMatch:
onMultipleMatches: RELATE_ALL
onMiss:
action: CREATE_UNINSTRUMENTED
uninstrumented:
type: HOST

- entityTypes:
- domain: INFRA
type: HOST
tags:
matchingMode: ALL
predicates:
- tagKeys: ["host.name", "hostName"]
field: host.name
- tagKeys: ["k8s.clusterName", "k8s.cluster.name"]
field: k8s.clusterName
onMatch:
onMultipleMatches: RELATE_ALL
onMiss:
action: NO_OP
36 changes: 15 additions & 21 deletions relationships/synthesis/INFRA-HOST-to-INFRA-KUBERNETES_POD.stg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ relationships:
- Kubernetes Integration
conditions:
- attribute: eventType
anyOf: [ "K8sPodSample" ]
anyOf: ["K8sPodSample"]
relationship:
expires: PT75M
relationshipType: HOSTS
source:
extractGuid:
attribute: host.guid
entityType:
value: HOST
lookupGuid:
candidateCategory: HOST
fields:
- field: hostName # hostname of host
attribute: nodeName # node hostname from pod
target:
extractGuid:
attribute: entityGuid
Expand All @@ -22,15 +23,15 @@ relationships:
- name: otelKsmK8sHostHostsPod
# use kube-state-metrics system metric
version: "1"
origins:
origins:
- OpenTelemetry
conditions:
- attribute: metricName
startsWith: system.
- attribute: eventType
anyOf: [ "Metric" ]
anyOf: ["Metric"]
- attribute: newrelic.source
anyOf: [ "api.metrics.otlp" ]
anyOf: ["api.metrics.otlp"]
# if service.name is present, it's a service, not a host
- attribute: service.name
present: false
Expand All @@ -40,20 +41,13 @@ relationships:
- attribute: k8s.cluster.name
present: true
relationship:
expires: PT2H
expires: PT75M
relationshipType: HOSTS
source:
extractGuid:
attribute: host.guid
entityType:
value: HOST
attribute: entity.guid
target:
lookupGuid:
candidateCategory: KUBERNETES_POD
fields:
- field: k8s.node.name # node name of host
attribute: host.name # node name of pod
- field: k8s.namespace.name # namespace of host
attribute: k8s.namespace.name # namespace of pod
- field: k8s.cluster.name # cluster of host
attribute: k8s.cluster.name # cluster of pod
extractGuid:
attribute: entityGuid
entityType:
value: KUBERNETES_POD