Remove obsolete tag settings and correct tag schemas

Eliminated redundant `correlationId` tag setting. Adjusted `workflowInstance` and `activityInstance` tag schemas for better clarity. Simplified the processors list in `otel-collector-config.yaml`.
This commit is contained in:
Sipke Schoorstra 2024-10-05 14:12:00 +02:00
parent 54624aea77
commit 078f34fd79
3 changed files with 4 additions and 7 deletions

View file

@ -41,7 +41,7 @@ service:
exporters: [ datadog ]
traces:
receivers: [ otlp ]
processors: [ batch, tail_sampling ] # Added tail_sampling to the main traces pipeline
processors: [ batch ] # Added tail_sampling to the main traces pipeline
exporters: [ debug, datadog ] # Directly exporting to debug and datadog
logs:
receivers: [ otlp ]

View file

@ -43,7 +43,7 @@ public class OpenTelemetryTracingActivityExecutionMiddleware(ActivityMiddlewareD
span.AddEvent(new ActivityEvent("Faulted", tags: CreateStatusTags(context)));
span.SetStatus(ActivityStatusCode.Error);
span.SetTag("error", true);
span.SetTag("hasIncidents", true);
span.SetTag("activityInstance.hasIncidents", true);
var errorMessage = string.IsNullOrWhiteSpace(context.Exception?.Message) ? "Unknown error" : context.Exception.Message;
span.SetTag("error.message", errorMessage);

View file

@ -35,9 +35,6 @@ public class OpenTelemetryTracingWorkflowExecutionMiddleware(WorkflowMiddlewareD
return;
}
if (!string.IsNullOrWhiteSpace(context.CorrelationId))
span.SetTag("correlationId", context.CorrelationId);
span.SetTag("workflowInstance.id", workflowInstanceId);
span.SetTag("workflowDefinition.definitionId", workflow.Identity.DefinitionId);
span.SetTag("workflowDefinition.version", workflow.Identity.Version);
@ -61,7 +58,7 @@ public class OpenTelemetryTracingWorkflowExecutionMiddleware(WorkflowMiddlewareD
if(context.Incidents.Any())
{
span.SetStatus(ActivityStatusCode.Error);
span.SetTag("hasIncidents", true);
span.SetTag("workflowInstance.hasIncidents", true);
span.SetTag("error", true);
if (context.Incidents.Count > 0)
@ -69,7 +66,7 @@ public class OpenTelemetryTracingWorkflowExecutionMiddleware(WorkflowMiddlewareD
}
if (!string.IsNullOrWhiteSpace(context.CorrelationId))
span.SetTag("correlationId", context.CorrelationId);
span.SetTag("workflowInstance.correlationId", context.CorrelationId);
var now = systemClock.UtcNow;
span.SetTag("workflowExecution.endTimeUtc", now);