Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(cymbal): run resolution service as a mode of cymbal (#64567)

Hugues Pouillot888cb6e155f3
diff --git a/.github/rust-images.yml b/.github/rust-images.yml
index a961beec5cb0..c7e978997734 100644
--- a/.github/rust-images.yml
+++ b/.github/rust-images.yml
@@ -31,10 +31,6 @@
dockerfile: ./rust/Dockerfile
project: 8dq0xkk0ck
-- image: cymbal-resolution
- dockerfile: ./rust/Dockerfile
- project: 8dq0xkk0ck
-
- image: embedding-worker
dockerfile: ./rust/Dockerfile
project: 8dq0xkk0ck
diff --git a/.github/workflows/rust-docker-build.yml b/.github/workflows/rust-docker-build.yml
index d9bf22719456..efd4ea7984b7 100644
--- a/.github/workflows/rust-docker-build.yml
+++ b/.github/workflows/rust-docker-build.yml
@@ -141,9 +141,6 @@ jobs:
- release: cymbal
digest_key: cymbal
values_key: image
- - release: cymbal-resolution
- digest_key: cymbal-resolution
- values_key: image
- release: embedding-worker
digest_key: embedding-worker
values_key: image
diff --git a/rust/Cargo.lock b/rust/Cargo.lock
index 9c4fe571fc31..a1b90fa88011 100644
--- a/rust/Cargo.lock
+++ b/rust/Cargo.lock
@@ -2705,6 +2705,7 @@ dependencies = [
name = "cymbal"
version = "0.1.0"
dependencies = [
+ "async-stream",
"async-trait",
"aws-config",
"aws-sdk-s3",
@@ -2721,7 +2722,6 @@ dependencies = [
"common-redis",
"common-types",
"cymbal-proto",
- "cymbal-resolution",
"envconfig",
"futures",
"health",
@@ -2731,6 +2731,7 @@ dependencies = [
"metrics",
"mockall",
"moka",
+ "personhog-common",
"posthog-rs 0.12.0",
"posthog-symbol-data",
"proguard",
@@ -2744,6 +2745,7 @@ dependencies = [
"sha2",
"sourcemap",
"sqlx",
+ "subtle",
"symbolic",
"thiserror 2.0.18",
"tiktoken-rs",
@@ -2766,32 +2768,6 @@ dependencies = [
"tonic-build 0.12.3",
]
-[[package]]
-name = "cymbal-resolution"
-version = "0.1.0"
-dependencies = [
- "async-stream",
- "async-trait",
- "axum 0.7.9",
- "common-alloc",
- "common-metrics",
- "common-posthog",
- "cymbal",
- "cymbal-proto",
- "envconfig",
- "futures",
- "metrics",
- "personhog-common",
- "serde_json",
- "subtle",
- "tokio",
- "tokio-stream",
- "tonic 0.12.3",
- "tracing",
- "tracing-subscriber",
- "uuid",
-]
-
[[package]]
name = "darling"
version = "0.20.11"
@@ -11815,9 +11791,9 @@ dependencies = [
[[package]]
name = "webpki-root-certs"
-version = "1.0.7"
+version = "1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f31141ce3fc3e300ae89b78c0dd67f9708061d1d2eda54b8209346fd6be9a92c"
+checksum = "0d46a5a140e6f7afeccd8eae97eff335163939eac8b929834875168b29b3d267"
dependencies = [
"rustls-pki-types",
]
diff --git a/rust/Cargo.toml b/rust/Cargo.toml
index 70e074c4267d..0c660c12aa2e 100644
--- a/rust/Cargo.toml
+++ b/rust/Cargo.toml
@@ -37,7 +37,6 @@ members = [
"cyclotron-janitor",
"cymbal",
"cymbal-proto",
- "cymbal-resolution",
"embedding-worker",
"common/geoip",
"common/hogvm",
diff --git a/rust/cymbal-proto/src/lib.rs b/rust/cymbal-proto/src/lib.rs
index 658aea2282b6..627c741fb44b 100644
--- a/rust/cymbal-proto/src/lib.rs
+++ b/rust/cymbal-proto/src/lib.rs
@@ -2,6 +2,21 @@ pub mod cymbal {
pub mod resolution {
pub mod v1 {
tonic::include_proto!("cymbal.resolution.v1");
+
+ impl ErrorKind {
+ /// Bounded metric label for this error kind, shared by the
+ /// remote client and the resolution service so their `kind=`
+ /// labels never drift.
+ pub fn metric_label(self) -> &'static str {
+ match self {
+ ErrorKind::Unspecified => "unspecified",
+ ErrorKind::InvalidPayload => "invalid_payload",
+ ErrorKind::Poison => "poison",
+ ErrorKind::Unhandled => "unhandled",
+ ErrorKind::Overloaded => "overloaded",
+ }
+ }
+ }
}
}
}
diff --git a/rust/cymbal-resolution/Cargo.toml b/rust/cymbal-resolution/Cargo.toml
deleted file mode 100644
index f09e385368b4..000000000000
--- a/rust/cymbal-resolution/Cargo.toml
+++ /dev/null
@@ -1,35 +0,0 @@
-[package]
-name = "cymbal-resolution"
-version = "0.1.0"
-edition = "2021"
-publish = false
-
-[dependencies]
-cymbal = { path = "../cymbal" }
-cymbal-proto = { path = "../cymbal-proto" }
-personhog-common = { path = "../personhog-common" }
-common-alloc = { path = "../common/alloc" }
-common-metrics = { path = "../common/metrics" }
-common-posthog = { path = "../common/posthog" }
-
-async-stream = { workspace = true }
-axum = { workspace = true }
-envconfig = { workspace = true }
-futures = { workspace = true }
-metrics = { workspace = true }
-serde_json = { workspace = true }
-subtle = "2.6"
-tokio = { workspace = true }
-tokio-stream = "0.1"
-tonic = { workspace = true }
-tracing = { workspace = true }
-tracing-subscriber = { workspace = true }
-uuid = { workspace = true }
-
-[dev-dependencies]
-async-trait = { workspace = true }
-tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
-tokio-stream = "0.1"
-
-[lints]
-workspace = true
diff --git a/rust/cymbal-resolution/src/app_context.rs b/rust/cymbal-resolution/src/app_context.rs
deleted file mode 100644
index 1316bf075c04..000000000000
--- a/rust/cymbal-resolution/src/app_context.rs
+++ /dev/null
@@ -1,67 +0,0 @@
-use std::sync::Arc;
-
-use cymbal::app_context::build_symbol_resolver;
-use cymbal::config::Config as CymbalConfig;
-use cymbal::error::UnhandledError;
-use cymbal::stages::resolution::symbol::SymbolResolver;
-use tokio::sync::Semaphore;
-
-use crate::config::Config;
-use crate::load_monitor::LoadMonitor;
-
-/// Process-wide handles required to serve `cymbal.resolution.v1`.
-///
-/// v1 reuses cymbal's symbol-resolution stack (catalog + frame cache + PG-
-/// backed resolved-frame reuse) via [`build_symbol_resolver`]. That builder
-/// only connects to Postgres and S3 — Kafka producers, Redis, the issue
-/// cache, signals, and the remote-resolution pool are intentionally NOT
-/// started here. cymbal-resolution owns symbol resolution only.
-pub struct AppContext {
- pub symbol_resolver: Arc<dyn SymbolResolver>,
- pub symbol_resolution_limiter: Arc<Semaphore>,
- pub load_monitor: LoadMonitor,
- pub config: Config,
- pub service_instance_id: String,
-}
-
-impl AppContext {
- pub async fn from_config(
- config: Config,
- cymbal_config: &CymbalConfig,
- ) -> Result<Self, UnhandledError> {
- let symbol_resolver = build_symbol_resolver(cymbal_config).await?;
- Ok(Self::from_resolver(
- config,
- symbol_resolver,
- // Use a dedicated limiter for this service so its concurrency
- // surface is independent of any cymbal-side configuration.
- None,
- ))
- }
-
- /// Constructor for tests and integrations that already own a resolver. The
- /// optional limiter override is used by tests that need to force the
- /// permit acquisition path; production callers pass `None`.
- pub fn from_resolver(
- config: Config,
- symbol_resolver: Arc<dyn SymbolResolver>,
- symbol_resolution_limiter: Option<Arc<Semaphore>>,
- ) -> Self {
- let symbol_resolution_limiter = symbol_resolution_limiter.unwrap_or_else(|| {
- Arc::new(Semaphore::new(config.symbol_resolution_concurrency.max(1)))
- });
- let max_item_concurrency = config.max_item_concurrency.max(1);
- let load_monitor = LoadMonitor::new(max_item_concurrency as u32);
- let service_instance_id = config
- .service_instance_id
- .clone()
- .unwrap_or_else(|| uuid::Uuid::now_v7().to_string());
- Self {
- symbol_resolver,
- symbol_resolution_limiter,
- load_monitor,
- config,
- service_instance_id,
- }
- }
-}
diff --git a/rust/cymbal-resolution/src/item_limiter.rs b/rust/cymbal-resolution/src/item_limiter.rs
deleted file mode 100644
index 49df40e5814d..000000000000
--- a/rust/cymbal-resolution/src/item_limiter.rs
+++ /dev/null
@@ -1,61 +0,0 @@
-use std::sync::Arc;
-
-use tokio::sync::{AcquireError, OwnedSemaphorePermit, Semaphore, TryAcquireError};
-
-/// Process-wide admission gate for exception item processing.
-#[derive(Clone, Debug)]
-pub struct ItemLimiter {
- semaphore: Arc<Semaphore>,
- max_permits: usize,
-}
-
-impl ItemLimiter {
- pub fn new(max_permits: usize) -> Self {
- let max_permits = max_permits.max(1);
- Self {
- semaphore: Arc::new(Semaphore::new(max_permits)),
- max_permits,
- }
- }
-
- pub fn from_semaphore(semaphore: Arc<Semaphore>, max_permits: usize) -> Self {
- Self {
- semaphore,
- max_permits: max_permits.max(1),
- }
- }
-
- pub async fn acquire_owned(&self) -> Result<OwnedSemaphorePermit, AcquireError> {
- self.semaphore.clone().acquire_owned().await
- }
-
- pub fn try_acquire_owned(&self) -> Result<OwnedSemaphorePermit, TryAcquireError> {
- self.semaphore.clone().try_acquire_owned()
- }
-
- pub fn available_permits(&self) -> usize {
- self.semaphore.available_permits()
- }
-
- pub fn max_permits(&self) -> usize {
- self.max_permits
- }
-
- pub fn close(&self) {
- self.semaphore.close();
- }
-}
-
-#[cfg(test)]
-mod tests {
- use super::ItemLimiter;
-
- #[tokio::test]
- async fn max_permits_remains_the_configured_capacity() {
- let limiter = ItemLimiter::new(3);
- let _permit = limiter.acquire_owned().await.unwrap();
-
- assert_eq!(limiter.max_permits(), 3);
- assert_eq!(limiter.available_permits(), 2);
- }
-}
diff --git a/rust/cymbal-resolution/src/lib.rs b/rust/cymbal-resolution/src/lib.rs
deleted file mode 100644
index 43ce4a55a5e3..000000000000
--- a/rust/cymbal-resolution/src/lib.rs
+++ /dev/null
@@ -1,6 +0,0 @@
-pub mod app_context;
-pub mod auth;
-pub mod config;
-pub mod item_limiter;
-pub mod load_monitor;
-pub mod service;
diff --git a/rust/cymbal/Cargo.toml b/rust/cymbal/Cargo.toml
index d899b091957d..d283cbdeb29c 100644
--- a/rust/cymbal/Cargo.toml
+++ b/rust/cymbal/Cargo.toml
@@ -50,10 +50,12 @@ rustls = { version = "0.23", default-features = false, features = ["ring", "std"
tiktoken-rs.workspace = true
tonic = { workspace = true }
tokio-stream = "0.1"
+personhog-common = { path = "../personhog-common" }
+async-stream = { workspace = true }
+subtle = "2.6"
[dev-dependencies]
-cymbal-resolution = { path = "../cymbal-resolution" }
httpmock = { workspace = true }
mockall = { workspace = true }
insta = { version = "1.46.0", features = ["json", "redactions"] }
diff --git a/rust/cymbal/README.md b/rust/cymbal/README.md
index 563f265adb26..6e68adf8908d 100644
--- a/rust/cymbal/README.md
+++ b/rust/cymbal/README.md
@@ -3,12 +3,14 @@
You throw 'em, we catch 'em.
Cymbal owns the HTTP ingress and full processing pipeline (fingerprinting,
-suppression, Kafka producers, issue linking). Symbol resolution can run
-either inline inside the cymbal binary (default) or be offloaded to the
-[`cymbal-resolution`](../cymbal-resolution/README.md) gRPC service via the
+suppression, Kafka producers, issue linking). The binary runs in one of two
+modes selected by `CYMBAL_MODE` (default `processing`): the processing
+pipeline, or the `cymbal.resolution.v1` gRPC symbol-resolution service
+(`CYMBAL_MODE=resolution`). Symbol resolution can run either inline inside the
+processing binary (default) or be offloaded to resolution-mode pods via the
`cymbal.resolution.v1` contract. The remote path is opt-in via
`CYMBAL_REMOTE_RESOLUTION_ENABLED=true` and has **no silent local fallback**
-— see the [cymbal-resolution README](../cymbal-resolution/README.md) for
+— see the [resolution mode README](src/modes/resolution/README.md) for
rollout, configuration, and operator guidance.
## Remote resolution behavior
@@ -47,7 +49,7 @@ flattens traffic across the rendezvous-ranked candidate list: `0.0` sends all tr
the top-ranked endpoint, `1.0` is uniform across candidates, and intermediate values decay by rank.
See [`docs/compatibility.md`](docs/compatibility.md) for the Node consumer
-compatibility checklist and [`../cymbal-resolution/README.md`](../cymbal-resolution/README.md)
+compatibility checklist and [`src/modes/resolution/README.md`](src/modes/resolution/README.md)
for rollout and dashboard guidance.
### Terms
diff --git a/rust/cymbal/src/app_context.rs b/rust/cymbal/src/app_context.rs
index 0a0d6cd2d5d5..1cc8e0837b98 100644
--- a/rust/cymbal/src/app_context.rs
+++ b/rust/cymbal/src/app_context.rs
@@ -20,8 +20,8 @@ use crate::{
dns::TokioDnsResolver, pool::EndpointPool, resolver::RemoteResolutionContext,
RemoteResolutionConfig,
},
- stages::resolution::symbol::{local::LocalSymbolResolver, SymbolResolver},
- symbol_store::{
+ symbolication::symbol::{local::LocalSymbolResolver, SymbolResolver},
+ symbolication::symbol_store::{
apple::AppleProvider,
caching::{Caching, SymbolSetCache},
chunk_id::ChunkIdFetcher,
@@ -80,10 +80,10 @@ impl Drop for AppContext {
/// resolution pool — those belong to the full cymbal pipeline and are
/// constructed by [`AppContext::from_config`].
///
-/// Used by `cymbal-resolution`, the standalone gRPC service that only
-/// needs symbol resolution; keeping this separate stops cymbal-resolution
-/// pods from holding Kafka/Redis connections they never use.
-pub async fn build_symbol_resolver(
+/// Used by resolution mode (`crate::modes::resolution`), which only needs
+/// symbol resolution; keeping this separate stops resolution-mode pods from
+/// holding Kafka/Redis connections they never use.
+pub(crate) async fn build_symbol_resolver(
config: &Config,
) -> Result<Arc<dyn SymbolResolver>, UnhandledError> {
init_global_state(config);
diff --git a/rust/cymbal/src/config.rs b/rust/cymbal/src/config.rs
index ce987c2f0d22..163d92ca4005 100644
--- a/rust/cymbal/src/config.rs
+++ b/rust/cymbal/src/config.rs
@@ -12,9 +12,20 @@ pub static BATCH_APPLY_CONCURRENCY: AtomicUsize = AtomicUsize::new(64);
#[derive(Envconfig, Clone)]
pub struct Config {
+ /// Which server stack the binary runs. `processing` (default) serves the
+ /// error-tracking HTTP pipeline; `resolution` serves the
+ /// `cymbal.resolution.v1` gRPC symbol-resolution service.
+ #[envconfig(from = "CYMBAL_MODE", default = "processing")]
+ pub mode: crate::modes::CymbalMode,
+
#[envconfig(nested = true)]
pub continuous_profiling: ContinuousProfilingConfig,
+ /// Resolution-mode settings. Parsed unconditionally (defaults make this
+ /// harmless in processing mode); only read when `mode == Resolution`.
+ #[envconfig(nested = true)]
+ pub resolution: crate::modes::resolution::Config,
+
#[envconfig(from = "BIND_HOST", default = "::")]
pub host: String,
diff --git a/rust/cymbal/src/frames/mod.rs b/rust/cymbal/src/frames/mod.rs
index 68f1a67e01c1..351c81a6af35 100644
--- a/rust/cymbal/src/frames/mod.rs
+++ b/rust/cymbal/src/frames/mod.rs
@@ -16,7 +16,7 @@ use crate::{
},
metric_consts::{FRAME_NOT_RESOLVED, FRAME_RESOLVED, LEGACY_JS_FRAME_RESOLVED, PER_FRAME_TIME},
sanitize_source_line,
- symbol_store::Catalog,
+ symbolication::symbol_store::Catalog,
};
/// Records the metric and tracing line for a single failed-frame construction. Each
diff --git a/rust/cymbal/src/langs/apple.rs b/rust/cymbal/src/langs/apple.rs
index 489eb684b748..a6f4ae7ab63f 100644
--- a/rust/cymbal/src/langs/apple.rs
+++ b/rust/cymbal/src/langs/apple.rs
@@ -15,7 +15,7 @@ use crate::{
langs::native::{self, DebugImage},
langs::utils::{add_raw_to_junk, get_context_lines},
langs::CommonFrameMetadata,
- symbol_store::{
+ symbolication::symbol_store::{
apple::AppleRef,
chunk_id::OrChunkId,
native::{ParsedNativeSymbols, SymbolInfo},
@@ -443,7 +443,7 @@ mod test {
use crate::{
config::Config,
frames::RawFrame,
- symbol_store::{
+ symbolication::symbol_store::{
apple::AppleProvider, chunk_id::ChunkIdFetcher, hermesmap::HermesMapProvider,
proguard::ProguardProvider, saving::SymbolSetRecord, sourcemap::SourcemapProvider,
Catalog, MockS3Client,
@@ -606,7 +606,7 @@ mod test {
use crate::{
config::Config,
frames::RawFrame,
- symbol_store::{
+ symbolication::symbol_store::{
apple::AppleProvider, chunk_id::ChunkIdFetcher, hermesmap::HermesMapProvider,
proguard::ProguardProvider, saving::SymbolSetRecord, sourcemap::SourcemapProvider,
Catalog, MockS3Client,
diff --git a/rust/cymbal/src/langs/hermes.rs b/rust/cymbal/src/langs/hermes.rs
index eb87336afaa6..d6364ddc2a1d 100644
--- a/rust/cymbal/src/langs/hermes.rs
+++ b/rust/cymbal/src/langs/hermes.rs
@@ -13,7 +13,7 @@ use crate::{
CommonFrameMetadata,
},
sanitize_string,
- symbol_store::{chunk_id::OrChunkId, hermesmap::ParsedHermesMap, SymbolCatalog},
+ symbolication::symbol_store::{chunk_id::OrChunkId, hermesmap::ParsedHermesMap, SymbolCatalog},
};
#[derive(Debug, Clone, Deserialize, Serialize)]
@@ -239,7 +239,7 @@ mod test {
config::Config,
frames::RawFrame,
langs::{hermes::RawHermesFrame, CommonFrameMetadata},
- symbol_store::{
+ symbolication::symbol_store::{
apple::AppleProvider, chunk_id::ChunkIdFetcher, hermesmap::HermesMapProvider,
proguard::ProguardProvider, saving::SymbolSetRecord, sourcemap::SourcemapProvider,
Catalog, MockS3Client,
diff --git a/rust/cymbal/src/langs/java.rs b/rust/cymbal/src/langs/java.rs
index 9c04495e3e04..371cd45d119b 100644
--- a/rust/cymbal/src/langs/java.rs
+++ b/rust/cymbal/src/langs/java.rs
@@ -10,7 +10,7 @@ use crate::{
error::{FrameError, ProguardError, ResolveError, UnhandledError},
frames::{record_frame_resolution_failure, Frame},
langs::{utils::add_raw_to_junk, CommonFrameMetadata},
- symbol_store::{
+ symbolication::symbol_store::{
chunk_id::OrChunkId,
proguard::{FetchedMapping, ProguardRef},
SymbolCatalog,
diff --git a/rust/cymbal/src/langs/js.rs b/rust/cymbal/src/langs/js.rs
index ec38f9ab886a..13e7c210b652 100644
--- a/rust/cymbal/src/langs/js.rs
+++ b/rust/cymbal/src/langs/js.rs
@@ -10,7 +10,9 @@ use crate::{
frames::{record_frame_resolution_failure, Frame},
langs::CommonFrameMetadata,
sanitize_string,
- symbol_store::{chunk_id::OrChunkId, sourcemap::OwnedSourceMapCache, SymbolCatalog},
+ symbolication::symbol_store::{
+ chunk_id::OrChunkId, sourcemap::OwnedSourceMapCache, SymbolCatalog,
+ },
};
use super::utils::{add_raw_to_junk, get_sourcelocation_context};
diff --git a/rust/cymbal/src/langs/node.rs b/rust/cymbal/src/langs/node.rs
index 8d7803a71ca9..a43966207b2b 100644
--- a/rust/cymbal/src/langs/node.rs
+++ b/rust/cymbal/src/langs/node.rs
@@ -3,7 +3,9 @@ use crate::{
frames::{record_frame_resolution_failure, Context, ContextLine, Frame},
langs::CommonFrameMetadata,
sanitize_string,
- symbol_store::{chunk_id::OrChunkId, sourcemap::OwnedSourceMapCache, SymbolCatalog},
+ symbolication::symbol_store::{
+ chunk_id::OrChunkId, sourcemap::OwnedSourceMapCache, SymbolCatalog,
+ },
};
use common_types::error_tracking::FrameId;
use reqwest::Url;
diff --git a/rust/cymbal/src/lib.rs b/rust/cymbal/src/lib.rs
index f53e1b97daa5..1902885a4757 100644
--- a/rust/cymbal/src/lib.rs
+++ b/rust/cymbal/src/lib.rs
@@ -16,6 +16,7 @@ pub mod frames;
pub mod issue_resolution;
pub mod langs;
pub mod metric_consts;
+pub mod modes;
pub mod posthog_utils;
pub mod router;
pub mod server;
@@ -23,7 +24,7 @@ pub mod signals;
pub mod spike_config;
pub mod stages;
pub mod suppression_rules;
-pub mod symbol_store;
+pub mod symbolication;
pub mod teams;
#[cfg(test)]
pub mod test_utils;
diff --git a/rust/cymbal/src/main.rs b/rust/cymbal/src/main.rs
index 4179e2159821..212f1b778570 100644
--- a/rust/cymbal/src/main.rs
+++ b/rust/cymbal/src/main.rs
@@ -1,6 +1,5 @@
-use std::sync::Arc;
-
-use cymbal::{app_context::AppContext, config::Config, server::start_server};
+use cymbal::config::Config;
+use cymbal::modes::{self, CymbalMode};
use tracing::level_filters::LevelFilter;
use tracing::{error, info};
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter, Layer};
@@ -37,15 +36,25 @@ async fn main() {
}
};
+ let service_name = match config.mode {
+ CymbalMode::Processing => "cymbal",
+ CymbalMode::Resolution => "cymbal-resolution",
+ };
common_posthog::init(
- "cymbal",
+ service_name,
config.posthog_api_key.as_deref(),
&config.posthog_endpoint,
)
.await
.unwrap();
- let context = Arc::new(AppContext::from_config(&config).await.unwrap());
-
- start_server(config.clone(), context.clone()).await;
+ match config.mode {
+ CymbalMode::Processing => modes::processing::run(config).await,
+ CymbalMode::Resolution => {
+ if let Err(e) = modes::resolution::serve(&config).await {
+ error!("cymbal-resolution server error: {e}");
+ std::process::exit(1);
+ }
+ }
+ }
}
diff --git a/rust/cymbal/src/modes/mod.rs b/rust/cymbal/src/modes/mod.rs
new file mode 100644
index 000000000000..ff71a690af91
--- /dev/null
+++ b/rust/cymbal/src/modes/mod.rs
@@ -0,0 +1,34 @@
+//! Run modes for the cymbal binary. The active mode is selected at boot via
+//! the `CYMBAL_MODE` env var; each mode owns its own server stack and (nested)
+//! config. Adding a mode is one submodule, one [`CymbalMode`] variant, one
+//! nested config field on [`crate::config::Config`], and one match arm in
+//! `main.rs`.
+
+use std::str::FromStr;
+
+pub mod processing;
+pub mod resolution;
+
+/// Which server stack the cymbal binary runs. Parsed from `CYMBAL_MODE`.
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
+pub enum CymbalMode {
+ /// Error-tracking HTTP `/process` pipeline (the default).
+ #[default]
+ Processing,
+ /// `cymbal.resolution.v1` gRPC symbol-resolution service.
+ Resolution,
+}
+
+impl FromStr for CymbalMode {
+ type Err = String;
+
+ fn from_str(s: &str) -> Result<Self, Self::Err> {
+ match s.trim().to_ascii_lowercase().as_str() {
+ "processing" => Ok(Self::Processing),
+ "resolution" => Ok(Self::Resolution),
+ other => Err(format!(
+ "unknown CYMBAL_MODE '{other}', expected 'processing' or 'resolution'"
+ )),
+ }
+ }
+}
diff --git a/rust/cymbal/src/modes/processing.rs b/rust/cymbal/src/modes/processing.rs
new file mode 100644
index 000000000000..ee1c69ef1967
--- /dev/null
+++ b/rust/cymbal/src/modes/processing.rs
@@ -0,0 +1,14 @@
+//! Processing mode: the error-tracking HTTP `/process` pipeline. This is the
+//! default mode and wraps the full [`AppContext`] (Kafka, Redis, issue cache,
+//! remote-resolution pool) behind the HTTP server.
+
+use std::sync::Arc;
+
+use crate::app_context::AppContext;
+use crate::config::Config;
+use crate::server::start_server;
+
+pub async fn run(config: Config) {
+ let context = Arc::new(AppContext::from_config(&config).await.unwrap());
+ start_server(config.clone(), context).await;
+}
diff --git a/rust/cymbal-resolution/README.md b/rust/cymbal/src/modes/resolution/README.md
similarity index 92%
rename from rust/cymbal-resolution/README.md
rename to rust/cymbal/src/modes/resolution/README.md
index 05a2921b5f0d..66782cff1741 100644
--- a/rust/cymbal-resolution/README.md
+++ b/rust/cymbal/src/modes/resolution/README.md
@@ -1,7 +1,9 @@
-# cymbal-resolution
+# Resolution mode (`CYMBAL_MODE=resolution`)
gRPC service that owns exception-level symbol resolution for PostHog error tracking.
-It speaks `cymbal.resolution.v1` and is used by the [`cymbal`](../cymbal) ingestion binary when remote resolution is enabled.
+It is a run mode of the `cymbal` binary, selected with `CYMBAL_MODE=resolution`.
+It speaks `cymbal.resolution.v1` and is used by cymbal's processing mode (the client lives in
+[`stages/resolution/remote`](../../stages/resolution/remote)) when remote resolution is enabled.
## Architecture
@@ -54,7 +56,7 @@ The contract is intentionally split across two streams:
- `ERROR_KIND_UNHANDLED` is an unexpected resolver failure.
- `ERROR_KIND_OVERLOADED` is result-only backpressure. Callers reroute the item with overload-specific backoff.
-The proto lives at [`proto/cymbal/resolution/v1/resolution.proto`](../../proto/cymbal/resolution/v1/resolution.proto).
+The proto lives at [`proto/cymbal/resolution/v1/resolution.proto`](../../../../../proto/cymbal/resolution/v1/resolution.proto).
## Rollout model
@@ -119,7 +121,7 @@ All variables are prefixed `CYMBAL_REMOTE_RESOLUTION_` and live on `cymbal::conf
| `CYMBAL_REMOTE_RESOLUTION_SUBSCRIBE_TICK_HINT_MS` | `1000` | Cadence hint sent on `SubscribeRequest`; snapshots are considered fresh for two ticks. |
| `CYMBAL_REMOTE_RESOLUTION_SUBSCRIBE_RECONNECT_BACKOFF_MS` | `500` | Backoff between subscription reconnect attempts when a stream terminates. |
-### Cymbal-resolution server (`cymbal-resolution` binary)
+### Resolution-mode server (`CYMBAL_MODE=resolution`)
| Env var | Default | Purpose |
| ------- | ------- | ------- |
@@ -197,11 +199,11 @@ Logs intentionally do not include raw routing keys as metric labels. Routing key
## Code organization
-- **Service (`cymbal-resolution`)**
- - [`src/main.rs`](src/main.rs) — process bootstrap, gRPC + metrics servers, layer stack (`GrpcMetricsLayer`, `GrpcLoadShedLayer`).
- - [`src/config.rs`](src/config.rs) — server `Config` (env-driven).
- - [`src/app_context.rs`](src/app_context.rs) — constructs an `AppContext` by reusing cymbal's `AppContext::from_config` to materialize a `SymbolResolver`, then dedicates a semaphore for symbol-resolution concurrency.
- - [`src/service.rs`](src/service.rs) and [`src/service/resolve.rs`](src/service/resolve.rs) — gRPC handlers and `ErrorKind` mapping.
+- **Service (resolution mode, `cymbal/src/modes/resolution/`)**
+ - [`mod.rs`](mod.rs) — `serve()`: gRPC + metrics servers, drain listener, layer stack (`GrpcMetricsLayer`, `GrpcLoadShedLayer`). Invoked from `cymbal`'s `main.rs` when `CYMBAL_MODE=resolution`.
+ - [`config.rs`](config.rs) — resolution-mode `Config`, nested into `cymbal::config::Config`.
+ - [`app_context.rs`](app_context.rs) — `ResolutionAppContext`: reuses cymbal's `build_symbol_resolver` to materialize a `SymbolResolver`, then dedicates a semaphore for symbol-resolution concurrency.
+ - [`service.rs`](service.rs) and [`service/resolve.rs`](service/resolve.rs) — gRPC handlers and `ErrorKind` mapping.
- **Client (`cymbal/src/stages/resolution/remote/`)**
- `config.rs` — `RemoteResolutionConfig`.
- `dns.rs` — `DnsResolver` trait + tokio-backed default.
@@ -209,10 +211,9 @@ Logs intentionally do not include raw routing keys as metric labels. Routing key
- `mux.rs` — per-endpoint bidirectional Resolve stream, waiter demux, local admission, and stream-break cleanup.
- `subscription.rs` — long-lived per-endpoint Subscribe task.
- `resolver.rs` — event partitioning, work-item construction, per-exception reroute, and response reassembly.
-- **Proto contract** — [`proto/cymbal/resolution/v1/resolution.proto`](../../proto/cymbal/resolution/v1/resolution.proto).
+- **Proto contract** — [`proto/cymbal/resolution/v1/resolution.proto`](../../../../../proto/cymbal/resolution/v1/resolution.proto).
## Tests
- `cargo test -p cymbal-proto` — proto contract round-trips for `ResolveItem`, `ResolveOutcome`, `ErrorKind`, `Retry`, and `LoadEvent`.
-- `cargo test -p cymbal-resolution` — service-level bidirectional streaming, accounting, overload behavior, invalid payload handling, unhandled errors, and Subscribe freshness/draining coverage.
-- `cargo test -p cymbal` — client-side endpoint pool, mux, integration tests against in-process tonic stubs, end-to-end Subscribe routing, and parity vs local mode.
+- `cargo test -p cymbal` — resolution-mode service tests (`tests/resolution_service_tests.rs`: bidirectional streaming, accounting, overload, invalid payload, unhandled errors, Subscribe freshness/draining) plus client-side endpoint pool, mux, end-to-end Subscribe routing, and parity vs local mode.
diff --git a/rust/cymbal/src/modes/resolution/app_context.rs b/rust/cymbal/src/modes/resolution/app_context.rs
new file mode 100644
index 000000000000..95fb17104ddd
--- /dev/null
+++ b/rust/cymbal/src/modes/resolution/app_context.rs
@@ -0,0 +1,45 @@
+use std::sync::Arc;
+
+use tokio::sync::Semaphore;
+
+use crate::app_context::build_symbol_resolver;
+use crate::config::Config as CymbalConfig;
+use crate::error::UnhandledError;
+use crate::symbolication::symbol::SymbolResolver;
+
+use super::load_monitor::LoadMonitor;
+
+/// Process-wide handles required to serve `cymbal.resolution.v1`.
+///
+/// Reuses cymbal's symbol-resolution stack (catalog + frame cache + PG-backed
+/// resolved-frame reuse) via [`build_symbol_resolver`]. That builder only
+/// connects to Postgres and S3 — Kafka producers, Redis, the issue cache,
+/// signals, and the remote-resolution pool are intentionally NOT started here.
+/// Resolution mode owns symbol resolution only.
+pub struct ResolutionAppContext {
+ pub symbol_resolver: Arc<dyn SymbolResolver>,
+ pub symbol_resolution_limiter: Arc<Semaphore>,
+ pub load_monitor: LoadMonitor,
+ pub service_instance_id: String,
+}
+
+impl ResolutionAppContext {
+ pub async fn from_config(config: &CymbalConfig) -> Result<Self, UnhandledError> {
+ let symbol_resolver = build_symbol_resolver(config).await?;
+ // Symbol-resolution concurrency is the shared knob on the parent config.
+ let symbol_resolution_limiter =
+ Arc::new(Semaphore::new(config.symbol_resolution_concurrency.max(1)));
+ let load_monitor = LoadMonitor::new(config.resolution.max_item_concurrency.max(1) as u32);
+ let service_instance_id = config
+ .resolution
+ .service_instance_id
+ .clone()
+ .unwrap_or_else(|| uuid::Uuid::now_v7().to_string());
+ Ok(Self {
+ symbol_resolver,
+ symbol_resolution_limiter,
+ load_monitor,
+ service_instance_id,
+ })
+ }
+}
diff --git a/rust/cymbal-resolution/src/auth.rs b/rust/cymbal/src/modes/resolution/auth.rs
similarity index 100%
rename from rust/cymbal-resolution/src/auth.rs
rename to rust/cymbal/src/modes/resolution/auth.rs
diff --git a/rust/cymbal-resolution/src/config.rs b/rust/cymbal/src/modes/resolution/config.rs
similarity index 69%
rename from rust/cymbal-resolution/src/config.rs
rename to rust/cymbal/src/modes/resolution/config.rs
index b0af30a6e034..42f3290fb781 100644
--- a/rust/cymbal-resolution/src/config.rs
+++ b/rust/cymbal/src/modes/resolution/config.rs
@@ -2,6 +2,10 @@ use std::net::SocketAddr;
use envconfig::Envconfig;
+/// Resolution-mode config, nested into [`crate::config::Config`] via
+/// `#[envconfig(nested = true)]`. Two knobs shared with processing mode live on
+/// the parent config instead and are read from there: `INTERNAL_API_SECRET` and
+/// `SYMBOL_RESOLUTION_CONCURRENCY`.
#[derive(Envconfig, Clone)]
pub struct Config {
/// gRPC bind address for the cymbal.resolution.v1 server.
@@ -12,10 +16,6 @@ pub struct Config {
#[envconfig(from = "METRICS_PORT", default = "9101")]
pub metrics_port: u16,
- /// Shared secret required on every gRPC request via X-Internal-Api-Secret.
- #[envconfig(from = "INTERNAL_API_SECRET", default = "")]
- pub internal_api_secret: String,
-
/// Cap on concurrent gRPC requests accepted by the server before fast
/// load shedding kicks in. Beyond this, callers receive `UNAVAILABLE`
/// and retry against another pod — preferred over hidden queue growth
@@ -24,20 +24,9 @@ pub struct Config {
#[envconfig(from = "MAX_CONCURRENT_REQUESTS", default = "256")]
pub max_concurrent_requests: usize,
- /// Cap on concurrent symbol-resolution operations across all in-flight
- /// requests. Reuses the same semantic as cymbal's
- /// `SYMBOL_RESOLUTION_CONCURRENCY` knob. Items beyond this wait on the
- /// internal semaphore until the request deadline; sustained pressure
- /// surfaces as per-item `ErrorKind::Overloaded` outcomes when the limiter
- /// is closed.
- #[envconfig(from = "SYMBOL_RESOLUTION_CONCURRENCY", default = "64")]
- pub symbol_resolution_concurrency: usize,
-
/// Process-wide cap on concurrent item (exception) processing across all
- /// in-flight `Resolve` requests. Replaces the previous per-request
- /// `REQUEST_ITEM_CONCURRENCY` so total item parallelism stays bounded
- /// regardless of how many concurrent RPCs are open. Symbol work is
- /// governed separately by `SYMBOL_RESOLUTION_CONCURRENCY`.
+ /// in-flight `Resolve` requests. Symbol work is governed separately by the
+ /// shared `SYMBOL_RESOLUTION_CONCURRENCY` knob on the parent config.
#[envconfig(from = "MAX_ITEM_CONCURRENCY", default = "64")]
pub max_item_concurrency: usize,
diff --git a/rust/cymbal-resolution/src/load_monitor.rs b/rust/cymbal/src/modes/resolution/load_monitor.rs
similarity index 100%
rename from rust/cymbal-resolution/src/load_monitor.rs
rename to rust/cymbal/src/modes/resolution/load_monitor.rs
diff --git a/rust/cymbal-resolution/src/main.rs b/rust/cymbal/src/modes/resolution/mod.rs
similarity index 62%
rename from rust/cymbal-resolution/src/main.rs
rename to rust/cymbal/src/modes/resolution/mod.rs
index a0fd35187bac..5d9ea06d5178 100644
--- a/rust/cymbal-resolution/src/main.rs
+++ b/rust/cymbal/src/modes/resolution/mod.rs
@@ -1,3 +1,9 @@
+//! Resolution mode: serves `cymbal.resolution.v1` over gRPC, exposing cymbal's
+//! symbol-resolution stack to the remote-resolution client
+//! (`crate::stages::resolution::remote`). It starts only the symbol resolver
+//! (Postgres + object storage) — no Kafka, Redis, issue cache, or signals.
+//! See [`README.md`](./README.md) for the wire contract and operations guide.
+
use std::sync::{
atomic::{AtomicBool, Ordering},
Arc,
@@ -5,49 +11,43 @@ use std::sync::{
use std::time::Duration;
use axum::{http::StatusCode, routing::get, Router};
-use cymbal::config::Config as CymbalConfig;
use cymbal_proto::cymbal::resolution::v1::cymbal_resolution_server::CymbalResolutionServer;
-use cymbal_resolution::app_context::AppContext;
-use cymbal_resolution::auth::InternalApiSecretInterceptor;
-use cymbal_resolution::config::Config;
-use cymbal_resolution::load_monitor::LoadMonitor;
-use cymbal_resolution::service::{CymbalResolutionService, ServiceConfig};
-use envconfig::Envconfig;
use personhog_common::grpc::{tracked_tcp_incoming, GrpcLoadShedLayer, GrpcMetricsLayer};
use tokio::sync::watch;
use tokio::task::JoinHandle;
use tonic::transport::Server;
-use tracing::level_filters::LevelFilter;
-use tracing_subscriber::fmt;
-use tracing_subscriber::layer::SubscriberExt;
-use tracing_subscriber::util::SubscriberInitExt;
-use tracing_subscriber::EnvFilter;
-
-common_alloc::used!();
-
-#[tokio::main]
-async fn main() -> Result<(), Box<dyn std::error::Error>> {
- init_tracing();
-
- let config = Config::init_from_env().expect("Invalid cymbal-resolution configuration");
- let cymbal_config = CymbalConfig::init_with_defaults().expect("Invalid cymbal configuration");
- init_posthog_client(&cymbal_config).await;
-
- tracing::info!("Starting cymbal-resolution service");
- tracing::info!("gRPC address: {}", config.grpc_address);
- tracing::info!("Metrics port: {}", config.metrics_port);
- tracing::info!(
- "Max concurrent requests: {}",
- config.max_concurrent_requests
- );
+use tracing::{info, warn};
+
+use crate::config::Config as CymbalConfig;
+
+pub mod app_context;
+pub mod auth;
+pub mod config;
+pub mod load_monitor;
+pub mod service;
+
+pub use config::Config;
+
+use app_context::ResolutionAppContext;
+use auth::InternalApiSecretInterceptor;
+use load_monitor::LoadMonitor;
+use service::{CymbalResolutionService, ServiceConfig};
- let app_context = AppContext::from_config(config.clone(), &cymbal_config)
- .await
- .expect("Failed to build cymbal-resolution app context");
+/// Boot the gRPC resolution service plus its metrics/health server and run
+/// until shutdown. The `internal_api_secret` and symbol-resolution concurrency
+/// are read from shared cymbal config; everything else from `config.resolution`.
+pub async fn serve(config: &CymbalConfig) -> Result<(), Box<dyn std::error::Error>> {
+ let res = &config.resolution;
+ info!("Starting cymbal-resolution service");
+ info!("gRPC address: {}", res.grpc_address);
+ info!("Metrics port: {}", res.metrics_port);
+ info!("Max concurrent requests: {}", res.max_concurrent_requests);
+
+ let app_context = ResolutionAppContext::from_config(config).await?;
let (shutdown_tx, shutdown_rx) = watch::channel(false);
let draining = Arc::new(AtomicBool::new(false));
- let drain_notice = Duration::from_millis(config.subscribe_tick_interval_ms).saturating_mul(2);
+ let drain_notice = Duration::from_millis(res.subscribe_tick_interval_ms).saturating_mul(2);
let _shutdown_handle = spawn_shutdown_listener(
shutdown_tx.clone(),
draining.clone(),
@@ -55,9 +55,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
drain_notice,
);
let metrics_handle =
- spawn_metrics_server(config.metrics_port, shutdown_rx.clone(), draining.clone());
+ spawn_metrics_server(res.metrics_port, shutdown_rx.clone(), draining.clone());
- let service_config = ServiceConfig::from(&config);
+ let service_config = ServiceConfig::from(res);
let service = CymbalResolutionService::new(
app_context.symbol_resolver.clone(),
app_context.symbol_resolution_limiter.clone(),
@@ -68,16 +68,16 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
);
let auth_interceptor = InternalApiSecretInterceptor::new(config.internal_api_secret.clone());
- let listener = tokio::net::TcpListener::bind(config.grpc_address).await?;
+ let listener = tokio::net::TcpListener::bind(res.grpc_address).await?;
let incoming = tracked_tcp_incoming(listener);
- tracing::info!("gRPC server listening on {}", config.grpc_address);
+ info!("gRPC server listening on {}", res.grpc_address);
let server_result = Server::builder()
.http2_keepalive_interval(Some(Duration::from_secs(30)))
.http2_keepalive_timeout(Some(Duration::from_secs(20)))
.layer(GrpcMetricsLayer::default().with_processing_time_header())
- .layer(GrpcLoadShedLayer::new(config.max_concurrent_requests))
+ .layer(GrpcLoadShedLayer::new(res.max_concurrent_requests))
// The cymbal client submits exception-level ResolveItems. The server
// relies on tonic's 4 MiB per-message default; an oversized item
// surfaces as `InvalidArgument`. Future: signal "send smaller" back
@@ -91,39 +91,13 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let _ignored = shutdown_tx.send(true);
if let Err(err) = metrics_handle.await {
- tracing::warn!(error = %err, "metrics server task failed during shutdown");
+ warn!(error = %err, "metrics server task failed during shutdown");
}
server_result?;
Ok(())
}
-async fn init_posthog_client(config: &CymbalConfig) {
- common_posthog::init(
- "cymbal-resolution",
- config.posthog_api_key.as_deref(),
- &config.posthog_endpoint,
- )
- .await
- .expect("Failed to initialize PostHog client");
-}
-
-fn init_tracing() {
- let log_layer = fmt::layer()
- .with_target(true)
- .with_thread_ids(true)
- .with_level(true);
-
- tracing_subscriber::registry()
- .with(log_layer)
- .with(
- EnvFilter::builder()
- .with_default_directive(LevelFilter::INFO.into())
- .from_env_lossy(),
- )
- .init();
-}
-
fn spawn_metrics_server(
port: u16,
shutdown_rx: watch::Receiver<bool>,
@@ -140,7 +114,7 @@ fn spawn_metrics_server(
let router = common_metrics::setup_metrics_routes_for_product(router, "cymbal-resolution");
let bind = format!("0.0.0.0:{port}");
- tracing::info!("Metrics server listening on {}", bind);
+ info!("Metrics server listening on {}", bind);
let listener = match tokio::net::TcpListener::bind(&bind).await {
Ok(listener) => listener,
Err(e) => {
@@ -165,14 +139,14 @@ fn spawn_shutdown_listener(
) -> JoinHandle<()> {
tokio::spawn(async move {
shutdown_signal().await;
- tracing::info!(
+ info!(
drain_notice_ms = drain_notice.as_millis() as u64,
"shutdown signal received, marking cymbal-resolution as draining",
);
draining.store(true, Ordering::Relaxed);
load_monitor.set_draining(true);
tokio::time::sleep(drain_notice).await;
- tracing::info!("drain notice elapsed, stopping cymbal-resolution");
+ info!("drain notice elapsed, stopping cymbal-resolution");
let _ignored = shutdown_tx.send(true);
})
}
@@ -205,7 +179,7 @@ async fn shutdown_signal() {
tokio::select! {
result = tokio::signal::ctrl_c() => {
if let Err(err) = result {
- tracing::warn!(error = %err, "failed to listen for Ctrl+C");
+ warn!(error = %err, "failed to listen for Ctrl+C");
}
}
_ = sigterm.recv() => {}
@@ -215,6 +189,6 @@ async fn shutdown_signal() {
#[cfg(not(unix))]
async fn shutdown_signal() {
if let Err(err) = tokio::signal::ctrl_c().await {
- tracing::warn!(error = %err, "failed to listen for Ctrl+C");
+ warn!(error = %err, "failed to listen for Ctrl+C");
}
}
diff --git a/rust/cymbal-resolution/src/service.rs b/rust/cymbal/src/modes/resolution/service.rs
similarity index 96%
rename from rust/cymbal-resolution/src/service.rs
rename to rust/cymbal/src/modes/resolution/service.rs
index 07feea214783..a6c87fd0fef3 100644
--- a/rust/cymbal-resolution/src/service.rs
+++ b/rust/cymbal/src/modes/resolution/service.rs
@@ -3,11 +3,11 @@ use std::sync::{
Arc,
};
-use cymbal::stages::resolution::symbol::SymbolResolver;
-use cymbal::stages::resolution::ResolutionStage;
+use crate::stages::resolution::ResolutionStage;
+use crate::symbolication::symbol::SymbolResolver;
use std::pin::Pin;
-use crate::load_monitor::LoadMonitor;
+use crate::modes::resolution::load_monitor::LoadMonitor;
use cymbal_proto::cymbal::resolution::v1::cymbal_resolution_server::CymbalResolution;
use cymbal_proto::cymbal::resolution::v1::{
LoadEvent, ResolveItem, ResolveOutcome, SubscribeRequest,
diff --git a/rust/cymbal-resolution/src/service/codes.rs b/rust/cymbal/src/modes/resolution/service/codes.rs
similarity index 100%
rename from rust/cymbal-resolution/src/service/codes.rs
rename to rust/cymbal/src/modes/resolution/service/codes.rs
diff --git a/rust/cymbal-resolution/src/service/config.rs b/rust/cymbal/src/modes/resolution/service/config.rs
similarity index 85%
rename from rust/cymbal-resolution/src/service/config.rs
rename to rust/cymbal/src/modes/resolution/service/config.rs
index fb2f14770354..070cade7d4fc 100644
--- a/rust/cymbal-resolution/src/service/config.rs
+++ b/rust/cymbal/src/modes/resolution/service/config.rs
@@ -1,8 +1,9 @@
use std::time::Duration;
-/// Configuration handed to the gRPC service. Subset of [`crate::config::Config`]
-/// that the handler actually needs; isolating it lets tests construct the
-/// service without touching the env-var surface.
+/// Configuration handed to the gRPC service. Subset of the resolution-mode
+/// [`crate::modes::resolution::Config`] that the handler actually needs;
+/// isolating it lets tests construct the service without touching the env-var
+/// surface.
#[derive(Clone, Debug)]
pub struct ServiceConfig {
pub default_tick_interval: Duration,
@@ -10,8 +11,8 @@ pub struct ServiceConfig {
pub max_tick_interval: Duration,
}
-impl From<&crate::config::Config> for ServiceConfig {
- fn from(cfg: &crate::config::Config) -> Self {
+impl From<&crate::modes::resolution::Config> for ServiceConfig {
+ fn from(cfg: &crate::modes::resolution::Config) -> Self {
Self {
default_tick_interval: Duration::from_millis(cfg.subscribe_tick_interval_ms),
min_tick_interval: Duration::from_millis(cfg.subscribe_min_tick_ms),
diff --git a/rust/cymbal-resolution/src/service/resolve.rs b/rust/cymbal/src/modes/resolution/service/resolve.rs
similarity index 93%
rename from rust/cymbal-resolution/src/service/resolve.rs
rename to rust/cymbal/src/modes/resolution/service/resolve.rs
index b38767cac0b6..32213ce252e5 100644
--- a/rust/cymbal-resolution/src/service/resolve.rs
+++ b/rust/cymbal/src/modes/resolution/service/resolve.rs
@@ -7,18 +7,18 @@ use tokio::sync::mpsc;
use tonic::{Status, Streaming};
use tracing::{debug, warn};
-use cymbal::error::UnhandledError;
-use cymbal::langs::native::DebugImage;
-use cymbal::stages::resolution::exception::ExceptionResolver;
-use cymbal::stages::resolution::frame::FrameResolver;
-use cymbal::stages::resolution::ResolutionStage;
-use cymbal::types::Exception;
+use crate::error::UnhandledError;
+use crate::langs::native::DebugImage;
+use crate::stages::resolution::exception::ExceptionResolver;
+use crate::stages::resolution::frame::FrameResolver;
+use crate::stages::resolution::ResolutionStage;
+use crate::types::Exception;
use cymbal_proto::cymbal::resolution::v1::{
resolve_outcome, Accepted, Done, Error as ItemError, ResolveItem, ResolveOutcome,
};
use super::codes;
-use crate::load_monitor::LoadMonitor;
+use crate::modes::resolution::load_monitor::LoadMonitor;
const RESOLVE_REQUEST_DURATION_MS: &str = "cymbal_remote_resolution_server_request_duration_ms";
const SERVER_ERROR_KINDS: &str = "cymbal_remote_resolution_server_error_kinds_total";
@@ -204,7 +204,7 @@ async fn process_item(
}
fn error_result(kind: codes::ErrorKind, message: String) -> resolve_outcome::Result {
- metrics::counter!(SERVER_ERROR_KINDS, "kind" => error_kind_label(kind)).increment(1);
+ metrics::counter!(SERVER_ERROR_KINDS, "kind" => kind.metric_label()).increment(1);
resolve_outcome::Result::Error(ItemError {
kind: kind as i32,
message,
@@ -212,16 +212,6 @@ fn error_result(kind: codes::ErrorKind, message: String) -> resolve_outcome::Res
})
}
-fn error_kind_label(kind: codes::ErrorKind) -> &'static str {
- match kind {
- codes::ErrorKind::Unspecified => "unspecified",
- codes::ErrorKind::InvalidPayload => "invalid_payload",
- codes::ErrorKind::Poison => "poison",
- codes::ErrorKind::Unhandled => "unhandled",
- codes::ErrorKind::Overloaded => "overloaded",
- }
-}
-
fn record_resolve_duration(started_at: Instant, outcome: &'static str) {
metrics::histogram!(RESOLVE_REQUEST_DURATION_MS, "outcome" => outcome)
.record(started_at.elapsed().as_secs_f64() * 1000.0);
diff --git a/rust/cymbal-resolution/src/service/subscribe.rs b/rust/cymbal/src/modes/resolution/service/subscribe.rs
similarity index 97%
rename from rust/cymbal-resolution/src/service/subscribe.rs
rename to rust/cymbal/src/modes/resolution/service/subscribe.rs
index 61c5759ba55c..9430bb1683b7 100644
--- a/rust/cymbal-resolution/src/service/subscribe.rs
+++ b/rust/cymbal/src/modes/resolution/service/subscribe.rs
@@ -5,7 +5,7 @@ use futures::Stream;
use tonic::Status;
use tracing::info;
-use crate::load_monitor::LoadMonitor;
+use crate::modes::resolution::load_monitor::LoadMonitor;
use cymbal_proto::cymbal::resolution::v1::LoadEvent;
pub(super) struct SubscribeRuntime {
diff --git a/rust/cymbal/src/stages/resolution/exception.rs b/rust/cymbal/src/stages/resolution/exception.rs
index db4324a43fc2..10592d05a531 100644
--- a/rust/cymbal/src/stages/resolution/exception.rs
+++ b/rust/cymbal/src/stages/resolution/exception.rs
@@ -88,8 +88,8 @@ mod test {
config::Config,
frames::RawFrame,
langs::{java::RawJavaFrame, CommonFrameMetadata},
- stages::resolution::symbol::{local::LocalSymbolResolver, SymbolResolver},
- symbol_store::{
+ symbolication::symbol::{local::LocalSymbolResolver, SymbolResolver},
+ symbolication::symbol_store::{
apple::AppleProvider, chunk_id::ChunkIdFetcher, hermesmap::HermesMapProvider,
proguard::ProguardProvider, saving::SymbolSetRecord, sourcemap::SourcemapProvider,
Catalog, MockS3Client,
diff --git a/rust/cymbal/src/stages/resolution/mod.rs b/rust/cymbal/src/stages/resolution/mod.rs
index 08a6220e9ad3..42ffe8580c7b 100644
--- a/rust/cymbal/src/stages/resolution/mod.rs
+++ b/rust/cymbal/src/stages/resolution/mod.rs
@@ -6,7 +6,6 @@ pub mod exception;
pub mod frame;
pub mod properties;
pub mod remote;
-pub mod symbol;
use crate::{
app_context::AppContext,
@@ -18,8 +17,8 @@ use crate::{
frame::FrameResolver,
properties::PropertiesResolver,
remote::resolver::{resolve_batch, RemoteResolutionContext},
- symbol::SymbolResolver,
},
+ symbolication::symbol::SymbolResolver,
types::{
batch::Batch,
stage::{Stage, StageResult},
diff --git a/rust/cymbal/src/stages/resolution/remote/mod.rs b/rust/cymbal/src/stages/resolution/remote/mod.rs
index 04c5236b476a..c6ac973adb4a 100644
--- a/rust/cymbal/src/stages/resolution/remote/mod.rs
+++ b/rust/cymbal/src/stages/resolution/remote/mod.rs
@@ -3,7 +3,7 @@
//! When `Config::remote_resolution_enabled` is set, the resolution stage
//! routes exception-level symbol resolution through the `cymbal-resolution`
//! service via a caller-owned endpoint pool instead of running
-//! [`crate::stages::resolution::symbol::local::LocalSymbolResolver`] inline.
+//! [`crate::symbolication::symbol::local::LocalSymbolResolver`] inline.
//!
//! There is intentionally no silent local fallback: if the pool cannot
//! satisfy a request, the stage surfaces an unhandled error for the batch
diff --git a/rust/cymbal/src/stages/resolution/remote/resolver/retry.rs b/rust/cymbal/src/stages/resolution/remote/resolver/retry.rs
index 3675d3f98d2d..e1afab23c99c 100644
--- a/rust/cymbal/src/stages/resolution/remote/resolver/retry.rs
+++ b/rust/cymbal/src/stages/resolution/remote/resolver/retry.rs
@@ -311,7 +311,7 @@ fn classify_outcome(
}
resolve_outcome::Result::Error(err) => {
let kind = ErrorKind::try_from(err.kind).unwrap_or(ErrorKind::Unspecified);
- metrics::counter!(REMOTE_RESOLUTION_ERROR_KINDS, "kind" => error_kind_label(kind))
+ metrics::counter!(REMOTE_RESOLUTION_ERROR_KINDS, "kind" => kind.metric_label())
.increment(1);
match kind {
ErrorKind::Overloaded => Ok(ItemDecision::Overloaded(err.message)),
@@ -417,16 +417,6 @@ fn record_reroute_depth(outcome: &'static str, attempts_used: u32) {
.record(attempts_used.saturating_sub(1) as f64);
}
-fn error_kind_label(kind: ErrorKind) -> &'static str {
- match kind {
- ErrorKind::Unspecified => "unspecified",
- ErrorKind::InvalidPayload => "invalid_payload",
- ErrorKind::Poison => "poison",
- ErrorKind::Unhandled => "unhandled",
- ErrorKind::Overloaded => "overloaded",
- }
-}
-
#[cfg(test)]
mod tests {
use cymbal_proto::cymbal::resolution::v1::{Done, Error, Retry};
diff --git a/rust/cymbal/src/symbolication/mod.rs b/rust/cymbal/src/symbolication/mod.rs
new file mode 100644
index 000000000000..71686cab48fd
--- /dev/null
+++ b/rust/cymbal/src/symbolication/mod.rs
@@ -0,0 +1,9 @@
+//! Symbol resolution engine shared by both run modes: the processing
+//! pipeline's resolution stage (`crate::stages::resolution`) calls it inline,
+//! and resolution mode (`crate::modes::resolution`) serves it over gRPC.
+//!
+//! - [`symbol`] — the [`symbol::SymbolResolver`] trait and the local resolver.
+//! - [`symbol_store`] — symbol-set providers, caching, and the [`symbolication::symbol_store::Catalog`].
+
+pub mod symbol;
+pub mod symbol_store;
diff --git a/rust/cymbal/src/stages/resolution/symbol/local.rs b/rust/cymbal/src/symbolication/symbol/local.rs
similarity index 97%
rename from rust/cymbal/src/stages/resolution/symbol/local.rs
rename to rust/cymbal/src/symbolication/symbol/local.rs
index 385d47bccfae..3e307fb6473c 100644
--- a/rust/cymbal/src/stages/resolution/symbol/local.rs
+++ b/rust/cymbal/src/symbolication/symbol/local.rs
@@ -26,8 +26,8 @@ use crate::{
FRAME_CACHE_HITS, FRAME_CACHE_MISSES, FRAME_DB_HITS, FRAME_DB_MISSES,
SUSPICIOUS_FRAMES_DETECTED,
},
- stages::resolution::symbol::SymbolResolver,
- symbol_store::{
+ symbolication::symbol::SymbolResolver,
+ symbolication::symbol_store::{
chunk_id::OrChunkId,
dart_minified_names::lookup_minified_type,
proguard::{FetchedMapping, ProguardRef},
@@ -253,8 +253,8 @@ mod test {
use crate::{
config::Config,
frames::{records::ErrorTrackingStackFrame, RawFrame},
- stages::resolution::symbol::{local::LocalSymbolResolver, SymbolResolver},
- symbol_store::{
+ symbolication::symbol::{local::LocalSymbolResolver, SymbolResolver},
+ symbolication::symbol_store::{
apple::AppleProvider,
chunk_id::ChunkIdFetcher,
hermesmap::HermesMapProvider,
@@ -267,10 +267,10 @@ mod test {
};
const CHUNK_PATH: &str = "/static/chunk-PGUQKT6S.js";
- const MINIFIED: &[u8] = include_bytes!("../../../../tests/static/chunk-PGUQKT6S.js");
- const MAP: &[u8] = include_bytes!("../../../../tests/static/chunk-PGUQKT6S.js.map");
+ const MINIFIED: &[u8] = include_bytes!("../../../tests/static/chunk-PGUQKT6S.js");
+ const MAP: &[u8] = include_bytes!("../../../tests/static/chunk-PGUQKT6S.js.map");
const EXAMPLE_EXCEPTION: &str =
- include_str!("../../../../tests/static/raw_ch_exception_list.json");
+ include_str!("../../../tests/static/raw_ch_exception_list.json");
async fn setup_test_context<S>(pool: PgPool, s3_init: S) -> (Config, Catalog, MockServer)
where
diff --git a/rust/cymbal/src/stages/resolution/symbol/mod.rs b/rust/cymbal/src/symbolication/symbol/mod.rs
similarity index 98%
rename from rust/cymbal/src/stages/resolution/symbol/mod.rs
rename to rust/cymbal/src/symbolication/symbol/mod.rs
index f2af32209383..d01519ef171b 100644
--- a/rust/cymbal/src/stages/resolution/symbol/mod.rs
+++ b/rust/cymbal/src/symbolication/symbol/mod.rs
@@ -5,7 +5,7 @@ use crate::{
frames::{Frame, RawFrame},
langs::native::DebugImage,
metric_consts::JAVA_EXCEPTION_REMAP_FAILED,
- symbol_store::{chunk_id::OrChunkId, proguard::ProguardRef},
+ symbolication::symbol_store::{chunk_id::OrChunkId, proguard::ProguardRef},
types::{operator::TeamId, Exception},
};
use tracing::warn;
diff --git a/rust/cymbal/src/symbol_store/apple.rs b/rust/cymbal/src/symbolication/symbol_store/apple.rs
similarity index 96%
rename from rust/cymbal/src/symbol_store/apple.rs
rename to rust/cymbal/src/symbolication/symbol_store/apple.rs
index c22ede96e7b0..37e5aa24dc0e 100644
--- a/rust/cymbal/src/symbol_store/apple.rs
+++ b/rust/cymbal/src/symbolication/symbol_store/apple.rs
@@ -8,7 +8,7 @@ use posthog_symbol_data::{read_symbol_data_with_byte_count, AppleDsym};
use crate::{
error::{AppleError, ResolveError, UnhandledError},
metric_consts::SYMBOL_SET_DECOMPRESSED_BYTES,
- symbol_store::{native::ParsedNativeSymbols, Fetcher, Parser},
+ symbolication::symbol_store::{native::ParsedNativeSymbols, Fetcher, Parser},
};
pub struct AppleProvider {}
diff --git a/rust/cymbal/src/symbol_store/caching.rs b/rust/cymbal/src/symbolication/symbol_store/caching.rs
similarity index 99%
rename from rust/cymbal/src/symbol_store/caching.rs
rename to rust/cymbal/src/symbolication/symbol_store/caching.rs
index 7f6555e7fdd7..3fa1f34eb3c7 100644
--- a/rust/cymbal/src/symbol_store/caching.rs
+++ b/rust/cymbal/src/symbolication/symbol_store/caching.rs
@@ -182,7 +182,7 @@ mod tests {
use reqwest::Url;
use super::*;
- use crate::symbol_store::chunk_id::OrChunkId;
+ use crate::symbolication::symbol_store::chunk_id::OrChunkId;
struct FakeProvider {
fetches: Arc<AtomicUsize>,
diff --git a/rust/cymbal/src/symbol_store/chunk_id.rs b/rust/cymbal/src/symbolication/symbol_store/chunk_id.rs
similarity index 98%
rename from rust/cymbal/src/symbol_store/chunk_id.rs
rename to rust/cymbal/src/symbolication/symbol_store/chunk_id.rs
index a7f3ffef4293..3907c7945e0c 100644
--- a/rust/cymbal/src/symbol_store/chunk_id.rs
+++ b/rust/cymbal/src/symbolication/symbol_store/chunk_id.rs
@@ -13,7 +13,7 @@ use tracing::error;
use crate::{
error::{FrameError, UnhandledError},
metric_consts::{CHUNK_ID_FAILURE_FETCHED, CHUNK_ID_NOT_FOUND},
- symbol_store::BlobClient,
+ symbolication::symbol_store::BlobClient,
};
use super::{saving::SymbolSetRecord, Fetcher, Parser};
@@ -347,7 +347,7 @@ mod test {
error::ResolveError,
frames::RawFrame,
langs::js::RawJSFrame,
- symbol_store::{
+ symbolication::symbol_store::{
apple::AppleProvider,
chunk_id::{ChunkIdFetcher, OrChunkId, SymbolSetCacheKey},
hermesmap::HermesMapProvider,
@@ -359,9 +359,10 @@ mod test {
types::{RawErrProps, Stacktrace},
};
- const EXAMPLE_EXCEPTION: &str = include_str!("../../tests/static/raw_ch_exception_list.json");
- const MINIFIED: &[u8] = include_bytes!("../../tests/static/chunk-PGUQKT6S.js");
- const MAP: &[u8] = include_bytes!("../../tests/static/chunk-PGUQKT6S.js.map");
+ const EXAMPLE_EXCEPTION: &str =
+ include_str!("../../../tests/static/raw_ch_exception_list.json");
+ const MINIFIED: &[u8] = include_bytes!("../../../tests/static/chunk-PGUQKT6S.js");
+ const MAP: &[u8] = include_bytes!("../../../tests/static/chunk-PGUQKT6S.js.map");
// Used to construct a Catalog with only the chunk id based provider implemented
#[allow(dead_code)]
diff --git a/rust/cymbal/src/symbol_store/concurrency.rs b/rust/cymbal/src/symbolication/symbol_store/concurrency.rs
similarity index 100%
rename from rust/cymbal/src/symbol_store/concurrency.rs
rename to rust/cymbal/src/symbolication/symbol_store/concurrency.rs
diff --git a/rust/cymbal/src/symbol_store/dart_minified_names.rs b/rust/cymbal/src/symbolication/symbol_store/dart_minified_names.rs
similarity index 100%
rename from rust/cymbal/src/symbol_store/dart_minified_names.rs
rename to rust/cymbal/src/symbolication/symbol_store/dart_minified_names.rs
diff --git a/rust/cymbal/src/symbol_store/hermesmap.rs b/rust/cymbal/src/symbolication/symbol_store/hermesmap.rs
similarity index 96%
rename from rust/cymbal/src/symbol_store/hermesmap.rs
rename to rust/cymbal/src/symbolication/symbol_store/hermesmap.rs
index b26074a81e20..ca7f7c90cac8 100644
--- a/rust/cymbal/src/symbol_store/hermesmap.rs
+++ b/rust/cymbal/src/symbolication/symbol_store/hermesmap.rs
@@ -6,7 +6,7 @@ use crate::{
error::{HermesError, ResolveError, UnhandledError},
langs::hermes::HermesRef,
metric_consts::SYMBOL_SET_DECOMPRESSED_BYTES,
- symbol_store::{caching::Countable, Fetcher, Parser},
+ symbolication::symbol_store::{caching::Countable, Fetcher, Parser},
};
pub struct ParsedHermesMap {
diff --git a/rust/cymbal/src/symbol_store/mod.rs b/rust/cymbal/src/symbolication/symbol_store/mod.rs
similarity index 99%
rename from rust/cymbal/src/symbol_store/mod.rs
rename to rust/cymbal/src/symbolication/symbol_store/mod.rs
index 8280be7bdadf..53f587849b25 100644
--- a/rust/cymbal/src/symbol_store/mod.rs
+++ b/rust/cymbal/src/symbolication/symbol_store/mod.rs
@@ -9,7 +9,7 @@ use sourcemap::OwnedSourceMapCache;
use crate::{
error::ResolveError,
langs::hermes::HermesRef,
- symbol_store::{
+ symbolication::symbol_store::{
apple::AppleRef,
hermesmap::ParsedHermesMap,
native::ParsedNativeSymbols,
diff --git a/rust/cymbal/src/symbol_store/native.rs b/rust/cymbal/src/symbolication/symbol_store/native.rs
similarity index 99%
rename from rust/cymbal/src/symbol_store/native.rs
rename to rust/cymbal/src/symbolication/symbol_store/native.rs
index 7dffbafd6f78..139ffa2b7042 100644
--- a/rust/cymbal/src/symbol_store/native.rs
+++ b/rust/cymbal/src/symbolication/symbol_store/native.rs
@@ -7,7 +7,7 @@ use symbolic::demangle::{Demangle, DemangleOptions};
use symbolic::symcache::{SymCache, SymCacheConverter};
use zip::ZipArchive;
-use crate::{error::NativeError, symbol_store::caching::Countable};
+use crate::{error::NativeError, symbolication::symbol_store::caching::Countable};
/// Manifest format for source files bundled in the symbol ZIP under `__source/`
#[derive(Deserialize)]
diff --git a/rust/cymbal/src/symbol_store/proguard.rs b/rust/cymbal/src/symbolication/symbol_store/proguard.rs
similarity index 96%
rename from rust/cymbal/src/symbol_store/proguard.rs
rename to rust/cymbal/src/symbolication/symbol_store/proguard.rs
index 94b253202952..b3922fcd27e0 100644
--- a/rust/cymbal/src/symbol_store/proguard.rs
+++ b/rust/cymbal/src/symbolication/symbol_store/proguard.rs
@@ -7,7 +7,7 @@ use posthog_symbol_data::{read_symbol_data_with_byte_count, ProguardMapping};
use crate::{
error::{ProguardError, ResolveError, UnhandledError},
metric_consts::SYMBOL_SET_DECOMPRESSED_BYTES,
- symbol_store::{caching::Countable, Fetcher, Parser},
+ symbolication::symbol_store::{caching::Countable, Fetcher, Parser},
};
pub struct FetchedMapping {
@@ -101,7 +101,7 @@ mod tests {
use super::*;
- const PROGUARD_MAP: &str = include_str!("../../tests/static/proguard/mapping_example.txt");
+ const PROGUARD_MAP: &str = include_str!("../../../tests/static/proguard/mapping_example.txt");
#[test]
fn fetched_mapping_uses_proguard_cache_for_lookups() {
diff --git a/rust/cymbal/src/symbol_store/s3.rs b/rust/cymbal/src/symbolication/symbol_store/s3.rs
similarity index 100%
rename from rust/cymbal/src/symbol_store/s3.rs
rename to rust/cymbal/src/symbolication/symbol_store/s3.rs
diff --git a/rust/cymbal/src/symbol_store/saving.rs b/rust/cymbal/src/symbolication/symbol_store/saving.rs
similarity index 99%
rename from rust/cymbal/src/symbol_store/saving.rs
rename to rust/cymbal/src/symbolication/symbol_store/saving.rs
index 06044a155c69..488ffd5ab49d 100644
--- a/rust/cymbal/src/symbol_store/saving.rs
+++ b/rust/cymbal/src/symbolication/symbol_store/saving.rs
@@ -17,7 +17,7 @@ use crate::{
SYMBOL_SET_FETCH_RETRY, SYMBOL_SET_SAVED,
},
posthog_utils::{capture_symbol_set_deleted, capture_symbol_set_saved},
- symbol_store::{chunk_id::SymbolSetKey, BlobClient},
+ symbolication::symbol_store::{chunk_id::SymbolSetKey, BlobClient},
};
use super::{Fetcher, Parser};
@@ -534,7 +534,7 @@ mod test {
use crate::{
config::Config,
- symbol_store::{
+ symbolication::symbol_store::{
saving::{truncate_ref, Saving, SymbolSetRecord, MAX_REF_BYTES},
sourcemap::SourcemapProvider,
MockS3Client, Provider,
@@ -542,8 +542,8 @@ mod test {
};
const CHUNK_PATH: &str = "/static/chunk-PGUQKT6S.js";
- const MINIFIED: &[u8] = include_bytes!("../../tests/static/chunk-PGUQKT6S.js");
- const MAP: &[u8] = include_bytes!("../../tests/static/chunk-PGUQKT6S.js.map");
+ const MINIFIED: &[u8] = include_bytes!("../../../tests/static/chunk-PGUQKT6S.js");
+ const MAP: &[u8] = include_bytes!("../../../tests/static/chunk-PGUQKT6S.js.map");
#[test]
fn test_truncate_ref_short_string() {
diff --git a/rust/cymbal/src/symbol_store/sourcemap.rs b/rust/cymbal/src/symbolication/symbol_store/sourcemap.rs
similarity index 97%
rename from rust/cymbal/src/symbol_store/sourcemap.rs
rename to rust/cymbal/src/symbolication/symbol_store/sourcemap.rs
index 87bfaeef62eb..bda098323de8 100644
--- a/rust/cymbal/src/symbol_store/sourcemap.rs
+++ b/rust/cymbal/src/symbolication/symbol_store/sourcemap.rs
@@ -563,10 +563,10 @@ fn assert_is_sourcemap(data: &str) -> Result<(), ResolveError> {
mod test {
use httpmock::MockServer;
- const MINIFIED: &[u8] = include_bytes!("../../tests/static/chunk-PGUQKT6S.js");
- const MAP: &[u8] = include_bytes!("../../tests/static/chunk-PGUQKT6S.js.map");
+ const MINIFIED: &[u8] = include_bytes!("../../../tests/static/chunk-PGUQKT6S.js");
+ const MAP: &[u8] = include_bytes!("../../../tests/static/chunk-PGUQKT6S.js.map");
const MINIFIED_WITH_NO_MAP_REF: &[u8] =
- include_bytes!("../../tests/static/chunk-PGUQKT6S-no-map.js");
+ include_bytes!("../../../tests/static/chunk-PGUQKT6S-no-map.js");
use super::*;
@@ -657,7 +657,8 @@ mod test {
#[tokio::test]
pub async fn data_url_test() {
- let data_url_example: &str = include_str!("../../tests/static/inline_sourcemap_example.js");
+ let data_url_example: &str =
+ include_str!("../../../tests/static/inline_sourcemap_example.js");
let server = MockServer::start();
@@ -678,7 +679,7 @@ mod test {
panic!("Expected Data, got something else");
};
- let expected = include_str!("../../tests/static/inline_sourcemap_example.js.map");
+ let expected = include_str!("../../../tests/static/inline_sourcemap_example.js.map");
assert_eq!(res.trim(), expected.trim());
@@ -705,7 +706,7 @@ mod test {
#[sqlx::test(migrations = "./tests/test_migrations")]
async fn chunk_id_rescue_short_circuits_when_map_url_is_404(db: PgPool) {
- use crate::symbol_store::{saving::SymbolSetRecord, MockS3Client};
+ use crate::symbolication::symbol_store::{saving::SymbolSetRecord, MockS3Client};
use chrono::Utc;
use mockall::predicate;
use uuid::Uuid;
@@ -780,7 +781,7 @@ mod test {
#[sqlx::test(migrations = "./tests/test_migrations")]
async fn chunk_id_rescue_falls_through_when_no_db_record(db: PgPool) {
- use crate::symbol_store::MockS3Client;
+ use crate::symbolication::symbol_store::MockS3Client;
const RESCUE_BUCKET: &str = "test-bucket";
@@ -813,7 +814,7 @@ mod test {
#[sqlx::test(migrations = "./tests/test_migrations")]
async fn chunk_id_rescue_deletes_stale_record_when_blob_is_missing(db: PgPool) {
- use crate::symbol_store::{saving::SymbolSetRecord, MockS3Client};
+ use crate::symbolication::symbol_store::{saving::SymbolSetRecord, MockS3Client};
use chrono::Utc;
use mockall::predicate;
use uuid::Uuid;
diff --git a/rust/cymbal/src/test_utils.rs b/rust/cymbal/src/test_utils.rs
index 6fa43d8a50ca..dcde023ea21b 100644
--- a/rust/cymbal/src/test_utils.rs
+++ b/rust/cymbal/src/test_utils.rs
@@ -10,7 +10,8 @@ use mockall::mock;
use sqlx::PgPool;
use crate::{
- app_context::AppContext, config::Config, error::UnhandledError, symbol_store::BlobClient,
+ app_context::AppContext, config::Config, error::UnhandledError,
+ symbolication::symbol_store::BlobClient,
};
mock! {
diff --git a/rust/cymbal/tests/common/mod.rs b/rust/cymbal/tests/common/mod.rs
index cb891d7d3bdd..f79048d1840d 100644
--- a/rust/cymbal/tests/common/mod.rs
+++ b/rust/cymbal/tests/common/mod.rs
@@ -24,11 +24,11 @@ use cymbal::stages::resolution::{
remote::{
config::RemoteResolutionConfig, pool::EndpointPool, resolver::RemoteResolutionContext,
},
- symbol::SymbolResolver,
ResolutionStage,
};
-use cymbal::symbol_store::chunk_id::OrChunkId;
-use cymbal::symbol_store::proguard::ProguardRef;
+use cymbal::symbolication::symbol::SymbolResolver;
+use cymbal::symbolication::symbol_store::chunk_id::OrChunkId;
+use cymbal::symbolication::symbol_store::proguard::ProguardRef;
use cymbal::types::{
batch::Batch, exception_properties::ExceptionProperties, operator::TeamId, stage::Stage,
Exception, ExceptionList, Stacktrace,
diff --git a/rust/cymbal/tests/event.rs b/rust/cymbal/tests/event.rs
index 08f83fcbae0c..d6730ff95ab3 100644
--- a/rust/cymbal/tests/event.rs
+++ b/rust/cymbal/tests/event.rs
@@ -6,7 +6,7 @@ use common_types::error_tracking::FrameId;
use cymbal::{
error::UnhandledError,
frames::Frame,
- symbol_store::saving::SymbolSetRecord,
+ symbolication::symbol_store::saving::SymbolSetRecord,
types::{
event::AnyEvent, exception_properties::ExceptionProperties, Exception, ExceptionList,
Mechanism, Stacktrace,
diff --git a/rust/cymbal/tests/remote_resolution.rs b/rust/cymbal/tests/remote_resolution.rs
index a21f8d783809..7dec212a14ec 100644
--- a/rust/cymbal/tests/remote_resolution.rs
+++ b/rust/cymbal/tests/remote_resolution.rs
@@ -21,10 +21,10 @@ use common::{
use cymbal::error::{ResolveError, UnhandledError};
use cymbal::frames::{Frame, RawFrame};
use cymbal::langs::native::DebugImage;
-use cymbal::stages::resolution::symbol::SymbolResolver;
use cymbal::stages::resolution::ResolutionStage;
-use cymbal::symbol_store::chunk_id::OrChunkId;
-use cymbal::symbol_store::proguard::ProguardRef;
+use cymbal::symbolication::symbol::SymbolResolver;
+use cymbal::symbolication::symbol_store::chunk_id::OrChunkId;
+use cymbal::symbolication::symbol_store::proguard::ProguardRef;
use cymbal::types::batch::Batch;
use cymbal::types::exception_properties::ExceptionProperties;
use cymbal::types::operator::TeamId;
diff --git a/rust/cymbal/tests/remote_resolution_parity.rs b/rust/cymbal/tests/remote_resolution_parity.rs
index 9b4f4dfe9b67..646763ce8996 100644
--- a/rust/cymbal/tests/remote_resolution_parity.rs
+++ b/rust/cymbal/tests/remote_resolution_parity.rs
@@ -23,16 +23,16 @@ use common::{build_event, make_ctx};
use cymbal::error::{ResolveError, UnhandledError};
use cymbal::frames::{Frame, RawFrame};
use cymbal::langs::native::DebugImage;
-use cymbal::stages::resolution::symbol::SymbolResolver;
+use cymbal::modes::resolution::load_monitor::LoadMonitor;
+use cymbal::modes::resolution::service::{CymbalResolutionService, ServiceConfig};
use cymbal::stages::resolution::ResolutionStage;
-use cymbal::symbol_store::chunk_id::OrChunkId;
-use cymbal::symbol_store::proguard::ProguardRef;
+use cymbal::symbolication::symbol::SymbolResolver;
+use cymbal::symbolication::symbol_store::chunk_id::OrChunkId;
+use cymbal::symbolication::symbol_store::proguard::ProguardRef;
use cymbal::types::batch::Batch;
use cymbal::types::operator::TeamId;
use cymbal::types::stage::Stage;
use cymbal_proto::cymbal::resolution::v1::cymbal_resolution_server::CymbalResolutionServer;
-use cymbal_resolution::load_monitor::LoadMonitor;
-use cymbal_resolution::service::{CymbalResolutionService, ServiceConfig};
use tokio::sync::Semaphore;
/// Fake symbol resolver shared by both sides of the parity comparison. Every
diff --git a/rust/cymbal/tests/remote_resolution_subscribe.rs b/rust/cymbal/tests/remote_resolution_subscribe.rs
index 331d867a2e02..27943e97180c 100644
--- a/rust/cymbal/tests/remote_resolution_subscribe.rs
+++ b/rust/cymbal/tests/remote_resolution_subscribe.rs
@@ -18,14 +18,14 @@ use async_trait::async_trait;
use cymbal::error::{ResolveError, UnhandledError};
use cymbal::frames::{Frame, RawFrame};
use cymbal::langs::native::DebugImage;
+use cymbal::modes::resolution::load_monitor::LoadMonitor;
+use cymbal::modes::resolution::service::{CymbalResolutionService, ServiceConfig};
use cymbal::stages::resolution::remote::{EndpointPool, RemoteResolutionConfig};
-use cymbal::stages::resolution::symbol::SymbolResolver;
-use cymbal::symbol_store::chunk_id::OrChunkId;
-use cymbal::symbol_store::proguard::ProguardRef;
+use cymbal::symbolication::symbol::SymbolResolver;
+use cymbal::symbolication::symbol_store::chunk_id::OrChunkId;
+use cymbal::symbolication::symbol_store::proguard::ProguardRef;
use cymbal::types::operator::TeamId;
use cymbal_proto::cymbal::resolution::v1::cymbal_resolution_server::CymbalResolutionServer;
-use cymbal_resolution::load_monitor::LoadMonitor;
-use cymbal_resolution::service::{CymbalResolutionService, ServiceConfig};
use tokio::sync::Semaphore;
#[derive(Default)]
diff --git a/rust/cymbal-resolution/tests/service_tests.rs b/rust/cymbal/tests/resolution_service_tests.rs
similarity index 98%
rename from rust/cymbal-resolution/tests/service_tests.rs
rename to rust/cymbal/tests/resolution_service_tests.rs
index 62a0d5a04d18..edb0ff3e46c5 100644
--- a/rust/cymbal-resolution/tests/service_tests.rs
+++ b/rust/cymbal/tests/resolution_service_tests.rs
@@ -8,8 +8,10 @@ use async_trait::async_trait;
use cymbal::error::{ResolveError, UnhandledError};
use cymbal::frames::{Frame, RawFrame};
use cymbal::langs::native::DebugImage;
-use cymbal::stages::resolution::symbol::SymbolResolver;
-use cymbal::symbol_store::{chunk_id::OrChunkId, proguard::ProguardRef};
+use cymbal::modes::resolution::load_monitor::LoadMonitor;
+use cymbal::modes::resolution::service::{CymbalResolutionService, ServiceConfig};
+use cymbal::symbolication::symbol::SymbolResolver;
+use cymbal::symbolication::symbol_store::{chunk_id::OrChunkId, proguard::ProguardRef};
use cymbal::types::operator::TeamId;
use cymbal::types::{Exception, Stacktrace};
use cymbal_proto::cymbal::resolution::v1::cymbal_resolution_client::CymbalResolutionClient;
@@ -18,8 +20,6 @@ use cymbal_proto::cymbal::resolution::v1::cymbal_resolution_server::CymbalResolu
use cymbal_proto::cymbal::resolution::v1::{
resolve_outcome, ErrorKind, ResolveItem, ResolveOutcome, SubscribeRequest,
};
-use cymbal_resolution::load_monitor::LoadMonitor;
-use cymbal_resolution::service::{CymbalResolutionService, ServiceConfig};
use futures::StreamExt;
use tokio::sync::Semaphore;
use tonic::transport::{Channel, Server};
diff --git a/rust/cymbal/tests/resolve.rs b/rust/cymbal/tests/resolve.rs
index 74a60c3b0a42..a0995b156c26 100644
--- a/rust/cymbal/tests/resolve.rs
+++ b/rust/cymbal/tests/resolve.rs
@@ -6,7 +6,7 @@ use common_types::ClickHouseEvent;
use cymbal::{
config::Config,
frames::{Frame, RawFrame},
- symbol_store::{
+ symbolication::symbol_store::{
apple::AppleProvider,
caching::{Caching, SymbolSetCache},
chunk_id::OrChunkId,
diff --git a/rust/cymbal/tests/utils.rs b/rust/cymbal/tests/utils.rs
index f63d8f2fce14..e11c5357f82d 100644
--- a/rust/cymbal/tests/utils.rs
+++ b/rust/cymbal/tests/utils.rs
@@ -6,7 +6,7 @@ use bytes::Bytes;
use common_redis::MockRedisClient;
use cymbal::{
app_context::AppContext, config::Config, error::UnhandledError, router::get_router,
- symbol_store::BlobClient,
+ symbolication::symbol_store::BlobClient,
};
use async_trait::async_trait;