feat(otap-dataflow): expose startup helpers as a public library module#2505
Merged
jmacd merged 14 commits intoopen-telemetry:mainfrom Apr 6, 2026
Merged
feat(otap-dataflow): expose startup helpers as a public library module#2505jmacd merged 14 commits intoopen-telemetry:mainfrom
jmacd merged 14 commits intoopen-telemetry:mainfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2505 +/- ##
==========================================
- Coverage 88.36% 88.35% -0.02%
==========================================
Files 614 615 +1
Lines 223280 223318 +38
==========================================
+ Hits 197311 197314 +3
- Misses 25445 25480 +35
Partials 524 524
🚀 New features to boost your workflow:
|
lquerel
approved these changes
Apr 2, 2026
Contributor
lquerel
left a comment
There was a problem hiding this comment.
LGTM. I just left a suggestion for a future improvement.
jmacd
approved these changes
Apr 2, 2026
1 task
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes the OTAP dataflow controller easier to embed as a library by moving common binary startup logic into a public otap_df_controller::startup module and by exposing an in-process ObservedStateHandle to callers via new Controller observer-based run methods.
Changes:
- Extracts reusable startup helpers (CLI overrides, component validation, system diagnostics) from
src/main.rsintootap_df_controller::startup. - Adds
run_forever_with_observer/run_till_shutdown_with_observerto provide anObservedStateHandlecallback for zero-HTTP health/state access. - Adds embedding documentation and a runnable
examples/custom_collector.rsshowing the full pattern end-to-end.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| rust/otap-dataflow/src/main.rs | Switches binary entrypoint to call the new startup module helpers. |
| rust/otap-dataflow/README.md | Documents embedding pattern and points to the runnable example. |
| rust/otap-dataflow/examples/custom_collector.rs | New example binary demonstrating embedding + observer handle polling. |
| rust/otap-dataflow/crates/controller/src/startup.rs | New public module implementing validation/override/system-info helpers (and tests). |
| rust/otap-dataflow/crates/controller/src/lib.rs | Exposes startup module and adds observer-enabled controller run methods. |
| rust/otap-dataflow/crates/controller/Cargo.toml | Adds sysinfo dependency for startup::system_info. |
| rust/otap-dataflow/Cargo.toml | Removes sysinfo dependency from the top-level binary crate. |
github-merge-queue bot
pushed a commit
that referenced
this pull request
Apr 6, 2026
…le (#2505) Fixes: #2462, #2463 ### Summary - Moves reusable startup functions (`validate_engine_components`, `apply_cli_overrides`, `system_info`) from `src/main.rs` into a new `otap_df_controller::startup` module. This lets custom distribution binaries share the same validation, override, and diagnostics logic without copying code that may drift across releases. - Adds `run_forever_with_observer` and `run_till_shutdown_with_observer` to `Controller`, exposing the `ObservedStateHandle` via a callback so that in-process integrations can read pipeline liveness and health with zero HTTP overhead. - `src/main.rs` becomes a thin wrapper over these library calls - no behavioral change for existing users. A new "Embedding in Custom Distributions" section is added to the README, and a runnable `examples/custom_collector.rs` demonstrates the full library embedding pattern end-to-end, including the observer API with an opt-in `--poll-status` flag for periodic health snapshots. --------- Co-authored-by: Joshua MacDonald <[email protected]>
Merged
via the queue into
open-telemetry:main
with commit Apr 6, 2026
32bc2ca
66 of 69 checks passed
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.
Fixes: #2462, #2463
Summary
Moves reusable startup functions (
validate_engine_components,apply_cli_overrides,system_info) fromsrc/main.rsinto a newotap_df_controller::startupmodule. This lets custom distribution binaries share the same validation, override, and diagnostics logic without copying code that may drift across releases.Adds
run_forever_with_observerandrun_till_shutdown_with_observertoController, exposing theObservedStateHandlevia a callback so that in-process integrations can read pipeline liveness and health with zero HTTP overhead.src/main.rsbecomes a thin wrapper over these library calls - no behavioral change for existing users. A new "Embedding in Custom Distributions" section is added to the README, and a runnableexamples/custom_collector.rsdemonstrates the full library embedding pattern end-to-end, including the observer API with an opt-in--poll-statusflag for periodic health snapshots.