Skip to main content
PUT
Update a custom metric definition

Authorizations

Authorization
string
header
required

All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.

Path Parameters

customMetricKey
string
required

Key of the custom metric

Body

application/json

The full replacement state for a custom metric

name
string
required

Display name

Example:

"Deploy frequency"

valence
enum<string>
required

Whether a higher value is better. Defaults to NEUTRAL.

Available options:
POSITIVE,
NEGATIVE,
NEUTRAL
category
string

Free-text group for the metric

Example:

"Delivery"

description
string

What the metric measures

displayFormat
object

How Cortex shows the metric's values. The values stay as recorded. type is NUMBER, PERCENTAGE, CURRENCY (US dollars, always shown with cents), or DURATION. decimals is 0 to 6 and is not allowed for CURRENCY or DURATION. inputUnit is the unit the values are recorded in: RATIO (0 to 1) or PERCENT (0 to 100) for PERCENTAGE, and SECONDS, MINUTES, or HOURS for DURATION. Omit displayFormat to show the values as recorded.

isDraft
boolean
default:false

A draft metric still accepts data points but is hidden from Eng Intelligence. Defaults to false.

Response

The updated custom metric definition

A custom metric defined in the workspace

isDraft
boolean
required

A draft metric is hidden from Eng Intelligence

key
string
required

Unique key that data points are recorded against

Example:

"deploy-frequency"

name
string
required

Display name

Example:

"Deploy frequency"

type
enum<string>
required

PUBLIC_API metrics take data points through the API. CQL metrics compute their values from a CQL expression and are read-only through the API.

Available options:
CQL,
PUBLIC_API
valence
enum<string>
required

Whether a higher value is better

Available options:
POSITIVE,
NEGATIVE,
NEUTRAL
category
string

Free-text group for the metric

Example:

"Delivery"

cqlExpression
string

The CQL expression behind a CQL metric. Null for PUBLIC_API.

description
string

What the metric measures

displayFormat
object

How Cortex shows the metric's values. The values stay as recorded. type is NUMBER, PERCENTAGE, CURRENCY (US dollars, always shown with cents), or DURATION. decimals is 0 to 6 and is not allowed for CURRENCY or DURATION. inputUnit is the unit the values are recorded in: RATIO (0 to 1) or PERCENT (0 to 100) for PERCENTAGE, and SECONDS, MINUTES, or HOURS for DURATION. Omit displayFormat to show the values as recorded.