Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions devservices/ingest-router.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ingest_router:
locality_to_default_cell:
"--monolith--": "--monolith--"

locales:
localities:
"--monolith--":
- id: "--monolith--"
sentry_url: http://host.docker.internal:8000
Expand All @@ -33,35 +33,35 @@ ingest_router:
method: POST
action:
handler: relay_project_configs
locale: "--monolith--"
locality: "--monolith--"
- match:
host: localhost
path: /api/0/relays/live/
method: GET
action:
handler: health
locale: "--monolith--"
locality: "--monolith--"
- match:
host: localhost
path: /api/0/relays/register/challenge/
method: POST
action:
handler: register_challenge
locale: "--monolith--"
locality: "--monolith--"
- match:
host: localhost
path: /api/0/relays/register/response/
method: POST
action:
handler: register_response
locale: "--monolith--"
locality: "--monolith--"
- match:
host: localhost
path: /api/0/relays/publickeys/
method: POST
action:
handler: public_keys
locale: "--monolith--"
locality: "--monolith--"

metrics:
statsd_host: "127.0.0.1"
Expand Down
22 changes: 11 additions & 11 deletions example_config_ingest_router.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ingest_router:
us: us1
de: de1

locales:
localities:
us:
- id: us1
sentry_url: "http://10.0.0.1:8080"
Expand All @@ -43,71 +43,71 @@ ingest_router:
method: POST
action:
handler: relay_project_configs
locale: us
locality: us
- match:
host: de.sentry.io
path: /api/0/relays/projectconfigs/
method: POST
action:
handler: relay_project_configs
locale: de
locality: de
- match:
host: us.sentry.io
path: /api/0/relays/live/
method: GET
action:
handler: health
locale: us
locality: us
- match:
host: de.sentry.io
path: /api/0/relays/live/
method: GET
action:
handler: health
locale: de
locality: de
- match:
host: us.sentry.io
path: /api/0/relays/register/challenge/
method: POST
action:
handler: register_challenge
locale: us
locality: us
- match:
host: de.sentry.io
path: /api/0/relays/register/challenge/
method: POST
action:
handler: register_challenge
locale: de
locality: de
- match:
host: us.sentry.io
path: /api/0/relays/register/response/
method: POST
action:
handler: register_response
locale: us
locality: us
- match:
host: de.sentry.io
path: /api/0/relays/register/response/
method: POST
action:
handler: register_response
locale: de
locality: de
# Public keys endpoint
- match:
host: us.sentry.io
path: /api/0/relays/publickeys/
method: POST
action:
handler: public_keys
locale: us
locality: us
- match:
host: de.sentry.io
path: /api/0/relays/publickeys/
method: POST
action:
handler: public_keys
locale: de
locality: de


# logging:
Expand Down
8 changes: 4 additions & 4 deletions ingest-router/src/api/any_cell_handler.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::api::utils::normalize_headers;
use crate::errors::IngestRouterError;
use crate::handler::{CellId, ExecutionMode, Handler, SplitMetadata};
use crate::locale::Cells;
use crate::locality::Cells;
use async_trait::async_trait;
use http::StatusCode;
use hyper::body::Bytes;
Expand Down Expand Up @@ -103,12 +103,12 @@ impl Handler for AnyCellHandler {
mod tests {
use super::*;
use crate::config::CellConfig;
use crate::locale::Locales;
use crate::locality::Localities;
use std::collections::HashMap;
use url::Url;

fn create_test_cells() -> Cells {
let locales = HashMap::from([(
let localities = HashMap::from([(
"us".to_string(),
vec![
CellConfig {
Expand All @@ -123,7 +123,7 @@ mod tests {
},
],
)]);
Locales::new(locales).get_cells("us").unwrap()
Localities::new(localities).get_cells("us").unwrap()
}

#[tokio::test]
Expand Down
22 changes: 11 additions & 11 deletions ingest-router/src/api/project_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@
use crate::api::utils::{deserialize_body, normalize_headers, serialize_to_body};
use crate::errors::IngestRouterError;
use crate::handler::{CellId, ExecutionMode, Handler, SplitMetadata};
use crate::locale::Cells;
use crate::locality::Cells;
use async_trait::async_trait;
use http::StatusCode;
use http::response::Parts;
Expand Down Expand Up @@ -576,7 +576,7 @@ impl Handler for ProjectConfigsHandler {
mod tests {
use super::*;
use crate::config::CellConfig;
use crate::locale::Locales;
use crate::locality::Localities;
use crate::testutils::create_test_locator;
use std::collections::HashMap;
use url::Url;
Expand Down Expand Up @@ -604,7 +604,7 @@ mod tests {
]);
let locator = create_test_locator(key_to_cell).await;

let locales = HashMap::from([(
let localities = HashMap::from([(
"us".to_string(),
vec![
CellConfig {
Expand All @@ -620,8 +620,8 @@ mod tests {
],
)]);

let locales_obj = Locales::new(locales);
let cells = locales_obj.get_cells("us").unwrap();
let localities_obj = Localities::new(localities);
let cells = localities_obj.get_cells("us").unwrap();

let handler = ProjectConfigsHandler::new(locator);

Expand Down Expand Up @@ -653,7 +653,7 @@ mod tests {
]);
let locator = create_test_locator(key_to_cell).await;
let handler = ProjectConfigsHandler::new(locator);
let locales = HashMap::from([(
let localities = HashMap::from([(
"us".to_string(),
vec![
CellConfig {
Expand All @@ -668,8 +668,8 @@ mod tests {
},
],
)]);
let locales_obj = Locales::new(locales);
let cells = locales_obj.get_cells("us").unwrap();
let localities_obj = Localities::new(localities);
let cells = localities_obj.get_cells("us").unwrap();
let request2 = build_request(ProjectConfigsRequest {
public_keys: vec!["key1".to_string(), "key2".to_string(), "key3".to_string()],
extra_fields: extra.clone(),
Expand Down Expand Up @@ -704,7 +704,7 @@ mod tests {
async fn test_split_request_unknown_key_goes_to_pending() {
let key_to_cell = HashMap::from([("key1".to_string(), "us1".to_string())]);
let locator = create_test_locator(key_to_cell).await;
let locales = HashMap::from([(
let localities = HashMap::from([(
"us".to_string(),
vec![CellConfig {
id: "us1".to_string(),
Expand All @@ -713,8 +713,8 @@ mod tests {
}],
)]);

let locales_obj = Locales::new(locales);
let cells = locales_obj.get_cells("us").unwrap();
let localities_obj = Localities::new(localities);
let cells = localities_obj.get_cells("us").unwrap();

let handler = ProjectConfigsHandler::new(locator);

Expand Down
Loading
Loading