-
Notifications
You must be signed in to change notification settings - Fork 331
fix(telemetry): improve support of conditions at the request level, especially for events #5759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
baaaa61
wip
bnjjj 8f44ff5
improve support of conditions at the request level, especially for ev…
bnjjj 10c8e32
fix tests
bnjjj f556154
fix lint
bnjjj a0a2a96
fix lint
bnjjj 7464294
add test
bnjjj 5f63ce4
changelog
bnjjj 50756f6
add support of warning for configuration
bnjjj e4476a3
lint
Geal 5ab693e
Merge branch 'dev' of github.com:apollographql/router into bnjjj/fix_…
bnjjj b4086a0
add tests
bnjjj c786297
Merge branch 'bnjjj/fix_5702' of github.com:apollographql/router into…
bnjjj aeb1917
lint
bnjjj 5ef90f4
add changeset
bnjjj b965524
lint changeset
bnjjj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,26 @@ | ||
| ### Add warnings for invalid configuration on custom telemetry ([PR #5759](https://github.com/apollographql/router/issues/5759)) | ||
|
|
||
| For example sometimes if you have configuration like this: | ||
|
|
||
| ```yaml | ||
| telemetry: | ||
| instrumentation: | ||
| events: | ||
| subgraph: | ||
| my.event: | ||
| message: "Auditing Router Event" | ||
| level: info | ||
| on: request | ||
| attributes: | ||
| subgraph.response.status: | ||
| subgraph_response_status: code # This is a first warning because you can't access to the response if you're at the request stage | ||
| condition: | ||
| eq: | ||
| - subgraph_name # Another warning because instead of writing subgraph_name: true which is the selector, you're asking for a comparison between 2 strings ("subgraph_name" and "product") | ||
| - product | ||
| ``` | ||
|
|
||
| This configuration is syntaxically correct but wouldn't probably do what you would like to. I put comments to highlight 2 mistakes in this example. | ||
| Before it was silently computed, now you'll get warning when starting the router. | ||
|
|
||
| By [@bnjjj](https://github.com/bnjjj) in https://github.com/apollographql/router/pull/5759 |
This file contains hidden or 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,21 @@ | ||
| ### Improve support of conditions at the request level, especially for events ([Issue #5702](https://github.com/apollographql/router/issues/5702)) | ||
|
|
||
| `exists` condition is now properly handled with events, this configuration will now work: | ||
|
|
||
| ```yaml | ||
| telemetry: | ||
| instrumentation: | ||
| events: | ||
| supergraph: | ||
| my.event: | ||
| message: "Auditing Router Event" | ||
| level: info | ||
| on: request | ||
| attributes: | ||
| graphql.operation.name: true | ||
| condition: | ||
| exists: | ||
| operation_name: string | ||
| ``` | ||
|
|
||
| By [@bnjjj](https://github.com/bnjjj) in https://github.com/apollographql/router/pull/5759 |
This file contains hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.