Commit 2b2d4d8
authored
feat: configure OpenTelemetry batching per endpoint (#719)
#### Overview
Add endpoint-local OpenTelemetry batch processor configuration for observability config version 3. Omitted values continue to inherit the standard `OTEL_BSP_*` environment settings and SDK defaults.
- [x] I confirm this contribution is my own work, or I have the right to submit it under this project's license.
- [x] I searched existing issues and open pull requests, and this does not duplicate existing work.
#### Details
- Add optional `max_queue_size`, `max_export_batch_size`, and `scheduled_delay_millis` fields to each configured OpenTelemetry endpoint.
- Apply endpoint overrides after the environment-aware SDK batch defaults are constructed, preserving independent endpoint behavior and existing diagnostics, flush, and shutdown semantics.
- Reject zero values and explicitly configured export batches larger than their queue with indexed configuration diagnostics.
- Add configuration parity and serialization coverage for Rust, Python, Node.js, and Go while leaving manual subscriber APIs and the C FFI unchanged.
- Preserve the existing Python `OpenTelemetryEndpointConfig` positional constructor order by appending the new fields after all pre-existing fields, with regression coverage for legacy positional calls.
- Document precedence, sizing semantics, queue overflow behavior, scheduled-delay behavior, and the endpoint-local OTLP request timeout.
Validation:
- `uv run pre-commit run --all-files`
- `cargo clippy --workspace --all-targets -- -D warnings`
- `just test-go`
- `just docs`
- Full isolated Python suite: 640 passed, 45 skipped
- Focused Python observability suite: 16 passed
- Focused Rust and Node.js observability configuration tests
The canonical Rust, Python, and Node.js commands were also attempted. Configuration-sensitive cases discovered a local `/Users/wkillian/.nemo-relay/plugins.toml`, producing unrelated inherited-configuration warnings and conflicts. The canonical Python run completed with 629 passing tests and 11 affected tests; the full suite passes when run with isolated configuration discovery.
#### Where should the reviewer start?
Start with `crates/core/src/observability/plugin_component.rs` for the public endpoint schema and validation, then `crates/core/src/observability/otel.rs` for environment-aware batch processor construction and endpoint override precedence. The Python compatibility follow-up is covered by `python/tests/test_observability_plugin.py`.
#### Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
- Relates to: RELAY-626
## Summary by CodeRabbit
* **New Features**
* Added per-endpoint OpenTelemetry settings for queue size, export batch size, and scheduled export delay.
* Added support across Rust, Node.js, Go, and Python configuration interfaces.
* Endpoint-specific settings take precedence over process-wide defaults.
* Added validation for zero values and batch sizes larger than the queue.
* **Documentation**
* Updated configuration guidance, examples, fallback behavior, and known issues.
* **Tests**
* Added coverage for serialization, validation, defaults, and runtime propagation.
Authors:
- Will Killian (https://github.com/willkill07)
Approvers:
- Zhongxuan (Daniel) Wang (https://github.com/zhongxuanwang-nv)
URL: #7191 parent faf6e2c commit 2b2d4d8
14 files changed
Lines changed: 385 additions & 41 deletions
File tree
- crates
- core
- src/observability
- tests/unit/observability
- node
- tests
- docs
- about-nemo-relay/release-notes
- configure-plugins/observability
- go/nemo_relay
- python
- nemo_relay
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
| 52 | + | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
200 | 203 | | |
201 | 204 | | |
202 | 205 | | |
| |||
215 | 218 | | |
216 | 219 | | |
217 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
218 | 224 | | |
219 | 225 | | |
220 | 226 | | |
| |||
292 | 298 | | |
293 | 299 | | |
294 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
295 | 328 | | |
296 | 329 | | |
297 | 330 | | |
| |||
787 | 820 | | |
788 | 821 | | |
789 | 822 | | |
790 | | - | |
791 | | - | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
792 | 839 | | |
793 | 840 | | |
794 | 841 | | |
| |||
829 | 876 | | |
830 | 877 | | |
831 | 878 | | |
832 | | - | |
833 | | - | |
834 | | - | |
835 | | - | |
836 | | - | |
837 | | - | |
838 | | - | |
839 | | - | |
840 | | - | |
841 | | - | |
842 | | - | |
843 | | - | |
844 | | - | |
845 | 879 | | |
846 | 880 | | |
847 | 881 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
| 209 | + | |
210 | 210 | | |
211 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
212 | 221 | | |
213 | 222 | | |
214 | 223 | | |
| |||
531 | 540 | | |
532 | 541 | | |
533 | 542 | | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
534 | 551 | | |
535 | 552 | | |
536 | 553 | | |
| |||
1976 | 1993 | | |
1977 | 1994 | | |
1978 | 1995 | | |
| 1996 | + | |
1979 | 1997 | | |
1980 | 1998 | | |
1981 | 1999 | | |
| |||
1984 | 2002 | | |
1985 | 2003 | | |
1986 | 2004 | | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
1987 | 2014 | | |
1988 | 2015 | | |
1989 | 2016 | | |
| |||
2000 | 2027 | | |
2001 | 2028 | | |
2002 | 2029 | | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
2003 | 2060 | | |
2004 | 2061 | | |
2005 | 2062 | | |
| |||
2238 | 2295 | | |
2239 | 2296 | | |
2240 | 2297 | | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
2241 | 2301 | | |
2242 | 2302 | | |
2243 | 2303 | | |
| |||
2416 | 2476 | | |
2417 | 2477 | | |
2418 | 2478 | | |
| 2479 | + | |
2419 | 2480 | | |
2420 | 2481 | | |
2421 | 2482 | | |
| |||
2430 | 2491 | | |
2431 | 2492 | | |
2432 | 2493 | | |
| 2494 | + | |
| 2495 | + | |
| 2496 | + | |
| 2497 | + | |
| 2498 | + | |
| 2499 | + | |
| 2500 | + | |
| 2501 | + | |
| 2502 | + | |
| 2503 | + | |
| 2504 | + | |
| 2505 | + | |
| 2506 | + | |
| 2507 | + | |
| 2508 | + | |
| 2509 | + | |
| 2510 | + | |
| 2511 | + | |
| 2512 | + | |
| 2513 | + | |
| 2514 | + | |
| 2515 | + | |
| 2516 | + | |
| 2517 | + | |
| 2518 | + | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
| 2529 | + | |
| 2530 | + | |
| 2531 | + | |
| 2532 | + | |
| 2533 | + | |
| 2534 | + | |
| 2535 | + | |
| 2536 | + | |
| 2537 | + | |
2433 | 2538 | | |
2434 | 2539 | | |
2435 | 2540 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3427 | 3427 | | |
3428 | 3428 | | |
3429 | 3429 | | |
3430 | | - | |
| 3430 | + | |
| 3431 | + | |
| 3432 | + | |
| 3433 | + | |
3431 | 3434 | | |
3432 | 3435 | | |
3433 | 3436 | | |
| |||
0 commit comments