Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

MicroSkills Reference

Alert Rule Validate

observability.alert_rule_validate

ProductionBounded custom (Class B)Deterministicstrictfastv1.0.0
No network

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

Note
Validates a provider-neutral threshold alert rule and reports contradictions as diagnostics.

Non-goals

  • Does not query metrics
  • Does not validate PromQL or vendor DSL
  • Does not create or fire alerts

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

validation

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input64 KB

How we handle your data

Sensitive output possible
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.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
metricstringYesMetric identifier, 1 through 129 characters; runtime accepts at most 128. Not PromQL.
aggregationstringYesSUM, AVG, MIN, MAX, LAST or COUNT.
operatorstringYesGT, GTE, LT, LTE or EQ.
thresholdnumberYesFinite threshold compared with the aggregated metric.
windowSecondsintegerYesLookback window in seconds, 1 through 86401; runtime accepts at most 86400.
evaluationEverySecondsintegerYesEvaluation cadence in seconds, 1 through 86401; runtime accepts at most 86400.
forSecondsintegerNoPending period in seconds, 0 through 86401; omit it for 0.
missingDatastringNoBREACHING, NOT_BREACHING or IGNORE; omit it for NOT_BREACHING.
labelsobjectNoOptional string labels on the rule; omit it for none — unconstrained RFC 8259 JSON items are not used; values are strings.
notificationsarrayNoDestinations, 0 through 17 closed {channel, destination} objects; runtime accepts at most 16. Omit it for none.
baselinestringNoPublished ruleset baseline; omit it for STANDARD.

Output schema

FieldTypeRequiredDescription
validbooleanYesTrue when no ERROR diagnostic was produced.
baselinestringYesRuleset baseline that was actually applied.
rulesetVersionstringYesPinned Squillify alert-rule ruleset identifier.
evaluationWindowRationumberYesevaluationEverySeconds divided by windowSeconds, rounded to six decimals.
forEvaluationRationumberYesforSeconds divided by evaluationEverySeconds, rounded to six decimals.
diagnosticsarrayYesDeterministically ordered closed {code, severity, message, path} diagnostics, 0 through 32 entries.
notificationCountintegerYesHow many notification destinations were accepted.
labelCountintegerYesHow many labels were accepted.

API contract

POST /v1/execute
curl
curl -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"}]}}'
Integrations
TypeScript SDK
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

CodeHTTPRetryableDescription
VALIDATION_ERROR400NoThe request payload failed schema validation.
UNAUTHORIZED401NoMissing or invalid API key.
SKILL_NOT_ACCESSIBLE403NoThe API key is not granted access to this skill.
SKILL_NOT_AVAILABLE_FOR_PLAN403NoThis skill is not included in your current plan.
PLAN_ELIGIBILITY_UNAVAILABLE503YesPlan eligibility could not be decided. Retry after backoff.
SKILL_NOT_FOUND404NoThe requested skill or version does not exist.
TENANT_RATE_LIMITED429YesRequest rate limit exceeded. Retry after backoff.
QUOTA_EXCEEDED429YesPlan quota exhausted. Retryable once the quota period resets.
EXECUTION_TIMEOUT504YesExecution exceeded the allowed time budget.
OBS_ALERT_RULE_INVALID400NoThe request payload failed this skill's input validation.
OBS_ALERT_RULE_LIMIT_EXCEEDED429NoA size, quota, rate, or time limit was exceeded.

Other limits

LimitValue
Recommended inline bytes32 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)

Request bodyjson
{
  "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

Inputjson
{
  "metric": "http_requests_total",
  "threshold": 100,
  "aggregation": "SUM",
  "evaluationEverySeconds": 15,
  "operator": "GT",
  "notifications": [
    {
      "destination": "sre-oncall",
      "channel": "PAGER"
    }
  ],
  "windowSeconds": 60
}
Expected outputjson
{
  "labelCount": 0,
  "valid": true,
  "diagnostics": [],
  "evaluationWindowRatio": 0.25,
  "rulesetVersion": "alert-rule-v1",
  "notificationCount": 1,
  "baseline": "STANDARD",
  "forEvaluationRatio": 0
}
Tip
A finite threshold and at least one destination produce valid true.

Evaluating every 30 seconds over a 10-second window is an error

Inputjson
{
  "metric": "http_requests_total",
  "threshold": 1,
  "aggregation": "AVG",
  "evaluationEverySeconds": 30,
  "operator": "GT",
  "notifications": [
    {
      "destination": "[email protected]",
      "channel": "EMAIL"
    }
  ],
  "windowSeconds": 10
}
Expected outputjson
{
  "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
}
Tip
The cadence cannot be longer than the lookback window.
  • Lint a threshold alert before a vendor adapter writes it
  • Catch evaluation-versus-window contradictions

Avoid for

  • Authoring PromQL
  • Choosing an optimal threshold

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.

Tags

validationobservability