-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(telemetry): improve support of conditions at the request level, e…
…specially for events (#5759) Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
- Loading branch information
Showing
15 changed files
with
638 additions
and
22 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,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 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 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
Oops, something went wrong.