mirror of
https://github.com/hyperdxio/hyperdx
synced 2026-04-21 13:37:15 +00:00
- Add minor changeset for hdx query / hdx connections / --patterns. - Revert ConnectionResponse to a non-exported interface; knip flagged it as an unused export and the type isn't consumed outside client.ts.
1.2 KiB
1.2 KiB
| @hyperdx/cli |
|---|
| minor |
Add hdx query and hdx connections commands for agentic ClickHouse workflows:
hdx connections— list ClickHouse connections (id,name,host) for the authenticated team. Supports--jsonfor programmatic consumption.hdx query --connection-id <id> --sql <query>— run raw SQL against a configured ClickHouse connection via the/clickhouse-proxy. Default--formatisJSONEachRow(NDJSON); any ClickHouse format is accepted. Exit codes:0on success (empty stdout = zero rows),1on failure. On error, a lazy connection lookup distinguishes "unknown connection ID" from "bad SQL".hdx query --patterns— post-process the result with the Drain algorithm (@hyperdx/common-utils/dist/drain) and emit one NDJSON pattern object per cluster, sorted by count desc:{"pattern":"<template>","count":<n>,"sample":"<first sample>"}. Use--body-column <name>to cluster a single column's string value; defaults to the whole row JSON-serialized so any SELECT shape works.--helpdocuments the exit-code contract and includes sampling guidance (ORDER BY rand()+ selective WHERE warning) for mining over large tables.