Skip to content

Commit

Permalink
adapter: Always report prometheus metrics
Browse files Browse the repository at this point in the history
Change the default of reporting prometheus metrics from `false`
to `true`, to enable an easier user setup and integration with
readyset metrics.

Fixes: REA-3766
Change-Id: I1dbb8478ebb87728352e92912c38d1862d9fffe7
Reviewed-on: https://gerrit.readyset.name/c/readyset/+/6353
Tested-by: Buildkite CI
Reviewed-by: Luke Osborne <luke@readyset.io>
  • Loading branch information
jasobrown-rs committed Nov 14, 2023
1 parent 06f2ed9 commit 013c2a5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion readyset-clustertest/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ impl DeploymentBuilder {
cleanup: false,
enable_experimental_placeholder_inlining: false,
allow_full_materialization: false,
prometheus_metrics: false,
prometheus_metrics: true,
}
}
/// The number of shards in the graph, `shards` <= 1 disables sharding.
Expand Down
12 changes: 8 additions & 4 deletions readyset-clustertest/src/readyset_mysql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,11 +505,13 @@ async fn dry_run_evaluates_support() {
query_id.clone(),
"SELECT * FROM `t1` WHERE (`uid` = $1)".to_string(),
"pending".to_string(),
"1".to_string(),
)]);
results.write(&[(
query_id,
"SELECT * FROM `t1` WHERE (`uid` = $1)".to_string(),
"yes".to_string(),
"1".to_string(),
)]);

// Verify that the query eventually reaches the "yes" state in the
Expand Down Expand Up @@ -584,11 +586,13 @@ async fn proxied_queries_filtering() {
query_id.clone(),
"SELECT * FROM `t1` WHERE (`uid` = $1)".to_string(),
"pending".to_string(),
"1".to_string(),
)]);
results.write(&[(
query_id.clone(),
"SELECT * FROM `t1` WHERE (`uid` = $1)".to_string(),
"yes".to_string(),
"1".to_string(),
)]);

// Verify that the query eventually reaches the "yes" state in the
Expand All @@ -607,7 +611,7 @@ async fn proxied_queries_filtering() {
let proxied_queries = adapter
.as_mysql_conn()
.unwrap()
.query::<(String, String, String), _>(query)
.query::<(String, String, String, String), _>(query)
.await
.unwrap();

Expand Down Expand Up @@ -647,17 +651,17 @@ async fn cached_queries_filtering() {
let query_ids = adapter
.as_mysql_conn()
.unwrap()
.query::<(String, String, String, String), _>("SHOW CACHES")
.query::<(String, String, String, String, String), _>("SHOW CACHES")
.await
.unwrap();
assert_eq!(query_ids.len(), 2);

// Filter on one of the IDs
let (query_id, _, _, _) = query_ids.first().unwrap();
let (query_id, _, _, _, _) = query_ids.first().unwrap();
let cached_queries = adapter
.as_mysql_conn()
.unwrap()
.query::<(String, String, String, String), _>(&format!(
.query::<(String, String, String, String, String), _>(&format!(
"SHOW CACHES WHERE query_id = '{}'",
query_id
))
Expand Down
2 changes: 1 addition & 1 deletion readyset/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ pub struct Options {
password: Option<RedactedString>,

/// Enable recording and exposing Prometheus metrics
#[arg(long, env = "PROMETHEUS_METRICS")]
#[arg(long, env = "PROMETHEUS_METRICS", default_value = "true", hide = true)]
prometheus_metrics: bool,

#[arg(long, hide = true)]
Expand Down

0 comments on commit 013c2a5

Please sign in to comment.