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

MetricSelector for Properties Attribute

abnerlusung
Advisor

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": "arn‌‌lambda: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

7 REPLIES 7

victor_balbuena
Dynatrace Mentor
Dynatrace Mentor

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.

Hi @victor_balbuena 

The JSON above is from the Get Entity Type API.

As you saw, it has the publicCloudId property but cannot use. Why?

 

Regards,

Abner

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.

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?

As per the documentation, yes. The problem is probably on the metric selector or the entity selector, mind sharing that too?

Correct, the expected/documentation vs actual results does not match. 

Please see attached Dynatrace2.png

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.

Featured Posts