there is no need to ever sentry_sdk.start_transaction because the flask integration does that

This commit is contained in:
burnettk 2023-02-01 13:44:12 -05:00
parent 847a2cebf2
commit 808d8d4aab
2 changed files with 5 additions and 16 deletions

View File

@ -425,21 +425,10 @@ def task_submit(
terminate_loop: bool = False,
) -> flask.wrappers.Response:
"""Task_submit_user_data."""
sentry_op = "controller_action"
sentry_transaction_name = "tasks_controller.task_submit"
transaction = sentry_sdk.Hub.current.scope.transaction
if transaction is None:
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.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
)
with sentry_sdk.start_span(
op="controller_action", description="tasks_controller.task_submit"
):
return task_submit_shared(process_instance_id, task_id, body, terminate_loop)
def _get_tasks(

View File

@ -47,7 +47,7 @@ class ServiceTaskDelegate:
def call_connector(name: str, bpmn_params: Any, task_data: Any) -> str:
"""Calls a connector via the configured proxy."""
call_url = f"{connector_proxy_url()}/v1/do/{name}"
with sentry_sdk.start_transaction(op="call-connector", name=call_url):
with sentry_sdk.start_span(op="call-connector", description=call_url):
params = {
k: ServiceTaskDelegate.check_prefixes(v["value"])
for k, v in bpmn_params.items()