Commit 42f68fa
authored
fix: report dropped OpenTelemetry spans (#686)
#### Overview
Report OpenTelemetry batch-queue span loss through plugin runtime diagnostics instead of relying only on SDK warning logs that language bindings do not configure or expose consistently.
- [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
- Wrap each plugin-managed OpenTelemetry batch processor with counters for completed and exporter-accepted spans.
- Emit `otel.spans_dropped` with the exact dropped count, the indexed endpoint configuration field, and the configured endpoint URL during graceful shutdown.
- Treat the diagnostic as a recoverable runtime delivery failure so teardown retains the plugin report without disabling later configuration.
- Aggregate every OpenTelemetry provider shutdown result and permit reconfiguration only when every failure is a dropped-span delivery failure.
- Add a deterministic saturated-queue regression test and document the runtime diagnostic behavior.
Validation:
- `cargo fmt --all` passed.
- `cargo clippy --workspace --all-targets -- -D warnings` passed.
- Focused dropped-span, provider-shutdown aggregation, and teardown-classification tests passed.
- `uv run pre-commit run --all-files` passed.
- `just docs` passed; the redirects check was skipped after the remote FDR service returned 403.
- `just test-rust`: the core and non-FFI workspace passed. The FFI phase inherited `/Users/wkillian/.nemo-relay/plugins.toml`, failed its first empty-diagnostics assertion, and then reported 10 poisoned-lock cascades.
- `just test-python`: 603 tests passed; 11 failures came from the same discovered user configuration and its active-plugin cascade.
- `just test-go` passed.
- `just test-node`: 339 tests passed; 10 failures came from the same discovered user configuration and its active-plugin cascade.
#### Where should the reviewer start?
Start with `DiagnosticBatchSpanProcessor` in `crates/core/src/observability/otel.rs`, then review `dropped_spans_are_recorded_in_the_active_plugin_report` and the recoverable teardown marker handling in `crates/core/src/plugin.rs`.
#### Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
- Closes RELAY-602
## Summary by CodeRabbit
- **New Features**
- Added runtime diagnostics for OpenTelemetry spans dropped during batching, including the drop count and affected endpoint.
- Delivery failures are now reported consistently during OpenTelemetry and ATIF plugin shutdowns.
- Shutdown now preserves diagnostics and reports failures across multiple endpoints, supporting safer reconfiguration.
- **Documentation**
- Updated OpenTelemetry guidance with details about drop diagnostics and graceful shutdown.
- Clarified that clearing the plugin enables final queued spans to be exported and records remaining delivery failures.
Authors:
- Will Killian (https://github.com/willkill07)
Approvers:
- Eric Evans II (https://github.com/ericevans-nv)
URL: #6861 parent 0ef068f commit 42f68fa
7 files changed
Lines changed: 482 additions & 37 deletions
File tree
- crates/core
- src
- observability
- tests/unit
- observability
- docs/configure-plugins/observability
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
46 | 49 | | |
| 50 | + | |
47 | 51 | | |
48 | | - | |
| 52 | + | |
| 53 | + | |
49 | 54 | | |
50 | 55 | | |
51 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
52 | 62 | | |
53 | 63 | | |
54 | 64 | | |
| |||
397 | 407 | | |
398 | 408 | | |
399 | 409 | | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
400 | 429 | | |
401 | 430 | | |
402 | 431 | | |
| |||
406 | 435 | | |
407 | 436 | | |
408 | 437 | | |
409 | | - | |
| 438 | + | |
410 | 439 | | |
411 | 440 | | |
412 | 441 | | |
| |||
617 | 646 | | |
618 | 647 | | |
619 | 648 | | |
| 649 | + | |
620 | 650 | | |
621 | 651 | | |
622 | 652 | | |
| |||
637 | 667 | | |
638 | 668 | | |
639 | 669 | | |
640 | | - | |
| 670 | + | |
641 | 671 | | |
642 | 672 | | |
643 | 673 | | |
| |||
696 | 726 | | |
697 | 727 | | |
698 | 728 | | |
699 | | - | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
700 | 733 | | |
701 | 734 | | |
702 | | - | |
| 735 | + | |
703 | 736 | | |
704 | 737 | | |
705 | 738 | | |
| |||
713 | 746 | | |
714 | 747 | | |
715 | 748 | | |
716 | | - | |
| 749 | + | |
717 | 750 | | |
718 | 751 | | |
719 | 752 | | |
| |||
754 | 787 | | |
755 | 788 | | |
756 | 789 | | |
757 | | - | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
758 | 924 | | |
759 | 925 | | |
760 | 926 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | 72 | | |
75 | 73 | | |
76 | 74 | | |
| |||
1036 | 1034 | | |
1037 | 1035 | | |
1038 | 1036 | | |
1039 | | - | |
| 1037 | + | |
1040 | 1038 | | |
1041 | 1039 | | |
1042 | 1040 | | |
1043 | 1041 | | |
1044 | 1042 | | |
1045 | 1043 | | |
1046 | | - | |
| 1044 | + | |
1047 | 1045 | | |
1048 | 1046 | | |
1049 | 1047 | | |
| |||
1063 | 1061 | | |
1064 | 1062 | | |
1065 | 1063 | | |
1066 | | - | |
1067 | | - | |
1068 | | - | |
1069 | | - | |
1070 | | - | |
1071 | | - | |
1072 | | - | |
1073 | | - | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
1074 | 1067 | | |
1075 | | - | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
1076 | 1089 | | |
1077 | 1090 | | |
1078 | 1091 | | |
1079 | 1092 | | |
1080 | | - | |
1081 | | - | |
| 1093 | + | |
| 1094 | + | |
1082 | 1095 | | |
1083 | 1096 | | |
1084 | | - | |
| 1097 | + | |
1085 | 1098 | | |
1086 | 1099 | | |
1087 | | - | |
| 1100 | + | |
1088 | 1101 | | |
1089 | 1102 | | |
1090 | 1103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
| |||
127 | 126 | | |
128 | 127 | | |
129 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
130 | 135 | | |
131 | 136 | | |
132 | 137 | | |
| |||
2138 | 2143 | | |
2139 | 2144 | | |
2140 | 2145 | | |
2141 | | - | |
| 2146 | + | |
2142 | 2147 | | |
2143 | 2148 | | |
2144 | 2149 | | |
| |||
2169 | 2174 | | |
2170 | 2175 | | |
2171 | 2176 | | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
2172 | 2186 | | |
2173 | 2187 | | |
2174 | 2188 | | |
| |||
0 commit comments