langtrace-python-sdk 3.3.15__py3-none-any.whl → 3.3.17__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.
@@ -120,8 +120,6 @@ def patch_signature(operation_name, version, tracer):
120
120
  **get_extra_attributes(),
121
121
  }
122
122
 
123
- trace_checkpoint = os.environ.get("TRACE_DSPY_CHECKPOINT", "true").lower()
124
-
125
123
  if instance.__class__.__name__:
126
124
  span_attributes["dspy.signature.name"] = instance.__class__.__name__
127
125
  span_attributes["dspy.signature"] = str(instance.signature)
@@ -143,9 +141,6 @@ def patch_signature(operation_name, version, tracer):
143
141
  "dspy.signature.result",
144
142
  json.dumps(result.toDict()),
145
143
  )
146
- if trace_checkpoint == "true":
147
- print(Fore.RED + "Note: DSPy checkpoint tracing is enabled in Langtrace. To disable it, set the env var, TRACE_DSPY_CHECKPOINT to false" + Fore.RESET)
148
- set_span_attribute(span, "dspy.checkpoint", ujson.dumps(instance.dump_state(False), indent=2))
149
144
  span.set_status(Status(StatusCode.OK))
150
145
 
151
146
  span.end()
@@ -99,7 +99,9 @@ class LangtraceConfig:
99
99
  or os.environ.get("LANGTRACE_HEADERS")
100
100
  or os.environ.get("OTEL_EXPORTER_OTLP_HEADERS")
101
101
  )
102
- self.session_id = kwargs.get("session_id") or os.environ.get("LANGTRACE_SESSION_ID")
102
+ self.session_id = kwargs.get("session_id") or os.environ.get(
103
+ "LANGTRACE_SESSION_ID"
104
+ )
103
105
 
104
106
 
105
107
  def get_host(config: LangtraceConfig) -> str:
@@ -151,13 +153,22 @@ def get_headers(config: LangtraceConfig):
151
153
  return headers
152
154
 
153
155
 
156
+ def append_api_path(host: str):
157
+ if host == LANGTRACE_REMOTE_URL:
158
+ return f"{host}/api/trace"
159
+ if "localhost" in host:
160
+ return host
161
+ return f"{host}/v1/traces"
162
+
163
+
154
164
  def get_exporter(config: LangtraceConfig, host: str):
155
165
  if config.custom_remote_exporter:
156
166
  return config.custom_remote_exporter
157
167
 
158
168
  headers = get_headers(config)
159
- host = f"{host}/api/trace" if host == LANGTRACE_REMOTE_URL else host
160
- if "http" in host.lower() or "https" in host.lower():
169
+ exporter_protocol = os.environ.get("OTEL_EXPORTER_OTLP_PROTOCOL", "http")
170
+ if "http" in exporter_protocol.lower():
171
+ host = append_api_path(host)
161
172
  return HTTPExporter(endpoint=host, headers=headers)
162
173
  else:
163
174
  return GRPCExporter(endpoint=host, headers=headers)
@@ -1 +1 @@
1
- __version__ = "3.3.15"
1
+ __version__ = "3.3.17"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langtrace-python-sdk
3
- Version: 3.3.15
3
+ Version: 3.3.17
4
4
  Summary: Python SDK for LangTrace
5
5
  Project-URL: Homepage, https://github.com/Scale3-Labs/langtrace-python-sdk
6
6
  Author-email: Scale3 Labs <engineering@scale3labs.com>
@@ -108,8 +108,8 @@ examples/vertexai_example/main.py,sha256=gndId5X5ksD-ycxnAWMdEqIDbLc3kz5Vt8vm4YP
108
108
  examples/weaviate_example/__init__.py,sha256=8JMDBsRSEV10HfTd-YC7xb4txBjD3la56snk-Bbg2Kw,618
109
109
  examples/weaviate_example/query_text.py,sha256=wPHQTc_58kPoKTZMygVjTj-2ZcdrIuaausJfMxNQnQc,127162
110
110
  langtrace_python_sdk/__init__.py,sha256=VZM6i71NR7pBQK6XvJWRelknuTYUhqwqE7PlicKa5Wg,1166
111
- langtrace_python_sdk/langtrace.py,sha256=nPgasFrKrj3Y1UNlKF7VWvnTOGpiHLYcS0M1l8Qidww,12915
112
- langtrace_python_sdk/version.py,sha256=r9C31t3a0_mD9OGfNgqKJdVzFL5wn2Kmbe86L6ql4bI,23
111
+ langtrace_python_sdk/langtrace.py,sha256=Jbrmf3c8WwCb75fPU7Pp38EbgVPp6MxNlTL1DIwD00k,13150
112
+ langtrace_python_sdk/version.py,sha256=XsZO_FxCrBTe748Sk8qc957jJGKzbb_MCEA7H8yz2-I,23
113
113
  langtrace_python_sdk/constants/__init__.py,sha256=3CNYkWMdd1DrkGqzLUgNZXjdAlM6UFMlf_F-odAToyc,146
114
114
  langtrace_python_sdk/constants/exporter/langtrace_exporter.py,sha256=EVCrouYCpY98f0KSaKr4PzNxPULTZZO6dSA_crEOyJU,106
115
115
  langtrace_python_sdk/constants/instrumentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -159,7 +159,7 @@ langtrace_python_sdk/instrumentation/crewai/instrumentation.py,sha256=5Umzq8zjEn
159
159
  langtrace_python_sdk/instrumentation/crewai/patch.py,sha256=VoyOtGKYzaOIu7UnVNTemZeB3LrCIodrrYwmXLdxRw8,9133
160
160
  langtrace_python_sdk/instrumentation/dspy/__init__.py,sha256=tM1srfi_QgyCzrde4izojMrRq2Wm7Dj5QUvVQXIJzkk,84
161
161
  langtrace_python_sdk/instrumentation/dspy/instrumentation.py,sha256=qx2vBeuODI7rubf-0bkuNzDWu4bLI-E5uabrWTEuH6k,2923
162
- langtrace_python_sdk/instrumentation/dspy/patch.py,sha256=Qi8kbrf4AgWRE4b1S44JKl6wsdFSHu3PCz7wzB8gaDk,10502
162
+ langtrace_python_sdk/instrumentation/dspy/patch.py,sha256=BpesWxlNJAibzu06xNU9mSH82Ufw5h3p5jxM5d3QXqE,10073
163
163
  langtrace_python_sdk/instrumentation/embedchain/__init__.py,sha256=5L6n8-brMnRWZ0CMmHEuN1mrhIxrYLNtxRy0Ujc-hOY,103
164
164
  langtrace_python_sdk/instrumentation/embedchain/instrumentation.py,sha256=dShwm0duy25IvL7g9I_v-2oYuyh2fadeiJqXtXBay-8,1987
165
165
  langtrace_python_sdk/instrumentation/embedchain/patch.py,sha256=ovvBrtqUDwGSmSgK_S3pOOrDa4gkPSFG-HvmsxqmJE8,3627
@@ -270,8 +270,8 @@ tests/pinecone/cassettes/test_query.yaml,sha256=b5v9G3ssUy00oG63PlFUR3JErF2Js-5A
270
270
  tests/pinecone/cassettes/test_upsert.yaml,sha256=neWmQ1v3d03V8WoLl8FoFeeCYImb8pxlJBWnFd_lITU,38607
271
271
  tests/qdrant/conftest.py,sha256=9n0uHxxIjWk9fbYc4bx-uP8lSAgLBVx-cV9UjnsyCHM,381
272
272
  tests/qdrant/test_qdrant.py,sha256=pzjAjVY2kmsmGfrI2Gs2xrolfuaNHz7l1fqGQCjp5_o,3353
273
- langtrace_python_sdk-3.3.15.dist-info/METADATA,sha256=vKzB_DzXhTjtfj2LWvBbaEdyhTKa8ECnzEn8YxqgOLY,15676
274
- langtrace_python_sdk-3.3.15.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
275
- langtrace_python_sdk-3.3.15.dist-info/entry_points.txt,sha256=1_b9-qvf2fE7uQNZcbUei9vLpFZBbbh9LrtGw95ssAo,70
276
- langtrace_python_sdk-3.3.15.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
277
- langtrace_python_sdk-3.3.15.dist-info/RECORD,,
273
+ langtrace_python_sdk-3.3.17.dist-info/METADATA,sha256=CQZSp7-_M2whPPPbtgOJ7VVIaGNRWIthKJobbXKQr_k,15676
274
+ langtrace_python_sdk-3.3.17.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
275
+ langtrace_python_sdk-3.3.17.dist-info/entry_points.txt,sha256=1_b9-qvf2fE7uQNZcbUei9vLpFZBbbh9LrtGw95ssAo,70
276
+ langtrace_python_sdk-3.3.17.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
277
+ langtrace_python_sdk-3.3.17.dist-info/RECORD,,