09 Aug 2022 01:57 PM - last edited on 11 Aug 2022 10:03 AM by MaciejNeumann
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
10 Aug 2022 12:32 PM
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.
10 Aug 2022 01:15 PM
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.
10 Aug 2022 02:06 PM
Have you tried to use "Monitored Entity v2" endpoint - to see if you can retrieve data for that SERVICE ?
10 Aug 2022 02:15 PM
Yes, I was able to verify and successfully and retrieved entityId using "Monitored Entity v2"
16 Dec 2022 10:29 AM
Hi @b_umas, did you have any luck solving your issue?