Skip to content
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

Make it possible to conditionally skip the graphql_yoga_http_duration observation #3444

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions .changeset/three-shirts-grow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@graphql-yoga/plugin-prometheus': minor
---

Make it possible for a user to conditionally escape the `graphql_yoga_http_duration` histogram
observation on a per request basis
18 changes: 9 additions & 9 deletions packages/plugins/prometheus/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,15 @@
const start = startByRequest.get(request);
if (start) {
const duration = (Date.now() - start) / 1000;
const params = paramsByRequest.get(request);
httpHistogram?.histogram.observe(
httpHistogram.fillLabelsFn(params || {}, {
...serverContext,
request,
response,
}),
duration,
);
const params = paramsByRequest.get(request) || {};
const context = {
...serverContext,
request,
response,
};
if (httpHistogram?.shouldRecordFn(params, context)) {

Check failure on line 178 in packages/plugins/prometheus/src/index.ts

View workflow job for this annotation

GitHub Actions / benchmarks

Property 'shouldRecordFn' does not exist on type 'HistogramAndLabels<string, FillLabelsFnParams>'.

Check failure on line 178 in packages/plugins/prometheus/src/index.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v20 / graphql v16.6.0

Property 'shouldRecordFn' does not exist on type 'HistogramAndLabels<string, FillLabelsFnParams>'.

Check failure on line 178 in packages/plugins/prometheus/src/index.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v18 / graphql v15.8.0

Property 'shouldRecordFn' does not exist on type 'HistogramAndLabels<string, FillLabelsFnParams>'.

Check failure on line 178 in packages/plugins/prometheus/src/index.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v22 / graphql v16.6.0

Property 'shouldRecordFn' does not exist on type 'HistogramAndLabels<string, FillLabelsFnParams>'.

Check failure on line 178 in packages/plugins/prometheus/src/index.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v20 / graphql v15.8.0

Property 'shouldRecordFn' does not exist on type 'HistogramAndLabels<string, FillLabelsFnParams>'.

Check failure on line 178 in packages/plugins/prometheus/src/index.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v18 / graphql v16.6.0

Property 'shouldRecordFn' does not exist on type 'HistogramAndLabels<string, FillLabelsFnParams>'.

Check failure on line 178 in packages/plugins/prometheus/src/index.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v22 / graphql v15.8.0

Property 'shouldRecordFn' does not exist on type 'HistogramAndLabels<string, FillLabelsFnParams>'.

Check failure on line 178 in packages/plugins/prometheus/src/index.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v18 / graphql v15.8.0

Property 'shouldRecordFn' does not exist on type 'HistogramAndLabels<string, FillLabelsFnParams>'.

Check failure on line 178 in packages/plugins/prometheus/src/index.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v18 / graphql v16.6.0

Property 'shouldRecordFn' does not exist on type 'HistogramAndLabels<string, FillLabelsFnParams>'.

Check failure on line 178 in packages/plugins/prometheus/src/index.ts

View workflow job for this annotation

GitHub Actions / esm

Property 'shouldRecordFn' does not exist on type 'HistogramAndLabels<string, FillLabelsFnParams>'.

Check failure on line 178 in packages/plugins/prometheus/src/index.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v20 / graphql v15.8.0

Property 'shouldRecordFn' does not exist on type 'HistogramAndLabels<string, FillLabelsFnParams>'.

Check failure on line 178 in packages/plugins/prometheus/src/index.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (18, 16.6.0)

Property 'shouldRecordFn' does not exist on type 'HistogramAndLabels<string, FillLabelsFnParams>'.

Check failure on line 178 in packages/plugins/prometheus/src/index.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v22 / graphql v16.6.0

Property 'shouldRecordFn' does not exist on type 'HistogramAndLabels<string, FillLabelsFnParams>'.

Check failure on line 178 in packages/plugins/prometheus/src/index.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (20, 15.8.0)

Property 'shouldRecordFn' does not exist on type 'HistogramAndLabels<string, FillLabelsFnParams>'.

Check failure on line 178 in packages/plugins/prometheus/src/index.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (18, 15.8.0)

Property 'shouldRecordFn' does not exist on type 'HistogramAndLabels<string, FillLabelsFnParams>'.

Check failure on line 178 in packages/plugins/prometheus/src/index.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (20, 16.6.0)

Property 'shouldRecordFn' does not exist on type 'HistogramAndLabels<string, FillLabelsFnParams>'.

Check failure on line 178 in packages/plugins/prometheus/src/index.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v20 / graphql v16.6.0

Property 'shouldRecordFn' does not exist on type 'HistogramAndLabels<string, FillLabelsFnParams>'.

Check failure on line 178 in packages/plugins/prometheus/src/index.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (22, 15.8.0)

Property 'shouldRecordFn' does not exist on type 'HistogramAndLabels<string, FillLabelsFnParams>'.

Check failure on line 178 in packages/plugins/prometheus/src/index.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v22 / graphql v15.8.0

Property 'shouldRecordFn' does not exist on type 'HistogramAndLabels<string, FillLabelsFnParams>'.

Check failure on line 178 in packages/plugins/prometheus/src/index.ts

View workflow job for this annotation

GitHub Actions / typecheck

Property 'shouldRecordFn' does not exist on type 'HistogramAndLabels<string, FillLabelsFnParams>'.

Check failure on line 178 in packages/plugins/prometheus/src/index.ts

View workflow job for this annotation

GitHub Actions / leaks / nodejs v22 / graphql v16.6.0

Property 'shouldRecordFn' does not exist on type 'HistogramAndLabels<string, FillLabelsFnParams>'.

Check failure on line 178 in packages/plugins/prometheus/src/index.ts

View workflow job for this annotation

GitHub Actions / leaks / nodejs v18 / graphql v15.8.0

Property 'shouldRecordFn' does not exist on type 'HistogramAndLabels<string, FillLabelsFnParams>'.

Check failure on line 178 in packages/plugins/prometheus/src/index.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (22, 16.6.0)

Property 'shouldRecordFn' does not exist on type 'HistogramAndLabels<string, FillLabelsFnParams>'.

Check failure on line 178 in packages/plugins/prometheus/src/index.ts

View workflow job for this annotation

GitHub Actions / leaks / nodejs v18 / graphql v16.6.0

Property 'shouldRecordFn' does not exist on type 'HistogramAndLabels<string, FillLabelsFnParams>'.

Check failure on line 178 in packages/plugins/prometheus/src/index.ts

View workflow job for this annotation

GitHub Actions / leaks / nodejs v22 / graphql v15.8.0

Property 'shouldRecordFn' does not exist on type 'HistogramAndLabels<string, FillLabelsFnParams>'.
httpHistogram?.histogram.observe(httpHistogram.fillLabelsFn(params, context), duration);
}
}
},
};
Expand Down
96 changes: 95 additions & 1 deletion packages/plugins/prometheus/tests/prometheus.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createSchema, createYoga } from 'graphql-yoga';
import { register as registry } from 'prom-client';
import { usePrometheus } from '@graphql-yoga/plugin-prometheus';
import { createHistogram, usePrometheus } from '@graphql-yoga/plugin-prometheus';

describe('Prometheus', () => {
const schema = createSchema({
Expand All @@ -15,6 +15,7 @@
},
},
});

afterEach(() => {
registry.clear();
});
Expand Down Expand Up @@ -97,6 +98,7 @@
expect(metrics).toContain('method="POST"');
expect(metrics).toContain('statusCode="200"');
});

it('labels should be excluded', async () => {
const yoga = createYoga({
schema,
Expand Down Expand Up @@ -224,4 +226,96 @@
expect(metrics).toContain('statusCode="400"');
expect(metrics).toContain('operationName="TestProm"');
});

describe('when using a custom histogram', () => {
const request = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-test': 'test',
},
body: JSON.stringify({
query: /* GraphQL */ `
query TestProm {
hello
}
`,
}),
};

let config: ReturnType<typeof createConfig>;
const createConfig = () => ({
metrics: {
graphql_envelop_deprecated_field: false,
graphql_envelop_request: false,
graphql_envelop_request_duration: false,
graphql_envelop_request_time_summary: false,
graphql_envelop_phase_parse: false,
graphql_envelop_phase_validate: false,
graphql_envelop_phase_context: false,
graphql_envelop_error_result: false,
graphql_envelop_execute_resolver: false,
graphql_envelop_phase_execute: false,
graphql_envelop_phase_subscribe: false,
graphql_envelop_schema_change: false,
graphql_yoga_http_duration: createHistogram({
registry,
histogram: {
name: 'graphql_yoga_http_duration',
help: 'Time spent on HTTP connection',
labelNames: ['operation_name'],
},
fillLabelsFn: ({ operationName }, _rawContext) => ({
operation_name: operationName ?? 'Anonymous',
}),
shouldRecordFn: () => {

Check failure on line 271 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / benchmarks

Object literal may only specify known properties, and 'shouldRecordFn' does not exist in type '{ registry: Registry<"text/plain; version=0.0.4; charset=utf-8">; histogram: Omit<HistogramConfiguration<"operation_name">, "registers">; fillLabelsFn: FillLabelsFn<...>; }'.

Check failure on line 271 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v20 / graphql v16.6.0

Object literal may only specify known properties, and 'shouldRecordFn' does not exist in type '{ registry: Registry<"text/plain; version=0.0.4; charset=utf-8">; histogram: Omit<HistogramConfiguration<"operation_name">, "registers">; fillLabelsFn: FillLabelsFn<...>; }'.

Check failure on line 271 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v18 / graphql v15.8.0

Object literal may only specify known properties, and 'shouldRecordFn' does not exist in type '{ registry: Registry<"text/plain; version=0.0.4; charset=utf-8">; histogram: Omit<HistogramConfiguration<"operation_name">, "registers">; fillLabelsFn: FillLabelsFn<...>; }'.

Check failure on line 271 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v22 / graphql v16.6.0

Object literal may only specify known properties, and 'shouldRecordFn' does not exist in type '{ registry: Registry<"text/plain; version=0.0.4; charset=utf-8">; histogram: Omit<HistogramConfiguration<"operation_name">, "registers">; fillLabelsFn: FillLabelsFn<...>; }'.

Check failure on line 271 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v20 / graphql v15.8.0

Object literal may only specify known properties, and 'shouldRecordFn' does not exist in type '{ registry: Registry<"text/plain; version=0.0.4; charset=utf-8">; histogram: Omit<HistogramConfiguration<"operation_name">, "registers">; fillLabelsFn: FillLabelsFn<...>; }'.

Check failure on line 271 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v18 / graphql v16.6.0

Object literal may only specify known properties, and 'shouldRecordFn' does not exist in type '{ registry: Registry<"text/plain; version=0.0.4; charset=utf-8">; histogram: Omit<HistogramConfiguration<"operation_name">, "registers">; fillLabelsFn: FillLabelsFn<...>; }'.

Check failure on line 271 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v22 / graphql v15.8.0

Object literal may only specify known properties, and 'shouldRecordFn' does not exist in type '{ registry: Registry<"text/plain; version=0.0.4; charset=utf-8">; histogram: Omit<HistogramConfiguration<"operation_name">, "registers">; fillLabelsFn: FillLabelsFn<...>; }'.

Check failure on line 271 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v18 / graphql v15.8.0

Object literal may only specify known properties, and 'shouldRecordFn' does not exist in type '{ registry: Registry<"text/plain; version=0.0.4; charset=utf-8">; histogram: Omit<HistogramConfiguration<"operation_name">, "registers">; fillLabelsFn: FillLabelsFn<...>; }'.

Check failure on line 271 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v18 / graphql v16.6.0

Object literal may only specify known properties, and 'shouldRecordFn' does not exist in type '{ registry: Registry<"text/plain; version=0.0.4; charset=utf-8">; histogram: Omit<HistogramConfiguration<"operation_name">, "registers">; fillLabelsFn: FillLabelsFn<...>; }'.

Check failure on line 271 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / esm

Object literal may only specify known properties, and 'shouldRecordFn' does not exist in type '{ registry: Registry<"text/plain; version=0.0.4; charset=utf-8">; histogram: Omit<HistogramConfiguration<"operation_name">, "registers">; fillLabelsFn: FillLabelsFn<...>; }'.

Check failure on line 271 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v20 / graphql v15.8.0

Object literal may only specify known properties, and 'shouldRecordFn' does not exist in type '{ registry: Registry<"text/plain; version=0.0.4; charset=utf-8">; histogram: Omit<HistogramConfiguration<"operation_name">, "registers">; fillLabelsFn: FillLabelsFn<...>; }'.

Check failure on line 271 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (18, 16.6.0)

Object literal may only specify known properties, and 'shouldRecordFn' does not exist in type '{ registry: Registry<"text/plain; version=0.0.4; charset=utf-8">; histogram: Omit<HistogramConfiguration<"operation_name">, "registers">; fillLabelsFn: FillLabelsFn<...>; }'.

Check failure on line 271 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v22 / graphql v16.6.0

Object literal may only specify known properties, and 'shouldRecordFn' does not exist in type '{ registry: Registry<"text/plain; version=0.0.4; charset=utf-8">; histogram: Omit<HistogramConfiguration<"operation_name">, "registers">; fillLabelsFn: FillLabelsFn<...>; }'.

Check failure on line 271 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (20, 15.8.0)

Object literal may only specify known properties, and 'shouldRecordFn' does not exist in type '{ registry: Registry<"text/plain; version=0.0.4; charset=utf-8">; histogram: Omit<HistogramConfiguration<"operation_name">, "registers">; fillLabelsFn: FillLabelsFn<...>; }'.

Check failure on line 271 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (18, 15.8.0)

Object literal may only specify known properties, and 'shouldRecordFn' does not exist in type '{ registry: Registry<"text/plain; version=0.0.4; charset=utf-8">; histogram: Omit<HistogramConfiguration<"operation_name">, "registers">; fillLabelsFn: FillLabelsFn<...>; }'.

Check failure on line 271 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (20, 16.6.0)

Object literal may only specify known properties, and 'shouldRecordFn' does not exist in type '{ registry: Registry<"text/plain; version=0.0.4; charset=utf-8">; histogram: Omit<HistogramConfiguration<"operation_name">, "registers">; fillLabelsFn: FillLabelsFn<...>; }'.

Check failure on line 271 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v20 / graphql v16.6.0

Object literal may only specify known properties, and 'shouldRecordFn' does not exist in type '{ registry: Registry<"text/plain; version=0.0.4; charset=utf-8">; histogram: Omit<HistogramConfiguration<"operation_name">, "registers">; fillLabelsFn: FillLabelsFn<...>; }'.

Check failure on line 271 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (22, 15.8.0)

Object literal may only specify known properties, and 'shouldRecordFn' does not exist in type '{ registry: Registry<"text/plain; version=0.0.4; charset=utf-8">; histogram: Omit<HistogramConfiguration<"operation_name">, "registers">; fillLabelsFn: FillLabelsFn<...>; }'.

Check failure on line 271 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v22 / graphql v15.8.0

Object literal may only specify known properties, and 'shouldRecordFn' does not exist in type '{ registry: Registry<"text/plain; version=0.0.4; charset=utf-8">; histogram: Omit<HistogramConfiguration<"operation_name">, "registers">; fillLabelsFn: FillLabelsFn<...>; }'.

Check failure on line 271 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / typecheck

Object literal may only specify known properties, and 'shouldRecordFn' does not exist in type '{ registry: Registry<"text/plain; version=0.0.4; charset=utf-8">; histogram: Omit<HistogramConfiguration<"operation_name">, "registers">; fillLabelsFn: FillLabelsFn<...>; }'.

Check failure on line 271 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / leaks / nodejs v22 / graphql v16.6.0

Object literal may only specify known properties, and 'shouldRecordFn' does not exist in type '{ registry: Registry<"text/plain; version=0.0.4; charset=utf-8">; histogram: Omit<HistogramConfiguration<"operation_name">, "registers">; fillLabelsFn: FillLabelsFn<...>; }'.

Check failure on line 271 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / leaks / nodejs v18 / graphql v15.8.0

Object literal may only specify known properties, and 'shouldRecordFn' does not exist in type '{ registry: Registry<"text/plain; version=0.0.4; charset=utf-8">; histogram: Omit<HistogramConfiguration<"operation_name">, "registers">; fillLabelsFn: FillLabelsFn<...>; }'.

Check failure on line 271 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (22, 16.6.0)

Object literal may only specify known properties, and 'shouldRecordFn' does not exist in type '{ registry: Registry<"text/plain; version=0.0.4; charset=utf-8">; histogram: Omit<HistogramConfiguration<"operation_name">, "registers">; fillLabelsFn: FillLabelsFn<...>; }'.

Check failure on line 271 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / leaks / nodejs v18 / graphql v16.6.0

Object literal may only specify known properties, and 'shouldRecordFn' does not exist in type '{ registry: Registry<"text/plain; version=0.0.4; charset=utf-8">; histogram: Omit<HistogramConfiguration<"operation_name">, "registers">; fillLabelsFn: FillLabelsFn<...>; }'.

Check failure on line 271 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / leaks / nodejs v22 / graphql v15.8.0

Object literal may only specify known properties, and 'shouldRecordFn' does not exist in type '{ registry: Registry<"text/plain; version=0.0.4; charset=utf-8">; histogram: Omit<HistogramConfiguration<"operation_name">, "registers">; fillLabelsFn: FillLabelsFn<...>; }'.
throw new Error('jest should be used to mock implementation');
},
}),
},
registry,
});

describe('and shouldRecordFn returns true', () => {
beforeEach(() => {
config = createConfig();
jest
.spyOn(config.metrics.graphql_yoga_http_duration, 'shouldRecordFn')

Check failure on line 283 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / benchmarks

No overload matches this call.

Check failure on line 283 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v20 / graphql v16.6.0

No overload matches this call.

Check failure on line 283 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v18 / graphql v15.8.0

No overload matches this call.

Check failure on line 283 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v22 / graphql v16.6.0

No overload matches this call.

Check failure on line 283 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v20 / graphql v15.8.0

No overload matches this call.

Check failure on line 283 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v18 / graphql v16.6.0

No overload matches this call.

Check failure on line 283 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v22 / graphql v15.8.0

No overload matches this call.

Check failure on line 283 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v18 / graphql v15.8.0

No overload matches this call.

Check failure on line 283 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v18 / graphql v16.6.0

No overload matches this call.

Check failure on line 283 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / esm

No overload matches this call.

Check failure on line 283 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v20 / graphql v15.8.0

No overload matches this call.

Check failure on line 283 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (18, 16.6.0)

No overload matches this call.

Check failure on line 283 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v22 / graphql v16.6.0

No overload matches this call.

Check failure on line 283 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (20, 15.8.0)

No overload matches this call.

Check failure on line 283 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (18, 15.8.0)

No overload matches this call.

Check failure on line 283 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (20, 16.6.0)

No overload matches this call.

Check failure on line 283 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v20 / graphql v16.6.0

No overload matches this call.

Check failure on line 283 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (22, 15.8.0)

No overload matches this call.

Check failure on line 283 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v22 / graphql v15.8.0

No overload matches this call.

Check failure on line 283 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / typecheck

No overload matches this call.

Check failure on line 283 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / leaks / nodejs v22 / graphql v16.6.0

No overload matches this call.

Check failure on line 283 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / leaks / nodejs v18 / graphql v15.8.0

No overload matches this call.

Check failure on line 283 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (22, 16.6.0)

No overload matches this call.

Check failure on line 283 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / leaks / nodejs v18 / graphql v16.6.0

No overload matches this call.

Check failure on line 283 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / leaks / nodejs v22 / graphql v15.8.0

No overload matches this call.
.mockReturnValue(true);

Check failure on line 284 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / benchmarks

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 284 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v20 / graphql v16.6.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 284 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v18 / graphql v15.8.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 284 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v22 / graphql v16.6.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 284 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v20 / graphql v15.8.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 284 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v18 / graphql v16.6.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 284 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v22 / graphql v15.8.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 284 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v18 / graphql v15.8.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 284 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v18 / graphql v16.6.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 284 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / esm

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 284 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v20 / graphql v15.8.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 284 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (18, 16.6.0)

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 284 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v22 / graphql v16.6.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 284 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (20, 15.8.0)

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 284 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (18, 15.8.0)

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 284 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (20, 16.6.0)

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 284 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v20 / graphql v16.6.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 284 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (22, 15.8.0)

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 284 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v22 / graphql v15.8.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 284 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / typecheck

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 284 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / leaks / nodejs v22 / graphql v16.6.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 284 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / leaks / nodejs v18 / graphql v15.8.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 284 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (22, 16.6.0)

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 284 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / leaks / nodejs v18 / graphql v16.6.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 284 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / leaks / nodejs v22 / graphql v15.8.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.
});

it('makes a metric observation', async () => {
const yoga = createYoga({
schema,
plugins: [usePrometheus(config)],
});
const result = await yoga.fetch('http://localhost:4000/graphql', request);
await result.text();
const metrics = await registry.metrics();
expect(metrics).toContain('graphql_yoga_http_duration_bucket');
expect(metrics).toContain('operation_name="TestProm"');
});
});

describe('and shouldRecordFn returns false', () => {
beforeEach(() => {
config = createConfig();
jest
.spyOn(config.metrics.graphql_yoga_http_duration, 'shouldRecordFn')

Check failure on line 304 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / benchmarks

No overload matches this call.

Check failure on line 304 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v20 / graphql v16.6.0

No overload matches this call.

Check failure on line 304 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v18 / graphql v15.8.0

No overload matches this call.

Check failure on line 304 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v22 / graphql v16.6.0

No overload matches this call.

Check failure on line 304 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v20 / graphql v15.8.0

No overload matches this call.

Check failure on line 304 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v18 / graphql v16.6.0

No overload matches this call.

Check failure on line 304 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v22 / graphql v15.8.0

No overload matches this call.

Check failure on line 304 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v18 / graphql v15.8.0

No overload matches this call.

Check failure on line 304 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v18 / graphql v16.6.0

No overload matches this call.

Check failure on line 304 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / esm

No overload matches this call.

Check failure on line 304 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v20 / graphql v15.8.0

No overload matches this call.

Check failure on line 304 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (18, 16.6.0)

No overload matches this call.

Check failure on line 304 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v22 / graphql v16.6.0

No overload matches this call.

Check failure on line 304 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (20, 15.8.0)

No overload matches this call.

Check failure on line 304 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (18, 15.8.0)

No overload matches this call.

Check failure on line 304 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (20, 16.6.0)

No overload matches this call.

Check failure on line 304 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v20 / graphql v16.6.0

No overload matches this call.

Check failure on line 304 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (22, 15.8.0)

No overload matches this call.

Check failure on line 304 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v22 / graphql v15.8.0

No overload matches this call.

Check failure on line 304 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / typecheck

No overload matches this call.

Check failure on line 304 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / leaks / nodejs v22 / graphql v16.6.0

No overload matches this call.

Check failure on line 304 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / leaks / nodejs v18 / graphql v15.8.0

No overload matches this call.

Check failure on line 304 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (22, 16.6.0)

No overload matches this call.

Check failure on line 304 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / leaks / nodejs v18 / graphql v16.6.0

No overload matches this call.

Check failure on line 304 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / leaks / nodejs v22 / graphql v15.8.0

No overload matches this call.
.mockReturnValue(false);

Check failure on line 305 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / benchmarks

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 305 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v20 / graphql v16.6.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 305 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v18 / graphql v15.8.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 305 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v22 / graphql v16.6.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 305 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v20 / graphql v15.8.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 305 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v18 / graphql v16.6.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 305 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v22 / graphql v15.8.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 305 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / integration / nodejs v18 / graphql v15.8.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 305 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v18 / graphql v16.6.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 305 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / esm

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 305 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v20 / graphql v15.8.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 305 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (18, 16.6.0)

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 305 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v22 / graphql v16.6.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 305 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (20, 15.8.0)

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 305 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (18, 15.8.0)

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 305 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (20, 16.6.0)

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 305 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v20 / graphql v16.6.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 305 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (22, 15.8.0)

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 305 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / unit / nodejs v22 / graphql v15.8.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 305 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / typecheck

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 305 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / leaks / nodejs v22 / graphql v16.6.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 305 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / leaks / nodejs v18 / graphql v15.8.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 305 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / apollo-federation-compatibility (22, 16.6.0)

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 305 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / leaks / nodejs v18 / graphql v16.6.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.

Check failure on line 305 in packages/plugins/prometheus/tests/prometheus.spec.ts

View workflow job for this annotation

GitHub Actions / leaks / nodejs v22 / graphql v15.8.0

Argument of type 'boolean' is not assignable to parameter of type 'void & (FillLabelsFn<"operation_name", FillLabelsFnParams> | Histogram<"operation_name">)'.
});

it('does not make a metric observation', async () => {
const yoga = createYoga({
schema,
plugins: [usePrometheus(config)],
});
const result = await yoga.fetch('http://localhost:4000/graphql', request);
await result.text();
const metrics = await registry.metrics();
expect(metrics).not.toContain('graphql_yoga_http_duration_bucket');
expect(metrics).not.toContain('operation_name="TestProm"');
});
});
});
});
Loading