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

Get an online rule

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

Any project member can read.

project
required
string

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

id
required
string format: uuid

Online rule id.

The rule.

Media typeapplication/json

An online rule. Spec 09 § Evaluation & alerts.

object
budget_period

Period of the budget. Present exactly when budget_usd is.

string
Allowed values: day month
budget_usd

Budget per period, in USD. Omitted when the rule has none.

number format: double
created_at
required

Creation time. JSON is RFC 3339.

string format: date-time
created_by

User who created the rule. Omitted when that user is unknown.

string format: uuid
dropped_last_hour
required

Live matches dropped by the hourly cap in the current UTC hour. Counted in memory, so 0 after a restart.

integer format: int64
enabled
required

Whether the rule runs.

boolean
evaluator_id
required

The evaluator the rule runs. Immutable.

string format: uuid
filter

Filter over the target’s view. Omitted when the rule has none.

string
id
required

Rule id.

string format: uuid
jobs_last_24h
required

Jobs of the rule created in the last 24 hours, by status.

object
done
required

Finished jobs with a score.

integer format: int64
failed
required

Jobs that failed for good.

integer format: int64
queued
required

Jobs waiting to run.

integer format: int64
running
required

Jobs running now.

integer format: int64
skipped
required

Jobs left out before they ran.

integer format: int64
name
required

Display name, 1 to 128 characters.

string
paused_at

When the rule was paused. Omitted when it is not paused.

string format: date-time
paused_detail

Detail of the pause: an error text or a fixed text. Never payload content.

string
paused_reason

Why the rule is paused. Omitted when it is not paused.

string
Allowed values: budget errors connection
sample_rate
required

Share of the matching targets that are evaluated, in (0, 1].

number format: double
spend

Budget spend of the current period. Omitted when the rule has no budget.

object
period_start
required

Start of the current UTC day or month.

string format: date-time
reserved_usd
required

Estimated cost of the running jobs, in USD.

number format: double
spent_usd
required

Cost of the finished jobs in the period, in USD.

number format: double
target
required

What the rule matches. Immutable.

string
Allowed values: trace span
updated_at
required

Last change time. JSON is RFC 3339.

string format: date-time
variable_mapping
required

Prompt variable to mapping expression.

object
key
additional properties
string

Example

{
"budget_period": "day",
"paused_reason": "budget",
"target": "trace"
}

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"
}