netra-sdk 0.1.1__tar.gz → 0.1.3__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.

Files changed (43) hide show
  1. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/PKG-INFO +1 -5
  2. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/README.md +0 -1
  3. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/instrumentation/__init__.py +3 -61
  4. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/instrumentation/instruments.py +0 -4
  5. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/pii.py +0 -12
  6. netra_sdk-0.1.3/netra/version.py +1 -0
  7. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/pyproject.toml +1 -4
  8. netra_sdk-0.1.1/netra/version.py +0 -1
  9. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/LICENCE +0 -0
  10. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/__init__.py +0 -0
  11. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/anonymizer/__init__.py +0 -0
  12. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/anonymizer/anonymizer.py +0 -0
  13. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/anonymizer/base.py +0 -0
  14. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/anonymizer/fp_anonymizer.py +0 -0
  15. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/config.py +0 -0
  16. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/decorators.py +0 -0
  17. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/exceptions/__init__.py +0 -0
  18. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/exceptions/injection.py +0 -0
  19. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/exceptions/pii.py +0 -0
  20. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/input_scanner.py +0 -0
  21. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/instrumentation/aiohttp/__init__.py +0 -0
  22. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/instrumentation/aiohttp/version.py +0 -0
  23. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/instrumentation/cohere/__init__.py +0 -0
  24. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/instrumentation/cohere/version.py +0 -0
  25. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/instrumentation/google_genai/__init__.py +0 -0
  26. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/instrumentation/google_genai/config.py +0 -0
  27. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/instrumentation/google_genai/utils.py +0 -0
  28. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/instrumentation/google_genai/version.py +0 -0
  29. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/instrumentation/httpx/__init__.py +0 -0
  30. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/instrumentation/httpx/version.py +0 -0
  31. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/instrumentation/mistralai/__init__.py +0 -0
  32. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/instrumentation/mistralai/config.py +0 -0
  33. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/instrumentation/mistralai/utils.py +0 -0
  34. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/instrumentation/mistralai/version.py +0 -0
  35. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/instrumentation/weaviate/__init__.py +0 -0
  36. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/instrumentation/weaviate/version.py +0 -0
  37. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/processors/__init__.py +0 -0
  38. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/processors/session_span_processor.py +0 -0
  39. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/processors/span_aggregation_processor.py +0 -0
  40. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/scanner.py +0 -0
  41. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/session.py +0 -0
  42. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/session_manager.py +0 -0
  43. {netra_sdk-0.1.1 → netra_sdk-0.1.3}/netra/tracer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: netra-sdk
3
- Version: 0.1.1
3
+ Version: 0.1.3
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
@@ -22,14 +22,12 @@ Requires-Dist: llm-guard (>=0.3.16,<0.4.0) ; extra == "llm-guard"
22
22
  Requires-Dist: opentelemetry-api (>=1.34.0,<2.0.0)
23
23
  Requires-Dist: opentelemetry-instrumentation-aio-pika (>=0.55b1,<1.0.0)
24
24
  Requires-Dist: opentelemetry-instrumentation-aiohttp-client (>=0.55b1,<1.0.0)
25
- Requires-Dist: opentelemetry-instrumentation-aiohttp-server (>=0.55b1,<1.0.0)
26
25
  Requires-Dist: opentelemetry-instrumentation-aiokafka (>=0.55b1,<1.0.0)
27
26
  Requires-Dist: opentelemetry-instrumentation-aiopg (>=0.55b1,<1.0.0)
28
27
  Requires-Dist: opentelemetry-instrumentation-asyncclick (>=0.55b1,<1.0.0)
29
28
  Requires-Dist: opentelemetry-instrumentation-asyncio (>=0.55b1,<1.0.0)
30
29
  Requires-Dist: opentelemetry-instrumentation-asyncpg (>=0.55b1,<1.0.0)
31
30
  Requires-Dist: opentelemetry-instrumentation-aws-lambda (>=0.55b1,<1.0.0)
32
- Requires-Dist: opentelemetry-instrumentation-boto (>=0.55b1,<1.0.0)
33
31
  Requires-Dist: opentelemetry-instrumentation-boto3sqs (>=0.55b1,<1.0.0)
34
32
  Requires-Dist: opentelemetry-instrumentation-botocore (>=0.55b1,<1.0.0)
35
33
  Requires-Dist: opentelemetry-instrumentation-cassandra (>=0.55b1,<1.0.0)
@@ -55,7 +53,6 @@ Requires-Dist: opentelemetry-instrumentation-pymemcache (>=0.55b1,<1.0.0)
55
53
  Requires-Dist: opentelemetry-instrumentation-pymongo (>=0.55b1,<1.0.0)
56
54
  Requires-Dist: opentelemetry-instrumentation-pymssql (>=0.55b1,<1.0.0)
57
55
  Requires-Dist: opentelemetry-instrumentation-pymysql (>=0.55b1,<1.0.0)
58
- Requires-Dist: opentelemetry-instrumentation-pyramid (>=0.55b1,<1.0.0)
59
56
  Requires-Dist: opentelemetry-instrumentation-redis (>=0.55b1,<1.0.0)
60
57
  Requires-Dist: opentelemetry-instrumentation-remoulade (>=0.55b1,<1.0.0)
61
58
  Requires-Dist: opentelemetry-instrumentation-requests (>=0.55b1,<1.0.0)
@@ -228,7 +225,6 @@ class CustomerSupportAgent:
228
225
  - **Django** - High-level Python web framework
229
226
  - **Flask** - Lightweight WSGI web application framework
230
227
  - **Falcon** - High-performance Python web framework
231
- - **Pyramid** - Small, fast, down-to-earth Python web framework
232
228
  - **Starlette** - Lightweight ASGI framework/toolkit
233
229
  - **Tornado** - Asynchronous networking library and web framework
234
230
  - **gRPC** - High-performance, open-source universal RPC framework
@@ -149,7 +149,6 @@ class CustomerSupportAgent:
149
149
  - **Django** - High-level Python web framework
150
150
  - **Flask** - Lightweight WSGI web application framework
151
151
  - **Falcon** - High-performance Python web framework
152
- - **Pyramid** - Small, fast, down-to-earth Python web framework
153
152
  - **Starlette** - Lightweight ASGI framework/toolkit
154
153
  - **Tornado** - Asynchronous networking library and web framework
155
154
  - **gRPC** - High-performance, open-source universal RPC framework
@@ -39,6 +39,8 @@ def init_instrumentations(
39
39
  Instruments.MISTRAL,
40
40
  }
41
41
  )
42
+ if instruments is not None and traceloop_instruments is None and traceloop_block_instruments is None:
43
+ traceloop_block_instruments = set(Instruments)
42
44
 
43
45
  init_instrumentations(
44
46
  should_enrich_metrics=should_enrich_metrics,
@@ -84,10 +86,6 @@ def init_instrumentations(
84
86
  if CustomInstruments.AIO_PIKA in netra_custom_instruments:
85
87
  init_aio_pika_instrumentation()
86
88
 
87
- # Initialize aiohttp_server instrumentation.
88
- if CustomInstruments.AIOHTTP_SERVER in netra_custom_instruments:
89
- init_aiohttp_server_instrumentation()
90
-
91
89
  # Initialize aiokafka instrumentation.
92
90
  if CustomInstruments.AIOKAFKA in netra_custom_instruments:
93
91
  init_aiokafka_instrumentation()
@@ -112,10 +110,6 @@ def init_instrumentations(
112
110
  if CustomInstruments.AWS_LAMBDA in netra_custom_instruments:
113
111
  init_aws_lambda_instrumentation()
114
112
 
115
- # Initialize boto instrumentation.
116
- if CustomInstruments.BOTO in netra_custom_instruments:
117
- init_boto_instrumentation()
118
-
119
113
  # Initialize boto3sqs instrumentation.
120
114
  if CustomInstruments.BOTO3SQS in netra_custom_instruments:
121
115
  init_boto3sqs_instrumentation()
@@ -208,10 +202,6 @@ def init_instrumentations(
208
202
  if CustomInstruments.PYMYSQL in netra_custom_instruments:
209
203
  init_pymysql_instrumentation()
210
204
 
211
- # Initialize pyramid instrumentation.
212
- if CustomInstruments.PYRAMID in netra_custom_instruments:
213
- init_pyramid_instrumentation()
214
-
215
205
  # Initialize redis instrumentation.
216
206
  if CustomInstruments.REDIS in netra_custom_instruments:
217
207
  init_redis_instrumentation()
@@ -453,22 +443,6 @@ def init_aio_pika_instrumentation() -> bool:
453
443
  return False
454
444
 
455
445
 
456
- def init_aiohttp_server_instrumentation() -> bool:
457
- """Initialize aiohttp_server instrumentation."""
458
- try:
459
- if is_package_installed("aiohttp"):
460
- from opentelemetry.instrumentation.aiohttp_server import AioHttpServerInstrumentor
461
-
462
- instrumentor = AioHttpServerInstrumentor()
463
- if not instrumentor.is_instrumented_by_opentelemetry:
464
- instrumentor.instrument()
465
- return True
466
- except Exception as e:
467
- logging.error(f"Error initializing aiohttp_server instrumentor: {e}")
468
- Telemetry().log_exception(e)
469
- return False
470
-
471
-
472
446
  def init_aiokafka_instrumentation() -> bool:
473
447
  """Initialize aiokafka instrumentation."""
474
448
  try:
@@ -565,22 +539,6 @@ def init_aws_lambda_instrumentation() -> bool:
565
539
  return False
566
540
 
567
541
 
568
- def init_boto_instrumentation() -> bool:
569
- """Initialize boto instrumentation."""
570
- try:
571
- if is_package_installed("boto"):
572
- from opentelemetry.instrumentation.boto import BotoInstrumentor
573
-
574
- instrumentor = BotoInstrumentor()
575
- if not instrumentor.is_instrumented_by_opentelemetry:
576
- instrumentor.instrument()
577
- return True
578
- except Exception as e:
579
- logging.error(f"Error initializing boto instrumentor: {e}")
580
- Telemetry().log_exception(e)
581
- return False
582
-
583
-
584
542
  def init_boto3sqs_instrumentation() -> bool:
585
543
  """Initialize boto3sqs instrumentation."""
586
544
  try:
@@ -616,7 +574,7 @@ def init_botocore_instrumentation() -> bool:
616
574
  def init_cassandra_instrumentation() -> bool:
617
575
  """Initialize cassandra instrumentation."""
618
576
  try:
619
- if is_package_installed("cassandra-driver"):
577
+ if is_package_installed("cassandra-driver") and is_package_installed("scylla-driver"):
620
578
  from opentelemetry.instrumentation.cassandra import CassandraInstrumentor
621
579
 
622
580
  instrumentor = CassandraInstrumentor()
@@ -949,22 +907,6 @@ def init_pymysql_instrumentation() -> bool:
949
907
  return False
950
908
 
951
909
 
952
- def init_pyramid_instrumentation() -> bool:
953
- """Initialize pyramid instrumentation."""
954
- try:
955
- if is_package_installed("pyramid"):
956
- from opentelemetry.instrumentation.pyramid import PyramidInstrumentor
957
-
958
- instrumentor = PyramidInstrumentor()
959
- if not instrumentor.is_instrumented_by_opentelemetry:
960
- instrumentor.instrument()
961
- return True
962
- except Exception as e:
963
- logging.error(f"Error initializing pyramid instrumentor: {e}")
964
- Telemetry().log_exception(e)
965
- return False
966
-
967
-
968
910
  def init_redis_instrumentation() -> bool:
969
911
  """Initialize redis instrumentation."""
970
912
  try:
@@ -90,13 +90,11 @@ NetraInstruments follows the given structure. Refer this for usage within Netra
90
90
 
91
91
  class InstrumentSet(Enum):
92
92
  AIOHTTP = "aiohttp"
93
- AIOHTTP_SERVER = "aiohttp_server"
94
93
  AIO_PIKA = "aio_pika"
95
94
  AIOKAFKA = "aiokafka"
96
95
  AIOPG = "aiopg"
97
96
  ALEPHALPHA = "alephalpha"
98
97
  ANTHROPIC = "anthropic"
99
- ASGI = "asgi"
100
98
  ASYNCCLICK = "asyncclick"
101
99
  ASYNCIO = "asyncio"
102
100
  ASYNCPG = "asyncpg"
@@ -145,7 +143,6 @@ class InstrumentSet(Enum):
145
143
  PYMONGO = "pymongo"
146
144
  PYMSSQL = "pymssql"
147
145
  PYMYSQL = "pymysql"
148
- PYRAMID = "pyramid"
149
146
  QDRANTDB = "qdrant_db"
150
147
  REDIS = "redis"
151
148
  REMOULADE = "remoulade"
@@ -166,5 +163,4 @@ class InstrumentSet(Enum):
166
163
  VERTEXAI = "vertexai"
167
164
  WATSONX = "watsonx"
168
165
  WEAVIATEDB = "weaviate_db"
169
- WSGI = "wsgi"
170
166
  """
@@ -26,7 +26,6 @@ DEFAULT_PII_PATTERNS: Dict[str, Pattern[str]] = {
26
26
  DEFAULT_ENTITIES: List[str] = [
27
27
  "CREDIT_CARD",
28
28
  "CRYPTO",
29
- "DATE_TIME",
30
29
  "EMAIL_ADDRESS",
31
30
  "IBAN_CODE",
32
31
  "IP_ADDRESS",
@@ -42,16 +41,6 @@ DEFAULT_ENTITIES: List[str] = [
42
41
  "US_SSN",
43
42
  "UK_NHS",
44
43
  "UK_NINO",
45
- "ES_NIF",
46
- "ES_NIE",
47
- "IT_FISCAL_CODE",
48
- "IT_DRIVER_LICENSE",
49
- "IT_VAT_CODE",
50
- "IT_PASSPORT",
51
- "IT_IDENTITY_CARD",
52
- "PL_PESEL",
53
- "SG_NRIC_FIN",
54
- "SG_UEN",
55
44
  "AU_ABN",
56
45
  "AU_ACN",
57
46
  "AU_TFN",
@@ -61,7 +50,6 @@ DEFAULT_ENTITIES: List[str] = [
61
50
  "IN_VEHICLE_REGISTRATION",
62
51
  "IN_VOTER",
63
52
  "IN_PASSPORT",
64
- "FI_PERSONAL_IDENTITY_CODE",
65
53
  ]
66
54
 
67
55
 
@@ -0,0 +1 @@
1
+ __version__ = "0.1.3"
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [project]
6
6
  name = "netra-sdk"
7
- version = "0.1.1"
7
+ version = "0.1.3"
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"}
@@ -37,14 +37,12 @@ dependencies = [
37
37
  "opentelemetry-instrumentation-httpx>=0.55b1,<1.0.0",
38
38
  "opentelemetry-instrumentation-aiohttp-client>=0.55b1,<1.0.0",
39
39
  "opentelemetry-instrumentation-aio-pika>=0.55b1,<1.0.0",
40
- "opentelemetry-instrumentation-aiohttp-server>=0.55b1,<1.0.0",
41
40
  "opentelemetry-instrumentation-aiokafka>=0.55b1,<1.0.0",
42
41
  "opentelemetry-instrumentation-aiopg>=0.55b1,<1.0.0",
43
42
  "opentelemetry-instrumentation-asyncclick>=0.55b1,<1.0.0",
44
43
  "opentelemetry-instrumentation-asyncio>=0.55b1,<1.0.0",
45
44
  "opentelemetry-instrumentation-asyncpg>=0.55b1,<1.0.0",
46
45
  "opentelemetry-instrumentation-aws-lambda>=0.55b1,<1.0.0",
47
- "opentelemetry-instrumentation-boto>=0.55b1,<1.0.0",
48
46
  "opentelemetry-instrumentation-boto3sqs>=0.55b1,<1.0.0",
49
47
  "opentelemetry-instrumentation-botocore>=0.55b1,<1.0.0",
50
48
  "opentelemetry-instrumentation-cassandra>=0.55b1,<1.0.0",
@@ -68,7 +66,6 @@ dependencies = [
68
66
  "opentelemetry-instrumentation-pymongo>=0.55b1,<1.0.0",
69
67
  "opentelemetry-instrumentation-pymssql>=0.55b1,<1.0.0",
70
68
  "opentelemetry-instrumentation-pymysql>=0.55b1,<1.0.0",
71
- "opentelemetry-instrumentation-pyramid>=0.55b1,<1.0.0",
72
69
  "opentelemetry-instrumentation-redis>=0.55b1,<1.0.0",
73
70
  "opentelemetry-instrumentation-remoulade>=0.55b1,<1.0.0",
74
71
  "opentelemetry-instrumentation-requests>=0.55b1,<1.0.0",
@@ -1 +0,0 @@
1
- __version__ = "0.1.1"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes