-
Notifications
You must be signed in to change notification settings - Fork 841
Add runner name as metric label and benchmark name param #4243
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
Add runner name as metric label and benchmark name param #4243
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for differentiating benchmark runs by adding a runner name parameter that is included in both metric labels and benchmark names, enabling identification of results from different execution environments (ARC, GitHub runners, Blacksmith, local runs, etc.).
- Adds
runnerNameArgflag to benchmark tests with default value "dev" - Includes runner name in benchmark sub-test names and as a metric label
- Passes runner name through the entire CI/CD pipeline from workflows to scripts
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/reexecute/c/vm_reexecute_test.go | Adds runner name flag, metric label, and incorporates it into benchmark naming |
| scripts/benchmark_cchain_range.sh | Adds RUNNER_NAME environment variable requirement and passes it to test command |
| Taskfile.yml | Adds RUNNER_NAME variable with "dev" default to benchmark tasks |
| .github/workflows/c-chain-reexecution-benchmark-gh-native.yml | Passes matrix runner name to custom action |
| .github/workflows/c-chain-reexecution-benchmark-container.yml | Passes matrix runner name to custom action |
| .github/actions/c-chain-reexecution-benchmark/action.yml | Adds runner_name input and passes it through environment variables |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Taskfile.yml
Outdated
| LABELS: '{{.LABELS}}' | ||
| BENCHMARK_OUTPUT_FILE: '{{.BENCHMARK_OUTPUT_FILE}}' | ||
| METRICS_ENABLED: '{{.METRICS_ENABLED}}' | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Superfluous whitespace?
| b.Run(fmt.Sprintf("[%d,%d]-Config-%s", startBlockArg, endBlockArg, configNameArg), func(b *testing.B) { | ||
| benchmarkReexecuteRange(b, blockDirArg, currentStateDirArg, configBytesArg, startBlockArg, endBlockArg, chanSizeArg, metricsEnabledArg) | ||
| b.Run(fmt.Sprintf("[%d,%d]-Config-%s-Runner-%s", startBlockArg, endBlockArg, configNameArg, runnerNameArg), func(b *testing.B) { | ||
| benchmarkReexecuteRange( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(No action required) Maybe avoid unnecessary formatting changes to things that aren't changing? Same comment for L151
| func parseLabels(labelsStr string) (map[string]string, error) { | ||
| // parseCustomLabels parses a comma-separated list of key-value pairs into a map | ||
| // of custom labels. | ||
| func parseCustomLabels(labelsStr string) (map[string]string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(No action required) Maybe avoid including non-functional changes with functional ones?
| with: | ||
| run: | | ||
| ./scripts/run_task.sh reexecute-cchain-range-with-copied-data \ | ||
| run_env: | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was already a very long line, this made it longer, and I realized the run_env param supported this.
RodrigoVillar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving with the assumption that the (maybe?) cosmetic changes in this PR are not blockers for other reviewers.
Signed-off-by: aaronbuchwald <aaron.buchwald56@gmail.com>
Why this should be merged
This PR adds a runnerName argument to the benchmark tests, which is attached as both a metric label and incorporated into the benchmark name. This ensures that runs from two different machine types will not be treated the same and we know to differentiate runs on ARC from runs on GitHub runners, blacksmith, local runs, etc.
How this works
Adds a runnerName flag to the benchmark, passes it through Taskfile and the benchmark script, and adds it into the custom action and workflow triggers.
How this was tested
Testing locally shows that the default value of runner is correctly attached to the metrics and shows up in the benchmark name:
Metrics from local run here: https://grafana-poc.avax-dev.network/d/Gl1I20mnk/c-chain?orgId=1&from=now-15m&to=now&timezone=America%2FNew_York&var-datasource=P1809F7CD0C75ACF3&var-filter=runner%7C%3D%7Cdev&var-chain=C&refresh=10s
Output:
From CI:
Metrics correctly attach the new label: https://grafana-poc.avax-dev.network/d/Gl1I20mnk/c-chain?orgId=1&refresh=10s&var-filter=runner%7C%3D%7Cblacksmith-4vcpu-ubuntu-2404&from=2025-09-04T16:14:31.000Z&to=2025-09-04T16:29:31.000Z&timezone=America%2FNew_York&var-datasource=P1809F7CD0C75ACF3&var-chain=C
Output:
Need to be documented in RELEASES.md?
No