Skip to content

Commit ef6ebf0

Browse files
committed
fix
1 parent 6102e87 commit ef6ebf0

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

sentience/cloud_tracing.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ def _do_upload(self, on_progress: Callable[[int, int], None] | None = None) -> N
226226

227227
if response.status_code == 200:
228228
self._upload_successful = True
229+
print("✅ [Sentience] Trace uploaded successfully")
229230
if self.logger:
230231
self.logger.info("Trace uploaded successfully")
231232

@@ -247,17 +248,20 @@ def _do_upload(self, on_progress: Callable[[int, int], None] | None = None) -> N
247248
cleaned_trace_path.unlink()
248249
else:
249250
self._upload_successful = False
251+
print(f"❌ [Sentience] Upload failed: HTTP {response.status_code}")
252+
print(f" Response: {response.text[:200]}")
253+
print(f" Local trace preserved at: {self._path}")
250254
if self.logger:
251255
self.logger.error(
252256
f"Upload failed: HTTP {response.status_code}, Response: {response.text[:200]}"
253257
)
254-
# Don't print - rely on logger or silent failure
255258

256259
except Exception as e:
257260
self._upload_successful = False
261+
print(f"❌ [Sentience] Error uploading trace: {e}")
262+
print(f" Local trace preserved at: {self._path}")
258263
if self.logger:
259264
self.logger.error(f"Error uploading trace: {e}")
260-
# Don't print - rely on logger or silent failure
261265
# Don't raise - preserve trace locally even if upload fails
262266

263267
def _generate_index(self) -> None:
@@ -268,6 +272,7 @@ def _generate_index(self) -> None:
268272
write_trace_index(str(self._path))
269273
except Exception as e:
270274
# Non-fatal: log but don't crash
275+
print(f"⚠️ Failed to generate trace index: {e}")
271276
if self.logger:
272277
self.logger.warning(f"Failed to generate trace index: {e}")
273278

sentience/tracer_factory.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,25 +74,19 @@ def create_tracer(
7474
if api_key and upload_trace:
7575
try:
7676
# Request pre-signed upload URL from backend
77-
print(f"🔗 [Sentience] Attempting to initialize cloud tracing...")
78-
print(f" API URL: {api_url}/v1/traces/init")
79-
print(f" Run ID: {run_id}")
80-
8177
response = requests.post(
8278
f"{api_url}/v1/traces/init",
8379
headers={"Authorization": f"Bearer {api_key}"},
8480
json={"run_id": run_id},
8581
timeout=10,
8682
)
8783

88-
print(f" Response Status: HTTP {response.status_code}")
89-
9084
if response.status_code == 200:
9185
data = response.json()
9286
upload_url = data.get("upload_url")
9387

9488
if upload_url:
95-
print("☁️ [Sentience] Cloud tracing enabled")
89+
print("☁️ [Sentience] Cloud tracing enabled (Pro tier)")
9690
return Tracer(
9791
run_id=run_id,
9892
sink=CloudTraceSink(
@@ -109,8 +103,7 @@ def create_tracer(
109103
print(" Falling back to local-only tracing")
110104

111105
elif response.status_code == 403:
112-
print("⚠️ [Sentience] Cloud tracing requires Pro/Enterprise tier")
113-
print(" Your account tier may not support cloud tracing")
106+
print("⚠️ [Sentience] Cloud tracing requires Pro tier")
114107
try:
115108
error_data = response.json()
116109
error_msg = error_data.get("error") or error_data.get("message", "")

0 commit comments

Comments
 (0)