netra-sdk 0.1.13__py3-none-any.whl → 0.1.14__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.

Potentially problematic release.


This version of netra-sdk might be problematic. Click here for more details.

netra/span_wrapper.py CHANGED
@@ -1,5 +1,6 @@
1
1
  import json
2
2
  import logging
3
+ import re
3
4
  import time
4
5
  from datetime import datetime, timezone
5
6
  from typing import Any, Dict, List, Literal, Optional
@@ -8,7 +9,7 @@ from opentelemetry import context as context_api
8
9
  from opentelemetry import trace
9
10
  from opentelemetry.trace import SpanKind, Status, StatusCode
10
11
  from opentelemetry.trace.propagation import set_span_in_context
11
- from pydantic import BaseModel
12
+ from pydantic import BaseModel, field_validator
12
13
 
13
14
  from netra.config import Config
14
15
 
@@ -25,6 +26,21 @@ class ActionModel(BaseModel): # type: ignore[misc]
25
26
  affected_records: Optional[List[Dict[str, str]]] = None
26
27
  metadata: Optional[Dict[str, str]] = None
27
28
 
29
+ @field_validator("start_time") # type: ignore[misc]
30
+ @classmethod
31
+ def validate_time_format(cls, value: str) -> str:
32
+ """Validate that start_time is in ISO 8601 format with microseconds and Z suffix."""
33
+ # Pattern for ISO 8601 with microseconds: YYYY-MM-DDTHH:MM:SS.ffffffZ
34
+ pattern = r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{6}Z$"
35
+
36
+ if not re.match(pattern, value):
37
+ raise ValueError(
38
+ f"start_time must be in ISO 8601 format with microseconds: "
39
+ f"YYYY-MM-DDTHH:MM:SS.ffffffZ (e.g., 2025-07-18T14:30:45.123456Z). "
40
+ f"Got: {value}"
41
+ )
42
+ return value
43
+
28
44
 
29
45
  class UsageModel(BaseModel): # type: ignore[misc]
30
46
  model: str
netra/version.py CHANGED
@@ -1,2 +1,2 @@
1
- __version__ = "0.1.13"
1
+ __version__ = "0.1.14"
2
2
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: netra-sdk
3
- Version: 0.1.13
3
+ Version: 0.1.14
4
4
  Summary: A Python SDK for AI application observability that provides OpenTelemetry-based monitoring, tracing, and PII protection for LLM and vector database applications. Enables easy instrumentation, session tracking, and privacy-focused data collection for AI systems in production environments.
5
5
  License: Apache-2.0
6
6
  Keywords: netra,tracing,observability,sdk,ai,llm,vector,database
@@ -482,7 +482,7 @@ Action tracking follows this schema:
482
482
  ```python
483
483
  [
484
484
  {
485
- "start_time": str, # Start time of the action
485
+ "start_time": str, # Start time of the action in ISO 8601 format with microseconds and Z suffix (e.g., 2025-07-18T14:30:45.123456Z)
486
486
  "action": str, # Type of action (e.g., "DB", "API", "CACHE")
487
487
  "action_type": str, # Action subtype (e.g., "INSERT", "SELECT", "CALL")
488
488
  "affected_records": [ # Optional: List of records affected
@@ -37,10 +37,10 @@ netra/processors/__init__.py,sha256=wfnSskRBtMT90hO7LqFJoEW374LgoH_gnTxhynqtByI,
37
37
  netra/processors/session_span_processor.py,sha256=qcsBl-LnILWefsftI8NQhXDGb94OWPc8LvzhVA0JS_c,2432
38
38
  netra/scanner.py,sha256=wqjMZnEbVvrGMiUSI352grUyHpkk94oBfHfMiXPhpGU,3866
39
39
  netra/session_manager.py,sha256=EVcnWcSj4NdkH--HmqHx0mmzivQiM4GCyFLu6lwi33M,6252
40
- netra/span_wrapper.py,sha256=BJvWMJWYX95NRMj9Yjs6ZL3BY6c5v1VGVN9i88VfewQ,7409
40
+ netra/span_wrapper.py,sha256=DA5jjXkHBUJ8_mdlYP06rcZzFoSih4gdP71Wwr3btcQ,8104
41
41
  netra/tracer.py,sha256=In5QPVLz_6BxrolWpav9EuR9_hirD2UUIlyY75QUaKk,3450
42
- netra/version.py,sha256=PBhf_BIMfa1fmMCOO5V1SBLORGuuPOjZ5FtpjeZKVI4,24
43
- netra_sdk-0.1.13.dist-info/LICENCE,sha256=8B_UoZ-BAl0AqiHAHUETCgd3I2B9yYJ1WEQtVb_qFMA,11359
44
- netra_sdk-0.1.13.dist-info/METADATA,sha256=ZTfWpwu5b22-e_OCrRaTWut7CayCEtGNE6O0hKQFbNM,25266
45
- netra_sdk-0.1.13.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
46
- netra_sdk-0.1.13.dist-info/RECORD,,
42
+ netra/version.py,sha256=jWhoaiqtmxly5b1ZP9juafB_mr8j6AqYYdb_s5yLMwY,24
43
+ netra_sdk-0.1.14.dist-info/LICENCE,sha256=8B_UoZ-BAl0AqiHAHUETCgd3I2B9yYJ1WEQtVb_qFMA,11359
44
+ netra_sdk-0.1.14.dist-info/METADATA,sha256=ZoaTS9-wFXgJQp9EbgDoWkpJMnGRvg2T3pioYL0m0fE,25352
45
+ netra_sdk-0.1.14.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
46
+ netra_sdk-0.1.14.dist-info/RECORD,,