删除sync_center埋点
This commit is contained in:
parent
364ceb29a1
commit
85c2e7459e
@ -24,23 +24,15 @@ def sync_center():
|
|||||||
:return: 任务列表
|
:return: 任务列表
|
||||||
"""
|
"""
|
||||||
from template import TEMPLATES, download_template
|
from template import TEMPLATES, download_template
|
||||||
tracer = get_tracer(__name__)
|
|
||||||
with tracer.start_as_current_span("sync_center"):
|
|
||||||
with tracer.start_as_current_span("sync_center.request") as req_span:
|
|
||||||
try:
|
try:
|
||||||
req_span.set_attribute("http.method", "POST")
|
|
||||||
req_span.set_attribute("http.url", os.getenv('API_ENDPOINT') + "/sync")
|
|
||||||
response = session.post(os.getenv('API_ENDPOINT') + "/sync", json={
|
response = session.post(os.getenv('API_ENDPOINT') + "/sync", json={
|
||||||
'accessKey': os.getenv('ACCESS_KEY'),
|
'accessKey': os.getenv('ACCESS_KEY'),
|
||||||
'clientStatus': util.system.get_sys_info(),
|
'clientStatus': util.system.get_sys_info(),
|
||||||
'templateList': [{'id': t.get('id', ''), 'updateTime': t.get('updateTime', '')} for t in
|
'templateList': [{'id': t.get('id', ''), 'updateTime': t.get('updateTime', '')} for t in
|
||||||
TEMPLATES.values()]
|
TEMPLATES.values()]
|
||||||
}, timeout=10)
|
}, timeout=10)
|
||||||
req_span.set_attribute("http.status_code", response.status_code)
|
|
||||||
req_span.set_attribute("http.response", response.text)
|
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
except requests.RequestException as e:
|
except requests.RequestException as e:
|
||||||
req_span.set_attribute("http.error", str(e))
|
|
||||||
logger.error("请求失败!", e)
|
logger.error("请求失败!", e)
|
||||||
return []
|
return []
|
||||||
data = response.json()
|
data = response.json()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user