# KUBERNETES\_NODE and KUBERNETES\_CLUSTER entity type isNodeOfHost and isClusterOfHost is not coming in payload

**URL:** <https://community.dynatrace.com/t/kubernetes-node-and-kubernetes-cluster-entity-type-isnodeofhost-and-isclusterofhost-is-not-coming-in-payload/44941>\
**Category:** Dynatrace API\
**Tags:** kubernetes, dynatrace-api\
**Created:** [April 2, 2024, 10:28am UTC](https://community.dynatrace.com/t/kubernetes-node-and-kubernetes-cluster-entity-type-isnodeofhost-and-isclusterofhost-is-not-coming-in-payload/44941 "2024-04-02T10:28:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adarsh3312](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@Adarsh3312](https://community.dynatrace.com/u/Adarsh3312)\
**Post date:** [April 2, 2024, 10:28am UTC](https://community.dynatrace.com/t/kubernetes-node-and-kubernetes-cluster-entity-type-isnodeofhost-and-isclusterofhost-is-not-coming-in-payload/44941/1 "2024-04-02T10:28:15Z")

</div>

I am using entity selector API to get KUBERNETES\_NODE and KUBERNETES\_CLUSTER entityType data from Dynatrace.

In API documentation payload format for both entity type I can see there is attributes in “fromRelationships” which tells about HOST to which that entity is related to.

KUBERNETES\_NODE:

{

“id”: “isNodeOfHost”,

“toTypes”: [

“HOST”

]

}

KUBERNETES\_CLUSTER:

{

“id”: “isClusterOfHost”,

“toTypes”: [

“HOST”

]

},

But when I fetch data using entityselector API type(KUBENETES\_NODE) and type(KUBERNETES\_CLUSTER) I am not getting those attribute.

Actual paylaod:

KUBERNETES\_NODE:

“managementZones”: [],“fromRelationships”: {},“toRelationships”: {KUBERNETES\_CLUSTER:“fromRelationships”: {“isClusterOfNamespace”: [{“id”: “CLOUD\_APPLICATION\_INSTANCE-6C047C4AEF58E51F”,“type”: “CLOUD\_APPLICATION\_INSTANCE”}],“isClusterOfCa”: [{“id”: “CLOUD\_APPLICATION-A66EE578CFC22026”,“type”: “CLOUD\_APPLICATION”},],“isClusterOfService”: [{“id”: “SERVICE-7790727CC3E5E4D6”,“type”: “SERVICE”},{“id”: “SERVICE-F4E26B688E9FF1DC”,“type”: “SERVICE”},{“id”: “SERVICE-1CC299D94ECEB61D”,“type”: “SERVICE”},{“id”: “SERVICE-6F915E3E1BFAE902”,“type”: “SERVICE”},{“id”: “SERVICE-B40E35CB1F8B355E”,“type”: “SERVICE”},{“id”: “SERVICE-62515BF373524231”,“type”: “SERVICE”},{“id”: “SERVICE-E4795917413DF320”,“type”: “SERVICE”},{“id”: “SERVICE-DF8AFE5231C1260D”,“type”: “SERVICE”},{“id”: “SERVICE-8DE4FD3067C76286”,“type”: “SERVICE”},{“id”: “SERVICE-CCBB57E980F68262”,“type”: “SERVICE”}],“isClusterOfNode”: [{“id”: “KUBERNETES\_NODE-6C3263148CCF0B35”,“type”: “KUBERNETES\_NODE”}],“isClusterOfKubernetesSvc”: [{“id”: “KUBERNETES\_SERVICE-2649F65A84A287A9”,“type”: “KUBERNETES\_SERVICE”},{“id”: “KUBERNETES\_SERVICE-49D64648680D7559”,“type”: “KUBERNETES\_SERVICE”},{“id”: “KUBERNETES\_SERVICE-336DFC26C4C8AC89”,“type”: “KUBERNETES\_SERVICE”},]},“toRelationships”: {“isCgiOfCluster”: [Do we need to enable anything on Dynatrace side to capture this details in payload?Regards,Adarsh

---

<div class="post-metadata">

**Author:** ![MichalOlszewski](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@MichalOlszewski](https://community.dynatrace.com/u/MichalOlszewski)\
**Post date:** [April 9, 2024, 9:21am UTC](https://community.dynatrace.com/t/kubernetes-node-and-kubernetes-cluster-entity-type-isnodeofhost-and-isclusterofhost-is-not-coming-in-payload/44941/2 "2024-04-09T09:21:16Z")

</div>

Hi&nbsp;[@Adarsh3312](https://community.dynatrace.com/user/72818)

Using entity selectors is more complicated. If you want to use an entityselector that will display Kubernetes\_cluster based on the hostname, you have to do something like this:

```markup
type("KUBERNETES_CLUSTER"), fromRelationships.isClusterOfHost(type("Host"), entityname("name_of_host"))

```

And for KUBERNETES\_NODE, the query looks like this:

```markup
type("KUBERNETES_NODE"), fromRelationships.isNodeOfHost(type("Host"), entityname("name_of_host"))

```

To learn more about entitySelectors I recommend documentation:

> **[Environment API v2 - Entity selector](https://docs.dynatrace.com/docs/dynatrace-api/environment-api/entity-v2/entity-selector)**
>
> Learn the Environment API v2 entity selector syntax for filtering monitored entities by type, name, tag, management zone, and health state.

Bests  
Michal

---

<div class="post-metadata">

**Author:** ![Adarsh3312](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@Adarsh3312](https://community.dynatrace.com/u/Adarsh3312)\
**Post date:** [April 9, 2024, 2:17pm UTC](https://community.dynatrace.com/t/kubernetes-node-and-kubernetes-cluster-entity-type-isnodeofhost-and-isclusterofhost-is-not-coming-in-payload/44941/3 "2024-04-09T14:17:05Z")

</div>

Hi Michal,

entityselector gives flexibility to get all kubernetes cluster and node in minimum number of API call. But if we use

```auto
fromRelationships.isClusterOfHost(type("Host"), entityname("name_of_host"))

```

then we will have to make 'n; number API calls if we have ‘n’ number of HOSTS. This won’t be performant as per our use case for data loading due to multiple network call

As mentioned in my query, In payload structure of entity selector for kubernetes\_cluster and node we get a HOST relation ship but when we are trying to fetch real data, those attributes are missing in payload.

Using entity selector will be much more performant and will be able to create relationship as well if somehow we start getting those HOST details in payload.

Can you please help in understanding do we need to do any configuration on Dynatrace side to get those data as our product delivery depends on this.

Regards,

Adarsh

---

<div class="post-metadata">

**Author:** ![MichalOlszewski](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@MichalOlszewski](https://community.dynatrace.com/u/MichalOlszewski)\
**Post date:** [April 9, 2024, 2:30pm UTC](https://community.dynatrace.com/t/kubernetes-node-and-kubernetes-cluster-entity-type-isnodeofhost-and-isclusterofhost-is-not-coming-in-payload/44941/4 "2024-04-09T14:30:15Z")

</div>

Hi&nbsp;[@Adarsh3312](https://community.dynatrace.com/user/72818)

I get Your point - to do single query with lot of datapoints(?) for different dimensions (Hosts on NODE), but shouldn’t You use some metric that You specifically need about them (like CPU usage or just anything if You care about relation alone) and then using Filters and splitting to get them filtered as You like? Cause then You can get like 1 value (LAST aggregation) per Host / Node (SPLIT by)  
I believe You want to use : Metric API v2 ([Metrics API - GET metric data points - Dynatrace Docs](https://docs.dynatrace.com/docs/dynatrace-api/environment-api/metric-v2/get-data-points))

Unless You want to map topology, then its totally different case.

But honestly I don’t know what and why You want to achieve thus it’s hard to give best recommendation.

Best  
Michal
