Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cloud shotover metrics #1449

Merged
merged 1 commit into from
Feb 6, 2024
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
7 changes: 4 additions & 3 deletions Cargo.lock

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

13 changes: 10 additions & 3 deletions shotover-proxy/benches/windsock/cassandra/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,9 @@ impl Bench for CassandraBench {
let shotover_ip = shotover_instance
.as_ref()
.map(|x| x.instance.private_ip().to_string());
let shotover_connect_ip = shotover_instance
.as_ref()
.map(|x| x.instance.connect_ip().to_string());

let mut profiler_instances: HashMap<String, &Ec2Instance> =
[("bencher".to_owned(), &bench_instance.instance)].into();
Expand All @@ -581,9 +584,13 @@ impl Bench for CassandraBench {
profiler_instances.insert("cassandra".to_owned(), &cassandra_instances[0].instance);
}
}
let mut profiler =
CloudProfilerRunner::new(self.name(), profiling, profiler_instances, &shotover_ip)
.await;
let mut profiler = CloudProfilerRunner::new(
self.name(),
profiling,
profiler_instances,
&shotover_connect_ip,
)
.await;

let cassandra_nodes = vec![
AwsNodeInfo {
Expand Down
2 changes: 2 additions & 0 deletions shotover-proxy/benches/windsock/cloud/aws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ impl AwsInstances {
pub async fn new() -> Self {
AwsInstances {
aws: Aws::builder(CleanupResources::WithAppTag(AWS_THROWAWAY_TAG.to_owned()))
// shotover metrics port
.expose_ports_to_internet(vec![9001])
.build()
.await,
}
Expand Down
4 changes: 2 additions & 2 deletions shotover-proxy/benches/windsock/profilers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ impl CloudProfilerRunner {
bench_name: String,
profiling: Profiling,
instances: HashMap<String, &Ec2Instance>,
shotover_ip: &Option<String>,
shotover_connect_ip: &Option<String>,
) -> Self {
let run_sys_monitor = profiling
.profilers_to_use
Expand All @@ -124,7 +124,7 @@ impl CloudProfilerRunner {
let shotover_metrics = if run_shotover_metrics {
Some(ShotoverMetrics::new(
bench_name.clone(),
shotover_ip.as_ref().unwrap(),
shotover_connect_ip.as_ref().unwrap(),
))
} else {
None
Expand Down
7 changes: 4 additions & 3 deletions shotover-proxy/benches/windsock/profilers/shotover_metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,15 @@ impl ShotoverMetrics {
tokio::select! {
_ = shutdown_rx.recv() => break,
_ = interval.tick() => {
match tokio::time::timeout(Duration::from_secs(3), reqwest::get(url)).await.unwrap() {
Ok(response) => {
match tokio::time::timeout(Duration::from_secs(3), reqwest::get(url)).await {
Ok(Ok(response)) => {
results.push(RawPrometheusExposition {
timestamp: OffsetDateTime::now_utc(),
content: response.text().await.unwrap(),
});
}
Err(err) => tracing::debug!("Failed to request from metrics endpoint, probably not up yet, error was {err:?}")
Ok(Err(err)) => tracing::debug!("Failed to request from metrics endpoint {url}, probably not up yet, error was {err:?}"),
Err(_) => panic!("Timed out request from metrics endpoint {url}")
}
}
}
Expand Down
Loading