Skip to content

Commit 3c78303

Browse files
committed
feat(observability): remove unnecessary logging statements to enhance clarity
1 parent 84f8187 commit 3c78303

5 files changed

Lines changed: 0 additions & 37 deletions

File tree

‎backend/app/core/langfuse/langfuse.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ def wrapper(
321321
completion_config: NativeCompletionConfig, query: QueryParams, **kwargs
322322
):
323323
if not credentials:
324-
logger.info("[observe_llm_execution] No credentials - skipping tracing")
325324
return func(completion_config, query, **kwargs)
326325

327326
try:

‎backend/app/core/telemetry/tracing.py‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,6 @@ def setup_telemetry(service_name: str | None = None) -> None:
164164
except Exception:
165165
logger.exception("[setup_telemetry] Failed to instrument botocore")
166166

167-
logger.debug(
168-
"[setup_telemetry] OpenTelemetry initialized (service=%s, sink=Sentry)",
169-
service_name or settings.OTEL_SERVICE_NAME,
170-
)
171-
172167

173168
def flush_telemetry(timeout_millis: int = 10000) -> None:
174169
"""Force-flush OTel spans into Sentry, then flush Sentry's transport.
@@ -215,4 +210,3 @@ def instrument_app(app: FastAPI) -> None:
215210
excluded_urls=excluded_urls,
216211
exclude_spans=FASTAPI_EXCLUDED_SPANS,
217212
)
218-
logger.debug("[instrument_app] FastAPI instrumented with OpenTelemetry")

‎backend/app/services/llm/providers/google_aistudio.py‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,6 @@ def _execute_stt(
169169
else:
170170
merged_instruction = f"{lang_instruction}. {forced_transcription_text}"
171171

172-
logger.info(
173-
f"[GoogleAIProvider._execute_stt] Built instruction | instruction_len={len(merged_instruction)} | input_language={input_language} | output_language={output_language}"
174-
)
175-
176172
# Materialize the AudioRef to a temp file so the genai SDK can upload it.
177173
with resolved_input.to_path() as audio_path:
178174
gemini_file = self.client.files.upload(file=audio_path)

‎backend/app/tests/test_utils.py‎

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -427,26 +427,6 @@ class TestSendCallbackLogging:
427427
"metadata": {"job_id": "j1", "request_metadata": {"ref": "abc"}},
428428
}
429429

430-
@patch("app.utils.validate_callback_url")
431-
@patch("requests.Session")
432-
def test_success_logs_everything_except_user_data(
433-
self, mock_session_cls, mock_validate, caplog: pytest.LogCaptureFixture
434-
) -> None:
435-
mock_session = MagicMock()
436-
mock_session.post.return_value = MagicMock(status_code=200)
437-
mock_session_cls.return_value.__enter__.return_value = mock_session
438-
439-
with caplog.at_level("INFO", logger="app.utils"):
440-
assert send_callback("https://api.example.com/hook", self._payload)
441-
442-
line = next(
443-
r.getMessage() for r in caplog.records if "Callback sent" in r.getMessage()
444-
)
445-
assert "url=https://api.example.com/hook" in line
446-
assert "status=200" in line
447-
assert "'request_metadata': {'ref': 'abc'}" in line
448-
assert "model answer for the user" not in line
449-
450430
@patch("app.utils.validate_callback_url")
451431
@patch("requests.Session")
452432
def test_failure_logs_status_and_payload_without_user_data(

‎backend/app/utils.py‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -618,12 +618,6 @@ def send_callback(
618618
span.set_attribute("callback.response.status_code", response.status_code)
619619

620620
response.raise_for_status()
621-
622-
logger.info(
623-
f"[send_callback] Callback sent | url={callback_url} | status={response.status_code} "
624-
f"| duration_ms={(time.perf_counter() - started_at) * 1000:.2f} "
625-
f"| bytes={len(raw_body)} | payload={log_payload}"
626-
)
627621
return True
628622

629623
except requests.RequestException as e:

0 commit comments

Comments
 (0)