langtrace-python-sdk 1.1.28__py3-none-any.whl → 1.1.29__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,8 +3,8 @@ import os
3
3
  import typing
4
4
 
5
5
  import requests
6
- from opentelemetry.sdk.trace.export import ReadableSpan, SpanExporter, SpanExportResult
7
-
6
+ from opentelemetry.sdk.trace.export import (ReadableSpan, SpanExporter,
7
+ SpanExportResult)
8
8
  from opentelemetry.trace.span import format_trace_id
9
9
 
10
10
 
@@ -81,7 +81,6 @@ class LangTraceExporter(SpanExporter):
81
81
  "droppedAttributesCount": span.dropped_attributes,
82
82
  "droppedLinksCount": span.dropped_links,
83
83
  "ended": span.status.is_ok,
84
- "duration": span.end_time - span.start_time,
85
84
  **json.loads(span.to_json()),
86
85
  }
87
86
  for span in spans
@@ -97,7 +96,7 @@ class LangTraceExporter(SpanExporter):
97
96
  data=json.dumps(data),
98
97
  headers={"Content-Type": "application/json", "x-api-key": self.api_key},
99
98
  )
100
- print(f"Sent To {self.url} with Body {data} ")
99
+ print(f"Traces sent To {self.url}")
101
100
  return SpanExportResult.SUCCESS
102
101
  except Exception as e:
103
102
  print("Error sending data to remote URL", e)
@@ -35,29 +35,29 @@ from langtrace_python_sdk.instrumentation.pinecone.instrumentation import (
35
35
 
36
36
  def init(
37
37
  api_key: str = None,
38
- remote_url: str = None,
39
38
  batch: bool = True,
40
- log_spans_to_console: bool = False,
41
- write_to_remote_url: bool = True,
42
- custom_exporter = None
39
+ write_to_langtrace_cloud: bool = True,
40
+ remote_url: str = None,
41
+ debug_log_to_console: bool = False,
42
+ custom_remote_exporter = None
43
43
  ):
44
44
 
45
45
  provider = TracerProvider()
46
46
 
47
- remote_write_exporter = LangTraceExporter(api_key, remote_url, write_to_remote_url) if custom_exporter is None else custom_exporter
47
+ remote_write_exporter = LangTraceExporter(api_key, remote_url, write_to_langtrace_cloud) if custom_remote_exporter is None else custom_remote_exporter
48
48
  console_exporter = ConsoleSpanExporter()
49
49
  batch_processor_remote = BatchSpanProcessor(remote_write_exporter)
50
50
  simple_processor_remote = SimpleSpanProcessor(remote_write_exporter)
51
51
  batch_processor_console = BatchSpanProcessor(console_exporter)
52
52
  simple_processor_console = SimpleSpanProcessor(console_exporter)
53
53
 
54
- if log_spans_to_console:
54
+ if debug_log_to_console:
55
55
  if batch:
56
56
  provider.add_span_processor(batch_processor_console)
57
57
  else:
58
58
  provider.add_span_processor(simple_processor_console)
59
59
 
60
- if write_to_remote_url:
60
+ if write_to_langtrace_cloud:
61
61
  if batch:
62
62
  provider.add_span_processor(batch_processor_remote)
63
63
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: langtrace-python-sdk
3
- Version: 1.1.28
3
+ Version: 1.1.29
4
4
  Summary: Python SDK for LangTrace
5
5
  Home-page: https://github.com/Scale3-Labs/langtrace-python-sdk
6
6
  Author: Scale3 Labs
@@ -16,7 +16,7 @@ examples/openai/images_generate.py,sha256=ZioxTuHKE_yYlhpESqXKVzdkiwdegkmLVB7N8T
16
16
  examples/pinecone_example/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  examples/pinecone_example/basic.py,sha256=8Tpf0hYMgJdjVpISu15BW7IpjrnwZXrBuCGoC9xE7Fg,927
18
18
  langtrace_python_sdk/__init__.py,sha256=SlHg447-nQBbw8exRNJP_OyHUZ39Sldb7aaQ35hIRm8,262
19
- langtrace_python_sdk/langtrace.py,sha256=0fGFqYpu8LwYynHUhnoryv-j5y6T6Ap08CE_MucSltg,3215
19
+ langtrace_python_sdk/langtrace.py,sha256=XS4lhorNLPgsdKB2hTFsHR31_kUgr9cHZTc4dLgJs_g,3251
20
20
  langtrace_python_sdk/constants/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
21
  langtrace_python_sdk/constants/instrumentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  langtrace_python_sdk/constants/instrumentation/anthropic.py,sha256=YX3llt3zwDY6XrYk3CB8WEVqgrzRXEw_ffyk56JoF3k,126
@@ -25,7 +25,7 @@ langtrace_python_sdk/constants/instrumentation/common.py,sha256=6sy6Am2sd-yJ-3ZI
25
25
  langtrace_python_sdk/constants/instrumentation/openai.py,sha256=9VF6ic9Ed3bpSvdp6iNmrpx2Ppo6DPav3hoUcqSQSv0,1048
26
26
  langtrace_python_sdk/constants/instrumentation/pinecone.py,sha256=Xaqqw-xBO0JJLGk75hiCUQGztNm0HiVaLQvjtYK7VJM,472
27
27
  langtrace_python_sdk/extensions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
- langtrace_python_sdk/extensions/langtrace_exporter.py,sha256=HEi11k6u4JAE5NNNYojzQutleIOMGEIvMwibXi9GvRc,4347
28
+ langtrace_python_sdk/extensions/langtrace_exporter.py,sha256=6dMS0MjYCmZbuj3CMb94JarR3DYmiHLeN81hXbPsKOA,4320
29
29
  langtrace_python_sdk/instrumentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
30
  langtrace_python_sdk/instrumentation/anthropic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
31
  langtrace_python_sdk/instrumentation/anthropic/instrumentation.py,sha256=1shNkDE7Yb-JFVlEZHMcDbJ6zW8SkSFdxf_yFo9wTNA,1101
@@ -54,8 +54,8 @@ langtrace_python_sdk/instrumentation/pinecone/patch.py,sha256=uDKUBjyOVCDL44YxXV
54
54
  langtrace_python_sdk/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
55
55
  langtrace_python_sdk/utils/llm.py,sha256=4z2e-md_ELXCEuOIRVWracR6qH2pmsOxCqpkuF9_3Nw,1589
56
56
  langtrace_python_sdk/utils/with_root_span.py,sha256=LgFVwHq7KZ6sj2d783NZXr2fFWqI1rqVWSjJR68Ad1E,1044
57
- langtrace_python_sdk-1.1.28.dist-info/LICENSE,sha256=VD-pauwiiia-Xi2zgKvalKRIFSJJjqRCQw6aIpK2T9U,33892
58
- langtrace_python_sdk-1.1.28.dist-info/METADATA,sha256=PkHouxm-IdliOfiITht2J_H5Hqa96gMFuHek6n9XwW0,8131
59
- langtrace_python_sdk-1.1.28.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
60
- langtrace_python_sdk-1.1.28.dist-info/top_level.txt,sha256=rwET8cHATJvDBti7Dm6pwWIrNAT8DvqCXgRPWdu7_Hs,30
61
- langtrace_python_sdk-1.1.28.dist-info/RECORD,,
57
+ langtrace_python_sdk-1.1.29.dist-info/LICENSE,sha256=VD-pauwiiia-Xi2zgKvalKRIFSJJjqRCQw6aIpK2T9U,33892
58
+ langtrace_python_sdk-1.1.29.dist-info/METADATA,sha256=bOrPWAachBC1rAkDeUd6XSSI5UmpinEqe5-3wTAVhpk,8131
59
+ langtrace_python_sdk-1.1.29.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
60
+ langtrace_python_sdk-1.1.29.dist-info/top_level.txt,sha256=rwET8cHATJvDBti7Dm6pwWIrNAT8DvqCXgRPWdu7_Hs,30
61
+ langtrace_python_sdk-1.1.29.dist-info/RECORD,,