For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

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.

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

cURL with API key in Header
curl -X POST \
'https://app.sleuth.io/api/1/impact/<IMPACT_ID>/register_impact' \
  -H 'Authorization: apikey <APIKEY>' \
  -H 'Content-Type: application/json' \
  -d '{
  "value": <METRIC_VALUE>
}'
cURL with API key in Body
curl -X POST \
'https://app.sleuth.io/api/1/impact/<IMPACT_ID>/register_impact' \
  -H 'Content-Type: application/json' \
  -d '{
  "value": <METRIC_VALUE>,
  "api_key": "<APIKEY>"
}'
PowerShell with API key in Header
PowerShell with API key in Body

Last updated

Was this helpful?