elsa-core/src/modules/Elsa.OpenTelemetry/Contracts/IActivityErrorSpanHandler.cs
Sipke Schoorstra f0639cbd42
Refactor OpenTelemetry error handling implementation (#6621)
* Refactor OpenTelemetry error handling implementation

Introduce WorkflowErrorSpanHandler interface and context for improved error span handling in workflows. Separate activity and workflow error handling using dedicated abstractions and context models. Update error handling logic in tracing middleware and adjust DI configuration accordingly.

* Rename handler class and improve error tagging logic

Renamed `FaultExceptionActivityErrorSpanHandler` to `FaultExceptionErrorSpanHandler` for consistency and clarity. Updated error attribute tagging to align with Datadog's well-known attributes. Adjusted incident selection logic to use the first incident instead of the last.

* Align .gitignore file with consistent formatting

Standardized comments in the .gitignore file by adding missing spaces and capitalizing as needed. Updated the `/docker/data/` entry to `/docker/azurite-data/` for clarity.

* Fix incorrect selection of activity execution context

Replaced `LastOrDefault` with `FirstOrDefault` to ensure the correct activity execution context is retrieved when handling errors. This change resolves potential inaccuracies in identifying the faulted activity node.

* Exclude docker-compose-datadog.yml from solution file.
2025-05-07 10:59:44 +02:00

10 lines
251 B
C#

using Elsa.OpenTelemetry.Models;
namespace Elsa.OpenTelemetry.Contracts;
public interface IActivityErrorSpanHandler
{
float Order { get; }
bool CanHandle(ActivityErrorSpanContext context);
void Handle(ActivityErrorSpanContext context);
}