Skip to content

Commit 610e93b

Browse files
committed
Remove tracer
1 parent e660cbd commit 610e93b

File tree

1 file changed

+15
-11
lines changed
  • code/function/fastapp/api/v1/endpoints

1 file changed

+15
-11
lines changed

code/function/fastapp/api/v1/endpoints/sample.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,20 @@ async def post_predict(
1919
logger.info(f"Received request: {data}")
2020

2121
# Sample request
22-
tracer_attributes = {"http.client_ip": x_forwarded_for}
23-
with tracer.start_as_current_span(
24-
"dependency_span", attributes=tracer_attributes, kind=SpanKind.CLIENT
25-
) as span:
26-
try:
27-
async with httpx.AsyncClient() as client:
28-
response = await client.get("https://www.bing.com")
29-
logger.info(f"Received response status code: {response.status_code}")
30-
except Exception as ex:
31-
span.set_attribute("status", "exception")
32-
span.record_exception(ex)
22+
async with httpx.AsyncClient() as client:
23+
response = await client.get("https://www.bing.com")
24+
logger.info(f"Received response status code: {response.status_code}")
25+
26+
# tracer_attributes = {"http.client_ip": x_forwarded_for}
27+
# with tracer.start_as_current_span(
28+
# "dependency_span", attributes=tracer_attributes, kind=SpanKind.CLIENT
29+
# ) as span:
30+
# try:
31+
# async with httpx.AsyncClient() as client:
32+
# response = await client.get("https://www.bing.com")
33+
# logger.info(f"Received response status code: {response.status_code}")
34+
# except Exception as ex:
35+
# span.set_attribute("status", "exception")
36+
# span.record_exception(ex)
3337

3438
return SampleResponse(output=f"Hello {data.input}")

0 commit comments

Comments
 (0)