Skip to content

Commit 4b0b071

Browse files
authored
Merge pull request #321 from Scale3-Labs/obinna/S3EN-1111-update-self-host-notification
Update api error notification for self hosted setups
2 parents 7dc1930 + 8745187 commit 4b0b071

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/langtrace_python_sdk/extensions/langtrace_exporter.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,10 @@ def export(self, spans: typing.Sequence[ReadableSpan]) -> SpanExportResult:
140140
if not self.disable_logging:
141141
print(Fore.RED + "Failed to export spans.")
142142
print(Fore.RED + f"Error: {err}\r\n" + Fore.RESET)
143-
if "invalid api key" in str(err).lower():
143+
if (
144+
"invalid api key" in str(err).lower()
145+
and self.api_host == f"{LANGTRACE_REMOTE_URL}/api/trace"
146+
):
144147
print(
145148
Fore.YELLOW
146149
+ "If you're self-hosting Langtrace, make sure to do one of the following to configure your trace endpoint (e.g., http://localhost:3000/api/trace):"

0 commit comments

Comments
 (0)