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

Create calculated metrics error via API

b_umas
Visitor

What is missing in production to cause this error on a service?

 

API Path : /api/config/v1/calculatedMetrics/service

 

Request:

{
"tsmMetricKey": "calc:service.slo_XX",
"name": "XX",
"enabled": true,
"metricDefinition": {
"metric": "REQUEST_COUNT"
},
"unit": "COUNT",
"entityId": "SERVICE-XXX",
"conditions": [
{
"attribute": "RESPONSE_TIME",
"comparisonInfo": {
"type": "NUMBER",
"comparison": "LOWER_THAN_OR_EQUAL",
"value": 3000,
"negate": "false"
}
}
],
"dimensionDefinition": {
"name": "XX",
"dimension": "All Requests",
"topX": 10,
"topXDirection": "DESCENDING",
"topXAggregation": "SINGLE_VALUE"
}
}

 

Prod Environment Error:

{'code': 400, 'message': 'Constraints violated.', 'constraintViolations': [{'path': 'entityId', 'message': 'Please check entityId: there is no such SERVICE in the system', 'parameterLocation': 'PAYLOAD_BODY', 'location': None}]}}

 

Note : It's working as expected in the SI environment, both prod and SI share the same managed environment/install

4 REPLIES 4

Radoslaw_Szulgo
Dynatrace Guru
Dynatrace Guru

Looks like you've passed invalid entity ID here:

"entityId": "SERVICE-XXX",

 

Please double check if it is correct. Note that entity IDs may vary across environments.

Senior Product Manager,
Dynatrace Managed expert

@Radoslaw_Szulgo 

Thank you for the response

I have validated entityId for the current prod environment and it is the correct one. 

 

this issue only happening for some services but not for all, would like to know if there is a place I can verify service properties or configuration to find difference between working vs not working.

Have you tried to use "Monitored Entity v2" endpoint - to see if you can retrieve data for that SERVICE ? 

Senior Product Manager,
Dynatrace Managed expert

@Radoslaw_Szulgo 

 

Yes, I was able to verify and successfully and retrieved entityId using "Monitored Entity v2"