19 Oct 2023 07:40 AM - edited 19 Oct 2023 08:37 AM
Hi all,
Need help for creating Metric Selectors to select this service and lookup the publicCloudId.
This is the JSON.
{
"entityId": "SERVICE-ABCDEF",
"type": "SERVICE",
"displayName": "demo-name in ap-southeast-1",
"firstSeenTms": 1695795958177,
"lastSeenTms": 1697695446317,
"properties": {
"serviceType": "RPC_SERVICE",
"detectedName": "demo-name in ap-southeast-1",
"isExternalService": false,
"publicCloudRegion": "ap-southeast-1",
"publicCloudId": "arnlambda:ap-southeast-1:123456789:function:demo-name",
"softwareTechnologies": [
{
"type": "NODE_JS"
},
{
"type": "AWS_LAMBDA"
}
],
"agentTechnologyType": "N/A"
},
"tags": [],
"managementZones": [
{
"id": "987654321",
"name": "demoMZ"
}
],
"icon": {
"primaryIconType": "aws-lambda"
},
"fromRelationships": {
"runsOn": [
{
"id": "AWS_LAMBDA_FUNCTION-ABC123",
"type": "AWS_LAMBDA_FUNCTION"
}
],
"calls": [
{
"id": "SERVICE-ABC123",
"type": "SERVICE"
},
{
"id": "SERVICE-ABC1234",
"type": "SERVICE"
},
{
"id": "SERVICE-ABC12345",
"type": "SERVICE"
}
]
},
"toRelationships": {
"isGroupOf": [
{
"id": "SERVICE_METHOD_GROUP-ABC123",
"type": "SERVICE_METHOD_GROUP"
}
]
}
}
Cannot use the following:
"message": "Unknown predicate name publicCloudId",
Any ideas?
Thanks,
Abner
Solved! Go to Solution.
19 Oct 2023 11:43 AM
Can you please elaborate more on your question and provide some more screenshots/data?
From what I see in the question, you're trying to use a metric selector that uses an entity's property, in this case the publicCloudId. In order to do that, you need to use an entity selector insice the metric selector. However, there is a limited set of properties you can use from each entity type in an entity selector, as decribed here. You will need to call the GET entity type API for, in this case, the SERVICE entity type, and check the properties field. If the publicCloudId is in there, you can use it. If not, you will have to find a workaround with tags or something else to filter your metric selector by your service.
20 Oct 2023 03:25 AM
The JSON above is from the Get Entity Type API.
As you saw, it has the publicCloudId property but cannot use. Why?
Regards,
Abner
23 Oct 2023 07:47 AM
The entities API and the entities type API are different APIs. You're using the first one and it's the second one to tell you if you can use the property or not.
24 Oct 2023 07:25 AM
I tried the entities type API, it returned the property
publicCloudId
See screenshot Dynatrace.png
It means, I can use the property? But why right now, it's returning an error?
24 Oct 2023 07:29 AM
As per the documentation, yes. The problem is probably on the metric selector or the entity selector, mind sharing that too?
24 Oct 2023 07:42 AM
Correct, the expected/documentation vs actual results does not match.
Please see attached Dynatrace2.png
24 Oct 2023 08:03 AM
You're right, as per the documentation, that entitySelector should work and it doesn't. I guess the best course of action at this point is a Dynatrace support ticket, as this is potentially a bug, or some kind of exception tht's not documented.