-
Notifications
You must be signed in to change notification settings - Fork 272
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
feat(telemetry): selectively transmit/redact subgraph ftv1 error messages to studio #3011
Conversation
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good to me! Mostly a suggested change to the changeset entry.
/// Enable field level instrumentation for subgraphs via ftv1. ftv1 tracing can cause performance issues as it is transmitted in band with subgraph responses. | ||
/// 0.0 will result in no field level instrumentation. 1.0 will result in always instrumentation. | ||
/// Value MUST be less than global sampling rate | ||
/// Field level instrumentation for subgraphs via ftv1. ftv1 tracing can cause performance issues as it is transmitted in band with subgraph responses. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the motivation for this change in relation to this PR?
apollo-router/src/plugins/telemetry/tracing/apollo_telemetry.rs
Outdated
Show resolved
Hide resolved
if let Some(mut t) = decode_ftv1_trace(s.as_str()) { | ||
if error_config.redact || !error_config.send { | ||
if let Some(root) = &mut t.root { | ||
redact_node_errors(root, !error_config.send); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel this code is confusing. The function is called redact_node_errors
but takes the send config.
It'd be easier to get if it had the following signature preprocess_errors(root, redact, send)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with this feedback, but let's follow-up on this in another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done here #3030
Co-authored-by: Bryn Cooke <BrynCooke@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks! (There's one follow-up comment within from @BrynCooke for another PR [maybe?])
…llo studio (#3030) related to #3011 (comment) --------- Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
…ages to studio (#3011) When using subgraphs which are enabled with [Apollo Federated Tracing](https://www.apollographql.com/docs/router/configuration/apollo-telemetry/#enabling-field-level-instrumentation), the error messages within those traces will be **redacted by default**. New configuration (`tracing.apollo.errors.subgraph.all.redact`, which defaults to `true`) enables and disables the redaction mechanism. Similar configuration (`tracing.apollo.errors.subgraph.all.send`, which also defaults to `true`) enables and disables the entire transmission of the error to Studio. The error messages returned to the clients are **not** changed or redacted from their previous behavior. To enable sending subgraph's federated trace error messages to Studio **without redaction**, you can set the following configuration: ```yaml title="router.yaml" telemetry: apollo: errors: subgraph: all: send: true # (true = Send to Studio, false = Do not send; default: true) redact: false # (true = Redact full error message, false = Do not redact; default: true) ``` It is also possible to configure this **per-subgraph** using a `subgraphs` map at the same level as `all` in the configuration, much like other sections of the configuration which have subgraph-specific capabilities: ```yaml title="router.yaml" telemetry: apollo: errors: subgraph: all: send: true redact: false # Disable redaction as a default. The `accounts` service enables it below. subgraphs: accounts: # Applies to the `accounts` subgraph, overriding the `all` global setting. redact: true # Redact messages from the `accounts` service. ``` By [@bnjjj](https://github.com/bnjjj) in #3011 --------- Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com> Co-authored-by: Jesse Rosenberger <git@jro.cc> Co-authored-by: Bryn Cooke <BrynCooke@gmail.com>
…llo studio (#3030) related to #3011 (comment) --------- Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Add ability to transmit un-redacted errors from federated traces to Apollo Studio
When using subgraphs which are enabled with Apollo Federated Tracing, the error messages within those traces will be redacted by default.
New configuration (
tracing.apollo.errors.subgraph.all.redact
, which defaults totrue
) enables and disables the redaction mechanism. Similar configuration (tracing.apollo.errors.subgraph.all.send
, which also defaults totrue
) enables and disables the entire transmission of the error to Studio.The error messages returned to the clients are not changed or redacted from their previous behavior.
To enable sending subgraph's federated trace error messages to Studio without redaction, you can set the following configuration:
It is also possible to configure this per-subgraph using a
subgraphs
map at the same level asall
in the configuration, much like other sections of the configuration which have subgraph-specific capabilities:By @bnjjj in #3011