Skip to content

perf(mcp): speed up list_metrics and give metric discovery tools a 30s budget - #3260

Merged
kodiakhq[bot] merged 10 commits into
mainfrom
brandon/mcp-metrics-timeouts
Oct 8, 2026
Merged

kodiakhq[bot] merged 10 commits into
mainfrom
brandon/mcp-metrics-timeouts

Conversation

@brandon-pereira

@brandon-pereira brandon-pereira commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Why

clickstack_list_metrics often hit its 10s wall clock and returned an error with no results. clickstack_describe_metric had the same 10s cap. The other MCP query tools allow 30s (max_execution_time: 30, MCP_REQUEST_TIMEOUT = 32_000).

What changed

list_metrics

  • Names-only scan. The per-kind query used to aggregate anyLast(MetricUnit) and anyLast(MetricDescription) over every point in the 24h window. Reading those String columns was most of the bytes read. The scan now reads only MetricName and TimeUnix.
  • Unit and description only for the returned page. A second query runs WHERE MetricName IN (page) … LIMIT 1 BY MetricName LIMIT n. The outer LIMIT lets ClickHouse stop as soon as every name has a row. This step is best effort: if it fails or times out, names come back without unit/description. The row it picks is arbitrary, which matches the anyLast behaviour it replaces.
  • Kinds run in parallel. The call returns as soon as the page is decided, and queries for kinds that can no longer add to the page are aborted (cancel_http_readonly_queries_on_client_close is already on by default). Before, kinds ran one after another.
  • Partial results on timeout. The name scan gets the budget minus a 4s reserve for enrichment. Kinds still running at that point are listed in partialFailure as timed out, and the kinds that finished are returned. Before, the whole call returned an error.
  • Pagination fix. If one kind filled the page exactly and later kinds had names, no nextCursor was returned, so those kinds were dropped. A cursor is now returned in that case.
  • Budgets. Wall clock goes from 10s to 30s. The names query cap goes from 8s to 24s, and the enrichment cap is 3s. Both keep timeout_overflow_mode: 'break'.
  • The tool span now carries mcp.list_metrics.kinds_scanned, kinds_failed, kinds_timed_out and result_count.

describe_metric

  • Wall clock goes from 10s to 30s. The attribute-key and value-sampling queries run back to back, so the per-query cap goes from 8s to 14s. Both stages still return partial results in break mode before the wall clock fires. The old cap was already too high: two 8s stages added up to more than the 10s limit.

Measurements (local, ClickHouse 26.8)

The local dev data is too small to show a difference, so I measured on a synthetic gauge table with the OTel schema: 60M rows, 3,000 metric names, 200 services, 48h of data. The query used a 24h window and the default page size (51 rows). Numbers are the fastest of 3 runs, taken from system.query_log.

Query Duration Bytes read
Old per-kind query (anyLast unit + description) 457 ms 4.62 GiB
New names-only scan 104 ms 505 MiB
New unit/description for the page (LIMIT 1 BY + LIMIT) 13 ms 4.9 MiB
Same, with argMax instead (rejected) 207 ms 805 MiB
Old query with namePattern 361 ms 2.46 GiB
New names-only scan with namePattern 102 ms 380 MiB

That is about 9x fewer bytes read per kind and about 3.5x less ClickHouse time. Parallel kinds help further when the first kinds are small or empty, for example sparse namePattern matches or empty exponential histogram or summary tables.

agent_docs/query_optimizations.md, which the task pointed to, does not exist in the repo, so it was not consulted.

Trade-offs

  • Running kinds in parallel means a call can briefly have up to 5 queries in flight. Those that can no longer add to the page are cancelled as soon as the earlier kinds settle.
  • break mode on the names scan can still return a partial name set when the cap is hit. This was already true before this change.

Tests

  • New unit tests in listMetricsPage.test.ts cover page assembly, cursors (including the exact-fill case), kinds running in parallel, early abort, and partial results at the deadline.
  • New integration tests in sources.int.test.ts cover paging through every kind with limit: 1 without repeats or gaps, and unit/description coming back in the response.
  • make dev-int FILE=sources.int passes (142 tests), and yarn ci:unit src/mcp passes (379 tests).

🤖 Generated with Claude Code

…s budget

list_metrics timed out on 19% of production calls at its 10s cap. The
per-kind query aggregated MetricUnit/MetricDescription across every point in
the window, and kinds ran one after another.

- Scan names only (MetricName + TimeUnix), then fetch unit/description for
  the returned page with LIMIT 1 BY + LIMIT so ClickHouse stops early.
- Scan kinds in parallel; resolve once the page is decided and abort the
  rest. Kinds still running at the deadline are reported in partialFailure
  and finished kinds are returned.
- Emit a cursor when a kind exactly fills the page and later kinds have
  names (previously the remaining kinds were dropped).
- Raise list_metrics and describe_metric wall clocks to 30s to match the
  other MCP query tools, scaling per-query caps (break mode) to fit.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hyperdx-oss Ready Ready Preview Oct 8, 2026 5:16pm UTC
hyperdx-storybook Ready Ready Preview Oct 8, 2026 5:16pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 859c996

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@hyperdx/api Patch
@hyperdx/app Patch
@hyperdx/otel-collector Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added the review/tier-3 Standard — full human review required label Oct 1, 2026
@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

🟡 Tier 3 — Standard

Introduces new logic, modifies core functionality, or touches areas with non-trivial risk.

Why this tier:

  • Diff size: 979 production lines changed (Tier 2 max: < 250)

Review process: Full human review — logic, architecture, edge cases.
SLA: First-pass feedback within 1 business day.

Stats
  • Production files changed: 9
  • Production lines changed: 979 (+ 284 in test files, excluded from tier calculation)
  • Branch: brandon/mcp-metrics-timeouts
  • Author: brandon-pereira

To override this classification, remove the review/tier-3 label and apply a different review/tier-* label. Manual overrides are preserved on subsequent pushes.

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Duplicate code analysis

No new duplicate code introduced by this PR.


jscpd compared this branch against origin/main
across app, api and common-utils. Only new clones are listed; the codebase
currently holds 125 in total (1.75%).
Run yarn dupes locally to reproduce, or yarn dupes:all for the full picture.

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

PR Review

If you are a coding agent acting for the author, read this first.
Nothing below blocks merge automatically; a maintainer decides. What they will expect:

  • 🔴 critical or 🟠 major in code this PR adds or changes: fix before asking for review.
  • 🔵 minor in code this PR changes: your call. Fix if small, otherwise reply.
  • Anything about surrounding code, or asking you to widen the change (hoist a helper,
    dedupe with another file, fix other call sites): never fix here, whatever the
    severity. Reply with one sentence; if it is critical, say so plainly so a human sees it.

One commit per review round. After two rounds, stop and ask a maintainer to review
scope rather than addressing more automated findings. Full rule: AGENTS.md.

3 finding(s): 🔴 0 critical · 🟠 0 major · 🔵 3 minor

1 posted as inline comment(s) on the changed lines. 2 listed below.

Findings outside the changed lines

2 minor
  • 🔵 packages/api/src/mcp/tools/sources/listMetrics.ts:266 — Following a cursor from an exact-fill page can return an empty page with a 'No metrics matched' hint → When one kind fills the page exactly, assembleMetricsPage returns early with next: { kind: <pending kind> } before that kind's scan finishes. If that kind and every later kind turn out to be empty, the next call returns metrics: [] with the 'No metrics matched. Try widening the time window…' hint, and the agent may then widen the window for no reason. Skip that hint when cursor was provided, and return a short end-of-results note instead.
  • 🔵 packages/api/src/mcp/tools/sources/listMetricsQueries.ts:320 — enrichEntries fallback paths have no test → The only coverage for enrichEntries is the int-test happy path. Its best-effort behaviour has no test: racing the lookups against the abort signal, returning names only on timeout, and the per-kind catch that falls back to an empty map. Add unit tests with a stubbed metadata.getColumns and clickhouseClient.query. One should hang until the signal aborts and check that the entries come back unchanged. Another should reject for one kind only and check that the other kinds are still enriched.

Severity is the reviewer's own estimate and is used for ordering, not filtering. No finding blocks merge automatically; a maintainer decides.

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Refactors metric discovery queries for performance.

The PR appears safe to merge; no outstanding findings or new actionable issues remain.

Summary

This PR changes metric discovery to scan names by kind in parallel, enrich only the returned page, and use a 30-second budget for metric discovery tools.

  • Adds cursor and partial-result handling for incomplete kind scans.
  • Adds unit and integration coverage for pagination, timeouts, and enrichment.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Request[Metric listing request] --> Scans[Parallel kind name scans]
  Scans --> Page[Assemble ordered page and cursor]
  Page --> Enrich[Best-effort unit and description lookup]
  Enrich --> Response[Metrics and partial failures]
Loading

Reviews (10) · Last reviewed commit: "Merge branch 'main' into brandon/mcp-met..." · Reviewed by Greptile

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Deep Review

✅ No critical issues found. No P0/P1 ship-blockers survived verification. The pagination, timeout/abort, and enrichment logic is sound, and all five prior bot review comments (timed-out-kind cursor, full-page cursor, large-page enrichment, schema-lookup discard, file size) were confirmed addressed by the current code. The findings below are recommended hardening and test-coverage items.

🟡 P2 — recommended

  • packages/api/src/mcp/tools/sources/listMetricsPage.ts:67 — When a leading kind times out at the scan deadline and a later kind overflows the page, the response emits a nextCursor pointing at the later kind while the timed-out kind is only recorded in partialFailure, so following the cursor forward never re-scans that kind and its names are unreachable except via a from-scratch retry.
    • Fix: When a kind is skipped-forward due to timeout, suppress the forward nextCursor (forcing a cursorless retry) or encode the skipped kind in the cursor so the next page re-scans it before advancing.
    • adversarial, correctness, reliability, kieran-typescript
  • packages/api/src/mcp/tools/sources/listMetricsQueries.ts:195 — The new enrichEntries helper has no unit coverage for its abort-race path (returns names-only when the signal fires), its per-kind getColumns/query catch fallback, or its (kind, name)-keyed merge, so a regression that awaits lookups directly or mis-keys the merge would pass CI silently.
    • Fix: Add unit tests mocking clickhouseClient.query and metadata.getColumns for the aborted, per-kind-failure, and schema-without-unit/description cases, asserting returned entries.
    • testing, kieran-typescript
  • packages/api/src/mcp/__tests__/listMetricsQueries.test.ts:4 — The one fetchMetricNames test is titled "throws on the ClickHouse cap instead of returning a truncated name set" but mocks a successful resolve and only asserts the clickhouse_settings object, so the timeout_overflow_mode: 'throw' behavior that is the point of the change is never exercised.
    • Fix: Add a case where query() rejects (simulating the cap) and assert fetchMetricNames propagates the rejection rather than returning a short set.
    • testing
  • packages/api/src/mcp/__tests__/sources.int.test.ts — No tool-level test covers the partial-results-on-timeout wiring in listMetricsImpl (the deadlineAt - ENRICH_RESERVE_MS budget split, partialFailure surfacing, resumable nextCursor, and kinds_timed_out span attribute), including the cursor-skip edge above.
    • Fix: Add a test (unit over listMetricsImpl with an injected slow fetch, or integration with a short deadline) asserting finished kinds are returned, partialFailure lists the timed-out kind, and the cursor behavior is correct.
    • testing, correctness, reliability
🔵 P3 nitpicks (6)
  • packages/api/src/mcp/tools/sources/listMetricsQueries.ts:116 — fetchMetricUnitsAndDescriptions and describeMetric.ts's fetchUnitAndDescription read the same MetricUnit/MetricDescription columns with divergent query shapes and caps, which can silently drift on a schema change.
    • Fix: Consolidate on one shared chSql builder, or add a cross-reference comment on each explaining why two shapes are deliberate.
  • packages/api/src/mcp/tools/sources/listMetrics.ts:41 — NAMES_MAX_EXEC_SECONDS = 28 is hand-coupled to the invariant that it must exceed (LIST_TIMEOUT_MS - ENRICH_RESERVE_MS)/1000, with no enforcement, so changing either budget silently breaks the comment's stated guarantee.
    • Fix: Derive the constant from the budgets or add a dev-time assertion.
  • packages/api/src/mcp/tools/sources/listMetrics.ts:224 — The - 500 reserve in AbortSignal.timeout(Math.max(0, deadlineAt - Date.now() - 500)) is an unnamed magic number.
    • Fix: Extract a named constant with a one-line comment on its relationship to the other reserves.
  • packages/api/src/mcp/tools/sources/listMetricsPage.ts:135 — The scanKindsForPage promise executor has no reject path, so a synchronous throw in fetchNames or assembleMetricsPage would only be bounded by the outer wall-clock timeout rather than surfacing as a kind error.
    • Fix: Wrap tryFinish/the fetchNames call so a synchronous throw resolves as a kind error.
  • packages/api/src/mcp/tools/query/helpers.ts:260 — The new defaultLookbackMs parameter on parseTimeRange (used with the 24h metric lookback) has no test.
    • Fix: Add a case asserting an omitted startTime honors the custom lookback window.
  • packages/api/src/mcp/tools/sources/listMetricsQueries.ts:193 — The same MetricName existing under two kinds (each needing its own unit/description) is handled correctly by the (kind, name) merge but is not exercised by any test.
    • Fix: Seed one metric name under two kinds and assert each entry gets its kind's own metadata.

Reviewers (10): correctness, adversarial, reliability, performance, security, kieran-typescript, testing, maintainability, project-standards, previous-comments.

Notes: describeMetric.ts (778 lines) and query/helpers.ts (971 lines) exceed the repo's 300-line guideline but are pre-existing and not introduced by this diff (which reduced describeMetric.ts and left helpers.ts effectively untouched); listMetrics.ts/listMetricsPage.ts were split back under the limit. The UNSAFE_RAW_SQL name inlining in listMetricsQueries.ts is safe as written — names are sourced from ClickHouse's own MetricName column and SqlString.escape covers ClickHouse quote/backslash escaping — but it is the lone hand-escaped SQL sink, so keep it guarded by a regression test if names with quotes become possible.

Testing gaps:

  • enrichEntries abort-race, per-kind failure fallback, and same-name-across-kinds merge are unit-untested.
  • fetchMetricNames throw-on-cap behavior is asserted only by a settings-object match, never by an actual rejection.
  • The tool-level partial-results-on-timeout path (budget split, partialFailure, resumable cursor, span attributes) has no end-to-end coverage.
  • describeMetric's budget/lookback changes (10s→30s, 8s→14s per stage, 24h default window) have no asserting test.

No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

E2E Test Results

✅ All tests passed • 407 passed • 1 skipped • 1505s

Status Count
✅ Passed 407
❌ Failed 0
⚠️ Flaky 0
⏭️ Skipped 1

Tests ran across 4 shards in parallel.

View full report →

… pages

- End the page at a timed-out kind and resume the cursor there (greptile P1)
- Return a full page immediately with a cursor to the next non-empty kind (greptile P1)
- Race unit/description enrichment, including getColumns, against the deadline (greptile P1)
- Inline page names as escaped literals instead of one bind param each (greptile P2)
- Resolve immediately when there are no kinds to scan (deep-review P0)
- Bring api lint warnings back under the ceiling; add changeset
Keeps listMetricsPage.ts under the 300-line limit (greptile P2) and shares
one ClickHouse query helper between the name scan and enrichment queries,
removing the duplicated block jscpd flagged.
signal: AbortSignal;
}): Promise<Map<string, { unit?: string; description?: string }>> {
const enrichments = new Map<
string,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 minor — Batch unit/description lookup duplicates describeMetric's fetchUnitAndDescription; error cleanup duplicates sanitizeFetchError

describeMetric.ts:171 fetchUnitAndDescription builds the same hasUnit/hasDescription projection over the same bounded scan for a single name. describeMetric.ts:143 sanitizeFetchError is the same replace(/\s+/g,' ').trim().slice(0,200) that listMetricsPage.ts:142 inlines. Have describeMetric call fetchMetricUnitsAndDescriptions({ names: [metricName] }), and move sanitizeFetchError into a shared module that both files import.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

Keeps listMetricsPage free of tool-module imports (review bot minor).
…meRange

- Move the input schema and cursor helpers to listMetricsSchema.ts
- Move enrichEntries next to the queries it runs in listMetricsQueries.ts
- Share parseTimeRange between list_metrics and describe_metric (jscpd clone)

Addresses the greptile file-size finding.
…cated

The names scan used timeout_overflow_mode 'break' with a 24s cap, below the
26s scan deadline, so ClickHouse could return a partial name set that looked
complete and the cursor skipped names never read. Raise the cap above the
deadline and throw on overflow so the kind is reported in partialFailure
and the cursor resumes at it (review bot major).

@karl-power karl-power left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just had one question here

…mes out

End the page at a timed-out kind only when it already has entries; otherwise
record it in partialFailure and continue, so a call never returns the cursor
it was given (review bot major). Drop ASCII section dividers (greptile P2).

const projections = [
chSql`MetricName`,
...(hasUnit ? [chSql`${{ Identifier: 'MetricUnit' }}`] : []),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 minor — Unit/description lookup now exists twice, with different query strategies

fetchUnitAndDescription in describeMetric.ts:147 still uses a 100k-row anyLast subquery for the same columns. The PR measured that approach as slower than the new LIMIT 1 BY query. Export fetchMetricUnitsAndDescriptions and have describeMetric call it with names: [metricName], so there is one implementation.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

…int ceiling

- Reuse parseTimeRange from mcp/tools/query/helpers with a defaultLookbackMs
  argument instead of a second copy (review bot minor)
- Share a NumberMetricPoint type between the gauge and sum fixtures (jscpd)
- Type fetchMetricNames' client as Pick<ClickhouseClient, 'query'> so its test
  needs no cast, keeping api lint at the 302-warning ceiling after merging main
connectionId: string;
names: string[];
startDate: Date;
endDate: Date;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 minor — New unit/description lookup duplicates fetchUnitAndDescription in describeMetric.ts

describeMetric.ts:150 (fetchUnitAndDescription) already does this lookup for one name: same projections built from hasUnit/hasDescription, same time filter, same empty-string stripping. Export fetchMetricUnitsAndDescriptions and have describeMetric call it with [input.metricName], so the two tools share one query and can't drift apart. Today they pick their row differently (LIMIT 1 BY here vs anyLast over a 100k-row sample there).

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

logger.warn(
{ kinds },
'Timed out fetching metric unit/description; returning names only',
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 minor — No test for enrichEntries' best-effort fallback paths

Nothing tests the new fallback logic: the race against the abort signal when metadata.getColumns is slow, the per-kind catch that returns an empty map, and the merge by kind. The only test that touches enrichment is the happy-path integration test. Add unit tests with a stub metadata.getColumns that never resolves (or a pre-aborted signal), plus a failing query. Assert that the entries come back unchanged and the call doesn't hang.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

maxExecutionSeconds: number;
signal: AbortSignal;
}): Promise<Map<string, { unit?: string; description?: string }>> {
const enrichments = new Map<

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 minor — Batch unit/description lookup duplicates describeMetric's fetchUnitAndDescription

fetchMetricUnitsAndDescriptions now does the same lookup as fetchUnitAndDescription in packages/api/src/mcp/tools/sources/describeMetric.ts:150: same column-presence flags, same WHERE clause, and the same filtering of empty unit and description values. The only difference is the query shape (LIMIT 1 BY here, an anyLast over a 100k-row sample there). Export the batch helper and have describeMetric call it with names: [metricName]. That leaves one implementation, and describeMetric also gets the cheaper query.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

@kodiakhq
kodiakhq Bot merged commit cf5b831 into main Oct 8, 2026
29 checks passed
@kodiakhq
kodiakhq Bot deleted the brandon/mcp-metrics-timeouts branch October 8, 2026 17:21
kodiakhq Bot pushed a commit that referenced this pull request Oct 9, 2026
## Summary

MCP tools each hand-rolled their own wall-clock timeout: an `AbortController`, one or two `setTimeout`s, a `Promise.race`, and either a marker error (`DESCRIBE_METRIC_TIMEOUT`, `LIST_METRICS_TIMEOUT`) or a sentinel symbol to detect the timeout. They now share `runWithTimeout` in `mcp/utils/timeout.ts`, and the 30s ClickHouse cap comes from one constant instead of literal `30`s scattered across tools. Each tool keeps its own budget.

Resolves HDX-5606. Follow-up to #3260 (comment).

`runWithTimeout(work, { timeoutMs, graceMs })`:
- aborts the signal passed to `work` at `timeoutMs`, and stops waiting `graceMs` later — work that returns partial results after the abort keeps them (what `describe_source` needs)
- a rejection after the abort counts as a timeout; one before it is rethrown
- always aborts the signal on exit, so no query outlives the call

| Caller | Budget | Grace |
|---|---|---|
| `clickstack_describe_source` | 30s | 2s |
| `clickstack_describe_metric` | 30s | – |
| `clickstack_list_metrics` | 30s | – |
| `query_tiles` `withDeadline` (per tile, shared batch deadline) | remaining of 60s | – |
| `list_sources` metric-name preview | 3s | – |

`MCP_CLICKHOUSE_SETTINGS`, `MCP_REQUEST_TIMEOUT` (30s + 2s), and the `max_execution_time` in `denoise`, `runEventPatterns`, and `eventDeltas` now derive from the shared constants.

Not converted: `scanKindsForPage` (its deadline finalizes a page rather than cancelling work) and the per-query ClickHouse caps (14s/28s/3s/2.5s), which are tuned per tool.

**Behavior change:** `describe_source`, `describe_metric`, `list_metrics`, and the `list_sources` preview now abort their signal on every exit, not only on timeout. `withDeadline` already did this.

## Test plan

- New `timeout.test.ts` covers success, abort at the deadline, partial results in the grace window, the backstop, and rejections before/after the abort
- Existing `describeSourceTimeout`, `withDeadline`, and `listMetrics*` unit tests pass unchanged
- `sources`, `queryTiles`, and `deltasTool` integration suites pass

This branch was successfully deployed

2 active deployments
Preview – hyperdx-oss — 859c9966 Deployed Oct 8, 2026 by vercel[bot]
Preview – hyperdx-storybook — 859c9966 Deployed Oct 8, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge review/tier-3 Standard — full human review required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants