GraphQL query for relatedEntites provides entities with "entityType": "UNAVAILABLE_ENTITY"

Hello!
For querying info about entities relations we use relationships field, and all works fine.
But now this field marked as deprecated, and relatedEntites recommended for usage instead.
Unfortunately, relatedEntites not works properly for entityTypes like ‘APM_DATABASE_INSTANCE_ENTITY’ or ‘APM_EXTERNAL_SERVICE_ENTITY’.
Example response for relationships field:
{
“target”: {
“entity”: {
“entityType”: “APM_DATABASE_INSTANCE_ENTITY”,
“guid”: “MTQ3MTgyNnxBUE18REJfSU5TVEFOQ0V8UG9zdGdyZXN8ZHdoLnNreWVuZy5saW5rfDE1NDM5”,
“host”: “ex.sample.link”,
“name”: “Postgres”,
“portOrPath”: “15439”
}
}
}

Response for relatedEntites:
{
“target”: {
“entity”: {
“entityType”: “UNAVAILABLE_ENTITY”,
“guid”: “MTQ3MTgyNnxBUE18REJfSU5TVEFOQ0V8UG9zdGdyZXN8ZHdoLnNreWVuZy5saW5rfDE1NDM5”,
“name”: null,
“type”: “DB_INSTANCE”
}
}
},
So, for same related entity, we got different results. My question is: how should i use relatedEntites field to get correct entity response?

Hi @a.sedyshev - This is an excellent question. I’ll check into this and get back to you soon. Thanks for asking this.

We are facing the same issue.
When we used relationships, target entity name and entity type were returned correctly.

With relatedEntities these fields are having issues and the value is not returned correctly.

Since relationships is deprecated we are not able to fetch the correct details

"target": {
              "entity": {
                "domain": "APM",
                "entityType": "UNAVAILABLE_ENTITY",
                "guid": "MzA1ODgyMHxBUE18REJfSU5TVEFOQ0V8TXlTUUx8Y2FvLWRiYS1na2F2LW15c3FsNTctYXVyb3JhLXByZC1kYmNsdXN0ZXIuY2x1c3Rlci1jNW9nenNnaXB5cmkudXMtZWFzdC0xLnJkcy5hbWF6b25hd3MuY29tfDMzMDY",
                "name": null,
                "type": "DB_INSTANCE"
              }
            },

@dkoyano @philweber Any update?

@dkoyano @philweber Any update?

Any updates after 2 months?

@a.sedyshev - This seems to be an issue whit what we call “external entities”. These entities only exist in the relationships api but you can’t query them in the search. They are not real entities and hence they are not attached to any entityType which is why “UNAVAILABLE_ENTITY” is used. Before Nerdgraph tried to put some sense on the types based on the guid but those types also didn’t exist in the platform. We are currently trying to define a way to get rid of these “external” entities and instead provide proper entities for the relationships.

@dkoyano Any further updates on this?

Hi there @hitesh.x.shahjee - There have not been any updates to this, but we will update this thread if we learn more.

Is there any further progress on this?

Hi @hitesh.x.shahjee - Nerdgraph queries using relatedEntities should now return the entities as they were returned by the relationships one.

1 Like