Skip to content

feat(ingest): Ingest nested OTLP resourceSpans/scopeSpans exports and typed attributes (#11) - #19

Open
IronLad123 wants to merge 6 commits into
bamdadd:mainfrom
IronLad123:feat/ingest-nested-otlp-envelope
Open

feat(ingest): Ingest nested OTLP resourceSpans/scopeSpans exports and typed attributes (#11)#19
IronLad123 wants to merge 6 commits into
bamdadd:mainfrom
IronLad123:feat/ingest-nested-otlp-envelope

Conversation

@IronLad123

Copy link
Copy Markdown
Contributor

Closes #11

Summary

Adds support for standard, nested OpenTelemetry Collector / OTLP JSON exports (resourceSpans[].scopeSpans[].spans[]) to src/taintline/ingest.py, including typed OTLP attribute array decoding.

Key Changes

  1. Nested Envelope Flattening:

    • Updated _parse_otlp(data) to auto-detect and flatten resourceSpans[].scopeSpans[].spans[] into normalized Span/Trace objects without modifying model.py.
  2. Typed OTLP Attribute Array Decoding:

    • Added _normalize_attributes() and _unwrap_otlp_value() to decode OTLP attribute arrays containing typed value objects (stringValue, intValue, boolValue, doubleValue, arrayValue, kvlistValue, bytesValue) into flat attribute dictionaries.
  3. Open-Closed Backward Compatibility:

    • Preserved existing flat span lists and Strands nested-dict parsing paths.
  4. Portability Fixture & Testing:

    • Added portability fixture tests/fixtures/portability/otlp_nested_export.json.
    • Verified determinism across PYTHONHASHSEED=0 and PYTHONHASHSEED=42.
    • 58 / 58 tests passed (1.19s).
    • ruff check: 0 errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New span source: ingest nested OTLP resourceSpans/scopeSpans exports

1 participant