feat(engine): wire extensions and capabilities into runtime pipeline#2860
Open
gouslu wants to merge 11 commits intoopen-telemetry:mainfrom
Open
feat(engine): wire extensions and capabilities into runtime pipeline#2860gouslu wants to merge 11 commits intoopen-telemetry:mainfrom
gouslu wants to merge 11 commits intoopen-telemetry:mainfrom
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Extension and node URNs now share one canonical 4-segment shape `urn:<namespace>:<kind>:<id>` (e.g., `urn:microsoft:extension:azure_identity_auth`), mirroring the receiver/processor/exporter convention. Short forms `<kind>:<id>` work for both, expanding to `urn:otel:<kind>:<id>`. The previous 3-segment extension form (`urn:<ns>:<id>`) is no longer accepted. Misplacement errors include actionable hints, e.g. '(declare under `extensions:` instead of `nodes:`)'. - New private `crates/config/src/urn.rs` factors out the shared parser core (`parse_kinded_urn`, `build_canonical_urn`, segment validators, misplacement-hint formatter). - `node_urn.rs` and `extension_urn.rs` now delegate to it; their accepted-kind sets are disjoint, so `NodeUrn` can never parse an extension URN and vice versa. - Removed `NodeKind::Extension` from the node enum and all defensive match arms in `pipeline.rs`, `controller/lib.rs`, `controller/startup.rs`, `engine/lib.rs`. - Removed `Error::ExtensionInNodesSection` (became unreachable — type-rejected at parse). - Updated YAML fixtures, bundled `configs/fake-with-extension.yaml`, and all `extension_e2e.rs` test URN constants to the 4-segment form. - Added regression tests for misplacement-hint error messages. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2860 +/- ##
==========================================
+ Coverage 86.27% 86.33% +0.06%
==========================================
Files 715 717 +2
Lines 272067 272391 +324
==========================================
+ Hits 234715 235162 +447
+ Misses 36828 36705 -123
Partials 524 524
🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… validation
The file contains Jinja placeholders ({{core_start}}, {{core_end}}) but
was missing the .j2 suffix, so the validate-configs CI script picked it
up as a real config and failed YAML parsing. Sibling otlp-otlp.yaml.j2
and otlphttp-otlphttp.yaml.j2 already use the .j2 convention; align
otap-otap with them and update the three suite references.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Summary
Part 4 of the Extension System (P1) series. Wires the previously
landed Capability Registry & Resolver (#2732) into the runtime
pipeline so extensions are actually instantiated, started, and
shut down by the engine, and so consumer nodes can resolve their
capability bindings at build time.
Highlights:
runtime_pipeline.rs: extension lifecycleis invoked before any data-path node is spawned, and
Shutdownis delivered to extensions only after the data path drains
("started first, shut down last"). Active and passive extensions
are handled separately; failures abort startup cleanly.
Box-clone factory pattern, removing the prior asymmetry between
the two trait variants.
crates/engine/src/capability/:NoOpStatelessandNoOpStateful. They exercise every codegen path of the#[capability]proc macro (&self× {sync, async},&mut self× {sync, async}, borrowed/owned returns, etc.).
crates/engine/tests/extension_e2e.rs(26 tests) covering:passive/active/background extensions, lifecycle ordering and
shutdown ordering, fail-fast on extension errors, dual-variant
pruning, one-shot capability enforcement (all accessor
combinations), shared mutable state across consumers via
Arc/Rcfor both local and shared trait variants, async&mut selfinvocation through boxed handles, and activeextensions mutating shared state observed by capability
consumers.
start-first/shut-down-last invariant (it orders lifecycle
calls, not init completion) and a noted future consideration
to add an opt-in readiness probe if/when an extension needs an
init-complete guarantee.
4-segment form
urn:<namespace>:extension:<id>(mirroring thereceiver/processor/exporter convention), with a short form
extension:<id>. The shared parser core lives in a newprivate
crates/config/src/urn.rs;node_urn.rsandextension_urn.rsdelegate to it with disjoint accepted-kindsets so the two URN types cannot be confused. As a consequence,
NodeKind::Extensionand the now-unreachableError::ExtensionInNodesSectionare removed. Misplacementerrors include actionable hints (e.g. "declare under
extensions:instead ofnodes:").in
core-nodesandcontrib-nodes) updated to accept the new&Capabilitiesparameter; existing factories that don't dependon any capability simply ignore it.
What issue does this PR close?
How are these changes tested?
extension_e2e.rsintegration test (26 tests) exercises thewiring end-to-end against synthetic receivers/processors/
exporters/extensions.
urn.rscover the shared parser core and themisplacement-error hints; existing
extension_urnandnode_urntests updated to assert the canonical 4-segment form.in the
nodes:section and node URNs in theextensions:section.
cargo xtask check(structure check +fmt+clippy --workspace --all-targets -- -D warnings+cargo test --workspace) passescleanly. No new clippy warnings.
Are there any user-facing changes?
Yes:
urn:<namespace>:extension:<id>(4-segment) instead of thepre-existing 3-segment
urn:<namespace>:<id>. Short formextension:<id>(expands tourn:otel:extension:<id>) isavailable as a developer convenience. Existing 3-segment
extension URNs in pipeline configs must be updated; the bundled
configs/fake-with-extension.yamlshows the new shape.Extensiontrait,ExtensionWrapper::buildertypestate, theextension_capabilities!macro, and the test capabilitiesNoOpStateless/NoOpStatefulare now reachable forexternal extension authors. The architecture doc captures the
lifecycle contract.
&Capabilitiesas aparameter; existing custom factories will need to accept (and
may ignore) this new argument