Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
f557866
Create tables for tracking coordinate errors; add coordinate executio…
jdolle May 22, 2026
3ade7e9
format
jdolle May 22, 2026
9836551
rename and add import
jdolle May 22, 2026
86ba957
move coordinate counts to its own migration file
jdolle May 22, 2026
8f27ab4
Add import
jdolle May 22, 2026
cfce6e1
Update packages/migrations/src/clickhouse-actions/018-usage-coordinat…
jdolle May 22, 2026
52d69dd
Update packages/migrations/src/clickhouse-actions/018-usage-coordinat…
jdolle May 22, 2026
18e3d2b
Update packages/migrations/src/clickhouse-actions/018-usage-coordinat…
jdolle May 22, 2026
e8190cd
Update packages/migrations/src/clickhouse-actions/018-usage-coordinat…
jdolle May 22, 2026
d32d5f1
Remove lowcardinality from uuid
jdolle May 22, 2026
9051d9e
Fix 019-usage-coordinate-counts migration
jdolle May 22, 2026
6ca66ab
Use a projection instead of a second set of tables; fix syntax errors
jdolle May 22, 2026
ab312de
Add projection rebuild mode
jdolle May 22, 2026
9032ee0
Fix migration syntax
jdolle May 23, 2026
55ce903
Provide example operations for migration tables
jdolle May 27, 2026
064fa8b
Create a gateway-usage plugin that supports subgraph usage data
jdolle May 28, 2026
4b08973
Update date on license for this new package
jdolle May 28, 2026
09b3a80
get gateway usage passing tests; add integration test to confirm inge…
jdolle May 29, 2026
ff547c8
Fix callback import
jdolle May 29, 2026
7fd451f
Move subgraph request logic to client; handle monolith case
jdolle May 29, 2026
c152c8b
New usage data ingestion and processing
jdolle May 30, 2026
6004233
support inserting operations with missing coordinate_totals column
jdolle Jun 1, 2026
ac7edf0
Track fetch status
jdolle Jun 1, 2026
c27efaf
Merge remote-tracking branch 'origin/main' into usage-field-errors
jdolle Jun 1, 2026
6dec2f1
Remove the setting because it's enabled by default
jdolle Jun 1, 2026
8db0177
Remove noisy debug logs from clickhouse; get errors and field coordin…
jdolle Jun 3, 2026
4307b11
Add explorer and coordinate insights error metrics
jdolle Jun 4, 2026
eab0624
Fix a permissions bug; fix timescale for error count; and use a list …
jdolle Jun 4, 2026
762a153
Fix resolution count total and over time
jdolle Jun 4, 2026
2afc8d4
Track type usage
jdolle Jun 4, 2026
16a8ed2
Dont lookup errors on types and scalars; fix typing on extract coordi…
jdolle Jun 4, 2026
fb94bf2
add test for operation error serialization
jdolle Jun 4, 2026
7fea255
Don't do lookup on errors over time on types
jdolle Jun 4, 2026
e144048
Improve metrics on hover for explorer
jdolle Jun 5, 2026
43dfad5
Better tooltips
jdolle Jun 5, 2026
7573622
Handle abstract types
jdolle Jun 5, 2026
58aca01
Cache modified operations in gateway-usage
jdolle Jun 8, 2026
720fab4
Separate requests from resolutions resolvers; add separate resolution…
jdolle Jun 9, 2026
ef86ec8
Add a bar to represent availability and a tooltip
jdolle Jun 9, 2026
be42cc1
Add a list of error codes to coordinate insights
jdolle Jun 9, 2026
e6cc062
Add separator line on availability bar
jdolle Jun 9, 2026
3e3fc1f
rename plugin
jdolle Jun 9, 2026
fb97e23
remote types from other changes
jdolle Jun 9, 2026
73fa054
Unlock tiny-lru version
jdolle Jun 9, 2026
a9aa6fd
Add flag to api to check if field level metrics should be shown
jdolle Jun 9, 2026
8a26fb1
Merge remote-tracking branch 'origin/main' into usage-field-errors
jdolle Jun 9, 2026
3a19dd1
only drop parts in clickhouse to improve ttl efficiency
jdolle Jun 9, 2026
d71e145
Add test for multiple subgraphs and for an error
jdolle Jun 10, 2026
4def7ea
Merge branch 'main' into usage-field-errors
jdolle Jun 10, 2026
a25787b
update lockfile
jdolle Jun 10, 2026
bd225d5
fix type issue; simplify query for test
jdolle Jun 10, 2026
67e2f08
fix tsconfig
jdolle Jun 10, 2026
49c0378
Automatically determine whether or not to display the resolutions, an…
jdolle Jun 10, 2026
ed97657
Use info colors
jdolle Jun 11, 2026
e5d8e75
type and spec terms cleanup
jdolle Jun 11, 2026
e707174
Merge branch 'main' into usage-field-errors
jdolle Jun 11, 2026
8d31d1f
Fix name and add changeset
jdolle Jun 11, 2026
bf8711f
Add error codes over time query
jdolle Jun 11, 2026
be1ead7
Add error activity over time
jdolle Jun 12, 2026
ce926bc
Remove unnecessary allocations from add-typename for performance
jdolle Jun 12, 2026
9e65db9
Revert changes due to failing test
jdolle Jun 12, 2026
6fae88d
Merge branch 'main' into usage-field-errors
jdolle Jun 12, 2026
50eb535
Remove redundant checks and improve tests for add typenames
jdolle Jun 12, 2026
6575cf9
avoid memory allocating when necessary
jdolle Jun 12, 2026
4131b25
Attempt performance improvements to extract-coordinates
jdolle Jun 12, 2026
2effd2c
remove comments
jdolle Jun 12, 2026
3b03aa0
Avoid converting to set then back to array for exclusions
jdolle Jun 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/tricky-items-sit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@graphql-hive/gateway-plugin-console-sdk': minor
'@graphql-hive/core': minor
'hive': minor
---

Support coordinate level resolution and error reporting
1 change: 1 addition & 0 deletions docker/configs/clickhouse/logging.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<clickhouse>
<logger>
<console>true</console>
<level>information</level>
</logger>
</clickhouse>
2 changes: 2 additions & 0 deletions integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
"@esm2cjs/execa": "6.1.1-cjs.1",
"@graphql-hive/apollo": "workspace:*",
"@graphql-hive/core": "workspace:*",
"@graphql-hive/gateway-plugin-console-sdk": "workspace:*",
"@graphql-hive/gateway-runtime": "^1.0.0 || ^2.0.0",
"@graphql-typed-document-node/core": "3.2.0",
"@hive/commerce": "workspace:*",
"@hive/postgres": "workspace:*",
Expand Down
64 changes: 64 additions & 0 deletions integration-tests/testkit/flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1339,6 +1339,30 @@ export function updateBaseSchema(input: UpdateBaseSchemaInput, token: string) {
});
}

export function readTotalRequests(
reference: GraphQLSchema.TargetReferenceInput,
period: GraphQLSchema.DateRangeInput,
token: string,
) {
return execute({
document: graphql(`
query IntegrationTests_ReadTotalRequests(
$reference: TargetReferenceInput!
$period: DateRangeInput!
) {
target(reference: $reference) {
totalRequests(period: $period)
}
}
`),
token,
variables: {
reference,
period,
},
});
}

export function readClientStats(
reference: GraphQLSchema.TargetReferenceInput,
period: GraphQLSchema.DateRangeInput,
Expand Down Expand Up @@ -1442,6 +1466,46 @@ export function readOperationsStats(
});
}

export function readSchemaCoordinateStats(
selector: {
organizationSlug: string;
projectSlug: string;
targetSlug: string;
schemaCoordinate: string;
},
period: GraphQLSchema.DateRangeInput,
token: string,
) {
return execute({
document: graphql(`
query readSchemaCoordinateStats(
$selector: TargetSelectorInput!
$schemaCoordinate: String!
$period: DateRangeInput!
) {
target(reference: { bySelector: $selector }) {
id
schemaCoordinateStats(schemaCoordinate: $schemaCoordinate, period: $period) {
totalRequests
totalResolutions
totalFailures
}
}
}
`),
token,
variables: {
selector: {
organizationSlug: selector.organizationSlug,
projectSlug: selector.projectSlug,
targetSlug: selector.targetSlug,
},
schemaCoordinate: selector.schemaCoordinate,
period,
},
});
}

export function readOperationBody(
selector: {
organizationSlug: string;
Expand Down
28 changes: 20 additions & 8 deletions integration-tests/testkit/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ import {
readClientStats,
readOperationBody,
readOperationsStats,
readSchemaCoordinateStats,
readTokenInfo,
readTotalRequests,
updateBaseSchema,
updateMemberRole,
updateMetricAlertRule,
Expand Down Expand Up @@ -1142,6 +1144,22 @@ export function initSeed() {
)
).expectNoGraphQLErrors();
},
async readSchemaCoordinateStats(
schemaCoordinate: string,
period: GraphQLSchema.DateRangeInput,
ttarget: TargetOverwrite = target,
) {
return await readSchemaCoordinateStats(
{
organizationSlug: organization.slug,
projectSlug: project.slug,
targetSlug: ttarget.slug,
schemaCoordinate,
},
period,
ownerToken,
).then(r => r.expectNoGraphQLErrors());
},
async readOperationBody(hash: string, ttarget: TargetOverwrite = target) {
const operationBodyResult = await readOperationBody(
{
Expand Down Expand Up @@ -1195,7 +1213,7 @@ export function initSeed() {
const from = formatISO(opts?.from ?? subHours(Date.now(), 1));
const to = formatISO(opts?.to ?? Date.now());
const check = async () => {
const statsResult = await readOperationsStats(
const statsResult = await readTotalRequests(
{
bySelector: {
organizationSlug: organization.slug,
Expand All @@ -1207,15 +1225,9 @@ export function initSeed() {
from,
to,
},
{},
ownerToken,
).then(r => r.expectNoGraphQLErrors());
const totalRequests =
statsResult.target?.operationsStats.operations.edges.reduce(
(total, edge) => total + edge.node.count,
0,
);
return totalRequests == n;
return statsResult.target?.totalRequests == n;
};

return pollFor(check);
Expand Down
10 changes: 5 additions & 5 deletions integration-tests/tests/api/app-deployments.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2142,7 +2142,7 @@ test('app deployment usage reporting', async () => {
},
});

await client.collectUsage()(
await client.collectUsage().finish(
{
document: parse(`query { a }`),
schema: buildASTSchema(parse(sdl)),
Expand Down Expand Up @@ -2720,7 +2720,7 @@ test('activeAppDeployments filters by lastUsedBefore', async () => {
},
});

await client.collectUsage()(
await client.collectUsage().finish(
{
document: parse(`query { hello }`),
schema: buildASTSchema(parse(sdl)),
Expand Down Expand Up @@ -2882,7 +2882,7 @@ test('activeAppDeployments applies OR logic between lastUsedBefore and neverUsed
},
});

await client.collectUsage()(
await client.collectUsage().finish(
{
document: parse(`query { hello }`),
schema: buildASTSchema(parse(sdl)),
Expand Down Expand Up @@ -3159,7 +3159,7 @@ test('activeAppDeployments filters by name combined with lastUsedBefore', async
},
});

await client.collectUsage()(
await client.collectUsage().finish(
{
document: parse(`query { hello }`),
schema: buildASTSchema(parse(sdl)),
Expand Down Expand Up @@ -5602,7 +5602,7 @@ test('retire app deployment with --force bypasses protection', async () => {
},
});

await client.collectUsage()(
await client.collectUsage().finish(
{
document: parse(`query { hello }`),
schema: buildASTSchema(parse(sdl)),
Expand Down
16 changes: 8 additions & 8 deletions integration-tests/tests/api/target/usage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2246,7 +2246,7 @@ test.concurrent(
`);

function collectA() {
client.collectUsage()(
client.collectUsage().finish(
{
document: queryA,
schema,
Expand All @@ -2259,7 +2259,7 @@ test.concurrent(
}

function collectB() {
client.collectUsage()(
client.collectUsage().finish(
{
document: queryB,
schema,
Expand Down Expand Up @@ -2465,7 +2465,7 @@ test.concurrent(
`);

function collectA() {
client.collectUsage()(
client.collectUsage().finish(
{
document: queryA,
schema,
Expand Down Expand Up @@ -2637,7 +2637,7 @@ test.concurrent(
`);

function collectA() {
client.collectUsage()(
client.collectUsage().finish(
{
document: queryA,
schema,
Expand All @@ -2649,7 +2649,7 @@ test.concurrent(
);
}
function collectB() {
client.collectUsage()(
client.collectUsage().finish(
{
document: queryB,
schema,
Expand Down Expand Up @@ -2927,7 +2927,7 @@ test.concurrent(

// Now let's make subscription insignificant by making 3 queries

client.collectUsage()(
client.collectUsage().finish(
{
document: parse('{ a }'),
schema,
Expand All @@ -2937,7 +2937,7 @@ test.concurrent(
},
{},
);
client.collectUsage()(
client.collectUsage().finish(
{
document: parse('{ a }'),
schema,
Expand All @@ -2947,7 +2947,7 @@ test.concurrent(
},
{},
);
client.collectUsage()(
client.collectUsage().finish(
{
document: parse('{ a }'),
schema,
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/tests/cli/app.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ test('app:retire --force bypasses protection', async () => {
},
});

await client.collectUsage()(
await client.collectUsage().finish(
{
document: parse(`query { hello }`),
schema: buildASTSchema(parse(sdl)),
Expand Down
Loading
Loading