-
Notifications
You must be signed in to change notification settings - Fork 661
Description
Description
The RedactedSpan wrapper class in genkit.core.trace.adjusting_exporter causes an
AttributeError when the OTLP trace encoder tries to serialize spans for export to
backends like AWS X-Ray.
Error
AttributeError: 'TimeAdjustedSpan' object has no attribute '_attributes'
Full traceback:
opentelemetry/.../trace_encoder/__init__.py:130 in _encode_span
dropped_attributes_count=sdk_span.dropped_attributes,
opentelemetry/sdk/trace/__init__.py:412 in dropped_attributes
if isinstance(self._attributes, BoundedAttributes):
^^^^^^^^^^^^^^^^
AttributeError: 'TimeAdjustedSpan' object has no attribute '_attributes'
Root Cause
RedactedSpan (and its subclass TimeAdjustedSpan) wraps a ReadableSpan without
calling super().__init__(). This is intentional to avoid duplicating span state.
However, three properties in the base ReadableSpan class access private instance
variables that are only set by ReadableSpan.__init__():
dropped_attributes→ accessesself._attributesdropped_events→ accessesself._eventsdropped_links→ accessesself._links
Since RedactedSpan.__init__() never calls super().__init__(), these private
fields don't exist, and the OTLP encoder crashes when it tries to serialize
span metadata.
Impact
Any telemetry plugin that uses AdjustingTraceExporter (AWS Bedrock, Google Cloud,
etc.) will crash at span export time, silently dropping all trace data.
Fix
Add dropped_attributes, dropped_events, and dropped_links property overrides
to RedactedSpan that delegate to self._span (the wrapped span).
Files
py/packages/genkit/src/genkit/core/trace/adjusting_exporter.pypy/packages/genkit/tests/genkit/core/trace/adjusting_exporter_test.py
Metadata
Metadata
Assignees
Labels
Type
Projects
Status