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:
parent
54624aea77
commit
078f34fd79
|
|
@ -41,7 +41,7 @@ service:
|
||||||
exporters: [ datadog ]
|
exporters: [ datadog ]
|
||||||
traces:
|
traces:
|
||||||
receivers: [ otlp ]
|
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
|
exporters: [ debug, datadog ] # Directly exporting to debug and datadog
|
||||||
logs:
|
logs:
|
||||||
receivers: [ otlp ]
|
receivers: [ otlp ]
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ public class OpenTelemetryTracingActivityExecutionMiddleware(ActivityMiddlewareD
|
||||||
span.AddEvent(new ActivityEvent("Faulted", tags: CreateStatusTags(context)));
|
span.AddEvent(new ActivityEvent("Faulted", tags: CreateStatusTags(context)));
|
||||||
span.SetStatus(ActivityStatusCode.Error);
|
span.SetStatus(ActivityStatusCode.Error);
|
||||||
span.SetTag("error", true);
|
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;
|
var errorMessage = string.IsNullOrWhiteSpace(context.Exception?.Message) ? "Unknown error" : context.Exception.Message;
|
||||||
span.SetTag("error.message", errorMessage);
|
span.SetTag("error.message", errorMessage);
|
||||||
|
|
|
||||||
|
|
@ -35,9 +35,6 @@ public class OpenTelemetryTracingWorkflowExecutionMiddleware(WorkflowMiddlewareD
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(context.CorrelationId))
|
|
||||||
span.SetTag("correlationId", context.CorrelationId);
|
|
||||||
|
|
||||||
span.SetTag("workflowInstance.id", workflowInstanceId);
|
span.SetTag("workflowInstance.id", workflowInstanceId);
|
||||||
span.SetTag("workflowDefinition.definitionId", workflow.Identity.DefinitionId);
|
span.SetTag("workflowDefinition.definitionId", workflow.Identity.DefinitionId);
|
||||||
span.SetTag("workflowDefinition.version", workflow.Identity.Version);
|
span.SetTag("workflowDefinition.version", workflow.Identity.Version);
|
||||||
|
|
@ -61,7 +58,7 @@ public class OpenTelemetryTracingWorkflowExecutionMiddleware(WorkflowMiddlewareD
|
||||||
if(context.Incidents.Any())
|
if(context.Incidents.Any())
|
||||||
{
|
{
|
||||||
span.SetStatus(ActivityStatusCode.Error);
|
span.SetStatus(ActivityStatusCode.Error);
|
||||||
span.SetTag("hasIncidents", true);
|
span.SetTag("workflowInstance.hasIncidents", true);
|
||||||
span.SetTag("error", true);
|
span.SetTag("error", true);
|
||||||
|
|
||||||
if (context.Incidents.Count > 0)
|
if (context.Incidents.Count > 0)
|
||||||
|
|
@ -69,7 +66,7 @@ public class OpenTelemetryTracingWorkflowExecutionMiddleware(WorkflowMiddlewareD
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(context.CorrelationId))
|
if (!string.IsNullOrWhiteSpace(context.CorrelationId))
|
||||||
span.SetTag("correlationId", context.CorrelationId);
|
span.SetTag("workflowInstance.correlationId", context.CorrelationId);
|
||||||
|
|
||||||
var now = systemClock.UtcNow;
|
var now = systemClock.UtcNow;
|
||||||
span.SetTag("workflowExecution.endTimeUtc", now);
|
span.SetTag("workflowExecution.endTimeUtc", now);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue