feat(#159): add RAG data lineage tracing with OpenTelemetry - #200
Open
anshul23102 wants to merge 1 commit into
Open
feat(#159): add RAG data lineage tracing with OpenTelemetry#200anshul23102 wants to merge 1 commit into
anshul23102 wants to merge 1 commit into
Conversation
…etry Implement OpenTelemetry-based tracing for complete RAG pipeline visibility: - app/observability/rag_tracing.py: Core tracing module with: * RAGTracer context manager for end-to-end request tracing * RetrievalSpan for vector search operations and latency tracking * RerankerSpan for chunk reranking metrics * LLMSpan for language model generation with token tracking * Document lineage tracking with source attribution * Automatic latency metrics for all operations * Token usage tracking per request * Cache hit/miss tracing events - tests/test_rag_tracing.py: Comprehensive test suite with: * Span creation and context management * Attribute setting and query text handling * Token usage tracking * Error handling and status reporting * Integration scenario testing * Latency metric recording Features: - Request lifecycle tracing with user/tenant/session correlation - Retrieved document metadata capture (source, chunk index, similarity) - Vector search latency metrics - LLM execution time tracking - Token consumption metrics per request - Reranking operation tracing - Cache operation visibility - Structured spans for audit trails Observability benefits: - Full visibility into RAG execution pipeline - Performance bottleneck identification via latency metrics - Token usage tracking for cost analysis - Document lineage for debugging and validation - Request correlation across distributed systems - Production audit trails for enterprise compliance Fixes devloperdevesh#159
|
@anshul23102 is attempting to deploy a commit to the devloperdevesh's projects Team on Vercel. A member of the Team first needs to authorize it. |
Author
|
Hi @devloperdevesh! 👋 I've completed the implementation for Issue #159 (RAG Data Lineage Tracing with OpenTelemetry). What's Included
Key Metrics
Enterprise Value
For ReviewWhen reviewing, you might consider these labels for GSSoC scoring:
Ready for review! 🚀 Contributed as part of GSSoC 2026 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implement OpenTelemetry-based tracing for complete visibility into RAG pipeline execution, document lineage, and performance metrics.
Problem
Current RAG retrieval pipeline lacks visibility into how answers are generated. Users cannot trace which documents were retrieved, which chunks influenced responses, retrieval latency, LLM execution time, or token consumption - making debugging and optimizing production systems difficult.
Solution
Implement comprehensive OpenTelemetry tracing across the RAG execution pipeline:
Core Features:
Tracing Capabilities:
Implementation
Metrics Exported
Acceptance Criteria
Enterprise Benefits
Fixes #159
GSSoC 2026 Contribution