diff --git a/src/HouseofCat.Dataflows/Extensions/WorkStateExtensions.cs b/src/HouseofCat.Dataflows/Extensions/WorkStateExtensions.cs index 7481e35..082bbf6 100644 --- a/src/HouseofCat.Dataflows/Extensions/WorkStateExtensions.cs +++ b/src/HouseofCat.Dataflows/Extensions/WorkStateExtensions.cs @@ -61,8 +61,6 @@ public static void StartWorkflowSpan( { if (state is null) return; - state.Data[DefaultWorkflowNameKey] = workflowName; - var attributes = new SpanAttributes(); attributes.Add(DefaultWorkflowNameKey, workflowName); @@ -107,8 +105,6 @@ public static TelemetrySpan CreateActiveSpan( SpanKind spanKind = SpanKind.Internal, IEnumerable> suppliedAttributes = null) { - if (state?.Data is null) return null; - var attributes = new SpanAttributes(); if (suppliedAttributes is not null) { @@ -139,19 +135,14 @@ public static TelemetrySpan CreateActiveSpan( public static TelemetrySpan CreateActiveChildSpan( this IWorkState state, string spanName, - SpanContext spanContext, SpanKind spanKind = SpanKind.Internal, SpanAttributes attributes = null) { - if (state?.Data is null) return null; - - state.Data.TryGetValue(DefaultWorkflowNameKey, out var workflowName); - return OpenTelemetryHelpers .StartActiveSpan( spanName, spanKind, - spanContext, + state.WorkflowSpan.Context, attributes: attributes); } diff --git a/src/HouseofCat.RabbitMQ/Dataflows/ConsumerDataflow.cs b/src/HouseofCat.RabbitMQ/Dataflows/ConsumerDataflow.cs index a80f033..b13321a 100644 --- a/src/HouseofCat.RabbitMQ/Dataflows/ConsumerDataflow.cs +++ b/src/HouseofCat.RabbitMQ/Dataflows/ConsumerDataflow.cs @@ -583,7 +583,7 @@ public TransformBlock GetByteManipulationTransformBlock( { TState WrapAction(TState state) { - using var childSpan = state.CreateActiveChildSpan(spanName, state.WorkflowSpan.Context, SpanKind.Internal); + using var childSpan = state.CreateActiveChildSpan(spanName, SpanKind.Internal); try { if (outbound) @@ -630,7 +630,7 @@ public TransformBlock GetByteManipulationTransformBlock( { async Task WrapActionAsync(TState state) { - using var childSpan = state.CreateActiveChildSpan(spanName, state.WorkflowSpan.Context, SpanKind.Internal); + using var childSpan = state.CreateActiveChildSpan(spanName, SpanKind.Internal); try { @@ -676,7 +676,7 @@ public TransformBlock GetWrappedSendTransformBlock( { async Task WrapPublishAsync(TState state) { - using var childSpan = state.CreateActiveChildSpan(SendStepIdentifier, state.WorkflowSpan.Context, SpanKind.Producer); + using var childSpan = state.CreateActiveChildSpan(SendStepIdentifier, SpanKind.Producer); try { await service.Publisher.PublishAsync(state.SendMessage, true, true).ConfigureAwait(false); diff --git a/tests/UnitTests/UnitTests.csproj b/tests/UnitTests/UnitTests.csproj index 0f78f0e..ad3089f 100644 --- a/tests/UnitTests/UnitTests.csproj +++ b/tests/UnitTests/UnitTests.csproj @@ -18,8 +18,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/version.props b/version.props index 986136d..5ca00a8 100644 --- a/version.props +++ b/version.props @@ -1,7 +1,7 @@ - 4.1.0 - 4.1.0 - 4.1.0 + 4.1.1 + 4.1.1 + 4.1.1