-
Notifications
You must be signed in to change notification settings - Fork 104
ref(logs): Process logs in all non-proxy Relays #4973
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
Conversation
a9df6b2
to
9f30258
Compare
8aed8e2
to
4067cf8
Compare
4067cf8
to
0a9d954
Compare
if ctx.is_processing() { | ||
let mut logs = process::expand(logs, ctx); | ||
process::process(&mut logs, ctx); | ||
self.limiter.enforce_quotas(&mut logs, ctx).await?; |
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.
This means quota enforcement now happens after expansion and processing, when it was the other way around before. I assume that's intentional?
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.
Not yet relevant, will be relevant once we have inbound filters. We don't want to count things we're going to drop.
Also technically wrong before.
@@ -247,7 +247,7 @@ pub struct RequestMeta<D = PartialDsn> { | |||
/// | |||
/// NOTE: This is internal-only and not exposed to Envelope headers. | |||
#[serde(skip)] | |||
from_internal_relay: bool, | |||
request_trust: Option<RequestTrust>, |
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.
Is there an actual advantage to making this optional? AFAICT None
has the same meaning as Some(Untrusted)
in all cases.
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.
Yes, copy_to
will now handle missing correctly, where before it would not. Also technically a bug that existed before and now became obvious with more typing.
The first big step at supporting inbound filters for logs.
Expansion and normalization of logs must happen in the same stage as inbound filters, since inbound filters must run at the earliest point possible to minimize unnecessary processing/traffic the normalization must also happen then.
This change enables processing of logs in all Relays except Relays running in proxy mode. Proxy mode does not have access to the necessary processing config to apply inbound filters or do full processing.
As a side effect, static and other customer managed Relays will now (correctly) apply PII rules, as they always should've been.
Tests have been improved to always use a Relay chain, size assertions are done on a trusted and untrusted Relay chain.
I also replaced the
is_from_trusted_relay
with a proper enum to not run into an issue where somewhat important information is passed around as a boolean. Adds some type-safety.Things to be done in a follow-up:
Closes: #4990
Closes: INGEST-469