Skip to content

feat(backend): add observability instrumentation to remaining routes#165

Merged
DevanshuNEU merged 1 commit into
OpenCodeIntel:mainfrom
DevanshuNEU:feat/163-observability-routes
Jan 6, 2026
Merged

feat(backend): add observability instrumentation to remaining routes#165
DevanshuNEU merged 1 commit into
OpenCodeIntel:mainfrom
DevanshuNEU:feat/163-observability-routes

Conversation

@DevanshuNEU

Copy link
Copy Markdown
Collaborator

Summary

Add comprehensive observability instrumentation to the 4 remaining routes that were missing it:

  • routes/search.py
  • routes/search_v2.py
  • routes/auth.py
  • routes/api_keys.py

Changes

Routes Updated

Each route now includes:

  • Sentry operation context - Sets context at request start for error grouping
  • Breadcrumbs - Adds trail of events for debugging
  • Structured logging - Logs with context (user_id, repo_id, duration_ms)
  • Performance tracking - Uses track_time() for cache checks, searches, auth ops
  • Exception capture - Sends errors to Sentry with full context

Tests Added

  • 17 new tests in test_observability_routes.py
  • All tests pass ✅

Testing

pytest tests/test_observability_routes.py -v
# ========================= 17 passed in 1.89s =========================

pytest tests/test_search_v2_route.py tests/test_api.py -v  
# ========================= 17 passed in 3.88s =========================

Closes #163

Add comprehensive observability to search.py, search_v2.py, auth.py,
and api_keys.py routes using the existing observability module.

Changes:
- Add structured logging with context (user_id, repo_id, duration)
- Add Sentry operation context and breadcrumbs for error tracing
- Add performance tracking with track_time() for key operations
- Add exception capture with full context for debugging
- Add 17 new tests for observability coverage

Each route now properly:
- Sets Sentry operation context at request start
- Adds breadcrumbs for request tracing
- Logs request completion with metrics
- Captures exceptions with full context
- Tracks timing for cache checks, searches, auth operations

Closes OpenCodeIntel#163
@vercel

vercel Bot commented Jan 6, 2026

Copy link
Copy Markdown

@DevanshuNEU is attempting to deploy a commit to the Dev's projects Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Jan 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
opencodeintel Ignored Ignored Preview Jan 6, 2026 7:30pm

@DevanshuNEU DevanshuNEU merged commit 35d57a4 into OpenCodeIntel:main Jan 6, 2026
6 checks passed
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(backend): Add observability instrumentation to remaining routes

1 participant