From 737e09646f15f4290638c61506fa2fbefcd7571e Mon Sep 17 00:00:00 2001 From: Vadim Zelenevsky Date: Tue, 7 Nov 2023 14:27:58 +0600 Subject: [PATCH] Headers propagation from an execution request to actions/notifications Currently Mistal doesn`t support distribution tracing, which means that there`s no way to propagate traceId/spanId from an execution to related actions/notifications. It leads us to an issue, because according to distribution tracing principles "traceId" should remain the same during the discovery process, which includes Mistral worflow execution. Proposed solution is to keep some headers from execution request and propagate them later to actions/notifications. Regexp can be stored as env variable to define headers which will be propagated. Implements blueprint add-headers-propagation Change-Id: Id8cc900a7d94286e79f1ece4dc4177383263f55c --- mistral_lib/actions/context.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mistral_lib/actions/context.py b/mistral_lib/actions/context.py index c4fcbf9..fbde99b 100644 --- a/mistral_lib/actions/context.py +++ b/mistral_lib/actions/context.py @@ -70,7 +70,8 @@ class ExecutionContext(object): def __init__(self, workflow_execution_id=None, task_execution_id=None, action_execution_id=None, workflow_name=None, callback_url=None, task_id=None, with_items_index=0, - task_rerun_no=0, task_rerun_id=None): + task_rerun_no=0, task_rerun_id=None, + workflow_propagated_headers=None): self.workflow_execution_id = workflow_execution_id self.task_execution_id = task_execution_id self.action_execution_id = action_execution_id @@ -79,10 +80,10 @@ class ExecutionContext(object): self.with_items_index = with_items_index self.task_rerun_no = task_rerun_no self.task_rerun_id = task_rerun_id + self.workflow_propagated_headers = workflow_propagated_headers if task_id is not None: self.task_execution_id = task_id - self._deprecate_task_id_warning() def _deprecate_task_id_warning(self):