Alert Rule Validate
observability.alert_rule_validate
Overview
You send a metric identifier, aggregation, operator, finite threshold, window and evaluation cadence. metric is an identifier, never PromQL. Contradictions such as evaluation longer than the window, a missing destination, or a non-finite threshold become ERROR diagnostics; a for-period shorter than evaluation is a flapping WARNING. This does not create alerts or claim an optimal threshold. A successful call costs 1 execution credit.
Threshold alerts need a published contradiction check before a vendor adapter writes them.
Reliability
OBS_ALERT_RULE_INVALID — trigger: metric is not an identifier; retryable: no; next: send a name, not a query. OBS_ALERT_RULE_LIMIT_EXCEEDED — trigger: more than 16 labels or notifications, or windows above 86400 seconds; retryable: no; next: split the rule.
Context footprint
Metric names and destinations are identifiers only. A successful call costs 1 execution credit.
When to use it
When a caller already holds a metric identifier, window and destination list.
When the input is PromQL, or when a live query against a metrics backend is required.
Powered by Squillify's own alert-rule-v1 ruleset. No metrics engine is involved.
Scope
Non-goals
- Does not query metrics
- Does not validate PromQL or vendor DSL
- Does not create or fire alerts
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
How we handle your data
What this means
This skill may receive sensitive content and may return submitted, transformed, extracted, or reformatted content.
Squillify guarantees
- Runs inside Squillify
- This skill runs inside Squillify.
- Payloads are not sent to an external service by this skill.
- Squillify does not permanently store submitted payloads.
- Telemetry records metadata only, not submitted content.
- Submitted payloads are not used for training.
- Submitted payloads are not reviewed by humans.
- This skill does not target sensitive data.
- The response may contain submitted or transformed content.
Your responsibility
Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| metric | string | Yes | Metric identifier, 1 through 129 characters; runtime accepts at most 128. Not PromQL. |
| aggregation | string | Yes | SUM, AVG, MIN, MAX, LAST or COUNT. |
| operator | string | Yes | GT, GTE, LT, LTE or EQ. |
| threshold | number | Yes | Finite threshold compared with the aggregated metric. |
| windowSeconds | integer | Yes | Lookback window in seconds, 1 through 86401; runtime accepts at most 86400. |
| evaluationEverySeconds | integer | Yes | Evaluation cadence in seconds, 1 through 86401; runtime accepts at most 86400. |
| forSeconds | integer | No | Pending period in seconds, 0 through 86401; omit it for 0. |
| missingData | string | No | BREACHING, NOT_BREACHING or IGNORE; omit it for NOT_BREACHING. |
| labels | object | No | Optional string labels on the rule; omit it for none — unconstrained RFC 8259 JSON items are not used; values are strings. |
| notifications | array | No | Destinations, 0 through 17 closed {channel, destination} objects; runtime accepts at most 16. Omit it for none. |
| baseline | string | No | Published ruleset baseline; omit it for STANDARD. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| valid | boolean | Yes | True when no ERROR diagnostic was produced. |
| baseline | string | Yes | Ruleset baseline that was actually applied. |
| rulesetVersion | string | Yes | Pinned Squillify alert-rule ruleset identifier. |
| evaluationWindowRatio | number | Yes | evaluationEverySeconds divided by windowSeconds, rounded to six decimals. |
| forEvaluationRatio | number | Yes | forSeconds divided by evaluationEverySeconds, rounded to six decimals. |
| diagnostics | array | Yes | Deterministically ordered closed {code, severity, message, path} diagnostics, 0 through 32 entries. |
| notificationCount | integer | Yes | How many notification destinations were accepted. |
| labelCount | integer | Yes | How many labels were accepted. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"observability.alert_rule_validate","input":{"metric":"http_requests_total","aggregation":"SUM","operator":"GT","threshold":100,"windowSeconds":60,"evaluationEverySeconds":15,"notifications":[{"channel":"PAGER","destination":"sre-oncall"}]}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("observability.alert_rule_validate", {"metric":"http_requests_total","threshold":100,"aggregation":"SUM","evaluationEverySeconds":15,"operator":"GT","notifications":[{"destination":"sre-oncall","channel":"PAGER"}],"windowSeconds":60});Errors
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
| OBS_ALERT_RULE_INVALID | 400 | No | The request payload failed this skill's input validation. |
| OBS_ALERT_RULE_LIMIT_EXCEEDED | 429 | No | A size, quota, rate, or time limit was exceeded. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not query metrics
- Does not validate PromQL or vendor DSL
- Does not create or fire alerts
- Authoring PromQL
- Choosing an optimal threshold
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "observability.alert_rule_validate",
"input": {
"metric": "http_requests_total",
"threshold": 100,
"aggregation": "SUM",
"evaluationEverySeconds": 15,
"operator": "GT",
"notifications": [
{
"destination": "sre-oncall",
"channel": "PAGER"
}
],
"windowSeconds": 60
}
}Examples
A one-minute window with a pager destination is valid
{
"metric": "http_requests_total",
"threshold": 100,
"aggregation": "SUM",
"evaluationEverySeconds": 15,
"operator": "GT",
"notifications": [
{
"destination": "sre-oncall",
"channel": "PAGER"
}
],
"windowSeconds": 60
}{
"labelCount": 0,
"valid": true,
"diagnostics": [],
"evaluationWindowRatio": 0.25,
"rulesetVersion": "alert-rule-v1",
"notificationCount": 1,
"baseline": "STANDARD",
"forEvaluationRatio": 0
}Evaluating every 30 seconds over a 10-second window is an error
{
"metric": "http_requests_total",
"threshold": 1,
"aggregation": "AVG",
"evaluationEverySeconds": 30,
"operator": "GT",
"notifications": [
{
"destination": "[email protected]",
"channel": "EMAIL"
}
],
"windowSeconds": 10
}{
"labelCount": 0,
"valid": false,
"diagnostics": [
{
"code": "EVALUATION_LONGER_THAN_WINDOW",
"severity": "ERROR",
"message": "evaluationEverySeconds must not exceed windowSeconds.",
"path": "/evaluationEverySeconds"
}
],
"evaluationWindowRatio": 3,
"rulesetVersion": "alert-rule-v1",
"notificationCount": 1,
"baseline": "STANDARD",
"forEvaluationRatio": 0
}Recommended use cases
- Lint a threshold alert before a vendor adapter writes it
- Catch evaluation-versus-window contradictions
Avoid for
- Authoring PromQL
- Choosing an optimal threshold
Related skills
Composable with
Safety & privacy
- Runs without calling any external service.
- Your payloads are never stored permanently.
- Telemetry captures metadata only — never your payload contents.
- We never train models on your payloads.
- No human reviews your payloads.