From e276a864e16af8f69f087f8cbf339dc4d5bef534 Mon Sep 17 00:00:00 2001 From: Leonardo Alminana Date: Wed, 24 Apr 2024 19:39:49 +0200 Subject: [PATCH] opentelemetry: made the scope field optional Signed-off-by: Leonardo Alminana --- src/ctr_decode_opentelemetry.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ctr_decode_opentelemetry.c b/src/ctr_decode_opentelemetry.c index 768f86f..067e88d 100644 --- a/src/ctr_decode_opentelemetry.c +++ b/src/ctr_decode_opentelemetry.c @@ -552,7 +552,10 @@ int ctr_decode_opentelemetry_create(struct ctrace **out_ctr, scope_span = ctr_scope_span_create(resource_span); ctr_scope_span_set_schema_url(scope_span, otel_scope_span->schema_url); - ctr_scope_span_set_scope(scope_span, otel_scope_span->scope); + + if (otel_scope_span->scope != NULL) { + ctr_scope_span_set_scope(scope_span, otel_scope_span->scope); + } for (span_index = 0; span_index < otel_scope_span->n_spans; span_index++) { otel_span = otel_scope_span->spans[span_index];