Skip to content

Commit

Permalink
Adapter: Enable query metrics by default if prometheus-metrics
Browse files Browse the repository at this point in the history
Enables --query-log and --query-log-ad-hoc by default when
--prometheus-metrics are set. Though this is slightly unidiomatic (flags
are disabled by default), most users trying out ReadySet will want all
three of these flags set.

Users will now have to explicitly disable --query-log and/or
--query-log-ad-hoc if they only want to run a subset of these flags.

Release-Note-Core: --query-log and --query-log-ad-hoc are now enabled by
  default if --prometheus-metrics is set, which effectively enables all
  query metrics by default if metrics are enabled.
Change-Id: Id9a03ad9eb3979c8599b01f13d38947ee22bcd36
Reviewed-on: https://gerrit.readyset.name/c/readyset/+/5653
Tested-by: Buildkite CI
Reviewed-by: Luke Osborne <luke@readyset.io>
  • Loading branch information
Dan Wilbanks committed Aug 4, 2023
1 parent fcbeb08 commit 66b4a54
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions readyset/src/lib.rs
Expand Up @@ -245,11 +245,24 @@ pub struct Options {
noria_metrics: bool,

/// Enable logging queries and execution metrics. This creates a histogram per unique query.
#[clap(long, env = "QUERY_LOG", requires = "metrics")]
/// Enabled by default if prometheus-metrics is enabled.
#[clap(
long,
env = "QUERY_LOG",
requires = "metrics",
default_value_if("promethues-metrics", "true", Some("true"))
)]
query_log: bool,

/// Enables logging ad-hoc queries in the query log. Useful for testing.
#[clap(long, hide = true, env = "QUERY_LOG_AD_HOC", requires = "query_log")]
/// Enables logging ad-hoc queries in the query log. Useful for testing. Enabled by default if
/// prometheus-metrics is enabled.
#[clap(
long,
hide = true,
env = "QUERY_LOG_AD_HOC",
requires = "query_log",
default_value_if("prometheus_metrics", "true", Some("true"))
)]
query_log_ad_hoc: bool,

/// Use the AWS EC2 metadata service to determine the external address of this noria adapter's
Expand Down

0 comments on commit 66b4a54

Please sign in to comment.