more spans to track performance

This commit is contained in:
burnettk 2023-02-01 07:45:48 -05:00
parent cd2ff49ea6
commit cd435841d7
2 changed files with 16 additions and 15 deletions

View File

@ -380,6 +380,7 @@ def task_submit_shared(
)
)
with sentry_sdk.start_span(op="task", description="complete_form_task"):
processor.lock_process_instance("Web")
ProcessInstanceService.complete_form_task(
processor=processor,
@ -428,15 +429,13 @@ def task_submit(
sentry_transaction_name = "tasks_controller.task_submit"
transaction = sentry_sdk.Hub.current.scope.transaction
if transaction is None:
current_app.logger.debug(
"transaction was None. pretty sure this never happens."
)
current_app.logger.info("transaction was None. pretty sure this never happens.")
with sentry_sdk.start_transaction(op=sentry_op, name=sentry_transaction_name):
return task_submit_shared(
process_instance_id, task_id, body, terminate_loop
)
else:
current_app.logger.debug("transaction existed.")
current_app.logger.info("transaction existed.")
with transaction.start_child(op=sentry_op, description=sentry_transaction_name):
return task_submit_shared(
process_instance_id, task_id, body, terminate_loop

View File

@ -4,6 +4,7 @@ from typing import Any
from typing import List
from typing import Optional
import sentry_sdk
from flask import current_app
from SpiffWorkflow.task import Task as SpiffTask # type: ignore
@ -234,6 +235,7 @@ class ProcessInstanceService:
# ProcessInstanceService.post_process_form(spiff_task) # some properties may update the data store.
processor.complete_task(spiff_task, human_task, user=user)
with sentry_sdk.start_span(op="task", description="backend_do_engine_steps"):
# maybe move this out once we have the interstitial page since this is here just so we can get the next human task
processor.do_engine_steps(save=True)