Commit 32bc2ca
feat(otap-dataflow): expose startup helpers as a public library module (#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 <jmacd@users.noreply.github.com>1 parent a1fa843 commit 32bc2ca
File tree
7 files changed
+761
-413
lines changed- rust/otap-dataflow
- crates/controller
- src
- examples
- src
7 files changed
+761
-413
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
354 | 415 | | |
355 | 416 | | |
356 | 417 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
| |||
264 | 266 | | |
265 | 267 | | |
266 | 268 | | |
267 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
268 | 291 | | |
269 | 292 | | |
270 | 293 | | |
271 | 294 | | |
272 | 295 | | |
273 | 296 | | |
274 | | - | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
275 | 315 | | |
276 | 316 | | |
277 | 317 | | |
| |||
957 | 997 | | |
958 | 998 | | |
959 | 999 | | |
960 | | - | |
| 1000 | + | |
961 | 1001 | | |
962 | 1002 | | |
963 | 1003 | | |
964 | | - | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
965 | 1009 | | |
966 | 1010 | | |
967 | 1011 | | |
| |||
993 | 1037 | | |
994 | 1038 | | |
995 | 1039 | | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
996 | 1046 | | |
997 | 1047 | | |
998 | 1048 | | |
| |||
0 commit comments