aiqa-client 0.1.5__tar.gz → 0.1.6__tar.gz
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.
- {aiqa_client-0.1.5/aiqa_client.egg-info → aiqa_client-0.1.6}/PKG-INFO +1 -1
- {aiqa_client-0.1.5 → aiqa_client-0.1.6}/aiqa/__init__.py +1 -1
- {aiqa_client-0.1.5 → aiqa_client-0.1.6}/aiqa/tracing.py +18 -0
- {aiqa_client-0.1.5 → aiqa_client-0.1.6/aiqa_client.egg-info}/PKG-INFO +1 -1
- {aiqa_client-0.1.5 → aiqa_client-0.1.6}/pyproject.toml +1 -1
- {aiqa_client-0.1.5 → aiqa_client-0.1.6}/LICENSE +0 -0
- {aiqa_client-0.1.5 → aiqa_client-0.1.6}/MANIFEST.in +0 -0
- {aiqa_client-0.1.5 → aiqa_client-0.1.6}/README.md +0 -0
- {aiqa_client-0.1.5 → aiqa_client-0.1.6}/aiqa/aiqa_exporter.py +0 -0
- {aiqa_client-0.1.5 → aiqa_client-0.1.6}/aiqa/py.typed +0 -0
- {aiqa_client-0.1.5 → aiqa_client-0.1.6}/aiqa_client.egg-info/SOURCES.txt +0 -0
- {aiqa_client-0.1.5 → aiqa_client-0.1.6}/aiqa_client.egg-info/dependency_links.txt +0 -0
- {aiqa_client-0.1.5 → aiqa_client-0.1.6}/aiqa_client.egg-info/requires.txt +0 -0
- {aiqa_client-0.1.5 → aiqa_client-0.1.6}/aiqa_client.egg-info/top_level.txt +0 -0
- {aiqa_client-0.1.5 → aiqa_client-0.1.6}/setup.cfg +0 -0
- {aiqa_client-0.1.5 → aiqa_client-0.1.6}/setup.py +0 -0
|
@@ -189,6 +189,13 @@ def WithTracing(
|
|
|
189
189
|
|
|
190
190
|
# Use start_as_current_span to ensure span is recorded by BatchSpanProcessor
|
|
191
191
|
with tracer.start_as_current_span(fn_name) as span:
|
|
192
|
+
# Check if span is recording - if not, spans won't be exported
|
|
193
|
+
if not span.is_recording():
|
|
194
|
+
logger.warning(f"Span {fn_name} is not recording - will not be exported")
|
|
195
|
+
return await fn(*args, **kwargs)
|
|
196
|
+
|
|
197
|
+
logger.debug(f"Span {fn_name} is recording, trace_id={format(span.get_span_context().trace_id, '032x')}")
|
|
198
|
+
|
|
192
199
|
if input_data is not None:
|
|
193
200
|
# Serialize for span attributes (OpenTelemetry only accepts primitives or JSON strings)
|
|
194
201
|
serialized_input = _serialize_for_span(input_data)
|
|
@@ -215,12 +222,16 @@ def WithTracing(
|
|
|
215
222
|
span.set_attribute("output", _serialize_for_span(output_data))
|
|
216
223
|
span.set_status(Status(StatusCode.OK))
|
|
217
224
|
|
|
225
|
+
logger.debug(f"Span {fn_name} completed successfully, is_recording={span.is_recording()}")
|
|
218
226
|
return result
|
|
219
227
|
except Exception as exception:
|
|
220
228
|
error = exception if isinstance(exception, Exception) else Exception(str(exception))
|
|
221
229
|
span.record_exception(error)
|
|
222
230
|
span.set_status(Status(StatusCode.ERROR, str(error)))
|
|
223
231
|
raise
|
|
232
|
+
finally:
|
|
233
|
+
# Log when span context exits - span should be ended automatically by context manager
|
|
234
|
+
logger.debug(f"Span {fn_name} context exiting, is_recording={span.is_recording()}")
|
|
224
235
|
|
|
225
236
|
async_traced_fn._is_traced = True
|
|
226
237
|
logger.debug(f"Function {fn_name} is now traced (async)")
|
|
@@ -239,6 +250,13 @@ def WithTracing(
|
|
|
239
250
|
|
|
240
251
|
# Use start_as_current_span to ensure span is recorded by BatchSpanProcessor
|
|
241
252
|
with tracer.start_as_current_span(fn_name) as span:
|
|
253
|
+
# Check if span is recording - if not, spans won't be exported
|
|
254
|
+
if not span.is_recording():
|
|
255
|
+
logger.warning(f"Span {fn_name} is not recording - will not be exported")
|
|
256
|
+
return fn(*args, **kwargs)
|
|
257
|
+
|
|
258
|
+
logger.debug(f"Span {fn_name} is recording, trace_id={format(span.get_span_context().trace_id, '032x')}")
|
|
259
|
+
|
|
242
260
|
if input_data is not None:
|
|
243
261
|
# Serialize for span attributes (OpenTelemetry only accepts primitives or JSON strings)
|
|
244
262
|
serialized_input = _serialize_for_span(input_data)
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "aiqa-client"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.6"
|
|
8
8
|
description = "OpenTelemetry-based Python client for tracing functions and sending traces to the AIQA server"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.8"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|