Skip to content

Commit ac47128

Browse files
Merge branch 'main' into cursor/fix-multi-column-order-by-parser-344d
2 parents 62d0781 + 3db148a commit ac47128

67 files changed

Lines changed: 2096 additions & 805 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@hyperdx/app': patch
3+
---
4+
5+
feat: Support source remapping during ad hoc filter import
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@hyperdx/app': patch
3+
---
4+
5+
feat: use the click-ui `Badge` for all status badges on the Kubernetes dashboard
6+
and its node, namespace, and pod drawers.

‎.changeset/llm-badges-click-ui.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@hyperdx/app': patch
3+
---
4+
5+
feat: use the click-ui `Badge` for the model, provider, tool, agent, and chat
6+
role badges in the LLM span panel, session drawer, and dashboard.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@hyperdx/app': patch
3+
---
4+
5+
fix: add a key search to Map and JSON filter groups (e.g. `ResourceAttributes`,
6+
`LogAttributes`) in the search page filter sidebar, matching the value search on
7+
regular filters.

‎.changeset/promql-source-id.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@hyperdx/common-utils': patch
3+
'@hyperdx/api': patch
4+
'@hyperdx/app': patch
5+
---
6+
7+
fix: Resolve PromQL queries through the source instead of a caller-supplied connection and table
8+
9+
The `/api/v1/prometheus/*` routes now take `sourceId` instead of `connectionId`, and read the connection and TimeSeries table from that PromQL source. Caller-supplied `database`/`table` params are ignored for ClickHouse and no longer forwarded to external Prometheus endpoints. Saved PromQL chart configs now require `source` and no longer persist `connection`, so provisioned dashboards with PromQL tiles must set `source`.

‎packages/api/src/mcp/tools/query/helpers.ts‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ import {
1010
isTimeSeriesDisplayType,
1111
splitAndTrimWithBracket,
1212
} from '@hyperdx/common-utils/dist/core/utils';
13-
import { isBuilderSavedChartConfig } from '@hyperdx/common-utils/dist/guards';
13+
import {
14+
isBuilderSavedChartConfig,
15+
isPromqlSavedChartConfig,
16+
} from '@hyperdx/common-utils/dist/guards';
1417
import { UnknownVariableError } from '@hyperdx/common-utils/dist/macroErrors';
1518
import type {
1619
ChartConfigWithDateRange,
@@ -618,6 +621,11 @@ export async function runConfigTile(
618621
}
619622
}
620623

624+
// PromQL is evaluated by the Prometheus API, not the SQL renderer.
625+
if (isPromqlSavedChartConfig(savedConfig)) {
626+
return mcpUserError('PromQL tiles cannot be queried through MCP yet.');
627+
}
628+
621629
// Raw SQL tile — hydrate source fields for macro support ($__sourceTable, $__filters)
622630
let sourceFields: {
623631
from?: { databaseName: string; tableName: string };

‎packages/api/src/middleware/__tests__/queryAttribution.int.test.ts‎

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { buildLogComment } from '@hyperdx/common-utils/dist/clickhouse';
22
import { Metadata } from '@hyperdx/common-utils/dist/core/metadata';
3+
import { SourceKind } from '@hyperdx/common-utils/dist/types';
34

45
import * as config from '@/config';
56
import {
@@ -11,6 +12,7 @@ import {
1112
seedTimeSeriesTagsTable,
1213
} from '@/fixtures';
1314
import Connection from '@/models/connection';
15+
import { Source } from '@/models/source';
1416

1517
declare global {
1618
// Set by jest.setup.ts before it stubs `fetch`.
@@ -118,14 +120,18 @@ describe('request query attribution', () => {
118120
username: config.CLICKHOUSE_USER,
119121
password: config.CLICKHOUSE_PASSWORD,
120122
});
123+
const source = await Source.create({
124+
kind: SourceKind.Promql,
125+
team: team._id,
126+
connection: conn._id,
127+
name: 'PromQL',
128+
from: { databaseName: DEFAULT_DATABASE, tableName: TABLE },
129+
timestampValueExpression: 'timestamp',
130+
});
121131

122132
await agent
123133
.get('/v1/prometheus/labels')
124-
.query({
125-
connectionId: conn._id.toString(),
126-
database: DEFAULT_DATABASE,
127-
table: TABLE,
128-
})
134+
.query({ sourceId: source._id.toString() })
129135
.expect(200);
130136

131137
const logged = await findRouteQueries();
@@ -153,6 +159,14 @@ describe('request query attribution', () => {
153159
username: config.CLICKHOUSE_USER,
154160
password: config.CLICKHOUSE_PASSWORD,
155161
});
162+
const source = await Source.create({
163+
kind: SourceKind.Promql,
164+
team: team._id,
165+
connection: conn._id,
166+
name: 'PromQL',
167+
from: { databaseName: DEFAULT_DATABASE, tableName: TABLE },
168+
timestampValueExpression: 'timestamp',
169+
});
156170
const tile = `tile-${Date.now()}`;
157171

158172
await agent
@@ -170,9 +184,7 @@ describe('request query attribution', () => {
170184
.query({
171185
query: 'attribution_metric',
172186
time: '1700003600',
173-
connectionId: conn._id.toString(),
174-
database: DEFAULT_DATABASE,
175-
table: TABLE,
187+
sourceId: source._id.toString(),
176188
})
177189
.expect(200);
178190

@@ -202,6 +214,14 @@ describe('request query attribution', () => {
202214
username: config.CLICKHOUSE_USER,
203215
password: config.CLICKHOUSE_PASSWORD,
204216
});
217+
const source = await Source.create({
218+
kind: SourceKind.Promql,
219+
team: team._id,
220+
connection: conn._id,
221+
name: 'PromQL',
222+
from: { databaseName: DEFAULT_DATABASE, tableName: TABLE },
223+
timestampValueExpression: 'timestamp',
224+
});
205225
const tile = `tile-${Date.now()}`;
206226

207227
await agent
@@ -213,9 +233,7 @@ describe('request query attribution', () => {
213233
.query({
214234
query: 'attribution_metric',
215235
time: '1700003600',
216-
connectionId: conn._id.toString(),
217-
database: DEFAULT_DATABASE,
218-
table: TABLE,
236+
sourceId: source._id.toString(),
219237
})
220238
.expect(200);
221239

‎packages/api/src/routers/api/__tests__/iac.int.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ describe('iac router', () => {
9797
config: {
9898
configType: 'promql',
9999
promqlExpression: 'up',
100-
connection: randomMongoId(),
100+
source: randomMongoId(),
101101
displayType: 'line',
102102
},
103103
},

0 commit comments

Comments
 (0)