Links

Custom Metric Impact Registration

Use this endpoint with the POST method to register Custom Metric Impact values.
You can submit custom metric impact values to Sleuth. Sleuth will perform its anomaly detection on these values and they will inform the health of your deploys. Values can represent any metric that matters to you and must be represented via a float.

Path

ENDPOINT

https://app.sleuth.io/api/1/impact/IMPACT_ID/register_impact
The endpoint path takes 1 ID which uniquely identifies the Impact Source to register a value against:
  • IMPACT_ID: must be an integer, you can find the full path (including the ID) in your Sleuth org by navigating to your Custom Metric Impact Source, clicking the gearwheel icon in the top-right corner, and selecting "Show register details"

Parameters

Mandatory parameters
Optional parameters
Responses
Name
Type
Comments
api_key*
string
Can be found in the Organization Settings -> Details -> Api Key field in your Sleuth org.
value*
float
The metric value to be registered.
Name
Type
Comments
date
string
The date and time at which the metric value should be registered. If left blank, it defaults to the current time. Must be in ISO-8601 format.
Please note that backfilling of metrics data is not currently supported, and the supplied date therefore cannot be older/before than the Impact Source creation date.
Code
Comments
Response Text
200
Manual change registered successfully.
Success
400
Returned if any of the input parameters are invalid, e.g.: - date format isn't valid - value is not a valid float
The response text will indicate the nature of the error:
Bad Request - impact value must be a number
401
Returned if the API key provided doesn't exist.
Unauthorized
404
Returned if the IMPACT_ID does not exist.
MetricImpactSource Not Found
429
Returned if your requests are more frequent than one every 120 seconds. A Retry-After header is provided with the number of seconds you should wait until you try again.
You may only register a custom metric once every 120 seconds

Examples

Make sure you replace the values surrounded by< and >with your own values.
cURL with API key in Header
1
curl -X POST \
2
'https://app.sleuth.io/api/1/impact/<IMPACT_ID>/register_impact' \
3
-H 'Authorization: apikey <APIKEY>' \
4
-H 'Content-Type: application/json' \
5
-d '{
6
"value": <METRIC_VALUE>
7
}'
cURL with API key in Body
1
curl -X POST \
2
'https://app.sleuth.io/api/1/impact/<IMPACT_ID>/register_impact' \
3
-H 'Content-Type: application/json' \
4
-d '{
5
"value": <METRIC_VALUE>,
6
"api_key": "<APIKEY>"
7
}'
PowerShell with API key in Header
1
Invoke-RestMethod -Method POST `
2
-Uri 'https://app.sleuth.io/api/1/impact/<IMPACT_ID>/register_impact' `
3
-Headers @{
4
'Authorization' = 'apikey <APIKEY>'
5
'Content-Type' = 'application/json'
6
} `
7
-Body '{
8
"value": <METRIC_VALUE>
9
}'
PowerShell with API key in Body
1
Invoke-RestMethod -Method POST `
2
-Uri 'https://app.sleuth.io/api/1/impact/<IMPACT_ID>/register_impact' `
3
-Headers @{
4
'Content-Type' = 'application/json'
5
} `
6
-Body '{
7
"api_key": "<APIKEY>",
8
"value": <METRIC_VALUE>
9
}'