Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion src/langtrace_python_sdk/langtrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,30 @@ def add_span_processor(provider: TracerProvider, config: LangtraceConfig, export
)
else:
provider.add_span_processor(BatchSpanProcessor(exporter))
print(Fore.BLUE + "Exporting spans to Langtrace cloud.." + Fore.RESET)
project = get_project(config)
if project:
print(Fore.BLUE + f"Exporting spans to {project['name']}.." + Fore.RESET)
print(
Fore.BLUE
+ f"Langtrace Project URL: {LANGTRACE_REMOTE_URL}/project/{project['id']}/traces"
+ Fore.RESET
)
else:
print(Fore.BLUE + "Exporting spans to Langtrace cloud.." + Fore.RESET)


def get_project(config: LangtraceConfig):
import requests

try:

response = requests.get(
f"{LANGTRACE_REMOTE_URL}/api/project",
headers={"x-api-key": config.api_key},
)
return response.json()["project"]
except Exception as error:
return None


def init_sentry(config: LangtraceConfig, host: str):
Expand Down
2 changes: 1 addition & 1 deletion src/langtrace_python_sdk/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "3.8.13"
__version__ = "3.8.14"
Loading