From bc327db2730e4b13095e5475ae0bc29bd2567c12 Mon Sep 17 00:00:00 2001 From: TheGuildBot <59414373+theguild-bot@users.noreply.github.com> Date: Wed, 27 Nov 2024 07:42:17 -0500 Subject: [PATCH] chore(release): update monorepo packages versions (#3514) Co-authored-by: github-actions[bot] --- ...oga_plugin-prometheus-3489-dependencies.md | 8 -- ...oga_plugin-prometheus-3519-dependencies.md | 7 - .changeset/changelog.md | 6 - .changeset/changelog1.md | 5 - .changeset/lazy-dancers-confess.md | 103 --------------- .../plugins/apollo-usage-report/CHANGELOG.md | 17 +++ .../plugins/apollo-usage-report/package.json | 2 +- packages/plugins/prometheus/CHANGELOG.md | 124 ++++++++++++++++++ packages/plugins/prometheus/package.json | 2 +- 9 files changed, 143 insertions(+), 131 deletions(-) delete mode 100644 .changeset/@graphql-yoga_plugin-prometheus-3489-dependencies.md delete mode 100644 .changeset/@graphql-yoga_plugin-prometheus-3519-dependencies.md delete mode 100644 .changeset/changelog.md delete mode 100644 .changeset/changelog1.md delete mode 100644 .changeset/lazy-dancers-confess.md diff --git a/.changeset/@graphql-yoga_plugin-prometheus-3489-dependencies.md b/.changeset/@graphql-yoga_plugin-prometheus-3489-dependencies.md deleted file mode 100644 index fe7341cbd3..0000000000 --- a/.changeset/@graphql-yoga_plugin-prometheus-3489-dependencies.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@graphql-yoga/plugin-prometheus': patch ---- -dependencies updates: - - Updated dependency - [`@envelop/prometheus@11.1.0-alpha-20241122091727-adade563355e3d213f27427a9a1d86adf9431d41` - ↗︎](https://www.npmjs.com/package/@envelop/prometheus/v/11.1.0) (from `11.0.0`, in - `dependencies`) diff --git a/.changeset/@graphql-yoga_plugin-prometheus-3519-dependencies.md b/.changeset/@graphql-yoga_plugin-prometheus-3519-dependencies.md deleted file mode 100644 index 7ebdfe5c03..0000000000 --- a/.changeset/@graphql-yoga_plugin-prometheus-3519-dependencies.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@graphql-yoga/plugin-prometheus': patch ---- -dependencies updates: - - Updated dependency [`@envelop/prometheus@11.1.0` - ↗︎](https://www.npmjs.com/package/@envelop/prometheus/v/11.1.0) (from - `11.1.0-alpha-20241122091727-adade563355e3d213f27427a9a1d86adf9431d41`, in `dependencies`) diff --git a/.changeset/changelog.md b/.changeset/changelog.md deleted file mode 100644 index 34fc565a25..0000000000 --- a/.changeset/changelog.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@graphql-yoga/plugin-apollo-usage-report": minor ---- - -### Removed -- **Breaking change** remove option to set `clientName` and `clientVersion` as a static `string` in `ApolloUsageReportOptions` diff --git a/.changeset/changelog1.md b/.changeset/changelog1.md deleted file mode 100644 index cccf043792..0000000000 --- a/.changeset/changelog1.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@graphql-yoga/plugin-apollo-usage-report": patch ---- - -fixed: move logic from `onEnveloped` hook to `onParse` hook (`onParseEnd`) which prevents the `operationName` could be missing. diff --git a/.changeset/lazy-dancers-confess.md b/.changeset/lazy-dancers-confess.md deleted file mode 100644 index f45a756001..0000000000 --- a/.changeset/lazy-dancers-confess.md +++ /dev/null @@ -1,103 +0,0 @@ ---- -'@graphql-yoga/plugin-prometheus': minor ---- - -Allow to explicitly control which events and timing should be observe. - -Each metric can now be configured to observe events and timings only for certain GraphQL pipeline -phases, or depending on the request context. - -## Example: trace only execution and subscription errors - -```ts -import { execute, parse, specifiedRules, subscribe, validate } from 'graphql' -import { envelop, useEngine } from '@envelop/core' -import { usePrometheus } from '@envelop/prometheus' - -const TRACKED_OPERATION_NAMES = [ - // make a list of operation that you want to monitor -] - -const getEnveloped = envelop({ - plugins: [ - useEngine({ parse, validate, specifiedRules, execute, subscribe }), - usePrometheus({ - metrics: { - // Here, an array of phases can be provided to enable the metric only on certain phases. - // In this example, only error happening during the execute and subscribe phases will tracked - graphql_envelop_phase_error: ['execute', 'subscribe'] - } - }), - ], -}) -``` - -## Example: Monitor timing only of a set of operations by name - -```ts -import { execute, parse, specifiedRules, subscribe, validate } from 'graphql' -import { envelop, useEngine } from '@envelop/core' -import { usePrometheus } from '@envelop/prometheus' - -const TRACKED_OPERATION_NAMES = [ - // make a list of operation that you want to monitor -] - -const getEnveloped = envelop({ - plugins: [ - useEngine({ parse, validate, specifiedRules, execute, subscribe }), - usePrometheus({ - metrics: { - graphql_yoga_http_duration: createHistogram({ - registry, - histogram: { - name: 'graphql_envelop_request_duration', - help: 'Time spent on HTTP connection', - labelNames: ['operationName'] - }, - fillLabelsFn: ({ operationName }, _rawContext) => ({ operationName, }), - phases: ['execute', 'subscribe'], - - // Here `shouldObserve` control if the request timing should be observed, based on context - shouldObserve: ({ operationName }) => TRACKED_OPERATIONS.includes(operationName), - }) - }, - }) - ] -}) -``` - -## Default Behavior Change - -A metric is enabled using `true` value in metrics options will observe in every -phases available. - -Previously, which phase was observe was depending on which other metric were enabled. For example, -this config would only trace validation error: - -```ts -usePrometheus({ - metrics: { - graphql_envelop_phase_error: true, - graphql_envelop_phase_validate: true, - }, -}) -``` - -This is no longer the case. If you were relying on this behavior, please use an array of string to -restrict observed phases. - -```ts -usePrometheus({ - metrics: { - graphql_envelop_phase_error: ['validate'], - }, -}) -``` - -## Deprecation - -The `fillLabelFn` function was provided the `response` and `request` through the `context` argument. - -This is now deprecated, `request` and `response` are now available in the first `params` argument. -This change allows to provide better typing, since `context` is not typed. \ No newline at end of file diff --git a/packages/plugins/apollo-usage-report/CHANGELOG.md b/packages/plugins/apollo-usage-report/CHANGELOG.md index 6c3fe66900..a6017c2c09 100644 --- a/packages/plugins/apollo-usage-report/CHANGELOG.md +++ b/packages/plugins/apollo-usage-report/CHANGELOG.md @@ -1,5 +1,22 @@ # @graphql-yoga/plugin-apollo-usage-report +## 0.5.0 + +### Minor Changes + +- [#3458](https://github.com/dotansimha/graphql-yoga/pull/3458) + [`cb29c6c`](https://github.com/dotansimha/graphql-yoga/commit/cb29c6c03c83b552a39c3d5a4d2c1de2a9df4bee) + Thanks [@kroupacz](https://github.com/kroupacz)! - ### Removed + - **Breaking change** remove option to set `clientName` and `clientVersion` as a static `string` + in `ApolloUsageReportOptions` + +### Patch Changes + +- [#3488](https://github.com/dotansimha/graphql-yoga/pull/3488) + [`a4bc07f`](https://github.com/dotansimha/graphql-yoga/commit/a4bc07ff0120e8f817dd0efec575c1f35021e264) + Thanks [@kroupacz](https://github.com/kroupacz)! - fixed: move logic from `onEnveloped` hook to + `onParse` hook (`onParseEnd`) which prevents the `operationName` could be missing. + ## 0.4.3 ### Patch Changes diff --git a/packages/plugins/apollo-usage-report/package.json b/packages/plugins/apollo-usage-report/package.json index 153f75de6e..28cdb2b6aa 100644 --- a/packages/plugins/apollo-usage-report/package.json +++ b/packages/plugins/apollo-usage-report/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-yoga/plugin-apollo-usage-report", - "version": "0.4.3", + "version": "0.5.0", "type": "module", "description": "Apollo's GraphOS usage report plugin for GraphQL Yoga.", "repository": { diff --git a/packages/plugins/prometheus/CHANGELOG.md b/packages/plugins/prometheus/CHANGELOG.md index 8d6762a9e9..49b13e945f 100644 --- a/packages/plugins/prometheus/CHANGELOG.md +++ b/packages/plugins/prometheus/CHANGELOG.md @@ -1,5 +1,129 @@ # @graphql-yoga/plugin-prometheus +## 6.5.0 + +### Minor Changes + +- [#3489](https://github.com/dotansimha/graphql-yoga/pull/3489) + [`131dfa3`](https://github.com/dotansimha/graphql-yoga/commit/131dfa3f1b2e644501de4cfbc261d4b384bd20b1) + Thanks [@EmrysMyrddin](https://github.com/EmrysMyrddin)! - Allow to explicitly control which + events and timing should be observe. + + Each metric can now be configured to observe events and timings only for certain GraphQL pipeline + phases, or depending on the request context. + + ## Example: trace only execution and subscription errors + + ```ts + import { execute, parse, specifiedRules, subscribe, validate } from 'graphql' + import { envelop, useEngine } from '@envelop/core' + import { usePrometheus } from '@envelop/prometheus' + + const TRACKED_OPERATION_NAMES = [ + // make a list of operation that you want to monitor + ] + + const getEnveloped = envelop({ + plugins: [ + useEngine({ parse, validate, specifiedRules, execute, subscribe }), + usePrometheus({ + metrics: { + // Here, an array of phases can be provided to enable the metric only on certain phases. + // In this example, only error happening during the execute and subscribe phases will tracked + graphql_envelop_phase_error: ['execute', 'subscribe'] + } + }) + ] + }) + ``` + + ## Example: Monitor timing only of a set of operations by name + + ```ts + import { execute, parse, specifiedRules, subscribe, validate } from 'graphql' + import { envelop, useEngine } from '@envelop/core' + import { usePrometheus } from '@envelop/prometheus' + + const TRACKED_OPERATION_NAMES = [ + // make a list of operation that you want to monitor + ] + + const getEnveloped = envelop({ + plugins: [ + useEngine({ parse, validate, specifiedRules, execute, subscribe }), + usePrometheus({ + metrics: { + graphql_yoga_http_duration: createHistogram({ + registry, + histogram: { + name: 'graphql_envelop_request_duration', + help: 'Time spent on HTTP connection', + labelNames: ['operationName'] + }, + fillLabelsFn: ({ operationName }, _rawContext) => ({ operationName }), + phases: ['execute', 'subscribe'], + + // Here `shouldObserve` control if the request timing should be observed, based on context + shouldObserve: ({ operationName }) => TRACKED_OPERATIONS.includes(operationName) + }) + } + }) + ] + }) + ``` + + ## Default Behavior Change + + A metric is enabled using `true` value in metrics options will observe in every phases available. + + Previously, which phase was observe was depending on which other metric were enabled. For example, + this config would only trace validation error: + + ```ts + usePrometheus({ + metrics: { + graphql_envelop_phase_error: true, + graphql_envelop_phase_validate: true + } + }) + ``` + + This is no longer the case. If you were relying on this behavior, please use an array of string to + restrict observed phases. + + ```ts + usePrometheus({ + metrics: { + graphql_envelop_phase_error: ['validate'] + } + }) + ``` + + ## Deprecation + + The `fillLabelFn` function was provided the `response` and `request` through the `context` + argument. + + This is now deprecated, `request` and `response` are now available in the first `params` argument. + This change allows to provide better typing, since `context` is not typed. + +### Patch Changes + +- [#3489](https://github.com/dotansimha/graphql-yoga/pull/3489) + [`131dfa3`](https://github.com/dotansimha/graphql-yoga/commit/131dfa3f1b2e644501de4cfbc261d4b384bd20b1) + Thanks [@EmrysMyrddin](https://github.com/EmrysMyrddin)! - dependencies updates: + + - Updated dependency + [`@envelop/prometheus@11.1.0-alpha-20241122091727-adade563355e3d213f27427a9a1d86adf9431d41` ↗︎](https://www.npmjs.com/package/@envelop/prometheus/v/11.1.0) + (from `11.0.0`, in `dependencies`) + +- [#3519](https://github.com/dotansimha/graphql-yoga/pull/3519) + [`ca1e8b4`](https://github.com/dotansimha/graphql-yoga/commit/ca1e8b44c26e509397bee5cfdb5074f6e809fc34) + Thanks [@EmrysMyrddin](https://github.com/EmrysMyrddin)! - dependencies updates: + - Updated dependency + [`@envelop/prometheus@11.1.0` ↗︎](https://www.npmjs.com/package/@envelop/prometheus/v/11.1.0) + (from `11.1.0-alpha-20241122091727-adade563355e3d213f27427a9a1d86adf9431d41`, in `dependencies`) + ## 6.4.3 ### Patch Changes diff --git a/packages/plugins/prometheus/package.json b/packages/plugins/prometheus/package.json index c95c9cb2c8..493dc96385 100644 --- a/packages/plugins/prometheus/package.json +++ b/packages/plugins/prometheus/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-yoga/plugin-prometheus", - "version": "6.4.3", + "version": "6.5.0", "type": "module", "description": "Prometheus plugin for GraphQL Yoga.", "repository": {