Skip to content

Commit

Permalink
bump Sōzu to 1.1: remove aggregation of metrics
Browse files Browse the repository at this point in the history
Now Sōzu aggregates metrics by worker and cluster
  • Loading branch information
Emmanuel Bosquet committed Jul 16, 2024
1 parent fc90d9c commit 5819971
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 277 deletions.
24 changes: 16 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ serde = { version = "^1.0.195", features = ["derive"] }
serde_json = "^1.0.111"
sentry = { version = "^0.34.0", default-features = false, features = ["backtrace", "contexts", "panic", "reqwest", "rustls"] }
sentry-tracing = "^0.34.0"
sozu-client = "^0.4.0"
sozu-command-lib = "^1.0.0"
# sozu-client = "^0.4.0"
sozu-client = { path = "/home/emmanuel/clever/traffic/sozu-client" }
# sozu-command-lib = "^1.0.0"
sozu-command-lib = { path = "/home/emmanuel/clever/traffic/sozu/command" }
thiserror = "^1.0.56"
tokio = { version = "^1.35.1", features = ["macros", "rt", "signal"] }
tracing = "^0.1.40"
Expand Down
3 changes: 0 additions & 3 deletions example.config.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Socket address on which to listen
listening-address = "0.0.0.0:3000"

# aggregate backend metrics by cluster id
aggregate-backend-metrics = true

[sozu]
# Path to Sōzu's configuration file
configuration = "path/to/sozu/config.toml"
Expand Down
2 changes: 0 additions & 2 deletions src/svc/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ pub struct Sozu {
pub struct ConnectorConfiguration {
#[serde(rename = "listening-address")]
pub listening_address: SocketAddr,
#[serde(rename = "aggregate-backend-metrics")]
pub aggregate_backend_metrics: bool,
#[serde(rename = "sozu")]
pub sozu: Sozu,
#[serde(rename = "sentry")]
Expand Down
5 changes: 1 addition & 4 deletions src/svc/http/server/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,7 @@ pub async fn telemetry(State(state): State<server::State>, _req: Request<Body>)
content_type: Some(ContentType::Metrics(aggregated_metrics)),
}),
..
}) => convert_metrics_to_prometheus(
aggregated_metrics,
state.config.aggregate_backend_metrics,
),
}) => convert_metrics_to_prometheus(aggregated_metrics),
Ok(response) => {
let headers = res.headers_mut();
let message = serde_json::json!({
Expand Down
Loading

0 comments on commit 5819971

Please sign in to comment.