Skip to content

feat: abstract tracing hooks to support alternative providers #596#602

Open
suhaniiz wants to merge 1 commit into
param20h:devfrom
suhaniiz:feat/abstract-tracing-596
Open

feat: abstract tracing hooks to support alternative providers #596#602
suhaniiz wants to merge 1 commit into
param20h:devfrom
suhaniiz:feat/abstract-tracing-596

Conversation

@suhaniiz

Copy link
Copy Markdown
Contributor

📋 PR Checklist

Thank you for contributing to PDF-Assistant-RAG! 🎉
Please fill out this template before submitting. PRs without it filled in will be closed.


🔗 Related Issue

Closes #596


📝 What does this PR do?

This PR decouples the telemetry/tracking infrastructure from being locked into LangSmith. It introduces a Strategy-pattern based interface (BaseTracingProvider) and a factory manager (_get_active_provider) to dynamically switch between alternative monitoring backends.

Key changes:

  • Created an abstract base class BaseTracingProvider.
  • Refactored the existing LangSmith configuration and logic into an independent LangSmithProvider class.
  • Added a NoOpProvider fallback class to cleanly handle setups where tracing is disabled or unconfigured without throwing errors.
  • Kept the public execution surface API (trace_call, trace_function) identical to ensure perfect backward compatibility with the existing RAG pipeline files.

🗂️ Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 🔧 Refactor / code cleanup
  • 📝 Documentation update
  • 🎨 UI / styling change
  • ⚙️ CI / tooling / config change
  • 🧪 Tests

🧪 How was this tested?

  • Verified that codebase loads cleanly and passes standard interpreter syntax/safety checks.
  • Validated that the public wrapper functions fallback perfectly to execution without interrupting the application flow if variables are missing.

📸 Screenshots (if UI change)

N/A (Backend / Architecture Change)


⚠️ Anything to flag for reviewers?

Reviewers should note that the public signatures (trace_call and trace_function) were left completely untouched to preserve structural boundaries—no external imports outside this module required updates.

GSSoC '26 Contribution


✅ Self-Review Checklist

  • My branch is based on dev, not main
  • I have not added any secrets / API keys
  • I have not modified main branch or any HuggingFace deployment config
  • My code follows the existing style (no unnecessary formatting changes)
  • I have updated relevant docs / comments if needed

@suhaniiz suhaniiz requested a review from param20h as a code owner June 13, 2026 14:18
@suhaniiz

Copy link
Copy Markdown
Contributor Author

hey @param20h , this pr is under gssoc 2026

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.

[FEAT] Abstract tracing hooks to support alternative monitoring providers

1 participant