-
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.
refactor(prometheus-plugin): rename metric options names (#3391)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
f5a2ae9
commit 0788d8a
Showing
11 changed files
with
920 additions
and
494 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
.changeset/@graphql-yoga_plugin-prometheus-3391-dependencies.md
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@graphql-yoga/plugin-prometheus': patch | ||
--- | ||
dependencies updates: | ||
- Updated dependency [`@envelop/[email protected]` | ||
↗︎](https://www.npmjs.com/package/@envelop/prometheus/v/11.0.0) (from `^10.0.0`, in | ||
`dependencies`) |
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
'@graphql-yoga/plugin-prometheus': major | ||
--- | ||
|
||
**Breaking Change:** Rename all metrics options to their actual metric name to avoid confusion. | ||
|
||
All metric options have been moved under a mandatory `metrics` key, and the name of each options | ||
have been renamed to match the default metric name. | ||
|
||
The plugin option argument is also now mandatory. | ||
|
||
```diff | ||
export const serveConfig = defineConfig({ | ||
plugins: pluginCtx => [ | ||
usePrometheus({ | ||
...pluginCtx, | ||
|
||
// Enable all available metrics | ||
- http: true | ||
- requestSummary: true, | ||
- parse: true, | ||
- validate: true, | ||
- contextBuilding: true, | ||
- execute: true, | ||
- subscribe: true, | ||
- errors: true, | ||
- deprecatedFields: true, | ||
- requestTotalDuration: true, | ||
- schemaChangeCount: true, | ||
|
||
// Warning: enabling resolvers level metrics will introduce significant overhead | ||
- resolvers: true, | ||
+ metrics: { | ||
+ graphql_yoga_http_duration: true, | ||
+ graphql_envelop_request_time_summary: true, | ||
+ graphql_envelop_phase_parse: true, | ||
+ graphql_envelop_phase_validate: true, | ||
+ graphql_envelop_phase_context: true, | ||
+ graphql_envelop_phase_execute: true, | ||
+ graphql_envelop_phase_subscribe: true, | ||
+ graphql_envelop_error_result: true, | ||
+ graphql_envelop_deprecated_field: true, | ||
+ graphql_envelop_request_duration: true, | ||
+ graphql_envelop_schema_change: true, | ||
|
||
// Warning: enabling resolvers level metrics will introduce significant overhead | ||
+ graphql_envelop_execute_resolver: true, | ||
+ } | ||
}) | ||
] | ||
}) | ||
``` | ||
|
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@graphql-yoga/plugin-prometheus': minor | ||
--- | ||
|
||
Add missing labels `path` and `phase` of `graphql_envelop_error_result` metric to the configuration. | ||
|
||
Add missing labels `method` and `statusCode` of `graphql_yoga_http_duration` metric to the configuration. |
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.