-
Notifications
You must be signed in to change notification settings - Fork 128
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 metrics options (#2270)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
- Loading branch information
1 parent
6b4b73c
commit 73eb69f
Showing
9 changed files
with
1,170 additions
and
400 deletions.
There are no files selected for viewing
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,51 @@ | ||
--- | ||
'@envelop/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 | ||
|
||
- 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_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,5 @@ | ||
--- | ||
'@envelop/prometheus': minor | ||
--- | ||
|
||
Add missing labels `path` and `phase` of `graphql_envelop_error_result` metric to the configuration. |
Large diffs are not rendered by default.
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
Oops, something went wrong.