roachtest: add code changes to benchmarks to emit openmetrics#133035
Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom Nov 15, 2024
Merged
roachtest: add code changes to benchmarks to emit openmetrics#133035craig[bot] merged 1 commit intocockroachdb:masterfrom
craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
Member
1e0a443 to
ce9e8dd
Compare
6946c90 to
642455d
Compare
sambhav-jain-16
commented
Oct 25, 2024
Comment on lines
-122
to
-152
|
|
||
| // InitRoachprod initializes the roachprod providers by calling InitProviders. | ||
| // This function sets up the environment for running roachprod commands. | ||
| func InitRoachprod() { | ||
| _ = roachprod.InitProviders() | ||
| } | ||
|
|
||
| // RoachprodRun runs a command on a roachprod cluster with the given cluster name and logger. | ||
| // It takes a list of command arguments and passes them to the roachprod command execution. | ||
| func RoachprodRun(clusterName string, l *logger.Logger, cmdArray []string) error { | ||
| // Execute the roachprod command with the provided context, logger, cluster name, and options. | ||
| return roachprod.Run( | ||
| context.Background(), l, clusterName, "", "", false, | ||
| os.Stdout, os.Stderr, cmdArray, install.DefaultRunOptions(), | ||
| ) | ||
| } | ||
|
|
||
| // InitLogger initializes and returns a logger based on the provided log file path. | ||
| // If the logger configuration fails, the program prints an error and exits. | ||
| func InitLogger(path string) *logger.Logger { | ||
| loggerCfg := logger.Config{Stdout: os.Stdout, Stderr: os.Stderr} // Create a logger config with standard output and error. | ||
| var loggerError error | ||
| l, loggerError := loggerCfg.NewLogger(path) // Create a new logger based on the configuration. | ||
| if loggerError != nil { | ||
| // If there is an error initializing the logger, print the error message and exit the program. | ||
| _, _ = fmt.Fprintf(os.Stderr, "unable to configure logger: %s\n", loggerError) | ||
| os.Exit(1) | ||
| } | ||
| return l // Return the initialized logger. | ||
| } |
Contributor
Author
There was a problem hiding this comment.
This change was done due to a deep cyclic dependency that was happening in pkg/kv/kvserver/split/load_based_splitter_test.go
sambhav-jain-16
commented
Oct 25, 2024
Comment on lines
-18
to
-28
| invalidCharRegex = regexp.MustCompile(`[^a-zA-Z0-9_]`) | ||
| invalidFirstCharRegex = regexp.MustCompile(`^[^a-zA-Z_]`) | ||
| summaryQuantiles = []float64{50, 95, 99, 100} | ||
| summaryQuantiles = []float64{50, 95, 99, 100} | ||
| ) | ||
|
|
||
| func sanitizeOpenMetricsLabels(input string) string { | ||
| sanitized := invalidCharRegex.ReplaceAllString(input, "_") | ||
| sanitized = invalidFirstCharRegex.ReplaceAllString(sanitized, "_") | ||
| return sanitized | ||
| } | ||
|
|
Contributor
Author
There was a problem hiding this comment.
Removing this in favour of using the roachprod-microbench/util to maintain consistency with roachtest/clusterstats package
642455d to
1655d3b
Compare
4c739dd to
059e4d5
Compare
059e4d5 to
0103ff9
Compare
Contributor
nameisbhaskar
left a comment
There was a problem hiding this comment.
Thanks for the changes. I have comments mostly on the usage of fmt.Sprintf which can be made consistent all across and avoid the use of +. Second point is getting the file names form a single utility function.
sambhav-jain-16
added a commit
to sambhav-jain-16/cockroach
that referenced
this pull request
Nov 15, 2024
cockroachdb#133035 added changes to the `roachtest` binary to emit openmetrics from benchmarks. This change is intended for nightlies to be able to pass on relevant flags and buckets to export openmetrics Epic: https://cockroachlabs.atlassian.net/browse/CRDB-41852 Release note: None
craig bot
pushed a commit
that referenced
this pull request
Nov 17, 2024
135239: build/teamcity: add changes to enable openmetrics in nightly roachtests r=nameisbhaskar a=sambhav-jain-16 #133035 added changes to the `roachtest` binary to emit openmetrics from benchmarks. This change is intended for nightlies to be able to pass on relevant flags and buckets to export openmetrics Epic: https://cockroachlabs.atlassian.net/browse/CRDB-41852 Release note: None Co-authored-by: Sambhav Jain <sambhav.jain@cockroachlabs.com>
sambhav-jain-16
added a commit
to sambhav-jain-16/cockroach
that referenced
this pull request
Nov 18, 2024
The roachtests starting failing with validation errors `Error: error creating metrics exporter: file path must end with .json` after this PR was merged cockroachdb#133035 path defined in `GetWorkloadHistogramArgs` was jumbled. Also there was an error in cockroachdb#135239. This change intends to fix all the errors. Epic: none Release note: None
craig bot
pushed a commit
that referenced
this pull request
Nov 18, 2024
135540: roachtest: fix bench roachtests failing with validation when using json r=srosenberg a=sambhav-jain-16 The roachtests starting failing with validation errors `Error: error creating metrics exporter: file path must end with .json` after this PR was merged #133035 path defined in `GetWorkloadHistogramArgs` was jumbled. Also there was an error in #135239. This change intends to fix all the errors. Epic: none Release note: None Co-authored-by: Sambhav Jain <sambhav.jain@cockroachlabs.com>
sambhav-jain-16
added a commit
to sambhav-jain-16/cockroach
that referenced
this pull request
Nov 18, 2024
This change intends to fix 3 failures detected in benchmark runs after cockroachdb#133035 1. admission-control/elastic-io due to one wrong flag. 2. tpcc/headroom/n4cpu16 due to wrong passing of labels in case of openmetrics, removed suite label since it is not required. 3. tpccbench/* erroring out with nil pointer error in case of openmetrics, reverted the changes in this PR. Will fix in a different PR. Epic: none Fixes: cockroachdb#135393
craig bot
pushed a commit
that referenced
this pull request
Nov 19, 2024
135633: roachtest: fix benchmark failing tests r=srosenberg a=sambhav-jain-16 This change intends to fix 3 failures detected in benchmark runs after #133035 1. `admission-control/elastic-io` due to one wrong flag. 2. `tpcc/headroom/n4cpu16` due to wrong passing of labels in case of openmetrics, removed suite label since it is not required. 3. `tpccbench/*` erroring out with nil pointer error in case of openmetrics, reverted the changes in this PR. Will fix in a different PR. Epic: none Fixes: #135393 Co-authored-by: Sambhav Jain <sambhav.jain@cockroachlabs.com>
aadityasondhi
added a commit
to aadityasondhi/cockroach
that referenced
this pull request
Nov 21, 2024
cockroachdb#133035 inadvertently removed the space. Fixes cockroachdb#135792. Release note: None
sambhav-jain-16
added a commit
to sambhav-jain-16/cockroach
that referenced
this pull request
Dec 3, 2024
`tpcc/large-schema-benchmark` stopped emitting benchmark file after cockroachdb#133035. It was discovered that after `DisableHistogram` was set true for every case and therefore `runTPCC` was skipping setting up the histogram args. Epic: none Release note: None
craig bot
pushed a commit
that referenced
this pull request
Dec 3, 2024
136265: changefeedccl: change cdc latency hist bucket sizes r=asg0451 a=rharding6373
Increases the changefeed.admit_latency and changefeed.commit_latency max
from 5m to 60m and decreases their min to 5ms.
The metrics changefeed.parallel_io_queue_nanos,
changefeed.parallel_io_result_queue_nanos,
changefeed.sink_batch_hist_nanos,
changefeed.flush_hist_nanos, and
changefeed.kafka_throttling_hist_nanos have the new limits 5ms to 10m
(previously 500ms to 5m).
Epic: none
Fixes: #134593
Release note (general change): In order to improve the granularity of
changefeed pipeline metrics, the changefeed metrics
changefeed.admit_latency and changefeed.commit_latency have histogram
buckets from 5ms to 60m (previously 500ms to 5m). The changefeed
metrics changefeed.parallel_io_queue_nanos,
changefeed.parallel_io_result_queue_nanos,
changefeed.sink_batch_hist_nanos,
changefeed.flush_hist_nanos, and
changefeed.kafka_throttling_hist_nanos have histogram buckets from 5ms
to 10m (previously 500ms to 5m).
136575: roachtest: tpcc/large-schema-benchmark not emitting histogram r=sambhav-jain-16 a=sambhav-jain-16
`tpcc/large-schema-benchmark` stopped emitting benchmark file after #133035. It was discovered that `DisableHistogram` was set true for every case and therefore `runTPCC` was skipping setting up the histogram args.
Epic: none
Release note: None
Co-authored-by: rharding6373 <harding@cockroachlabs.com>
Co-authored-by: Sambhav Jain <sambhav.jain@cockroachlabs.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#129221 and #132023 added changes to
exporters to emit openmetrics. This PR makes changes to the roachtests
to make use of the changes in the above PRs. This change also made some
changes to some roachtests that use neither of the above approaches
Epic: https://cockroachlabs.atlassian.net/browse/CRDB-41852
Release note: None