Repository navigation
feat(observability): report OTLP/HTTP partial success as runtime diagnostics - #1614
Conversation
|
No actionable comments were generated in the recent review. WalkthroughOTLP/HTTP responses with positive partial-success rejection counts now produce signal-specific runtime diagnostics for traces, logs, and metrics. Exporters return the original response, and exports remain successful. Tests cover JSON and protobuf responses. Documentation states that gRPC partial-success responses remain unreported. ChangesOTLP partial-success reporting
Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant OTLPExporter
participant PartialSuccessHttpClient
participant OTLPCollector
participant SignalRuntimeDiagnostics
OTLPExporter->>PartialSuccessHttpClient: Send export request
PartialSuccessHttpClient->>OTLPCollector: Send HTTP request
OTLPCollector-->>PartialSuccessHttpClient: Return successful OTLP response
PartialSuccessHttpClient->>SignalRuntimeDiagnostics: Record positive rejected-item count
PartialSuccessHttpClient-->>OTLPExporter: Return original response
Merge Risk:
|
|
/ok to test b8e7149 |
License DiffCompared against Lockfile license changesLockfile License ChangesRustAdded
Removed
Updated/Changed
NodeAdded
Removed
Updated/Changed
PythonAdded
Removed
Updated/Changed
Status output |
|
@Somay-kousis could you resolve a test merge conflict? |
…nostics A collector can answer an OTLP/HTTP export with 200 and partial_success, rejecting some items. The SDK only logs it, so runtime_diagnostics() and force_flush() looked clean. Decode the response for traces, logs and metrics (protobuf and JSON) and record otel.spans_rejected, otel.logs_rejected or otel.metric_points_rejected with the rejected count. gRPC stays a documented limitation. Closes NVIDIA#1597 Signed-off-by: Somay-kousis <[email protected]>
…n nothing was recorded Match the diagnostic code agreed on NVIDIA#1597; each signal owns its recorder, so one code does not mix counts. When the diagnostics table is full, record returns 0, which previously logged a warning on every rejected response. Signed-off-by: Somay-kousis <[email protected]>
With one otel.partial_success code, the wrapper's signal only shows in the message, and all three responses keep the rejected count in protobuf field 1. Assert the item type so a wrapper wired to the wrong signal fails. Signed-off-by: Somay-kousis <[email protected]>
b8e7149 to
1a42d6a
Compare
|
Rebased on main (1a42d6a). The conflict was both PRs appending a test to otel_detached_tests.rs; kept both. |
|
/ok to test 1a42d6a |
Overview
A collector can return 200 with
partial_successand drop some spans, log records or metric data points. The vendored exporter only logs that internally, soruntime_diagnostics()stayed empty andforce_flush()looked clean. This records it.Details
otel_signal.rs:OtlpSignal,record_otlp_partial_success, andPartialSuccessHttpClient. On a 2xx it decodesExportTrace/Logs/MetricsServiceResponse(protobuf, or JSON by the request'sContent-Type; JSON counts can be numbers or decimal strings) and recordsotel.partial_success(as agreed on [Enhancement]: Report OTLP partial success as a runtime diagnostic #1597) with the rejected count in that signal's diagnostics. The message has the endpoint origin only; the collector'serror_messageis left out, same reasoning as the TLS path.DiagnosticTraceHttpClientcalls it after the existing TLS handling, which is unchanged.build_*_exporternow take the signal'sSignalRuntimeDiagnostics.force_flush()andshutdown()still succeed. Zero or negative counts, non-2xx responses and unreadable bodies record nothing.HttpClient); the docs warning now says only that.Where should the reviewer start?
crates/observability/src/otel_signal.rs(rejected_countandrecord_otlp_partial_success), then the three e2e tests that run a local collector returningpartial_success.Testing
tests/unit/otel_partial_success_tests.rs: protobuf and JSON, all three signals, string-encoded counts, accumulation, zero/negative/malformed, non-2xx, full diagnostics table, and the endpoint origin without credentials or query.otel_detached_tests.rs,otel_logs_detached_tests.rs,otel_metrics_detached_tests.rs: a local HTTP collector answers withpartial_success, and the subscriber'sruntime_diagnostics()has the code with the right count.cargo test -p nemo-relay-observability(616 pass),cargo clippy --all-targets -D warnings,uv run pre-commit run(all hooks pass).just test-rust: all pass except twonemo-relay-clidoctor tests (collect_configuration_uses_xdg_global_path_and_renders_resolution_branches,configuration_and_path_helpers_cover_direct_paths_and_fallbacks), which fail the same way on unmodified main on my machine because of a local~/.config/nemo-relay.Not covered by a test: the automatic (env-configured) HTTP paths assert wiring only by construction. The 0.11 release notes still list this limitation; I left that page alone.
Related Issues
Summary by CodeRabbit