Skip to content

Commit b4ef220

Browse files
authored
docs: correct span-drop diagnostic field (#841)
#### Overview Correct the documented runtime diagnostic field for dropped OTLP spans on the 0.8 release branch and cover the production constructor path. - [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 - Update the `otel.spans_dropped` diagnostic documentation from `opentelemetry.endpoints[N].endpoint` to the emitted `opentelemetry.traces[N].endpoint` field path. - Align the existing dropped-span diagnostic fixture with that field path. - Add a focused regression test that constructs the subscriber with `new_for_plugin` and asserts the runtime diagnostic field in the active plugin report. #### Where should the reviewer start? `crates/core/tests/unit/observability/otel_tests.rs`, which now verifies the constructor-produced field path; then review the documentation warning in `docs/configure-plugins/observability/opentelemetry.mdx`. #### Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to) - Relates to: RELAY-767 ## Summary by CodeRabbit * **Bug Fixes** * Corrected OpenTelemetry diagnostics to reference the appropriate trace endpoint path when reporting dropped spans. * Improved metric validation diagnostics for invalid endpoint configurations, including plugin-managed setups. * **Documentation** * Updated observability documentation to reflect the corrected version-4 trace endpoint path used in diagnostic messages. Authors: - Bryan Bednarski (https://github.com/bbednarski9) Approvers: - Eric Evans II (https://github.com/ericevans-nv) - Will Killian (https://github.com/willkill07) URL: #841
1 parent f1d8e86 commit b4ef220

2 files changed

Lines changed: 47 additions & 3 deletions

File tree

crates/core/tests/unit/observability/otel_tests.rs

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4377,7 +4377,7 @@ fn dropped_spans_are_recorded_in_the_active_plugin_report() {
43774377

43784378
let exporter = BlockingSpanExporter::default();
43794379
let runtime_diagnostics =
4380-
SignalRuntimeDiagnostics::new(Some("opentelemetry.endpoints[2].endpoint".to_string()));
4380+
SignalRuntimeDiagnostics::new(Some("opentelemetry.traces[2].endpoint".to_string()));
43814381
let processor = DiagnosticBatchSpanProcessor::new_with_batch_config(
43824382
exporter.clone(),
43834383
"https://collector.example/v1/traces".to_string(),
@@ -4415,7 +4415,7 @@ fn dropped_spans_are_recorded_in_the_active_plugin_report() {
44154415
assert_eq!(diagnostic.count, 2);
44164416
assert_eq!(
44174417
diagnostic.field.as_deref(),
4418-
Some("opentelemetry.endpoints[2].endpoint")
4418+
Some("opentelemetry.traces[2].endpoint")
44194419
);
44204420
assert!(
44214421
diagnostic
@@ -4431,6 +4431,50 @@ fn dropped_spans_are_recorded_in_the_active_plugin_report() {
44314431
);
44324432
}
44334433

4434+
#[test]
4435+
fn plugin_trace_subscriber_runtime_diagnostics_use_trace_field() {
4436+
let _guard = crate::observability::test_mutex().lock().unwrap();
4437+
let _ = crate::plugin::clear_plugin_configuration();
4438+
let _clear_guard = ClearPluginConfigurationGuard;
4439+
futures::executor::block_on(crate::plugin::initialize_plugins_exact(
4440+
crate::plugin::PluginConfig::default(),
4441+
))
4442+
.unwrap();
4443+
4444+
let subscriber = OpenTelemetrySubscriber::new_for_plugin(
4445+
OpenTelemetryConfig::new(OpenTelemetryType::Full, "http://localhost:4318/v1/traces"),
4446+
2,
4447+
)
4448+
.unwrap();
4449+
let event = Event::Mark(MarkEvent::new(
4450+
BaseEvent::builder()
4451+
.name("invalid-metric")
4452+
.data(json!({"measurements": []}))
4453+
.data_schema(
4454+
DataSchema::builder()
4455+
.name(METRIC_DATA_SCHEMA_NAME)
4456+
.version("999")
4457+
.build(),
4458+
)
4459+
.build(),
4460+
None,
4461+
None,
4462+
));
4463+
4464+
(subscriber.subscriber())(&event);
4465+
4466+
let report = crate::plugin::active_plugin_report().unwrap();
4467+
let diagnostic = report
4468+
.runtime_diagnostics
4469+
.iter()
4470+
.find(|diagnostic| diagnostic.code == "otel.metric_mark_invalid")
4471+
.expect("invalid metric diagnostic");
4472+
assert_eq!(
4473+
diagnostic.field.as_deref(),
4474+
Some("opentelemetry.traces[2].endpoint")
4475+
);
4476+
}
4477+
44344478
#[test]
44354479
fn trace_export_failures_are_diagnosed_until_a_later_export_recovers() {
44364480
let runtime_diagnostics = SignalRuntimeDiagnostics::new(None);

docs/configure-plugins/observability/opentelemetry.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ endpoint to avoid a log storm. During graceful shutdown, it logs
283283
For plugin-managed exporters, NeMo Relay also records `otel.spans_dropped` in the
284284
active plugin report's `runtime_diagnostics`. Its `count` is the exact number
285285
of dropped spans, `field` identifies the affected
286-
`opentelemetry.endpoints[N].endpoint`, and `message` includes the configured
286+
`opentelemetry.traces[N].endpoint`, and `message` includes the configured
287287
endpoint URL. If spans were dropped, clearing the plugin returns a delivery
288288
failure error and retains the diagnostic for inspection. This error does not
289289
disable later plugin configuration.

0 commit comments

Comments
 (0)