docs: Add extension system architecture document#2510
docs: Add extension system architecture document#2510gouslu wants to merge 9 commits intoopen-telemetry:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2510 +/- ##
=======================================
Coverage 88.36% 88.36%
=======================================
Files 614 614
Lines 223275 223275
=======================================
+ Hits 197293 197301 +8
+ Misses 25458 25450 -8
Partials 524 524
🚀 New features to boost your workflow:
|
6377ca5 to
b4d7df1
Compare
b4d7df1 to
200040f
Compare
|
@gouslu To help reviewers of this document, should we:
|
Done, please let me know if these changes address all these comments. |
There was a problem hiding this comment.
This is great! Thank you @gouslu.
I find the document matches my expectations and the sequence of PRs well described. Here is how I recommend we proceed. First, we'll wait for other reviewers to review and approve this. Then, I would be glad to see PR1 from your list, since it is well aligned with @lquerel's docs/extensions.md (which by the way, I recommend we rename to extensions-requirements.md).
|
PR 1 - feat(config): extensions section, capabilities bindings, and config-level validation: #2538 |
|
I will merge this PR if no one else comments. I requested #2538 as evidence that we are ready to move forward. |
lalitb
left a comment
There was a problem hiding this comment.
LGTM. Nit comments - more to fix the document, don't think it would be blocker for implementation.
3239025 to
ff01875
Compare
34c3604 to
c7df3f0
Compare
Change Summary
Adds the Phase 1 architecture document for the extension system (
rust/otap-dataflow/docs/extension-system-architecture.md), describing how the extension system proposal is implemented.A working PoC is available on the PoC branch.
What this document covers
The document maps each proposal requirement to a concrete Phase 1 implementation approach and introduces two additions beyond the proposal:
Active<E>/Passive<E>wrappers. Passive extensions provide capabilities without spawning a task or allocating control channels.SharedAsLocaladapter. Extension authors who need lock-free local performance can still opt in with a dedicated local variant.It also covers:
Rcfor local (no locks),Box<Clone+Send>withArc-wrapped fields for shared (similar to tokio/axum patterns)#[capability]proc macro — generates local/shared trait variants, sealed impls, registration structs, and coercion functions from a single trait definitionrequire_local()/require_shared()with compile-time sealing and 4-step binding validationExtensionWrapper,ExtensionFactory,CapabilityRegistry, builder pattern, and lifecycle managementextensionssection andcapabilitiesbindings on nodesPhase 1 — Migration Plan (PRs 1-8)
PRs 1-4 (Infrastructure): Config parsing (
extensionssection +capabilitiesbindings), core engine types (ExtensionFactory,ExtensionWrapper,Active/Passivewrappers), capability system (#[capability]proc macro,CapabilityRegistry,resolve_bindings()), and first capability definitions (BearerTokenProvider,KeyValueStore).PRs 5-6 (Runtime wiring): Extension spawning + shutdown ordering in
RuntimePipeline, and adding&Capabilitiesparameter to all node factories.PRs 7-8 (First real usage): Azure Identity Auth extension (active, shared-only with local fallback, provides
BearerTokenProvider) and Azure Monitor Exporter migration to consume it viarequire_local().PoC Map
Engine (core extension/capability infrastructure):
engine/src/extension.rs— ExtensionWrapper, builder, Active/Passive, dual control channelsengine/src/capability/registry.rs— CapabilityRegistry, Capabilities,extension_capabilities!macro,resolve_bindings()engine/src/capability/bearer_token_provider.rs— BearerToken, Secret,#[capability]invocationengine/src/capability/key_value_store.rs—#[capability]invocationengine-macros/src/capability.rs—#[capability]proc macro implementationengine/src/runtime_pipeline.rs— Extension spawning + shutdown orderingExtensions (sample implementations):
azure_identity_auth_extension/— Active, shared-only with local fallback, providesBearerTokenProvidersample_shared_key_value_store/— Passive, shared-only, providesKeyValueStoresample_optimized_key_value_store/— Passive, dual-type (local + shared)Consumers (extensions used by nodes):
azure_monitor_exporter/mod.rs—require_local::<BearerTokenProvider>()in factoryazure_monitor_exporter/exporter.rs—token_rx.changed()event loop integrationshared_kv_exporter/mod.rs—require_shared::<KeyValueStore>()in factoryWhat issue does this PR close?
How are these changes tested?
Documentation only — no code changes.
Are there any user-facing changes?
No. This is an internal architecture document for contributors.