-
Notifications
You must be signed in to change notification settings - Fork 102
feat(relay): Simplify Proxy Mode #5165
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
base: master
Are you sure you want to change the base?
Conversation
…rt of t eh parameterization.
) | ||
.collect(); | ||
let worker_pool_utilization = self.async_pool.metrics().total_utilization(); | ||
let worker_pool_utilization = self.async_pool.as_ref().map_or(0, |pool| pool.metrics().total_utilization()); |
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 sure if it is better here to make the runtime_utilization
in AutoscalingData
an option rather than setting 0 here.
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.
Intuitively using 0 here makes sense to me.
) | ||
.collect(); | ||
let worker_pool_utilization = self.async_pool.metrics().total_utilization(); | ||
let worker_pool_utilization = self.async_pool.as_ref().map_or(0, |pool| pool.metrics().total_utilization()); |
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.
Intuitively using 0 here makes sense to me.
pub struct ProxyProcessorService { | ||
inner: InnerProxyProcessor, | ||
} | ||
|
||
struct InnerProxyProcessor { | ||
config: Arc<Config>, | ||
project_cache: ProjectCacheHandle, | ||
addrs: ProxyAddrs, | ||
} |
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's the reason for the inner struct?
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.
As Sebastian mentions, this looks like a leftover from when it was still multi-threaded.
envelope_buffer: PartitionedEnvelopeBuffer, | ||
handle: Handle, | ||
async_pool: EnvelopeProcessorServicePool, | ||
async_pool: Option<EnvelopeProcessorServicePool>, |
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.
Mh, we could also disable the service and not run it at all in Proxy mode.
impl ProcessingGroup { | ||
/// Splits provided envelope into list of tuples of groups with associated envelopes. | ||
fn split_envelope( | ||
pub fn split_envelope( |
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 shouldn't be necessary.
#[derive(Debug)] | ||
pub struct SendEnvelope { | ||
envelope: TypedEnvelope<Processed>, | ||
body: Bytes, | ||
http_encoding: HttpEncoding, | ||
project_cache: ProjectCacheHandle, | ||
pub envelope: TypedEnvelope<Processed>, | ||
pub body: Bytes, | ||
pub http_encoding: HttpEncoding, | ||
pub project_cache: ProjectCacheHandle, | ||
} |
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.
For the reader, we discussed what to do here and decided to just make it public for this PR, we can clean up visibility and types in a follow up
pub struct ProxyProcessorService { | ||
inner: InnerProxyProcessor, | ||
} | ||
|
||
struct InnerProxyProcessor { | ||
config: Arc<Config>, | ||
project_cache: ProjectCacheHandle, | ||
addrs: ProxyAddrs, | ||
} |
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.
As Sebastian mentions, this looks like a leftover from when it was still multi-threaded.
pub outcome_aggregator: Addr<TrackOutcome>, | ||
pub upstream_relay: Addr<UpstreamRelay>, |
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.
Generally we want docs on public fields, even if they are just very basic.
} | ||
|
||
impl ProxyProcessorService { | ||
/// Creates a multi-threaded proxy processor. |
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.
It's not multi threaded.
let mut envelope = Envelope::from_request(None, RequestMeta::outbound(dsn)); | ||
for client_report in client_reports { | ||
let mut item = Item::new(ItemType::ClientReport); | ||
item.set_payload(ContentType::Json, client_report.serialize().unwrap()); // TODO: unwrap OK? |
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.
Unwraps (with a TODO) are never okay, that todo should've been cleaned up a while ago in the other processor 🙈
Fine to leave it for now, we can do that in a follow up.
fn submit_upstream(&self, envelope: ManagedEnvelope) { | ||
let mut envelope = envelope; |
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.
fn submit_upstream(&self, envelope: ManagedEnvelope) { | |
let mut envelope = envelope; | |
fn submit_upstream(&self, mut envelope: ManagedEnvelope) { |
|
||
**Breaking Changes**: | ||
|
||
- Simplify proxy mode to forward without processing ([#5165](https://github.com/getsentry/relay/pull/5165)) |
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.
- Simplify proxy mode to forward without processing ([#5165](https://github.com/getsentry/relay/pull/5165)) | |
- Simplify proxy mode to forward without processing. ([#5165](https://github.com/getsentry/relay/pull/5165)) |
|
||
## Unreleased | ||
|
||
**Breaking Changes**: |
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.
Since this is a large fundamental change of how Relay operates in Proxy mode it's a good idea to call that out.
Ideally the PR description then goes into details why this is a breaking change and/or what users are expected to do when they encounter this one.
Introduces the
ProxyProcessorService
which is a simplified version of theEnvelopeProcessorService
to use if Relay is run in the Proxy mode. Also does some changes to theHealthCheckService
,AutoscalingMetricService
andRelayStats
to make these compatible.Fixes: https://linear.app/getsentry/issue/INGEST-581/simplify-proxy-mode