Skip to content
GitHubLog inStart free
cetra is not released yet. These docs describe the development version.

Get an alert rule

GET
/api/v1/projects/{project}/alert-rules/{id}
curl --request GET \
--url http://localhost:8080/api/v1/projects/example/alert-rules/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--cookie cetra_session=<cetra_session>
project
required
string

Project UUID, URL-encoded org-slug/project-slug, or current.

id
required
string format: uuid

Alert rule id.

The rule and its state.

Media typeapplication/json

One alert rule (D-K-2, D-K-4).

object
channel_ids
required

Channels notified on fired, resolved and reminder events. Ordered by id.

Array<string>
condition
required

What is measured and when it breaches, with defaults filled in.

object
aggregation

score only. Default avg.

string
Allowed values: avg pass_rate
comparator
required

How the value is compared with threshold.

string
Allowed values: gt gte lt lte
filter

Filter DSL expression over traces. Absent means every trace.

string
issue_id

issue_occurrences only: count one issue and the issues merged into it. Exactly one of issue_id and source_id is set for that metric.

string format: uuid
metric
required

What is measured.

string
Allowed values: error_rate cost latency_p95 score issue_occurrences
min_count

Fewer samples than this gives no_data. Not for cost or issue_occurrences. Defaults: 20, or 10 for score.

integer format: int64
score_name

score only: the score name.

string
source_id

issue_occurrences only: count every issue of the source that is not ignored or merged, and the issues merged into them.

string format: uuid
target

latency_p95 only. Default trace.

string
Allowed values: trace llm_span
threshold
required

Fraction for error_rate and pass_rate, USD for cost, milliseconds for latency_p95 (below the window length for a trace target), occurrences for issue_occurrences.

number format: double
window
required

Sliding window.

string
Allowed values: 1m 5m 15m 1h 6h 24h
cooldown_s
required

Minimum seconds between two reminders while firing.

integer format: int64
created_at
required

Creation time.

string format: date-time
enabled
required

Disabled rules are not evaluated.

boolean
id
required

Rule id.

string format: uuid
last_count

Sample count of the last successful evaluation.

integer format: int64
last_error

Why the last evaluation failed. Absent after a successful one.

string
last_evaluated_at

Last evaluation, successful or not.

string format: date-time
last_fired_at

Last fired event.

string format: date-time
last_value

Value of the last successful evaluation.

number format: double
name
required

Display name, unique in the project.

string
notify_while_firing
required

Send a reminder every cooldown_s while firing.

boolean
state
required

Current state.

string
Allowed values: ok firing no_data
updated_at
required

Last change.

string format: date-time

Example

{
"condition": {
"aggregation": "avg",
"comparator": "gt",
"metric": "error_rate",
"target": "trace",
"window": "1m"
},
"state": "ok"
}

The request is malformed or a filter is invalid.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

No credentials, or the credentials are invalid.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

The credentials do not allow this operation, or the organization’s plan does not include it (code plan_required).

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

The resource does not exist.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

Too many requests.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}