Skip to content

Wave-33 C05: OTLP metrics export soft stub - #276

Merged
KooshaPari merged 1 commit into
mainfrom
feat/sl-w33-c05-otlp-metrics
Jul 14, 2026
Merged

Wave-33 C05: OTLP metrics export soft stub#276
KooshaPari merged 1 commit into
mainfrom
feat/sl-w33-c05-otlp-metrics

Conversation

@KooshaPari

Copy link
Copy Markdown
Owner

Summary

  • Soft OTLP metrics export stub (otel-metrics feature + SL_OTLP_METRICS ack) with docs/JSON SSOT for C05 L43/L42 gaps
  • Hermetic SelfCheck + soft ops-load CI job; default Prometheus GET /metrics RED path unchanged

Test plan

  • pwsh ./scripts/otlp-metrics-check.ps1 -SelfCheck
  • cargo check --manifest-path crates/sl-daemon/Cargo.toml --locked --features otel-metrics
  • cargo test --locked --test otlp_metrics
  • Confirm default GET /metrics still renders sl_http_requests_total without the feature

Made with Cursor

Add docs/feature stub and SelfCheck for unpaid OTLP metrics push while keeping default Prometheus GET /metrics unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@KooshaPari, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 12 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: e38e2dc0-30a1-4763-a8ff-2c3dee4ae998

📥 Commits

Reviewing files that changed from the base of the PR and between 3efb0d0 and e6a10e7.

📒 Files selected for processing (10)
  • .github/workflows/ops-load.yml
  • crates/sl-daemon/Cargo.toml
  • crates/sl-daemon/README.md
  • crates/sl-daemon/src/main.rs
  • crates/sl-daemon/src/otel_metrics.rs
  • docs/ops/observability.md
  • docs/ops/otlp-metrics.json
  • docs/ops/otlp-metrics.md
  • scripts/otlp-metrics-check.ps1
  • tests/otlp_metrics.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/sl-w33-c05-otlp-metrics
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feat/sl-w33-c05-otlp-metrics

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.

@KooshaPari
KooshaPari merged commit ac7c47f into main Jul 14, 2026
54 of 55 checks passed
Comment thread tests/otlp_metrics.rs
let script = repo_root().join("scripts/otlp-metrics-check.ps1");
assert!(script.is_file(), "expected OTLP metrics check script at {}", script.display());

let output = Command::new("pwsh")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: Integration test hardcodes pwsh dependency

The Command::new("pwsh") call assumes PowerShell Core is installed on the developer machine. While GitHub ubuntu-latest runners have pwsh, many Linux/macOS environments do not. This makes cargo test --test otlp_metrics fail outside CI, breaking the hermetic SelfCheck promise for local development.

Consider gating this test behind a Windows-only cfg or providing a fallback (e.g., skip with a helpful message if pwsh is unavailable, or use bash for a portable subset of checks).


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

}

#[test]
fn stub_acknowledged_parses_truthy_values() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: Unit test leaks env state on panic

The stub_acknowledged_parses_truthy_values test uses std::env::set_var / remove_var without panic-safe cleanup. If any assert! between lines 51 and 60 panics, SL_OTLP_METRICS remains set in the process environment for subsequent tests, causing flaky test failures in the same binary.

Wrap the env mutations in a guard (e.g., a small RAII helper that restores the previous value on drop) to guarantee cleanup even on panic.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

set. If neither variable is set, the feature-enabled binary uses the same local
fmt logs and `RUST_LOG` filtering as the default build.

OTLP **metrics** push is a soft stub (`--features otel-metrics`, optional

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SUGGESTION: README docs omit accepted env values

The README documents SL_OTLP_METRICS=1 as the acknowledgment value, but otel_metrics.rs:15-17 also accepts "true" and "yes" (case-insensitive). Operators reading the README won't discover these alternatives, creating a doc/code mismatch.

Update the README to mention all accepted truthy values, or narrow the parser to only "1" to match the documented contract.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

Code Review Summary

Status: 3 Issues Found | Recommendation: Review post-merge (PR is already MERGED)

Overview

Severity Count
WARNING 2
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
tests/otlp_metrics.rs 17 Integration test hardcodes pwsh dependency — breaks hermetic local cargo test on non-Windows systems without PowerShell installed.
crates/sl-daemon/src/otel_metrics.rs 46 Unit test leaks env state on panic — std::env::set_var/remove_var without panic-safe cleanup can contaminate subsequent tests in the same process.

SUGGESTION

File Line Issue
crates/sl-daemon/README.md 34 README documents only SL_OTLP_METRICS=1 but code also accepts true/yes — doc/code mismatch on accepted env values.
Files Reviewed (3 files)
  • tests/otlp_metrics.rs - 1 issue
  • crates/sl-daemon/src/otel_metrics.rs - 1 issue
  • crates/sl-daemon/README.md - 1 issue

Fix these issues in Kilo Cloud


Reviewed by step-3.7-flash · Input: 68.5K · Output: 8.6K · Cached: 211.3K

@KooshaPari
KooshaPari deleted the feat/sl-w33-c05-otlp-metrics branch August 12, 2026 08:59
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.

1 participant