Repository navigation
feat: upgrade clickhouse versions and use promql remote endpoints #3142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9741791
6bca6cb
968d89e
acf6568
2fa8ca2
d2b2b13
a2925eb
21cfdec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| '@hyperdx/api': minor | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 major — Changeset omits The PR adds |
||
| --- | ||
|
|
||
| feat: run PromQL against ClickHouse through its Prometheus HTTP API | ||
|
|
||
| ClickHouse-backed `/query` and `/query_range` now proxy to the connection's `/prometheus/api/v1/*` endpoint (the `prometheus_api_v1` HTTP handler, ClickHouse 26.8+) instead of calling the `prometheusQuery`/`prometheusQueryRange` table functions. The `database` and `table` query parameters are forwarded so one handler serves any TimeSeries table. ClickHouse holds the Prometheus API forward-compatible while the TimeSeries engine is in preview; the table functions and inner-table schema are not. Bundled ClickHouse images move to 26.8. | ||
|
knudtty marked this conversation as resolved.
Resolved
knudtty marked this conversation as resolved.
Resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import { | ||
| formatMatrixResponse, | ||
| formatVectorResponse, | ||
| } from '@/controllers/timeseriesEngine'; | ||
|
|
||
| describe('formatMatrixResponse', () => { | ||
| it('converts prometheusQueryRange rows into Prometheus matrix shape', () => { | ||
| const rows = [ | ||
| { | ||
| tags: [ | ||
| ['__name__', 'http_requests_total'], | ||
| ['method', 'GET'], | ||
| ] as [string, string][], | ||
| samples: [ | ||
| [1700000000, 5], | ||
| ['2023-11-14T22:14:20.000Z', 7], | ||
| ] as [string | number, number][], | ||
| }, | ||
| ]; | ||
| expect(formatMatrixResponse(rows as any)).toEqual([ | ||
| { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new formatter test passes Context Used: CLAUDE.md (source) Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||
| metric: { __name__: 'http_requests_total', method: 'GET' }, | ||
| values: [ | ||
| [1700000000, '5'], | ||
| [1700000060, '7'], | ||
| ], | ||
| }, | ||
| ]); | ||
| }); | ||
|
|
||
| it('returns empty array for empty input', () => { | ||
| expect(formatMatrixResponse([])).toEqual([]); | ||
| }); | ||
| }); | ||
|
|
||
| describe('formatVectorResponse', () => { | ||
| it('converts prometheusQuery rows into Prometheus vector shape', () => { | ||
| const rows = [ | ||
| { tags: [['service', 'api']], timestamp: 1700000000, value: 42 }, | ||
| { tags: [], timestamp: '2023-11-14T22:13:20.000Z', value: 3 }, | ||
| ]; | ||
| expect(formatVectorResponse(rows as any)).toEqual([ | ||
| { metric: { service: 'api' }, value: [1700000000, '42'] }, | ||
| { metric: {}, value: [1700000000, '3'] }, | ||
| ]); | ||
| }); | ||
| }); | ||
Uh oh!
There was an error while loading. Please reload this page.