Skip to content

[NA] [BE] feat: always persist online-evaluation monitoring traces - #7317

Open
alexkuzmik wants to merge 4 commits into
mainfrom
aliaksandrk/NA-always-on-online-evaluation-tracing
Open

[NA] [BE] feat: always persist online-evaluation monitoring traces#7317
alexkuzmik wants to merge 4 commits into
mainfrom
aliaksandrk/NA-always-on-online-evaluation-tracing

Conversation

@alexkuzmik

@alexkuzmik alexkuzmik commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Details

Online-evaluation monitoring traces (OPIK_6994) were gated behind the onlineScoringTracingEnabled service toggle (env TOGGLE_ONLINE_SCORING_TRACING_ENABLED, default true). This PR removes that configuration so the behavior is always on — every LLM-as-judge online evaluation (trace / span / thread) is always recorded as a hidden source=evaluator monitoring trace.

  • The three online scorers now always start a real EvaluationRecorder instead of branching on the toggle.
  • The trace-thread path keeps its best-effort onErrorResumeEvaluationRecorder.NOOP fallback so a project lookup failure still can't abort scoring.
  • The field is dropped from the backend only: ServiceTogglesConfig, config.yml, and config-test.yml. The toggle is exposed via GET /v1/private/toggles, but per review the Fern-autogenerated OpenAPI specs and Python/TS rest_api types are left untouched — the daily Fern codegen job will drop onlineScoringTracingEnabled once the backend stops returning it.

Change checklist

  • User facing
  • Documentation update

Issues

  • OPIK_6994 (origin feature; not resolved by this PR)

AI-WATERMARK

AI-WATERMARK: yes

  • Tools: Claude Code
  • Model(s): Claude Opus 4.8 (1M context)
  • Scope: Full change (flag removal across backend + generated SDK/OpenAPI types)
  • Human verification: pending author review

Testing

  • mvn -o compile in apps/opik-backend — compiles cleanly.
  • Grep-verified no remaining references to onlineScoringTracingEnabled / TOGGLE_ONLINE_SCORING_TRACING_ENABLED in the repo.
  • Existing OPIK-6994 scorer/persistence tests already run with the recorder active (default was true), so they exercise the now-unconditional path.

Documentation

The removed toggle was infra config only; no user-facing docs reference it.

Remove the onlineScoringTracingEnabled service toggle (env
TOGGLE_ONLINE_SCORING_TRACING_ENABLED) so the LLM-as-judge online
evaluation loop is always recorded as hidden source=evaluator
monitoring traces. The three scorers now always start a real
EvaluationRecorder; the trace-thread best-effort onErrorResume still
degrades to NOOP on a project lookup failure.

Drops the field from ServiceTogglesConfig, config.yml, config-test.yml,
the OpenAPI schemas, and the generated Python/TS SDK types (the toggle
was exposed via GET /v1/private/toggles).

Origin feature: OPIK_6994.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@alexkuzmik
alexkuzmik requested review from a team as code owners July 2, 2026 09:51
@github-actions github-actions Bot added documentation Improvements or additions to documentation python Pull requests that update Python code java Pull requests that update Java code Backend tests Including test files, or tests related like configuration. typescript *.ts *.tsx Python SDK TypeScript SDK labels Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Backend Tests - Unit Tests

2 590 tests   2 588 ✅  1m 16s ⏱️
  349 suites      2 💤
  349 files        0 ❌

Results for commit 62d0920.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Backend Tests - Integration Group 12

264 tests   263 ✅  4m 50s ⏱️
 38 suites    1 💤
 38 files      0 ❌

Results for commit 62d0920.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

🌿 Preview your docs: https://opik-preview-c8295b3c-9d7d-44a2-a68c-3b12cc65935f.docs.buildwithfern.com/docs/opik

⚠️ The link check did not complete (likely a crawl crash or timeout). Please re-run this check.


📌 Results for commit b4c504f

…conditional

The scorer unit tests relied on the (unstubbed) onlineScoringTracingEnabled
toggle defaulting to false, which took the NOOP branch and never invoked
onlineEvaluationRecorder.begin(). With the toggle removed the recorder is
always started, so begin() must be stubbed to return EvaluationRecorder.NOOP
in setup.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
andrescrz
andrescrz previously approved these changes Jul 2, 2026

@andrescrz andrescrz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I like the idea of this feature being always enabled, I believe there's no per customer need etc. to disable. I tested it in prod and looks nice.

However, I wouldn't rush to merge and deploy this. I'd recommend leave it baking for max 1 week in production, so you have this flag as a emergency stop measure, in case some issue happens.

Left couple of non-blocking comments, but I do recommend addressing them.

Comment thread apps/opik-documentation/documentation/fern/openapi/opik.yaml
Per review: don't hand-edit Fern-generated files. Revert the manual
removals from the OpenAPI specs and the Python/TS rest_api ServiceTogglesConfig
types; the daily Fern codegen job will drop onlineScoringTracingEnabled once
the backend stops returning it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot removed documentation Improvements or additions to documentation python Pull requests that update Python code typescript *.ts *.tsx Python SDK TypeScript SDK labels Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Python SDK E2E Tests Results (Python 3.14)

286 tests   284 ✅  4m 20s ⏱️
  1 suites    2 💤
  1 files      0 ❌

Results for commit 708bc95.

♻️ This comment has been updated with latest results.

andrescrz
andrescrz previously approved these changes Jul 3, 2026
@alexkuzmik

Copy link
Copy Markdown
Collaborator Author

Don't merge before 13.07.2025

@andrescrz
andrescrz marked this pull request as draft July 3, 2026 13:42
@alexkuzmik
alexkuzmik marked this pull request as ready for review July 7, 2026 09:04
…racing

Resolve conflicts in online-scoring scorers: keep the {{trace}}/{{span}}
agentic triggers from main while dropping the isOnlineScoringTracingEnabled
toggle gate so the monitoring recorder is created unconditionally, and stub
the recorder in the span/thread scorer tests now that tracing always runs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

⏱️ pre-commit per-hook timing

Hook Description Result Duration
☕ spotless — java backend Format Java code 5.95s
Total (1 ran) 5.95s
⏭️ 40 skipped (no matching files changed)
Hook Description Result
🐍 trim trailing whitespace — python sdk Strip trailing whitespace ⏭️
🐍 fix end of files — python sdk Ensure files end in a newline ⏭️
🐍 ruff — python sdk Lint + autofix Python (ruff) ⏭️
🐍 ruff-format — python sdk Format Python code (ruff) ⏭️
🐍 mypy — python sdk Static type check ⏭️
🤖 trim trailing whitespace — optimizer Strip trailing whitespace ⏭️
🤖 fix end of files — optimizer Ensure files end in a newline ⏭️
🤖 check yaml — optimizer Validate YAML syntax ⏭️
🤖 check json — optimizer Validate JSON syntax ⏭️
🤖 check toml — optimizer Validate TOML syntax ⏭️
🤖 check for added large files — optimizer Block large files (>1MB) ⏭️
🔐 detect private key — optimizer Block committed private keys ⏭️
🤖 check for merge conflicts — optimizer Block merge-conflict markers ⏭️
🤖 check for case conflicts — optimizer Block case-only name clashes ⏭️
🤖 pyupgrade — optimizer Modernize Python syntax ⏭️
🤖 ruff — optimizer Lint + autofix Python (ruff) ⏭️
🤖 ruff-format — optimizer Format Python code (ruff) ⏭️
🤖 mypy — optimizer Static type check ⏭️
📓 nbstripout — optimizer notebooks Strip notebook output ⏭️
📝 markdownlint — optimizer Lint Markdown ⏭️
🔤 codespell — optimizer Fix common misspellings ⏭️
📊 radon cc — optimizer Cyclomatic-complexity gate ⏭️
📊 radon raw — optimizer Raw size metrics gate ⏭️
📊 xenon — optimizer Fail on complexity thresholds ⏭️
📊 lizard — optimizer Cyclomatic-complexity gate ⏭️
🧹 vulture — optimizer Find dead code ⏭️
🛡️ trim trailing whitespace — guardrails Strip trailing whitespace ⏭️
🛡️ fix end of files — guardrails Ensure files end in a newline ⏭️
🛡️ ruff — guardrails Lint + autofix Python (ruff) ⏭️
🛡️ ruff-format — guardrails Format Python code (ruff) ⏭️
🛡️ mypy — guardrails Static type check ⏭️
⚓ helm-docs Regenerate Helm chart README ⏭️
block non-public FE plugins Block non-public FE plugins ⏭️
🧪 pre-commit wrapper smoke tests Self-test the wrapper scripts ⏭️
🌐 eslint — frontend Lint + autofix JS/TS ⏭️
🌐 typecheck — frontend Whole-project tsc type check ⏭️
📘 eslint — typescript sdk Lint + autofix JS/TS ⏭️
📘 typecheck — typescript sdk Whole-project tsc type check ⏭️
⚙️ actionlint — github workflows Lint GitHub Actions workflows ⏭️
🐳 hadolint — dockerfiles Lint Dockerfiles ⏭️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backend java Pull requests that update Java code 🟢 size/S tests Including test files, or tests related like configuration.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants