relay_server/services/mod.rs
1//! Defines all services of Relay.
2//!
3//! Services require a tokio to run, see [`relay_system`] and particularly
4//! [`Controller`](relay_system::Controller) for more information.
5//!
6//! The web server is wrapped by [`HttpServer`](server::HttpServer). It starts the actual web server
7//! and dispatches the graceful shutdown signal. Internally, it creates several other services
8//! comprising the service state:
9//!
10//! - [`ProjectCache`](projects::cache::ProjectCache): A cache that serves queries for project
11//! configurations. Its requests are debounced and batched based on a configured interval (100ms
12//! by default). Also, missing projects are cached for some time.
13//! - [`EnvelopeProcessor`](processor::EnvelopeProcessor): A worker pool for CPU-intensive tasks.
14//! Most importantly, this implements envelope processing to verify their projects, execute PII
15//! stripping and finally send the envelope to the upstream.
16//! - [`UpstreamRelay`](upstream::UpstreamRelay): Abstraction for communication with the upstream
17//! (either another Relay or Sentry). It manages an internal client connector to throttle
18//! requests and ensures this relay is authenticated before sending queries (e.g. project config
19//! or public keys).
20//!
21//! # Example
22//!
23//! ```ignore
24//! use relay_server::controller::Controller;
25//! use relay_server::server::Server;
26//!
27//! Controller::run(|| Server::start())
28//! .expect("failed to start relay");
29//! ```
30pub mod buffer;
31pub mod cogs;
32pub mod global_config;
33#[cfg(feature = "processing")]
34pub mod global_rate_limits;
35pub mod health_check;
36pub mod metrics;
37pub mod outcome;
38pub mod outcome_aggregator;
39pub mod processor;
40pub mod projects;
41pub mod relays;
42pub mod server;
43pub mod stats;
44pub mod test_store;
45pub mod upstream;
46
47pub mod autoscaling;
48#[cfg(feature = "processing")]
49pub mod store;