* 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.
The tags "activity.incidents" and "workflow.incidents" were removed as they are unnecessary and provide no additional value. This change simplifies the middleware implementation while retaining essential telemetry data.
The `SetStatus(ActivityStatusCode.Ok)` calls were unnecessary as the default behavior already sets the appropriate status. This cleanup simplifies the code and avoids redundant operations, improving maintainability.
Introduced `StartNewTrace` input to workflows and updated OpenTelemetry middleware to support initiating new trace contexts. This helps improve trace isolation and linking when desired, enhancing observability during workflow execution.
This commit eliminates unused status checks ("running" and "pending") from OpenTelemetry tracing middlewares. The changes simplify the codebase and improve maintainability by removing unnecessary logic.
Introduced new span tags for activities and workflows to enhance trace analysis. Optimized error handling in activity tracing by selecting the first applicable handler. Removed unused manual tracing configuration and commented out console exporters in server setup.
Enhanced error status to include detailed message when the workflow is faulted, providing better context in logs. Fixed the retrieval of exception type by replacing `GetType()` with `.Type` for improved accuracy in incident tagging.
Added and updated multiple package references, including OpenTelemetry, Datadog.Trace.Bundle, and various Microsoft.Extensions libraries. This ensures compatibility with the latest dependencies and introduces enhanced features for resilience and tracing.
* Add proper summary tags back
* Apply suggestions from code review
Co-authored-by: Robin Sue <robinsue@live.de>
* 69 more files fixed
---------
Co-authored-by: Robin Sue <robinsue@live.de>
Enhanced the OpenTelemetry tracing middleware to include detailed information about the triggered activity within the workflow execution. This change adds tags for the activity ID, name, and type to provide better observability and debugging insights.
Eliminated redundant `correlationId` tag setting. Adjusted `workflowInstance` and `activityInstance` tag schemas for better clarity. Simplified the processors list in `otel-collector-config.yaml`.
Renamed variables from 'activity' to 'span' for clarity and consistency. Added additional span tags for start and end times, status updates, and detailed error information for improved traceability and debugging.
Replaced inline tag creation with a helper method to streamline code and ensure consistency in status tags for activity events. This change also includes a minor comment for clarity on null activity handling.
Reorganized the logic for setting tags when incidents are present in `OpenTelemetryTracingWorkflowExecutionMiddleware`. The new structure ensures consistent tag setting for error status and incidents, improving code readability and maintainability.
Enhanced the Datadog tracing configuration to include priority sampling, rate limits, and sampling rules in the docker-compose-datadog.yml. Updated the agent image version and improved error message serialization in OpenTelemetry middleware to use custom JSON serializer options. Adjusted Dockerfile path to correct bundle location.
Updated `docker-compose-datadog.yml` with new environment variables and updated image versions, enhancing trace sampling and service autodiscovery. Added Kubernetes deployment, service, and role files for `elsa-server`, `elsa-studio`, `plant-uml`, `postgres`, and `trace-lens`, improving the project's infrastructure. Enhanced OpenTelemetry middleware for better error handling and detailed tracing of activity and workflow executions.
This commit introduces the Elsa.OpenTelemetry module to provide OpenTelemetry sources for tracing workflow and activity execution. Additionally, it updates the program to include default workflow and activity execution pipelines with tracing middleware, and improves pipeline builder extensions to support middleware insertion.