Skip to content

Commit 73b6f1f

Browse files
committed
fix lint
1 parent 7367ac5 commit 73b6f1f

File tree

3 files changed

+1
-118
lines changed

3 files changed

+1
-118
lines changed

e2e/opentelemetry/gateway.config.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import { defineConfig, GatewayPlugin } from '@graphql-hive/gateway';
22
import { trace } from '@graphql-hive/gateway/opentelemetry/api';
3-
import {
4-
HiveTracingSpanProcessor,
5-
openTelemetrySetup,
6-
} from '@graphql-hive/gateway/opentelemetry/setup';
3+
import { openTelemetrySetup } from '@graphql-hive/gateway/opentelemetry/setup';
74
import type { MeshFetchRequestInit } from '@graphql-mesh/types';
85
import {
96
getNodeAutoInstrumentations,

e2e/opentelemetry/opentelemetry.e2e.ts

Lines changed: 0 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -248,119 +248,6 @@ describe('OpenTelemetry', () => {
248248
});
249249
});
250250

251-
it.only('should report telemetry metrics correctly to jaeger', async () => {
252-
const serviceName = crypto.randomUUID();
253-
const { execute } = await gateway({
254-
supergraph,
255-
env: {
256-
OTLP_EXPORTER_TYPE,
257-
OTLP_EXPORTER_URL: urls[OTLP_EXPORTER_TYPE],
258-
OTEL_SERVICE_NAME: serviceName,
259-
OTEL_SERVICE_VERSION: '1.0.0',
260-
},
261-
});
262-
263-
/*
264-
await expect(execute({ query: exampleSetup.query })).resolves.toEqual(
265-
exampleSetup.result,
266-
);
267-
/*/
268-
await expect(
269-
execute({ query: 'query test { unknown }' }),
270-
).resolves.toEqual({
271-
errors: [
272-
{
273-
message: 'Cannot query field "unknown" on type "Query".',
274-
extensions: {
275-
code: 'GRAPHQL_VALIDATION_FAILED',
276-
},
277-
locations: [
278-
{
279-
column: 14,
280-
line: 1,
281-
},
282-
],
283-
},
284-
],
285-
});
286-
//*/
287-
await expectJaegerTraces(serviceName, (traces) => {
288-
const relevantTraces = traces.data.filter((trace) =>
289-
trace.spans.some((span) =>
290-
span.operationName.startsWith('graphql.operation'),
291-
),
292-
);
293-
expect(relevantTraces.length).toBe(1);
294-
const relevantTrace = relevantTraces[0];
295-
expect(relevantTrace).toBeDefined();
296-
297-
// const resource = relevantTrace!.processes['p1'];
298-
// expect(resource).toBeDefined();
299-
300-
// const tags = resource!.tags.map(({ key, value }) => ({ key, value }));
301-
// // const tagKeys = resource!.tags.map(({ key }) => key);
302-
// expect(resource!.serviceName).toBe(serviceName);
303-
// [
304-
// ['custom.resource', 'custom value'],
305-
// ['otel.library.name', 'gateway'],
306-
// ].forEach(([key, value]) => {
307-
// return expect(tags).toContainEqual({ key, value });
308-
// });
309-
310-
// if (
311-
// gatewayRunner === 'node' ||
312-
// gatewayRunner === 'docker' ||
313-
// gatewayRunner === 'bin'
314-
// ) {
315-
// const expectedTags = [
316-
// 'process.owner',
317-
// 'host.arch',
318-
// 'os.type',
319-
// 'service.instance.id',
320-
// ];
321-
// if (gatewayRunner.includes('docker')) {
322-
// expectedTags.push('container.id');
323-
// }
324-
// expectedTags.forEach((key) => {
325-
// return expect(tags).toContainEqual(
326-
// expect.objectContaining({ key }),
327-
// );
328-
// });
329-
// }
330-
331-
// const spanTree = buildSpanTree(relevantTrace!.spans, 'POST /graphql');
332-
// expect(spanTree).toBeDefined();
333-
334-
// expect(spanTree!.children).toHaveLength(1);
335-
336-
const operationSpan = buildSpanTree(
337-
relevantTrace!.spans,
338-
'graphql.operation',
339-
)!;
340-
const expectedOperationChildren = [
341-
'graphql.parse',
342-
'graphql.validate',
343-
];
344-
// expect(operationSpan!.children).toHaveLength(
345-
// expectedOperationChildren.length,
346-
// );
347-
for (const operationName of expectedOperationChildren) {
348-
expect(operationSpan?.children).toContainEqual(
349-
expect.objectContaining({
350-
span: expect.objectContaining({ operationName }),
351-
}),
352-
);
353-
}
354-
355-
console.log(operationSpan.span.tags);
356-
expect(
357-
operationSpan.span.tags.find(
358-
({ key }) => key === 'graphql.operation.name',
359-
),
360-
).toMatchObject({ value: 'TestQuery' });
361-
});
362-
});
363-
364251
it('should report telemetry metrics correctly to jaeger using cli options', async () => {
365252
const serviceName = crypto.randomUUID();
366253
const { execute } = await gateway({

packages/plugins/opentelemetry/tests/useOpenTelemetry.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ import {
6767
getSpanProcessors,
6868
getTracerProvider,
6969
MockLogRecordExporter,
70-
MockSpanExporter,
7170
setupOtelForTests,
7271
spanExporter,
7372
} from './utils';

0 commit comments

Comments
 (0)