Skip to content

Commit 358257c

Browse files
committed
ref(outcomes): Remove outcomes aggregator, implement forwarding of metrics as client reports
1 parent 9c7e88c commit 358257c

9 files changed

Lines changed: 297 additions & 436 deletions

File tree

relay-config/src/config.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,25 +1233,6 @@ pub enum NormalizationLevel {
12331233
Full,
12341234
}
12351235

1236-
/// Configuration values for the outcome aggregator
1237-
#[derive(Serialize, Deserialize, Debug)]
1238-
#[serde(default)]
1239-
pub struct OutcomeAggregatorConfig {
1240-
/// Defines the width of the buckets into which outcomes are aggregated, in seconds.
1241-
pub bucket_interval: u64,
1242-
/// Defines how often all buckets are flushed, in seconds.
1243-
pub flush_interval: u64,
1244-
}
1245-
1246-
impl Default for OutcomeAggregatorConfig {
1247-
fn default() -> Self {
1248-
Self {
1249-
bucket_interval: 60,
1250-
flush_interval: 120,
1251-
}
1252-
}
1253-
}
1254-
12551236
/// Configuration options for objectstore's auth scheme.
12561237
#[derive(Serialize, Deserialize)]
12571238
pub struct ObjectstoreAuthConfig {
@@ -1418,8 +1399,6 @@ pub struct Outcomes {
14181399
/// Defines the source string registered in the outcomes originating from
14191400
/// this Relay (typically something like the region or the layer).
14201401
pub source: Option<String>,
1421-
/// Configures the outcome aggregator.
1422-
pub aggregator: OutcomeAggregatorConfig,
14231402
}
14241403

14251404
impl Default for Outcomes {
@@ -1429,7 +1408,6 @@ impl Default for Outcomes {
14291408
batch_size: 1000,
14301409
batch_interval: 500,
14311410
source: None,
1432-
aggregator: OutcomeAggregatorConfig::default(),
14331411
}
14341412
}
14351413
}
@@ -2163,11 +2141,6 @@ impl Config {
21632141
self.values.outcomes.source.as_deref()
21642142
}
21652143

2166-
/// Returns the width of the buckets into which outcomes are aggregated, in seconds.
2167-
pub fn outcome_aggregator(&self) -> &OutcomeAggregatorConfig {
2168-
&self.values.outcomes.aggregator
2169-
}
2170-
21712144
/// Returns logging configuration.
21722145
pub fn logging(&self) -> &relay_log::LogConfig {
21732146
&self.values.logging

relay-server/src/service.rs

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ use crate::services::metrics::RouterService;
1717
use crate::services::objectstore::Objectstore;
1818
#[cfg(feature = "processing")]
1919
use crate::services::objectstore::ObjectstoreService;
20-
use crate::services::outcome::{
21-
OutcomeAggregator, OutcomeProducer, OutcomeProducerService, TrackOutcome,
22-
};
20+
use crate::services::outcome::{OutcomeProducerService, TrackOutcome};
2321
use crate::services::processor::{
2422
self, EnvelopeProcessor, EnvelopeProcessorService, EnvelopeProcessorServicePool,
2523
};
@@ -73,7 +71,6 @@ pub enum ServiceError {
7371
#[derive(Clone, Debug)]
7472
pub struct Registry {
7573
pub health_check: Addr<HealthCheck>,
76-
pub outcome_producer: Addr<OutcomeProducer>,
7774
pub outcome_aggregator: Addr<TrackOutcome>,
7875
pub processor: Addr<EnvelopeProcessor>,
7976
pub relay_cache: Addr<RelayCache>,
@@ -201,13 +198,10 @@ impl ServiceState {
201198

202199
let (aggregator, aggregator_rx) = channel(RouterService::name());
203200

204-
let outcome_producer = services.start(OutcomeProducerService::create(
205-
config.clone(),
206-
processor.clone(),
201+
let outcome_aggregator = services.start(OutcomeProducerService::new(
202+
Arc::clone(&config),
207203
aggregator.clone(),
208-
)?);
209-
let outcome_aggregator =
210-
services.start(OutcomeAggregator::new(&config, outcome_producer.clone()));
204+
));
211205

212206
let (global_config, global_config_rx) =
213207
GlobalConfigService::new(config.clone(), upstream_relay.clone());
@@ -365,7 +359,6 @@ impl ServiceState {
365359
let registry = Registry {
366360
processor,
367361
health_check,
368-
outcome_producer,
369362
outcome_aggregator,
370363
relay_cache,
371364
global_config,
@@ -426,17 +419,12 @@ impl ServiceState {
426419
&self.inner.registry.health_check
427420
}
428421

429-
/// Returns the address of the [`OutcomeProducer`] service.
430-
pub fn outcome_producer(&self) -> &Addr<OutcomeProducer> {
431-
&self.inner.registry.outcome_producer
432-
}
433-
434-
/// Returns the address of the [`OutcomeProducer`] service.
422+
/// Returns the address of the [`UpstreamRelay`] service.
435423
pub fn upstream_relay(&self) -> &Addr<UpstreamRelay> {
436424
&self.inner.registry.upstream_relay
437425
}
438426

439-
/// Returns the address of the [`OutcomeProducer`] service.
427+
/// Returns the address of the [`EnvelopeProcessor`] service.
440428
pub fn processor(&self) -> &Addr<EnvelopeProcessor> {
441429
&self.inner.registry.processor
442430
}
@@ -446,7 +434,7 @@ impl ServiceState {
446434
&self.inner.registry.global_config
447435
}
448436

449-
/// Returns the address of the [`OutcomeProducer`] service.
437+
/// Returns the address of the [`TrackOutcome`] service.
450438
pub fn outcome_aggregator(&self) -> &Addr<TrackOutcome> {
451439
&self.inner.registry.outcome_aggregator
452440
}

relay-server/src/services/outcome/aggregator.rs

Lines changed: 0 additions & 173 deletions
This file was deleted.

0 commit comments

Comments
 (0)