Skip to content

Commit c0c7a78

Browse files
committed
fix typos
1 parent 063c082 commit c0c7a78

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

packages/migrations/src/clickhouse-actions/015-otel-trace.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export const action: Action = async exec => {
164164
, "SpanAttributes"['hive.client.name'] AS "client_name"
165165
, "SpanAttributes"['hive.client.version'] AS "client_version"
166166
, "SpanAttributes"['hive.graphql.operation.name'] AS "graphql_operation_name"
167-
, toLowCardinality("SpanAttributes"['graphql.operation.type']) AS "graphql_operation_type"
167+
, toLowCardinality("SpanAttributes"['hive.graphql.operation.type']) AS "graphql_operation_type"
168168
, "SpanAttributes"['hive.graphql.operation.document'] AS "graphql_operation_document"
169169
, "SpanAttributes"['hive.graphql.error.count'] AS "graphql_errors_count"
170170
, arrayMap(x -> toLowCardinality(x), splitByChar(',', "SpanAttributes"['hive.graphql.error.codes'])) AS "graphql_error_codes"

packages/services/api/src/modules/operations/resolvers/Target.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ export const Target: Pick<
7575
schemaCoordinate: args.schemaCoordinate,
7676
};
7777
},
78-
traces: async (_parent, { first, filter }, { injector }) => {
78+
traces: async (target, { first, filter }, { injector }) => {
7979
const clickhouse = injector.get(ClickHouse);
8080
const limit = (first ?? 10) + 1;
8181

82-
const ANDs: SqlValue[] = [sql`target_id = ${'target-1'}`];
82+
const ANDs: SqlValue[] = [sql`target_id = ${target.id}`];
8383

8484
if (filter?.id?.length) {
8585
ANDs.push(sql`trace_id IN (${sql.array(filter.id, 'String')})`);
@@ -102,11 +102,11 @@ export const Target: Pick<
102102
}
103103

104104
if (filter?.operationName?.length) {
105-
ANDs.push(sql`operation_name IN (${sql.array(filter.operationName, 'String')})`);
105+
ANDs.push(sql`graphql_operation_name IN (${sql.array(filter.operationName, 'String')})`);
106106
}
107107

108108
if (filter?.operationType?.length) {
109-
ANDs.push(sql`operation_type IN (${sql.array(filter.operationType, 'String')})`);
109+
ANDs.push(sql`graphql_operation_type IN (${sql.array(filter.operationType, 'String')})`);
110110
}
111111

112112
if (filter?.subgraphs?.length) {
@@ -156,8 +156,8 @@ export const Target: Pick<
156156
trace_id,
157157
span_id,
158158
timestamp,
159-
operation_name,
160-
operation_type,
159+
graphql_operation_name as operation_name,
160+
graphql_operation_type as operation_type,
161161
duration,
162162
subgraph_names,
163163
http_status_code,
@@ -177,6 +177,8 @@ export const Target: Pick<
177177
const traces = tracesQuery.data;
178178
let hasNext = false;
179179

180+
console.log('AYAYAYAY', traces.length);
181+
180182
if (traces.length == limit) {
181183
hasNext = true;
182184
(traces as any).pop();
@@ -242,11 +244,11 @@ export const Target: Pick<
242244
}
243245

244246
if (filter?.operationName?.length) {
245-
ANDs.push(sql`operation_name IN (${sql.array(filter.operationName, 'String')})`);
247+
ANDs.push(sql`graphql_operation_name IN (${sql.array(filter.operationName, 'String')})`);
246248
}
247249

248250
if (filter?.operationType?.length) {
249-
ANDs.push(sql`operation_type IN (${sql.array(filter.operationType, 'String')})`);
251+
ANDs.push(sql`graphql_operation_type IN (${sql.array(filter.operationType, 'String')})`);
250252
}
251253

252254
if (filter?.subgraphs?.length) {

packages/services/api/src/modules/operations/resolvers/TracesFilterOptions.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,16 @@ export const TracesFilterOptions: TracesFilterOptionsResolvers = {
5555
},
5656
operationName: async ({ loader }, { top }) => {
5757
return loader.load({
58-
key: 'operation_name',
59-
columnExpression: 'operation_name',
58+
key: 'graphql_operation_name',
59+
columnExpression: 'graphql_operation_name',
6060
limit: top ?? 5,
6161
arrayJoinColumn: null,
6262
});
6363
},
6464
operationType: async ({ loader }) => {
6565
return loader.load({
66-
key: 'operation_type',
67-
columnExpression: 'operation_type',
66+
key: 'graphql_operation_type',
67+
columnExpression: 'graphql_operation_type',
6868
limit: null,
6969
arrayJoinColumn: null,
7070
});

0 commit comments

Comments
 (0)