feat: add enabled option#83
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughThis PR adds an ChangesPluggable telemetry enablement
Sequence DiagramsequenceDiagram
participant App as Elysia App
participant Plugin as opentelemetry plugin
participant SDK as OpenTelemetry SDK
alt enabled: false
App->>Plugin: initialize with enabled: false
Plugin->>App: return inert Elysia instance
Note over App,Plugin: No tracing setup occurs
else enabled: true (default)
App->>Plugin: initialize with enabled: true
Plugin->>SDK: initialize tracer and spans
SDK-->>Plugin: tracing ready
Plugin->>App: wired middleware active
end
App->>App: handle request
Note over App: spans captured only if enabled: true
🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Summary
enabledoption to keep plugin composition stable while disabling telemetry setupenabled: falseCloses #79
Behavior
When disabled, the plugin returns an inert Elysia plugin with the same name and does not start the NodeSDK or register trace hooks.
Tests
bun test --preload ./test/test-setup.ts test/core.test.tsbun run buildnpm run test:nodebun test --preload ./test/test-setup.tscurrently reaches 62 passing tests, then fails on existingtest/integration.test.tsimport:Cannot find module @elysiajs/edenwhile package.json depends on@elysia/eden.Summary by CodeRabbit
New Features
enabledoption to toggle the OpenTelemetry plugin on/off for flexible deployment controlDocumentation