Skip to content

feat(sdk): enable OTEL error promotion at 100% by default#303

Open
igoramf wants to merge 1 commit into
mainfrom
deco-otel-error-promotion-defaults
Open

feat(sdk): enable OTEL error promotion at 100% by default#303
igoramf wants to merge 1 commit into
mainfrom
deco-otel-error-promotion-defaults

Conversation

@igoramf

@igoramf igoramf commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Flip DECO_OTEL_ERROR_PROMOTION default from falsetrue so any logger.error() with an active trace context promotes the trace for export.
  • Flip DECO_OTEL_ERROR_PROMOTION_RATE default from 0.11 (100% of promoted error traces are kept).
  • Explicit opt-out: DECO_OTEL_ERROR_PROMOTION=false.

Only level === "error" triggers promotion (see src/sdk/otelHttpLog.ts:228) — warns are unaffected.

Test plan

  • Deploy to a canary site, trigger a handled error, confirm the trace lands in ClickHouse even with head sampling < 1.
  • Set DECO_OTEL_ERROR_PROMOTION=false and confirm promotion is disabled.

🤖 Generated with Claude Code


Summary by cubic

Enable OTEL error promotion (DECO_OTEL_ERROR_PROMOTION) by default and set its sampling rate to 100%, so traces for logger.error() are exported even when head sampling skips them. Opt out with DECO_OTEL_ERROR_PROMOTION=false, or tune volume via DECO_OTEL_ERROR_PROMOTION_RATE (0.0–1.0).

Written for commit 458cdc1. Summary will update on new commits.

Review in cubic

Flip DECO_OTEL_ERROR_PROMOTION default to true and
DECO_OTEL_ERROR_PROMOTION_RATE default to 1 so error traces always ship
to ClickHouse without callers having to opt in. Set
DECO_OTEL_ERROR_PROMOTION=false to opt out.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@igoramf igoramf requested a review from a team July 2, 2026 16:24

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 1 file

Re-trigger cubic

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