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

Dispatch tests and metrics flag #561

Merged
merged 2 commits into from
Apr 25, 2022

Conversation

josephschorr
Copy link
Member

No description provided.

@josephschorr josephschorr requested review from vroldanbet and a team as code owners April 25, 2022 16:48
@github-actions github-actions bot added area/api v1 Affects the v1 API area/CLI Affects the command line area/datastore Affects the storage system area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) labels Apr 25, 2022
@josephschorr josephschorr force-pushed the dispatch-tests branch 2 times, most recently from d1c9359 to 30273cf Compare April 25, 2022 17:02
connMaxIdleTime: defaultConnMaxIdleTime,
connMaxLifetime: defaultConnMaxLifetime,
splitAtUsersetCount: defaultUsersetBatchSize,
enablePrometheusStats: false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: do we want to pull a constant just like every other option?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed

// Prometheus metrics are enabled by default.
func EnablePrometheusStats() Option {
// Prometheus metrics are disabled by default.
func WithEnablePrometheusStats(enablePrometheusStats bool) Option {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

naming nit: perhaps WithPrometheusStats would be easier to reason about?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I vacillated back and forth on that, but I decided to be explicit

@@ -104,6 +104,7 @@ func RegisterDatastoreFlags(cmd *cobra.Command, opts *Config) {
cmd.Flags().DurationVar(&opts.RequestHedgingInitialSlowValue, "datastore-request-hedging-initial-slow-value", 10*time.Millisecond, "initial value to use for slow datastore requests, before statistics have been collected")
cmd.Flags().Uint64Var(&opts.RequestHedgingMaxRequests, "datastore-request-hedging-max-requests", 1_000_000, "maximum number of historical requests to consider")
cmd.Flags().Float64Var(&opts.RequestHedgingQuantile, "datastore-request-hedging-quantile", 0.95, "quantile of historical datastore request time over which a request will be considered slow")
cmd.Flags().BoolVar(&opts.EnableDatastoreMetrics, "datastore-prometheus-metrics", true, "set to false to disabled prometheus metrics from the datastore")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. It should be enabled by default from the CLI, but disabled by default if you just instantiate the datastore directly

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it, it's intentional 👍🏻

@josephschorr josephschorr force-pushed the dispatch-tests branch 2 times, most recently from 3321b45 to c379d14 Compare April 25, 2022 17:23
vroldanbet
vroldanbet previously approved these changes Apr 25, 2022
ecordell
ecordell previously approved these changes Apr 25, 2022
Copy link
Contributor

@ecordell ecordell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

ecordell
ecordell previously approved these changes Apr 25, 2022
@ecordell
Copy link
Contributor

Error: internal/datastore/mysql/datastore_test.go:91:3: undefined: EnablePrometheusStats

@josephschorr josephschorr merged commit 8a72701 into authzed:main Apr 25, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 25, 2022
@josephschorr josephschorr deleted the dispatch-tests branch April 25, 2022 21:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/api v1 Affects the v1 API area/CLI Affects the command line area/datastore Affects the storage system area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants