Metrics Window Summary
observability.summarize_metrics_window
Overview
You send samples and a window and we return the count, the extremes, the mean, the sum and six percentiles, every figure rounded once at your declared scale. The window is half-open, so a sample exactly on the start counts and one exactly on the end does not, which is what makes a row of adjacent windows add up to their union. Samples outside the window are excluded and counted rather than refused, so an overshooting slice still gets an answer that says so. The interpolation method is echoed, so a stored summary is reproducible in a spreadsheet without reading anything else.
Percentiles are where two teams quietly disagree: one interpolates, one picks the nearest rank, one rounds before comparing, and the numbers stop matching. This publishes the method and echoes it with every answer.
Reliability
Fully deterministic and clock-free, and the summation order is fixed ascending so a shuffled request and a sorted one give byte-identical answers. The empty set returns nulls rather than zeros, and a single sample makes every percentile equal to it. Failures, none worth retrying unchanged: OBS_METRICS_SAMPLES_INVALID means samples was absent, was not an array, or an entry was not an object carrying t and v. OBS_METRICS_SAMPLE_LIMIT_EXCEEDED means more than 50000 samples arrived, so split the window and summarise each part. OBS_METRICS_SAMPLE_NON_FINITE means a value was a not-a-number or an infinity, and the answer names its index; JSON cannot carry either, so publishing one is not an option. OBS_METRICS_TIMESTAMP_INVALID means a timestamp was absent, unparseable or carried no offset, and the answer names its position. OBS_METRICS_OFFSET_MIXED means the set mixed offsets under REQUIRE_UNIFORM or carried a non-UTC one under REQUIRE_UTC, with both positions named. OBS_METRICS_WINDOW_INVALID means end was not after start or the span fell outside 1 millisecond to 366 days. OBS_METRICS_SCALE_INVALID means scale fell outside 0 to 12. OBS_METRICS_OPTION_UNSUPPORTED means a property or an offset policy is not one we accept.
Context footprint
The answer is one fixed-shape summary whatever the sample count, so 50000 samples cost the same context as five. A successful call costs 2 execution credits.
When to use it
When you hold timestamped numbers and want defensible extremes, a mean and percentiles over a stated window.
When you need grouping, resampling, gap filling or a verdict against an objective.
Scope
Non-goals
- Does not group rows, which data.aggregate answers
- Does not resample, convert to a rate or fill a gap
- Does not interpolate between samples — a missing sample stays missing
- Does not fetch or store a metric, and reads no clock
- Does not accept a caller-chosen percentile; the six are fixed
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 |
|---|---|---|---|
| samples | array | Yes | Samples, 0 to 50000 closed {t, v} objects; an empty array returns the empty summary rather than a failure. |
| window | object | Yes | Closed half-open window [start, end) as ISO-8601 instants with explicit offsets. |
| series | string | No | Label of 1 to 128 code points echoed back untouched; omit it and the answer carries JSON null. |
| scale | integer | No | Decimal places from 0 through 12; omit it for 6. |
| offsetPolicy | string | No | Offset mixing rule; omit it for REQUIRE_UNIFORM. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| series | string | Yes | The label you sent, echoed verbatim so a stored summary still names which series it measured; JSON null when you sent none. |
| window | object | Yes | Parsed window as we applied it, with the inclusivity literal and durationSeconds added so two summaries can be compared knowing they cover the same interval. |
| count | integer | Yes | In-window samples with a value. |
| nullCount | integer | Yes | In-window samples whose value was JSON null. |
| empty | boolean | Yes | True when no in-window sample carried a value. |
| min | number | Yes | Smallest in-window value at your scale, or JSON null on an empty set. |
| max | number | Yes | Largest in-window value at your scale, or JSON null on an empty set. |
| mean | number | Yes | Arithmetic mean at your scale, or JSON null on an empty set. |
| sum | number | Yes | Total at your scale, or JSON null on an empty set. |
| percentiles | object | Yes | Closed percentile set p50, p75, p90, p95, p99 and p99_9, each at your scale or JSON null on an empty set. |
| lowResolutionPercentiles | array | Yes | Percentile keys determined by fewer than two distinct order statistics, 0 to 6 strings. |
| interpolation | string | Yes | Always LINEAR_ORDER_STATISTIC_TYPE_7, echoed so a stored summary reproduces unaided. |
| outOfWindowCount | integer | Yes | Samples excluded because their timestamp fell outside the window. |
| scale | integer | Yes | Decimal places actually applied, echoed so figures can be compared with another summary honestly. |
| roundingMode | string | Yes | Always HALF_UP, the one rounding mode the platform publishes. |
| firstSampleAt | string | Yes | Earliest in-window valued sample, or JSON null on an empty set. |
| lastSampleAt | string | Yes | Latest in-window valued sample, or JSON null on an empty set. |
| sampleCoverageSeconds | integer | Yes | Whole seconds between the first and last valued sample, or JSON null on an empty set. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"observability.summarize_metrics_window","input":{"samples":[{"t":"2026-07-29T10:00:00Z","v":10}],"window":{"start":"2026-07-29T10:00:00Z","end":"2026-07-29T10:05:00Z"}}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("observability.summarize_metrics_window", {"series":"http.server.duration","window":{"start":"2026-07-29T10:00:00Z","end":"2026-07-29T10:05:00Z"},"samples":[{"v":10,"t":"2026-07-29T10:00:00Z"},{"v":20,"t":"2026-07-29T10:01:00Z"},{"v":30,"t":"2026-07-29T10:02:00Z"},{"v":40,"t":"2026-07-29T10:05:00Z"}]});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_METRICS_SAMPLES_INVALID | 400 | No | The request payload failed this skill's input validation. |
| OBS_METRICS_SAMPLE_LIMIT_EXCEEDED | 429 | No | A size, quota, rate, or time limit was exceeded. |
| OBS_METRICS_SAMPLE_NON_FINITE | 400 | No | The request payload failed this skill's input validation. |
| OBS_METRICS_TIMESTAMP_INVALID | 400 | No | The request payload failed this skill's input validation. |
| OBS_METRICS_OFFSET_MIXED | 400 | No | The request payload failed this skill's input validation. |
| OBS_METRICS_WINDOW_INVALID | 400 | No | The request payload failed this skill's input validation. |
| OBS_METRICS_SCALE_INVALID | 400 | No | The request payload failed this skill's input validation. |
| OBS_METRICS_OPTION_UNSUPPORTED | 400 | No | The skill does not support the requested variant. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not group rows, which data.aggregate answers
- Does not resample, convert to a rate or fill a gap
- Does not interpolate between samples — a missing sample stays missing
- Does not fetch or store a metric, and reads no clock
- Does not accept a caller-chosen percentile; the six are fixed
- Grouping rows by a key and reducing each group, which data.aggregate answers
- Deciding whether an objective was met, which observability.calculate_sli answers
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "observability.summarize_metrics_window",
"input": {
"series": "http.server.duration",
"window": {
"start": "2026-07-29T10:00:00Z",
"end": "2026-07-29T10:05:00Z"
},
"samples": [
{
"v": 10,
"t": "2026-07-29T10:00:00Z"
},
{
"v": 20,
"t": "2026-07-29T10:01:00Z"
},
{
"v": 30,
"t": "2026-07-29T10:02:00Z"
},
{
"v": 40,
"t": "2026-07-29T10:05:00Z"
}
]
}
}Examples
Four samples, one of them out of the window
{
"series": "http.server.duration",
"window": {
"start": "2026-07-29T10:00:00Z",
"end": "2026-07-29T10:05:00Z"
},
"samples": [
{
"v": 10,
"t": "2026-07-29T10:00:00Z"
},
{
"v": 20,
"t": "2026-07-29T10:01:00Z"
},
{
"v": 30,
"t": "2026-07-29T10:02:00Z"
},
{
"v": 40,
"t": "2026-07-29T10:05:00Z"
}
]
}{
"lowResolutionPercentiles": [
"p75",
"p90",
"p95",
"p99",
"p99_9"
],
"count": 3,
"max": 30,
"firstSampleAt": "2026-07-29T10:00:00Z",
"sum": 60,
"outOfWindowCount": 1,
"percentiles": {
"p50": 20,
"p75": 25,
"p90": 28,
"p95": 29,
"p99": 29.8,
"p99_9": 29.98
},
"sampleCoverageSeconds": 120,
"scale": 6,
"series": "http.server.duration",
"interpolation": "LINEAR_ORDER_STATISTIC_TYPE_7",
"empty": false,
"roundingMode": "HALF_UP",
"lastSampleAt": "2026-07-29T10:02:00Z",
"min": 10,
"nullCount": 0,
"mean": 20,
"window": {
"start": "2026-07-29T10:00:00Z",
"end": "2026-07-29T10:05:00Z",
"inclusivity": "[start,end)",
"durationSeconds": 300
}
}A single sample, where every percentile is that sample
{
"series": "http.server.duration",
"window": {
"start": "2026-07-29T10:00:00Z",
"end": "2026-07-29T10:05:00Z"
},
"samples": [
{
"v": 42,
"t": "2026-07-29T10:00:00Z"
}
]
}{
"lowResolutionPercentiles": [
"p50",
"p75",
"p90",
"p95",
"p99",
"p99_9"
],
"count": 1,
"max": 42,
"firstSampleAt": "2026-07-29T10:00:00Z",
"sum": 42,
"outOfWindowCount": 0,
"percentiles": {
"p50": 42,
"p75": 42,
"p90": 42,
"p95": 42,
"p99": 42,
"p99_9": 42
},
"sampleCoverageSeconds": 0,
"scale": 6,
"series": "http.server.duration",
"interpolation": "LINEAR_ORDER_STATISTIC_TYPE_7",
"empty": false,
"roundingMode": "HALF_UP",
"lastSampleAt": "2026-07-29T10:00:00Z",
"min": 42,
"nullCount": 0,
"mean": 42,
"window": {
"start": "2026-07-29T10:00:00Z",
"end": "2026-07-29T10:05:00Z",
"inclusivity": "[start,end)",
"durationSeconds": 300
}
}Recommended use cases
- Get p95 and p99 for a five-minute slice of latency samples you already hold
- Compare two adjacent windows knowing the boundary rule cannot double-count
Avoid for
- Grouping rows by a key and reducing each group, which data.aggregate answers
- Deciding whether an objective was met, which observability.calculate_sli answers
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.