get some more insight into connector proxy timings
This commit is contained in:
parent
48781039c7
commit
e460325e60
|
@ -3,6 +3,7 @@ import json
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
import sentry_sdk
|
||||||
from flask import current_app
|
from flask import current_app
|
||||||
from flask import g
|
from flask import g
|
||||||
|
|
||||||
|
@ -45,15 +46,15 @@ class ServiceTaskDelegate:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def call_connector(name: str, bpmn_params: Any, task_data: Any) -> str:
|
def call_connector(name: str, bpmn_params: Any, task_data: Any) -> str:
|
||||||
"""Calls a connector via the configured proxy."""
|
"""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):
|
||||||
params = {
|
params = {
|
||||||
k: ServiceTaskDelegate.check_prefixes(v["value"])
|
k: ServiceTaskDelegate.check_prefixes(v["value"])
|
||||||
for k, v in bpmn_params.items()
|
for k, v in bpmn_params.items()
|
||||||
}
|
}
|
||||||
params["spiff__task_data"] = task_data
|
params["spiff__task_data"] = task_data
|
||||||
|
|
||||||
proxied_response = requests.post(
|
proxied_response = requests.post(call_url, json=params)
|
||||||
f"{connector_proxy_url()}/v1/do/{name}", json=params
|
|
||||||
)
|
|
||||||
|
|
||||||
parsed_response = json.loads(proxied_response.text)
|
parsed_response = json.loads(proxied_response.text)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue