@envelop/prometheus 7.0.0 → 7.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -26,13 +26,13 @@ yarn add prom-client @envelop/prometheus
|
|
|
26
26
|
## Usage Example
|
|
27
27
|
|
|
28
28
|
```ts
|
|
29
|
-
import { parse, validate, execute, subscribe } from 'graphql'
|
|
29
|
+
import { parse, validate, specifiedRules, execute, subscribe } from 'graphql'
|
|
30
30
|
import { envelop, useEngine } from '@envelop/core'
|
|
31
31
|
import { usePrometheus } from '@envelop/prometheus'
|
|
32
32
|
|
|
33
33
|
const getEnveloped = envelop({
|
|
34
34
|
plugins: [
|
|
35
|
-
useEngine({ parse, validate, execute, subscribe }),
|
|
35
|
+
useEngine({ parse, validate, specifiedRules, execute, subscribe }),
|
|
36
36
|
// ... other plugins ...
|
|
37
37
|
usePrometheus({
|
|
38
38
|
// all optional, and by default, all set to false, please opt-in to the metrics you wish to get
|
|
@@ -59,7 +59,7 @@ const getEnveloped = envelop({
|
|
|
59
59
|
You can customize the `prom-client` `Registry` object if you are using a custom one, by passing it along with the configuration object:
|
|
60
60
|
|
|
61
61
|
```ts
|
|
62
|
-
import { parse, validate, execute, subscribe } from 'graphql'
|
|
62
|
+
import { parse, validate, specifiedRules, execute, subscribe } from 'graphql'
|
|
63
63
|
import { envelop, useEngine } from '@envelop/core'
|
|
64
64
|
import { Registry } from 'prom-client'
|
|
65
65
|
|
|
@@ -67,7 +67,7 @@ const myRegistry = new Registry()
|
|
|
67
67
|
|
|
68
68
|
const getEnveloped = envelop({
|
|
69
69
|
plugins: [
|
|
70
|
-
useEngine({ parse, validate, execute, subscribe }),
|
|
70
|
+
useEngine({ parse, validate, specifiedRules, execute, subscribe }),
|
|
71
71
|
// ... other plugins ...
|
|
72
72
|
usePrometheus({
|
|
73
73
|
// ... config ...
|
|
@@ -88,14 +88,14 @@ If you wish to disable introspection logging, you can use `skipIntrospection: tr
|
|
|
88
88
|
Each tracing field supports custom `prom-client` objects, and custom `labels` a metadata, you can create a custom extraction function for every `Histogram` / `Summary` / `Counter`:
|
|
89
89
|
|
|
90
90
|
```ts
|
|
91
|
-
import { parse, validate, execute, subscribe } from 'graphql'
|
|
91
|
+
import { parse, validate, specifiedRules, execute, subscribe } from 'graphql'
|
|
92
92
|
import { Histogram } from 'prom-client'
|
|
93
93
|
import { envelop, useEngine } from '@envelop/core'
|
|
94
94
|
import { createHistogram, usePrometheus } from '@envelop/prometheus'
|
|
95
95
|
|
|
96
96
|
const getEnveloped = envelop({
|
|
97
97
|
plugins: [
|
|
98
|
-
useEngine({ parse, validate, execute, subscribe }),
|
|
98
|
+
useEngine({ parse, validate, specifiedRules, execute, subscribe }),
|
|
99
99
|
// ... other plugins ...
|
|
100
100
|
usePrometheus({
|
|
101
101
|
// all optional, and by default, all set to false, please opt-in to the metrics you wish to get
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envelop/prometheus",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.1",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@envelop/core": "^3.0.
|
|
6
|
+
"@envelop/core": "^3.0.1",
|
|
7
7
|
"prom-client": "^13 || ^14.0.0",
|
|
8
8
|
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
9
9
|
},
|