netra-sdk 0.1.13__tar.gz → 0.1.14__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.
Potentially problematic release.
This version of netra-sdk might be problematic. Click here for more details.
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/PKG-INFO +2 -2
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/README.md +1 -1
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/span_wrapper.py +17 -1
- netra_sdk-0.1.14/netra/version.py +2 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/pyproject.toml +1 -1
- netra_sdk-0.1.13/netra/version.py +0 -2
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/LICENCE +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/__init__.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/anonymizer/__init__.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/anonymizer/anonymizer.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/anonymizer/base.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/anonymizer/fp_anonymizer.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/config.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/decorators.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/exceptions/__init__.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/exceptions/injection.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/exceptions/pii.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/input_scanner.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/instrumentation/__init__.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/instrumentation/aiohttp/__init__.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/instrumentation/aiohttp/version.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/instrumentation/cohere/__init__.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/instrumentation/cohere/version.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/instrumentation/fastapi/__init__.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/instrumentation/fastapi/version.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/instrumentation/google_genai/__init__.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/instrumentation/google_genai/config.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/instrumentation/google_genai/utils.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/instrumentation/google_genai/version.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/instrumentation/httpx/__init__.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/instrumentation/httpx/version.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/instrumentation/instruments.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/instrumentation/mistralai/__init__.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/instrumentation/mistralai/config.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/instrumentation/mistralai/utils.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/instrumentation/mistralai/version.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/instrumentation/openai/__init__.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/instrumentation/openai/version.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/instrumentation/openai/wrappers.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/instrumentation/weaviate/__init__.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/instrumentation/weaviate/version.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/pii.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/processors/__init__.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/processors/session_span_processor.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/scanner.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/session_manager.py +0 -0
- {netra_sdk-0.1.13 → netra_sdk-0.1.14}/netra/tracer.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: netra-sdk
|
|
3
|
-
Version: 0.1.
|
|
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
|
|
@@ -406,7 +406,7 @@ Action tracking follows this schema:
|
|
|
406
406
|
```python
|
|
407
407
|
[
|
|
408
408
|
{
|
|
409
|
-
"start_time": str, # Start time of the action
|
|
409
|
+
"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)
|
|
410
410
|
"action": str, # Type of action (e.g., "DB", "API", "CACHE")
|
|
411
411
|
"action_type": str, # Action subtype (e.g., "INSERT", "SELECT", "CALL")
|
|
412
412
|
"affected_records": [ # Optional: List of records affected
|
|
@@ -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
|
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "netra-sdk"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.14"
|
|
8
8
|
description = "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."
|
|
9
9
|
authors = [
|
|
10
10
|
{name = "Sooraj Thomas",email = "sooraj@keyvalue.systems"}
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|