Skip to content

Commit

Permalink
Merge pull request #18 from CleverCloud/bump-to-sozu-1.1
Browse files Browse the repository at this point in the history
convert histogram metrics
  • Loading branch information
Keksoj authored Jul 18, 2024
2 parents fc90d9c + e405175 commit b9dc09d
Show file tree
Hide file tree
Showing 6 changed files with 145 additions and 301 deletions.
52 changes: 32 additions & 20 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ 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.1"
sozu-command-lib = "^1.0.3"
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 b9dc09d

Please sign in to comment.