Skip to content

Add OpenTelemetry observability for retrieval calls #10

@varunreddy

Description

@varunreddy

Summary

Instrument the retrieval and emission paths with OpenTelemetry spans so teams can trace routing decisions in their observability stack.

Acceptance Criteria

  • Add optional opentelemetry-api dependency (in an [otel] extra)
  • Instrument retriever.py with spans: query received, BM25 score, dense score, RRF merge, top-K selection
  • Instrument adapters/ with spans: context formatting, token count estimation
  • Add span attributes: query text, registry name, top-K IDs, total cards searched
  • No-op gracefully when OpenTelemetry is not installed
  • Add a test verifying spans are emitted when the SDK is present
  • Document setup in README or a dedicated docs/observability.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions