Skip to content

Commit bbf0048

Browse files
authored
Improved screenshots service logs (#3578)
1 parent 955aa96 commit bbf0048

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

screenshot/app.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
api_key_header = APIKeyHeader(name="api_key", auto_error=True)
2727

2828
if SENTRY_ENABLED:
29+
logging.info("Starting sentry")
30+
2931
sentry_sdk.init(
3032
dsn="https://[email protected]/4505125491703808",
3133
# Set traces_sample_rate to 1.0 to capture 100%
@@ -34,7 +36,6 @@
3436
traces_sample_rate=1.0,
3537
)
3638

37-
3839
app = FastAPI()
3940
g_browser_instance = None
4041

@@ -129,7 +130,7 @@ async def screenshot(request_data: ScreenshotRequest = Body(...)):
129130

130131
buffer = await screenshot_element.screenshot(timeout=DEFAULT_TIMEOUT_MS)
131132
except Exception as e:
132-
logger.exception(f"Screenshot generation failed: {e}")
133+
logger.exception(f"Screenshot generation failed for {url}")
133134
raise HTTPException(
134135
status_code=400, detail=f"Screenshot generation failed: {e}"
135136
)

0 commit comments

Comments
 (0)