Repository navigation
Add programmatic search endpoint for logs/traces - #2258
Conversation
🦋 Changeset detectedLatest commit: d92f5af The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
|
@vinzee is attempting to deploy a commit to the HyperDX Team on Vercel. A member of the Team first needs to authorize it. |
PR ReviewSolid implementation: well-scoped, well-tested (incl. cross-team isolation, semicolon/subquery rejection, pagination determinism), and the error mapping (ClickHouse user-input errors → 400, others → 500) is sensible. A few non-critical items worth tightening before merge:
No blocking bugs or security issues found. |
Deep Review🔴 P0/P1 -- must fix
🟡 P2 -- recommended
🔵 P3 nitpicks (8)
Reviewers (9): correctness, security, api-contract, reliability, adversarial, kieran-typescript, testing, maintainability, project-standards. Testing gaps:
|
2ef528f to
c894469
Compare
c894469 to
013eb62
Compare
|
@pulpdrew addressed all comments |
pulpdrew
left a comment
There was a problem hiding this comment.
Looking pretty good, a few more comments. Also there are some failing automated checks which should be address (linting, knip, and tests)
Introduce a new V2 API endpoint to query raw log and trace data. This allows users to search events programmatically using Lucene or SQL syntax, with support for column selection and pagination. Co-authored-by: Cursor <cursoragent@cursor.com>
013eb62 to
d4274f1
Compare
Summary
Motivation
The existing external API (
/api/v2/charts/series) only supports aggregated time-series queries. There is no REST API to retrieve individual log or trace rows - the only programmatic way to do this today is through the MCP tool (hyperdx_query displayType:"search"), which is scoped to LLM tooling and not usable from scripts, CI pipelines, or backend services.This change fills this gap by adding
POST /api/v2/search- a new external API endpoint for fetching raw log and trace rows programmatically using familiar HTTP semantics, without having to write raw ClickHouse SQL or manage a direct database connection.Implementation Details
The endpoint mirrors the "search" panel mode in the HyperDX UI and routes through the same runConfigTile execution path used by the hyperdx_query MCP tool (displayType: "search"), so it automatically inherits all the same query optimizations:
Also extends
runConfigTileto accept an offset option (previously hardcoded to 0) to support pagination.Screenshots or video
N/A - API-only change, no UI impact.
How to test
GET /api/api/v2/sources{ "data": [...], "rows": N }.References