发布

  • [OPIK-6169][SDK] Python and TypeScript SDKs expose a helpers for handling distributed trace headers in OpenTelemetry (#6481)

    frostbyte_neo 发布于 2026-04-29 11:54:19 +00:00

    • [OPIK-6169][BE] Add helper functions for handling Opik distributed trace attributes and relevant unit tests.
    • Introduced OpikDistributedTraceAttributes class to manage trace ID and parent span ID.
    • Added helper functions extract_opik_distributed_trace_attributes and attach_to_parent.
    • Created comprehensive unit tests to validate trace attribute extraction and attachment logic.
    • [OPIK-6169][SDK] Refactor OTEL helper functions and tests for improved modularity.
    • Moved helper functions extract_opik_distributed_trace_attributes and attach_to_parent to the new distributed_trace module.
    • Updated imports in unit tests and modules to reflect the refactor.
    • Reorganized type references using otel_types for consistency.
    • [OPIK-6169][SDK] Refactor OTEL helper functions and tests for improved modularity.
    • Moved helper functions extract_opik_distributed_trace_attributes and attach_to_parent to the new distributed_trace module.
    • Updated imports in unit tests and modules to reflect the refactor.
    • Reorganized type references using otel_types for consistency.
    • [OPIK-6169][SDK] Add E2E test for OTel distributed tracing with Opik backend integration.
    • Validates end-to-end trace creation, spanning, and parent-child link verification between Service A and Service B using Opik OTLP.
    • Ensures spans appear correctly in the Opik backend.
    • [OPIK-6169][SDK] Add test dependencies and update E2E workflow for Python SDK.
    • Introduced test_requirements.txt to manage additional dependencies for Python SDK E2E tests.
    • Updated GitHub Actions workflow to install new E2E test requirements.
    • [OPIK-6169][SDK] Update OTEL exporter to handle dynamic endpoint paths based on URL override.

    • [OPIK-6169][SDK] Restructure Python SDK E2E tests for OpenTelemetry integration.

    • Moved OpenTelemetry-specific requirements and tests to a dedicated directory.
    • Updated GitHub Actions workflows to include OpenTelemetry library tests.
    • Removed redundant test requirements and adjusted imports for modularity.
    • [OPIK-6169][SDK] Update OTEL exporter to derive endpoint paths based on parsed port from the URL override.

    • [OPIK-6169][SDK] Add TypeScript helper functions for OTel distributed tracing with unit tests.

    • Introduced OpikDistributedTraceAttributes class for managing trace ID and parent span ID.
    • Added extractOpikDistributedTraceAttributes and attachToParent utility functions.
    • Implemented comprehensive unit tests to validate trace attribute extraction and attachment logic.
    • Updated TypeScript exports for integration with Opik distributed tracing functionalities.
    • [OPIK-6169][SDK] Enhance Opik distributed trace attribute handling with validation and logging.
    • Implemented UUID validation and logging for extract_opik_distributed_trace_attributes and attach_to_parent in Python and TypeScript SDKs.
    • Added tests for invalid, missing, and whitespace-only trace IDs and parent span IDs.
    • Improved handling of case-insensitive headers and trimmed attribute values.
    • [OPIK-6169][SDK] Refactor Opik distributed trace context handling.
    • Moved header definitions and context-related logic to a new context.ts module.
    • Updated imports and restructured exports for better modularity and separation of concerns.
    • [OPIK-6169][Docs] Add guidance for linking OpenTelemetry spans to existing Opik traces and distributed tracing examples.
    • Documented header propagation (opik_trace_id, opik_parent_span_id) and Opik bridging helper usage.
    • Included Python and TypeScript examples for client-side trace emission and remote service span attachment.
    • Expanded "Distributed Traces with a Remote Service Using OpenTelemetry" section with detailed instructions.
    • [OPIK-6169][SDK] Add unit tests for TypeScript distributed tracing context.
    • Introduced tests for context.ts to validate header constants and distributed trace header behavior.
    • Verified header extraction using trackStorage and context store scenarios in getDistributedTraceHeaders.
    • [OPIK-6169][SDK] Refactor OpenTelemetry integration package structure.
    • Moved opik.otel modules to opik.integrations.otel for better organization.
    • Updated imports across tests and source code to reflect the new structure.
    • [OPIK-6169][SDK] Add UUIDv7 validation, update tests, and refactor distributed trace integration.
    • Introduced is_valid_uuid_v7 function in id_helpers for UUIDv7 validation.
    • Updated distributed trace logic to use is_valid_uuid_v7 for header validation.
    • Added comprehensive unit tests for is_valid_uuid_v7 covering valid, invalid, and malformed inputs.
    • Refactored imports and removed redundant _is_valid_uuid utility in distributed tracing module.
    • Updated documentation to reflect import changes in integration examples.
    • [OPIK-6169][SDK] Add UUIDv7 validation to TypeScript, refactor imports, and expand tests.
    • Introduced isValidUuidV7 utility in TypeScript for UUIDv7 validation.
    • Updated distributed trace logic to use isValidUuidV7 for trace ID and parent span ID validation.
    • Added comprehensive unit tests for isValidUuidV7 and updated distributed trace tests for non-v7 UUID handling.
    • Refactored imports across affected modules for consistency.
    • [OPIK-6169][Backend] Add opik.span_id attribute override handling in OpenTelemetry mappings and tests.
    • Introduced opik.span_id as a new attribute with mapping rule to handle span ID overrides.
    • Updated OpenTelemetryMapper to support opik.span_id for UUIDv7-based span ID overrides.
    • Added comprehensive unit tests verifying opik.span_id extraction, override, and chaining logic.
    • Ensured opik.span_id is dropped from final attributes to prevent redundancy.
    • [OPIK-6169][P SDK] Add OpikSpanProcessor to propagate trace context and extend UUIDv7 chaining.
    • Introduced OpikSpanProcessor for automating trace context propagation across OTel spans.
    • Ensured UUIDv7-based opik.span_id and opik.parent_span_id chaining across descendant spans.
    • Updated attach_to_parent to mint boundary opik.span_id for consistent linking.
    • Added unit and E2E tests to validate correct span inheritance and linkage.
    • Refactored attribute handling into attributes.py for improved reusability and clarity.
    • [OPIK-6169][TS SDK] Add OpikSpanProcessor for automated Opik trace attribute propagation.
    • Introduced OpikSpanProcessor to automate opik.trace_id, opik.span_id, and opik.parent_span_id propagation across OTel spans.
    • Minted opik.span_id for boundary spans to enable consistent descendant chaining with UUIDv7-based linking.
    • Refactored trace attribute handling into reusable constants (attributes.ts) for clarity.
    • Enhanced unit tests to validate inheritance from parent spans and baggage, ensuring correct trace context propagation.
    • [OPIK-6169][Docs] Add OpikSpanProcessor setup instructions for OpenTelemetry spans and subtree propagation.
    • Documented OpikSpanProcessor registration to propagate Opik trace attributes to descendant spans.
    • Updated Python and TypeScript examples for accurate trace context inheritance.
    • Clarified boundary span behavior and subtree propagation mechanics.
    • Enhanced guidance for OpenTelemetry integration with Opik.
    • [OPIK-6169][TS SDK] Moved Opik OpenTelemetry integration and tests into separate package.

    • [OPIK-6169][P SDK] Add logging for invalid Opik context during span propagation.

    • Introduced LOGGER for enhanced debugging of invalid opik.trace_id and opik.span_id during context inheritance.
    • Updated is_valid_uuid_v7 to use TypeGuard for improved type safety and validation accuracy.
    • Refined error handling to ensure graceful fallback and detailed warning messages for invalid contexts.
    • Updated a test to mark it for future re-enablement after backend readiness.
    • [OPIK-6169][TS SDK] Updated package-lock.json to use opik 2.0.15

    • [OPIK-6169][Docs] Refine TypeScript example to illustrate context management and correct boundary span setup.

    • [OPIK-6169][TS SDK] Add validation and logging for inherited Opik context during span propagation.

    • Introduced strict UUIDv7 validation for opik.trace_id and opik.span_id in both parent span attributes and baggage.
    • Added detailed logger.warn messages for invalid or missing IDs to improve debugging of misconfigured upstreams.
    • Refined isValidUuidV7 as a type predicate for enhanced type safety in callers.
    • Ensured graceful fallback to avoid propagating invalid Opik contexts.
    下载附件