Skip to content

Start OTEL collector in run_skill() default container runner#78

Merged
EmilienM merged 1 commit into
mainfrom
otel-run-skill
Jun 9, 2026
Merged

Start OTEL collector in run_skill() default container runner#78
EmilienM merged 1 commit into
mainfrom
otel-run-skill

Conversation

@EmilienM

@EmilienM EmilienM commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Start the OTEL collector subprocess in _default_run_container() before running the agent container, and stop it in the finally block
  • Pass the collector port to PodmanBackend.run() so Claude Code exports telemetry metrics
  • The JSONL file lands at work_dir/_run/claude-otel.jsonl where _load_otel_cost() already looks, so cost data now flows into verdict _cost_summary fields automatically
  • Collector startup failure is handled gracefully (log warning, continue without telemetry)

Context

The OTEL plumbing was fully wired in the agentic-ci run CLI path but not in the run_skill() path used by autofix and triage runners. All the infrastructure existed (collector, env vars, metric parsing, cost formatting) but the collector was never started, so otel_port=None was passed to the backend and no metrics were collected.

Test plan

  • tox -e lint passes
  • tox -e py313 passes (501 tests)
  • Run an autofix ticket end-to-end and verify claude-otel.jsonl is produced in work_dir/_run/
  • Verify Jira comment includes cost summary

🤖 Generated with Claude Code

The _default_run_container() function used by run_skill() never started
the OTEL collector, so PodmanBackend.run() always received otel_port=None
and no telemetry was collected. This meant _load_otel_cost() never found
the JSONL file and cost data was never populated in verdicts.

Start the collector before the container run and stop it in the finally
block. The JSONL file is written to work_dir/_run/claude-otel.jsonl,
which is exactly where _load_otel_cost() already looks. If the collector
fails to start, log a warning and continue without telemetry.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Emilien Macchi <emacchi@redhat.com>
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@EmilienM, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 50 minutes and 30 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 5bc70992-8d53-47c7-a2c4-219c13bc2a00

📥 Commits

Reviewing files that changed from the base of the PR and between 1ad2a86 and 5824f72.

📒 Files selected for processing (1)
  • src/agentic_ci/skill.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@mprpic

mprpic commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Looks good but I guess this won't work for the OpenShell backend. Maybe we can add that in a separate PR.

@EmilienM

EmilienM commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Looks good but I guess this won't work for the OpenShell backend. Maybe we can add that in a separate PR.

ok will do as a follow-up

@EmilienM EmilienM merged commit d41c184 into main Jun 9, 2026
16 checks passed
@EmilienM EmilienM deleted the otel-run-skill branch June 9, 2026 19:50
@EmilienM

Copy link
Copy Markdown
Contributor Author

Looks good but I guess this won't work for the OpenShell backend. Maybe we can add that in a separate PR.

ok will do as a follow-up

#81

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