cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

KUBERNETES_NODE and KUBERNETES_CLUSTER entity type isNodeOfHost and isClusterOfHost is not coming in payload

Adarsh3312
Observer

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
3 REPLIES 3

Hi @Adarsh3312 

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:

 

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

 

And for KUBERNETES_NODE, the query looks like this:

 

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

 

 

To learn more about entitySelectors I recommend documentation:

https://docs.dynatrace.com/docs/dynatrace-api/environment-api/entity-v2/entity-selector 

 

Bests
Michal

Hi Michal,

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

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 

Hi @Adarsh3312 

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)

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

Featured Posts