Skip to content

fix: enable event store OpenTelemetry tracing by default - #56

Merged
yordis merged 1 commit into
mainfrom
fix-otel-default
Feb 27, 2026
Merged

yordis merged 1 commit into
mainfrom
fix-otel-default

Conversation

@yordis

@yordis yordis commented Feb 27, 2026

Copy link
Copy Markdown
Member

Summary

  • The event_store option in Commanded.OpenTelemetry.setup/1 was the only tracing module disabled by default (:disabled), while all other modules (aggregate, aggregate_populate, application, event_handler) default to enabled ([]).
  • Changed the default to [] so all OTEL tracing is enabled consistently when calling setup/0.
  • Updated docs and examples to reflect the new default.

Test plan

  • mix test test/opentelemetry/event_store_test.exs — all 15 tests pass
  • mix compile --warnings-as-errors — clean compilation

@cursor

cursor Bot commented Feb 27, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes the default behavior of Commanded.OpenTelemetry.setup/0 to start EventStore tracing automatically, which may increase span volume and overhead for existing users. The change is small and isolated to configuration/docs but affects runtime defaults.

Overview
Enables EventStore OpenTelemetry tracing by default by changing the event_store option default from :disabled to [] in Commanded.OpenTelemetry’s NimbleOptions schema.

Updates the docs/examples to reflect that setup/0 now enables all tracing by default and that event_store must be explicitly disabled via event_store: :disabled.

Written by Cursor Bugbot for commit acbe0ce. This will update automatically on new commits. Configure here.

@coderabbitai

coderabbitai Bot commented Feb 27, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7f4c270 and acbe0ce.

📒 Files selected for processing (1)
  • lib/commanded/opentelemetry.ex

Walkthrough

The pull request modifies the default behavior of event store tracing in the OpenTelemetry setup configuration. The event_store option default changes from :disabled to [], enabling event store tracing by default instead of disabling it. Documentation and usage examples are updated accordingly.

Changes

Cohort / File(s) Summary
OpenTelemetry Configuration
lib/commanded/opentelemetry.ex
Changed event_store option default from :disabled to [], inverting the default behavior to enable event store tracing. Updated NimbleOptions schema, documentation, and usage examples to reflect the new default and how to explicitly disable it.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

🐰 Event stores now glow by default with care,
Tracing enabled in the OpenTelemetry air!
No more hiding in the shadows deep,
All your events now tracked, while you sleep. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: enabling event store OpenTelemetry tracing by default, which is the core objective of this PR.
Description check ✅ Passed The description clearly explains the rationale (inconsistent defaults), the change made (default from :disabled to []), and includes a test plan confirming validation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-otel-default

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.

The event_store option in Commanded.OpenTelemetry.setup/1 was the only
tracing module disabled by default, inconsistent with all other modules
(aggregate, aggregate_populate, application, event_handler) which
default to enabled.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis
yordis merged commit 642ab64 into main Feb 27, 2026
5 checks passed
@yordis
yordis deleted the fix-otel-default branch February 27, 2026 04:21
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