From 37e51f5075fac24bb955f59f6f74ec249dc4c578 Mon Sep 17 00:00:00 2001 From: Mohamed Osman Date: Sun, 4 Jun 2023 15:35:09 -0400 Subject: [PATCH] add child span to test --- lightstep/sdk/trace/exporters/otlp/otelcol/client_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lightstep/sdk/trace/exporters/otlp/otelcol/client_test.go b/lightstep/sdk/trace/exporters/otlp/otelcol/client_test.go index 42ba2d4d..4de36aae 100644 --- a/lightstep/sdk/trace/exporters/otlp/otelcol/client_test.go +++ b/lightstep/sdk/trace/exporters/otlp/otelcol/client_test.go @@ -281,7 +281,13 @@ func (t *clientTestSuite) TestD2PD() { tracer := t.sdk.Tracer("test-tracer") _, span := tracer.Start(ctx, "ExecuteRequest") span.SetAttributes(attribute.String("test-attribute-1", "test-value-1")) - span.AddEvent("test event") + span.AddEvent("test event", trace.WithAttributes(attribute.String("test-event-attribute-1", "test-event-value-1"))) + + _, childSpan := tracer.Start(ctx, "child") + childSpan.SetAttributes(attribute.String("test-attribute-2", "test-value-2")) + childSpan.AddEvent("child test event", trace.WithAttributes(attribute.String("test-child-event-attribute-2", "test-child-event-value-2"))) + childSpan.End() + span.End() _ = t.sdk.Shutdown(ctx)