Skip to content

Commit 00370f5

Browse files
authored
Release 3.8.14 (#526)
* add project details * cleanup
1 parent 3cebd5d commit 00370f5

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

src/langtrace_python_sdk/langtrace.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,30 @@ def add_span_processor(provider: TracerProvider, config: LangtraceConfig, export
205205
)
206206
else:
207207
provider.add_span_processor(BatchSpanProcessor(exporter))
208-
print(Fore.BLUE + "Exporting spans to Langtrace cloud.." + Fore.RESET)
208+
project = get_project(config)
209+
if project:
210+
print(Fore.BLUE + f"Exporting spans to {project['name']}.." + Fore.RESET)
211+
print(
212+
Fore.BLUE
213+
+ f"Langtrace Project URL: {LANGTRACE_REMOTE_URL}/project/{project['id']}/traces"
214+
+ Fore.RESET
215+
)
216+
else:
217+
print(Fore.BLUE + "Exporting spans to Langtrace cloud.." + Fore.RESET)
218+
219+
220+
def get_project(config: LangtraceConfig):
221+
import requests
222+
223+
try:
224+
225+
response = requests.get(
226+
f"{LANGTRACE_REMOTE_URL}/api/project",
227+
headers={"x-api-key": config.api_key},
228+
)
229+
return response.json()["project"]
230+
except Exception as error:
231+
return None
209232

210233

211234
def init_sentry(config: LangtraceConfig, host: str):
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "3.8.13"
1+
__version__ = "3.8.14"

0 commit comments

Comments
 (0)