Skip to content

fix(bench): move collector config out of workflows/ + unthrottle telemetrygen (PR-N1.2) - #72

Merged
jensholdgaard merged 1 commit into
mainfrom
fix/bench-collector-path-and-rate
May 31, 2026
Merged

fix(bench): move collector config out of workflows/ + unthrottle telemetrygen (PR-N1.2)#72
jensholdgaard merged 1 commit into
mainfrom
fix/bench-collector-path-and-rate

Conversation

@jensholdgaard

@jensholdgaard jensholdgaard commented May 31, 2026

Copy link
Copy Markdown
Owner

What

Fixes the two failures PR-N1 (#70) hit on its first real dispatch.

1. Collector config was in the workflow-scan directory

.github/workflows/bench-collector.yaml (the OTel collector config from PR-N1) made GitHub try to parse it as a workflow definition on every push to main — everything under .github/workflows/ is scanned as a workflow — producing a failing run on each push (example: run 26706450810).

Moved to .github/bench-collector.yaml (one level up, still version-controlled beside bench.yml, no longer workflow-scanned — .github/FUNDING.yml already lives there as precedent). Updated the --config path in bench.yml and both files' self-describing comments.

2. telemetrygen crawled at 1 log/sec

The second dispatch (run 26706451070) got past install but the capture step ran for ~4h before I cancelled it. The worker log showed exported batched logs count: 100 every ~100 seconds = 1 log/sec.

Root cause, traced to source at the pinned v0.153.0:

  • cmd/telemetrygen/pkg/logs/config.go:54c.Rate = 1 (hardcoded default of 1 log/sec).
  • cmd/telemetrygen/pkg/logs/logs.go:53-55 → only --rate 0 selects the unbounded rate.Inf path.

1,000,000 records at 1/sec ≈ 11.5 days. Added --rate 0. With rate.Inf, 1M records is seconds.

3. Backstop against future hangs

Wrapped telemetrygen in timeout 600. Any future re-introduction of throttling (or a genuine collector stall) now fails the step in 10 min — with /tmp/collector.log dumped — instead of burning a runner to GitHub's 6h job ceiling. The real exit code is captured via || tg_rc=$? rather than if ! …; then (which reports $? as 0 inside the branch; 124 = the timeout backstop).

CLAUDE.md §6.6

  • cargo fmt --all --check, cargo test --all-features (322/0/44), cargo clippy, mdbook build — all green (no Rust changes; baseline preserved).
  • Both YAML files validated with yaml.safe_load.
  • The workflow itself can't be exercised without dispatching — first clean dispatch happens after merge.

Out of scope

The dispatch + the §9 row in docs/benchmarks.md follow this merge (PR-N2), once we have a non-hung run producing real A1/C1/C2 numbers on ci-runner + telemetrygen-synthetic-v1.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Enhanced benchmark testing workflow with stronger error detection, timeout safeguards, and improved diagnostic logging to help identify and resolve issues more quickly during test execution.
    • Updated and clarified benchmark collector configuration documentation to provide better context on infrastructure setup decisions and explain the configuration organization rationale.

…metrygen (PR-N1.2)

Two first-dispatch failures from PR-N1, both fixed here:

1. `.github/workflows/bench-collector.yaml` made GitHub try to
   parse the OTel collector config as a workflow definition on
   every push to main (everything under workflows/ is scanned
   as a workflow). Moved to `.github/bench-collector.yaml` —
   still version-controlled beside bench.yml, no longer
   workflow-scanned — and updated the `--config` path.

2. telemetrygen crawled at 1 log/sec: its `logs` subcommand
   hardcodes `Rate = 1` (config.go), and only `--rate 0` selects
   the unbounded `rate.Inf` path (logs.go). 1M records at 1/sec
   is ~11.5 days — the 4h hang on the first dispatch. Added
   `--rate 0`, plus a `timeout 600` backstop so any future
   throttle/stall fails the step in 10 min with the collector
   log dumped, instead of burning a runner to GitHub's 6h
   ceiling. Captures the real exit code via `|| tg_rc=$?` (the
   `if ! …; then` form reports $? as 0 inside the branch).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jensholdgaard
jensholdgaard requested a review from Copilot May 31, 2026 12:19
@coderabbitai

coderabbitai Bot commented May 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 15143be3-f361-4d8b-b066-93362ff8cf02

📥 Commits

Reviewing files that changed from the base of the PR and between 4ba907c and 58e9e50.

📒 Files selected for processing (2)
  • .github/bench-collector.yaml
  • .github/workflows/bench.yml

📝 Walkthrough

Walkthrough

Benchmark workflow infrastructure is reorganized: the OpenTelemetry Collector config moves from .github/workflows/bench-collector.yaml to .github/bench-collector.yaml with explanatory comments. The telemetrygen logs capture step is enhanced with unbounded rate, timeout guarding, proper exit code handling, and structured error reporting.

Changes

Benchmark Infrastructure Improvements

Layer / File(s) Summary
Config file reorganization and documentation
.github/bench-collector.yaml, .github/workflows/bench.yml
Collector config is placed under .github/ with a header comment documenting the rationale (avoiding GitHub Actions workflow parsing failures), and the workflow comment and config reference are updated to point to .github/bench-collector.yaml.
Telemetrygen capture resilience
.github/workflows/bench.yml
Telemetrygen logs generation is expanded with --rate 0 for unbounded capture, wrapped in timeout 600, modified to preserve the command's actual exit code despite set -e, and enhanced with ::error:: annotation and collector log dump on failure.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • jensholdgaard/ourios#70: Main PR refines the telemetrygen OTLP capture wiring introduced by this PR, updating the path reference and capture step with exit handling and timeout protection.
  • jensholdgaard/ourios#57: Both PRs modify the benchmark workflow; the retrieved PR introduces on-demand bench running, while the main PR updates the telemetrygen capture step to use the reorganized collector config.

Poem

🐇 A config takes flight from workflows to rest,
In .github/ home, it settles the best!
With timeout and rate, telemetrygen sings,
Error logs flutter on swift bunny wings. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and specifically summarizes the main changes: moving collector config out of workflows and unthrottling telemetrygen with explicit rate parameter.
Description check ✅ Passed The description comprehensively covers what the PR does, why, and related changes, but lacks completion of the repository's required checklist sections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/bench-collector-path-and-rate

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes the benchmark workflow’s telemetry capture path so the OTel collector config is no longer parsed as a workflow and telemetry generation completes within a bounded time.

Changes:

  • Moves the collector config reference from .github/workflows/ to .github/.
  • Adds --rate 0 to unthrottle telemetrygen logs.
  • Wraps telemetry generation with a 10-minute timeout and collector-log dump on failure.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.github/workflows/bench.yml Updates collector config path and hardens telemetrygen execution with unbounded rate plus timeout handling.
.github/bench-collector.yaml Updates comments to document why the collector config lives outside .github/workflows/.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jensholdgaard
jensholdgaard merged commit d132e25 into main May 31, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants