Skip to content

Conversation

@pan93412
Copy link
Member

  • chore: upgrade dependencies
  • chore: update nix lockfile
  • feat: implement OpenTelemetry and Prometheus basic infra
  • feat: implement otelgqlgen
  • feat: add slog-gin and trace ID header
  • docs: add OpenTelemetry and Prometheus instruction
  • feat: inject trace_id to GraphQL error
  • feat: add otelpgx
  • feat: add rueidisotel
  • feat(graph): implement OpenTelemetry tracing for GraphQL resolvers
  • feat(httpapi): implement OpenTelemetry tracing for HTTP APIs
  • feat(auth): implement OpenTelemetry tracing for auth service
  • feat(backend): setup otel sdk
  • feat(events): implement OpenTelemetry tracing for events service
  • feat(ranking): implement OpenTelemetry tracing for ranking service
  • feat(sqlrunner): implement OpenTelemetry tracing for sqlrunner service
  • feat(submission): implement OpenTelemetry tracing for submission service
  • feat(useraccount): implement OpenTelemetry tracing for useraccount service
  • chore: tidy up imports
  • test(auth): handle OpenTelemetry wrapped case

Copilot AI review requested due to automatic review settings December 28, 2025 19:31
@pan93412 pan93412 self-assigned this Dec 28, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements comprehensive OpenTelemetry and Prometheus observability infrastructure across the entire backend application, adding distributed tracing, logging, and metrics capabilities.

Key Changes

  • Added OpenTelemetry SDK setup with support for multiple exporters (console, OTLP) for traces and logs
  • Instrumented all service layers with tracing spans including useraccount, submission, sqlrunner, ranking, events, and auth services
  • Implemented automatic tracing for HTTP APIs, GraphQL resolvers, and database operations (pgx, Redis)
  • Integrated Prometheus metrics endpoint at /metrics with Gin middleware instrumentation

Reviewed changes

Copilot reviewed 33 out of 35 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
internal/otelprovider/otelprovider.go New OpenTelemetry SDK provider with configurable exporters for traces and logs
internal/useraccount/*.go Added tracing spans for token operations, user registration, and verification
internal/submission/submission.go Instrumented answer submission and execution with detailed span events
internal/sqlrunner/sqlrunner.go Added HTTP client tracing and database query instrumentation
internal/ranking/ranking.go Implemented tracing for ranking calculations and database queries
internal/events/*.go Added comprehensive tracing for event handling and points granting logic
internal/auth/*.go Instrumented authentication middleware and Redis storage operations
httpapi/auth/*.go Added OAuth 2.0 flow tracing with PKCE validation spans
graph/*.resolvers.go Instrumented all GraphQL resolvers with tracing spans
internal/deps/deps.go Updated to use otelpgx and rueidisotel for database/Redis tracing
cmd/backend/dependencies.go Integrated OTel SDK lifecycle, Prometheus metrics, and trace ID headers
docs/config.md Added comprehensive OpenTelemetry configuration documentation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pan93412 pan93412 merged commit ad1288a into main Jan 3, 2026
5 checks passed
@pan93412 pan93412 deleted the observability branch January 3, 2026 16:37
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.

2 participants