-
Notifications
You must be signed in to change notification settings - Fork 574
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(release): update monorepo packages versions (#3514)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
ca1e8b4
commit bc327db
Showing
9 changed files
with
143 additions
and
131 deletions.
There are no files selected for viewing
8 changes: 0 additions & 8 deletions
8
.changeset/@graphql-yoga_plugin-prometheus-3489-dependencies.md
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
.changeset/@graphql-yoga_plugin-prometheus-3519-dependencies.md
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/[email protected]` ↗︎](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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters