nvidia-nat-opentelemetry 1.3.0a20250910__py3-none-any.whl → 1.3.0a20250917__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.
@@ -15,10 +15,12 @@
15
15
 
16
16
  import logging
17
17
  from collections.abc import Callable
18
+ from collections.abc import Mapping
19
+ from enum import Enum
20
+ from typing import Any
18
21
 
19
22
  from nat.builder.context import ContextState
20
- from nat.observability.mixin.tagging_config_mixin import PrivacyLevel
21
- from nat.observability.processor.header_redaction_processor import HeaderRedactionProcessor
23
+ from nat.observability.processor.redaction import SpanHeaderRedactionProcessor
22
24
  from nat.observability.processor.span_tagging_processor import SpanTaggingProcessor
23
25
  from nat.plugins.opentelemetry.otlp_span_adapter_exporter import OTLPSpanAdapterExporter
24
26
 
@@ -61,11 +63,10 @@ class OTLPSpanHeaderRedactionAdapterExporter(OTLPSpanAdapterExporter):
61
63
  endpoint="https://api.service.com/v1/traces",
62
64
  headers={"Authorization": "Bearer your-token"},
63
65
  redaction_attributes=["user.email", "request.body"],
64
- redaction_header="x-user-id",
66
+ redaction_headers=["x-user-id"],
65
67
  redaction_callback=should_redact,
66
68
  redaction_value="REDACTED",
67
- privacy_tag_key="privacy.level",
68
- privacy_tag_value=PrivacyLevel.HIGH,
69
+ tags={"privacy.level": PrivacyLevel.HIGH, "service.type": "sensitive"},
69
70
  batch_size=50,
70
71
  flush_interval=10.0
71
72
  )
@@ -84,13 +85,13 @@ class OTLPSpanHeaderRedactionAdapterExporter(OTLPSpanAdapterExporter):
84
85
  resource_attributes: dict[str, str] | None = None,
85
86
  # Redaction args
86
87
  redaction_attributes: list[str] | None = None,
87
- redaction_header: str | None = None,
88
- redaction_callback: Callable[[str], bool] | None = None,
88
+ redaction_headers: list[str] | None = None,
89
+ redaction_callback: Callable[..., Any] | None = None,
89
90
  redaction_enabled: bool = False,
90
91
  force_redaction: bool = False,
91
92
  redaction_value: str = "[REDACTED]",
92
- privacy_tag_key: str | None = None,
93
- privacy_tag_value: PrivacyLevel | None = None,
93
+ redaction_tag: str | None = None,
94
+ tags: Mapping[str, Enum | str] | None = None,
94
95
  # OTLPSpanExporterMixin args
95
96
  endpoint: str,
96
97
  headers: dict[str, str] | None = None,
@@ -99,20 +100,20 @@ class OTLPSpanHeaderRedactionAdapterExporter(OTLPSpanAdapterExporter):
99
100
 
100
101
  Args:
101
102
  context_state: The context state for the exporter.
102
- batch_size: Number of spans to batch before exporting.
103
- flush_interval: Time in seconds between automatic batch flushes.
104
- max_queue_size: Maximum number of spans to queue.
105
- drop_on_overflow: Whether to drop spans when queue is full.
106
- shutdown_timeout: Maximum time to wait for export completion during shutdown.
103
+ batch_size: Number of spans to batch before exporting, default is 100.
104
+ flush_interval: Time in seconds between automatic batch flushes, default is 5.0.
105
+ max_queue_size: Maximum number of spans to queue, default is 1000.
106
+ drop_on_overflow: Whether to drop spans when queue is full, default is False.
107
+ shutdown_timeout: Maximum time to wait for export completion during shutdown, default is 10.0.
107
108
  resource_attributes: Additional resource attributes for spans.
108
109
  redaction_attributes: List of span attribute keys to redact when conditions are met.
109
- redaction_header: Header key to check for authentication/user identification.
110
- redaction_callback: Function to determine if spans should be redacted based on header value.
111
- redaction_enabled: Whether the redaction processor is enabled.
112
- force_redaction: If True, always redact regardless of header checks.
113
- redaction_value: Value to replace redacted attributes with.
114
- privacy_tag_key: Key name for the privacy level tag to add to spans.
115
- privacy_tag_value: Privacy level value to assign to spans.
110
+ redaction_headers: List of header keys to check for authentication/user identification.
111
+ redaction_callback: Function that returns true to redact spans based on header value, false otherwise.
112
+ redaction_enabled: Whether the redaction processor is enabled, default is False.
113
+ force_redaction: If True, always redact regardless of header checks, default is False.
114
+ redaction_value: Value to replace redacted attributes with, default is "[REDACTED]".
115
+ tags: Mapping of tag keys to their values (enums or strings) to add to spans.
116
+ redaction_tag: Tag to add to spans when redaction occurs.
116
117
  endpoint: The endpoint for the OTLP service.
117
118
  headers: The headers for the OTLP service.
118
119
  **otlp_kwargs: Additional keyword arguments for the OTLP service.
@@ -129,16 +130,14 @@ class OTLPSpanHeaderRedactionAdapterExporter(OTLPSpanAdapterExporter):
129
130
  **otlp_kwargs)
130
131
 
131
132
  # Insert redaction and tagging processors to the front of the processing pipeline
132
- self.add_processor(HeaderRedactionProcessor(attributes=redaction_attributes,
133
- header=redaction_header,
134
- callback=redaction_callback,
135
- enabled=redaction_enabled,
136
- force_redact=force_redaction,
137
- redaction_value=redaction_value),
133
+ self.add_processor(SpanHeaderRedactionProcessor(attributes=redaction_attributes or [],
134
+ headers=redaction_headers or [],
135
+ callback=redaction_callback or (lambda _: False),
136
+ enabled=redaction_enabled,
137
+ force_redact=force_redaction,
138
+ redaction_value=redaction_value,
139
+ redaction_tag=redaction_tag),
138
140
  name="header_redaction",
139
141
  position=0)
140
142
 
141
- self.add_processor(SpanTaggingProcessor(tag_key=privacy_tag_key,
142
- tag_value=privacy_tag_value.value if privacy_tag_value else None),
143
- name="span_privacy_tagging",
144
- position=1)
143
+ self.add_processor(SpanTaggingProcessor(tags=tags), name="span_sensitivity_tagging", position=1)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nvidia-nat-opentelemetry
3
- Version: 1.3.0a20250910
3
+ Version: 1.3.0a20250917
4
4
  Summary: Subpackage for OpenTelemetry integration in NeMo Agent toolkit
5
5
  Keywords: ai,observability,opentelemetry
6
6
  Classifier: Programming Language :: Python
@@ -9,7 +9,7 @@ Classifier: Programming Language :: Python :: 3.12
9
9
  Classifier: Programming Language :: Python :: 3.13
10
10
  Requires-Python: <3.14,>=3.11
11
11
  Description-Content-Type: text/markdown
12
- Requires-Dist: nvidia-nat==v1.3.0a20250910
12
+ Requires-Dist: nvidia-nat==v1.3.0a20250917
13
13
  Requires-Dist: opentelemetry-api~=1.2
14
14
  Requires-Dist: opentelemetry-exporter-otlp~=1.3
15
15
  Requires-Dist: opentelemetry-sdk~=1.3
@@ -3,13 +3,13 @@ nat/plugins/opentelemetry/__init__.py,sha256=j-YKuxwSIzGziyDyunw8s_W7WiFiqKLdFjw
3
3
  nat/plugins/opentelemetry/otel_span.py,sha256=v5Bzy4Cq51Sph5fKErZjt_UPfPXsVJx2qllj7c5afe4,16511
4
4
  nat/plugins/opentelemetry/otel_span_exporter.py,sha256=YO7JsQgi8Cf2OQBJ_s78HwJjrWx9SdqMvPen3Pa2_bI,6533
5
5
  nat/plugins/opentelemetry/otlp_span_adapter_exporter.py,sha256=C5MaZOB_ZijAbRZpRUtjpBsH0-FHeon81l5xAFlUKos,3945
6
- nat/plugins/opentelemetry/otlp_span_redaction_adapter_exporter.py,sha256=rxbTcPCYPoLinseVId4jllVP9E5NHD2vgcsy4-NsE9E,7086
6
+ nat/plugins/opentelemetry/otlp_span_redaction_adapter_exporter.py,sha256=FPh_wGpI-oYIX5FCDgVQOu9FSyrJ4yUtY-SlaxnL2FE,7217
7
7
  nat/plugins/opentelemetry/register.py,sha256=IWPDQBIhHB7OcykOlCQ5RlMrVWjWQvoJwlgy6QCjir8,9070
8
8
  nat/plugins/opentelemetry/span_converter.py,sha256=Gz3KvRNQeEBBlpaPO8YRAJkw4fmzV7m9bT6dGX0IV2E,8846
9
9
  nat/plugins/opentelemetry/mixin/__init__.py,sha256=Xs1JQ16L9btwreh4pdGKwskffAw1YFO48jKrU4ib_7c,685
10
10
  nat/plugins/opentelemetry/mixin/otlp_span_exporter_mixin.py,sha256=stTer5KT6l2RA93_pexoU8WqhQLCnYbjyOhIMbDEwWk,2807
11
- nvidia_nat_opentelemetry-1.3.0a20250910.dist-info/METADATA,sha256=383wC6qSke_K2R5xeDlAX9Df44lpylTrYRyNheVNhwM,1733
12
- nvidia_nat_opentelemetry-1.3.0a20250910.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
13
- nvidia_nat_opentelemetry-1.3.0a20250910.dist-info/entry_points.txt,sha256=gmEKhCafyibUJLGxbn8luTK0UTgIvV2vAtr4uZ8M85I,72
14
- nvidia_nat_opentelemetry-1.3.0a20250910.dist-info/top_level.txt,sha256=8-CJ2cP6-f0ZReXe5Hzqp-5pvzzHz-5Ds5H2bGqh1-U,4
15
- nvidia_nat_opentelemetry-1.3.0a20250910.dist-info/RECORD,,
11
+ nvidia_nat_opentelemetry-1.3.0a20250917.dist-info/METADATA,sha256=uuwWEvEcpYnUsKRQq4Tzj877fWLGc54xkHeeaykjr54,1733
12
+ nvidia_nat_opentelemetry-1.3.0a20250917.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
13
+ nvidia_nat_opentelemetry-1.3.0a20250917.dist-info/entry_points.txt,sha256=gmEKhCafyibUJLGxbn8luTK0UTgIvV2vAtr4uZ8M85I,72
14
+ nvidia_nat_opentelemetry-1.3.0a20250917.dist-info/top_level.txt,sha256=8-CJ2cP6-f0ZReXe5Hzqp-5pvzzHz-5Ds5H2bGqh1-U,4
15
+ nvidia_nat_opentelemetry-1.3.0a20250917.dist-info/RECORD,,